Commits

Kumar Golap authored 54b10fea377
make avgPB_p takes a subset of cfcache if image is a chunk

casa5/code/synthesis/TransformMachines2/AWProjectWBFT.cc

Modified
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 #include <synthesis/TransformMachines2/VB2CFBMap.h>
30 30 #include <synthesis/TransformMachines2/AWProjectWBFT.h>
31 31 #include <synthesis/TransformMachines2/AWVisResampler.h>
32 32 #include <synthesis/TransformMachines/StokesImageUtil.h>
33 +#include <imageanalysis/Utilities/SpectralImageUtil.h>
33 34 #include <coordinates/Coordinates/CoordinateSystem.h>
34 35 #include <scimath/Mathematics/FFTServer.h>
35 36 #include <scimath/Mathematics/Convolver.h>
36 37 #include <lattices/LatticeMath/LatticeFFT.h>
37 38 #include <images/Images/ImageInterface.h>
38 39 #include <images/Images/PagedImage.h>
39 40 #include <msvis/MSVis/VisBuffer2.h>
40 41 #include <casa/Arrays/Vector.h>
41 42 #include <casa/Arrays/Slice.h>
42 43 #include <casa/Arrays/ArrayMath.h>
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 {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut