Commits
23 23 | //# National Radio Astronomy Observatory |
24 24 | //# 520 Edgemont Road |
25 25 | //# Charlottesville, VA 22903-2475 USA |
26 26 | //# |
27 27 | //# $Id$ |
28 28 | |
29 29 | |
30 30 | |
31 31 | |
32 32 | |
33 + | |
33 34 | |
34 35 | |
35 36 | |
36 37 | |
37 38 | |
38 39 | |
39 40 | |
40 41 | |
41 42 | |
42 43 | |
726 727 | { |
727 728 | griddedWeights.resize(iimage.shape()); |
728 729 | griddedWeights.setCoordinateInfo(iimage.coordinates()); |
729 730 | griddedWeights.set(0.0); |
730 731 | pbPeaks.resize(griddedWeights.shape()(2)); |
731 732 | pbPeaks.set(0.0); |
732 733 | } |
733 734 | |
734 735 | resetPBs_p=false; |
735 736 | } |
736 - | |
737 - | avgPBReady_p = (cfCache_p->loadAvgPB(avgPB_p,sensitivityPatternQualifierStr_p) != CFDefs::NOTCACHED); |
737 + | TempImage<Float> tempCF(avgPB_p->shape(), avgPB_p->coordinates()); |
738 + | avgPBReady_p = (cfCache_p->loadAvgPB(tempCF,sensitivityPatternQualifierStr_p) != CFDefs::NOTCACHED); |
738 739 | |
739 740 | if(avgPBReady_p){ |
740 - | LatticeExprNode le( max( *avgPB_p ) ); |
741 + | if(tempCF.shape()(3) > iimage.shape()(3)){ |
742 + | Double freqofBegChan; |
743 + | //get freq of first chan of chunk |
744 + | spectralCoord_p.toWorld(freqofBegChan, 0.0); |
745 + | CoordinateSystem cs=tempCF.coordinates(); |
746 + | SpectralCoordinate fsys=cs.spectralCoordinate(cs.findCoordinate(Coordinate::SPECTRAL)); |
747 + | Double startchan; |
748 + | fsys.toPixel(startchan, freqofBegChan); |
749 + | Int endchan=startchan+iimage.shape()(3)-1; |
750 + | avgPB_p=SpectralImageUtil::getChannel(tempCF,Int(startchan), endchan); |
751 + | } |
752 + | else{ |
753 + | avgPB_p->copyData(tempCF); |
754 + | } |
755 + | LatticeExprNode le( max( *avgPB_p ) ); |
741 756 | Float avgPB_max=le.getFloat(); |
742 757 | |
743 758 | if(avgPB_max <= 0.0) avgPBReady_p = false; |
744 759 | } |
745 760 | |
746 761 | |
747 762 | // avgPBReady_p = cfCache_p->avgPBReady(sensitivityPatternQualifierStr_p); |
748 763 | // Need to grid the weighted Convolution Functions to make the sensitivity pattern. |
749 764 | if (!avgPBReady_p) |
750 765 | { |