LCOV - code coverage report
Current view: top level - synthesis/TransformMachines - AWProjectFT.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 29 0.0 %
Date: 2024-12-11 20:54:31 Functions: 0 19 0.0 %

          Line data    Source code
       1             : //# AWProjectFT.h: Definition for AWProjectFT
       2             : //# Copyright (C) 1996,1997,1998,1999,2000,2002
       3             : //# Associated Universities, Inc. Washington DC, USA.
       4             : //#
       5             : //# This library is free software; you can redistribute it and/or modify it
       6             : //# under the terms of the GNU Library General Public License as published by
       7             : //# the Free Software Foundation; either version 2 of the License, or (at your
       8             : //# option) any later version.
       9             : //#
      10             : //# This library is distributed in the hope that it will be useful, but WITHOUT
      11             : //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12             : //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
      13             : //# License for more details.
      14             : //#
      15             : //# You should have received a copy of the GNU Library General Public License
      16             : //# along with this library; if not, write to the Free Software Foundation,
      17             : //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
      18             : //#
      19             : //# Correspondence concerning AIPS++ should be adressed as follows:
      20             : //#        Internet email: casa-feedback@nrao.edu.
      21             : //#        Postal address: AIPS++ Project Office
      22             : //#                        National Radio Astronomy Observatory
      23             : //#                        520 Edgemont Road
      24             : //#                        Charlottesville, VA 22903-2475 USA
      25             : //#
      26             : //#
      27             : //# $Id$
      28             : 
      29             : #ifndef SYNTHESIS_AWPROJECTFT_H
      30             : #define SYNTHESIS_AWPROJECTFT_H
      31             : 
      32             : #include <synthesis/TransformMachines/VLACalcIlluminationConvFunc.h>
      33             : #include <synthesis/TransformMachines/VLAIlluminationConvFunc.h>
      34             : #include <synthesis/TransformMachines/AWVisResampler.h>
      35             : //#include <synthesis/MeasurementComponents/ConvolutionFunction.h>
      36             : #include <synthesis/TransformMachines/EVLAConvFunc.h>
      37             : #include <synthesis/MeasurementComponents/SolvableVisCal.h>
      38             : #include <synthesis/TransformMachines/VPSkyJones.h>
      39             : #include <synthesis/TransformMachines/FTMachine.h>
      40             : #include <synthesis/TransformMachines/PolOuterProduct.h>
      41             : //#include <synthesis/MeasurementComponents/CFCache.h>
      42             : #include <synthesis/TransformMachines/Utils.h>
      43             : 
      44             : #include <casacore/scimath/Mathematics/FFTServer.h>
      45             : #include <msvis/MSVis/VisBuffer.h>
      46             : 
      47             : #include <casacore/casa/Containers/Block.h>
      48             : #include <casacore/casa/Arrays/Array.h>
      49             : #include <casacore/casa/Arrays/Vector.h>
      50             : #include <casacore/casa/Arrays/Matrix.h>
      51             : 
      52             : #include <casacore/scimath/Mathematics/ConvolveGridder.h>
      53             : #include <casacore/lattices/Lattices/LatticeCache.h>
      54             : #include <casacore/lattices/Lattices/ArrayLattice.h>
      55             : #include <casacore/ms/MeasurementSets/MSColumns.h>
      56             : #include <casacore/measures/Measures/Measure.h>
      57             : #include <casacore/measures/Measures/MDirection.h>
      58             : #include <casacore/measures/Measures/MPosition.h>
      59             : #include <casacore/images/Images/ImageInterface.h>
      60             : #include <casacore/coordinates/Coordinates/DirectionCoordinate.h>
      61             : 
      62             : #include <synthesis/TransformMachines/AWConvFunc.h>
      63             : #include <synthesis/TransformMachines/AWConvFuncEPJones.h>
      64             : #include <synthesis/TransformMachines/ATerm.h>
      65             : 
      66             : #include <casacore/casa/OS/Timer.h>
      67             : 
      68             : namespace casa { //# NAMESPACE CASA - BEGIN
      69             :   
      70             :   // <summary>  An FTMachine for Gridded Fourier transforms including effects of primary beam and pointing offsets and the w-term</summary>
      71             :   
      72             :   // <use visibility=export>
      73             :   
      74             :   // <reviewed reviewer="" date="" tests="" demos="">
      75             :   
      76             :   // <prerequisite>
      77             :   //   <li> <linkto class=FTMachine>FTMachine</linkto> module
      78             :   //   <li> <linkto class=SkyEquation>SkyEquation</linkto> module
      79             :   //   <li> <linkto class=VisBuffer>VisBuffer</linkto> module
      80             :   //   <li> <linto class=EPJones>EPJones</linkto> module
      81             :   // </prerequisite>
      82             :   //
      83             :   // <etymology> 
      84             :   // FTMachine is a Machine for Fourier Transforms. Like
      85             :   // WProjectFT, AWProjectFT does Grid-based Fourier transforms but
      86             :   // also includes the effects of primary beam and antenna pointing
      87             :   // offsets. 
      88             :   // </etymology>
      89             :   //
      90             :   // <synopsis> 
      91             :   //
      92             :   // The <linkto class=SkyEquation>SkyEquation</linkto> needs to be
      93             :   // able to perform Fourier transforms on visibility
      94             :   // data. AWProjectFT allows efficient handling of direction
      95             :   // dependent effects due to the primary beam and antenna pointing
      96             :   // offsets using a <linkto class=VisBuffer>VisBuffer</linkto> which
      97             :   // encapsulates a chunk of visibility (typically all baselines for
      98             :   // one time) together with all the information needed for processing
      99             :   // (e.g. UVW coordinates).
     100             :   //
     101             :   // Using this FTMachine, errors due antenna pointing offsets can be
     102             :   // corrected during deconvolution.  One form of antenna pointing
     103             :   // error which is known a-priori is the VLA polarization squint
     104             :   // (about 6% of the Primary beam width at any frequency).  For
     105             :   // casacore::Stokes imaging, using this FTMachine, the VLA polarization squint
     106             :   // and beam polarization can also be corrected.  Also since the
     107             :   // effects of antenna pointing errors is strongest in the range of
     108             :   // 1-2GHz band (where the sky is not quite empty while the beams are
     109             :   // not too large either), this FTMachine can also be setup to
     110             :   // correct for the w-term.
     111             :   //
     112             :   // Switches are provided in the get() method to compute the
     113             :   // derivatives with respect to the parameters of the primary beam
     114             :   // (only pointing offsets for now).  This is used in the pointing
     115             :   // offset solver.
     116             :   //
     117             :   // See the documentation of other FTMachines for details about the
     118             :   // design of the FTMachines in general.
     119             :   //
     120             :   // </synopsis> 
     121             :   //
     122             :   // <example>
     123             :   // See the example for <linkto class=SkyModel>SkyModel</linkto>.
     124             :   // </example>
     125             :   //
     126             :   // <motivation>
     127             :   //
     128             :   // Encapsulate the correction of direction dependent effects via
     129             :   // visibility plane convolutions with a potentially different
     130             :   // convolution function for each baseline.
     131             :   //
     132             :   // </motivation>
     133             :   //
     134             :   // <todo asof="2005/07/21">
     135             :   //
     136             :   // <ul> Include the antenna based complex gain term as well since
     137             :   // that can interfere with the effects of pointing offsets.  
     138             :   //
     139             :   // <ul> Factor out the actual convolution functions as a separate
     140             :   // class making FTMachines for various direction dependent effects
     141             :   // generic.
     142             :   //
     143             :   // </todo>
     144             :   
     145             :   //  class EPJones;
     146             :   class SolvableVisJones;
     147             :   class AWProjectFT : public FTMachine {
     148             :   public:
     149             :     static ATerm* createTelescopeATerm(const casacore::String& telescopeName, 
     150             :                                        const casacore::Bool& isATermOn);
     151             :     static casacore::CountedPtr<ConvolutionFunction> makeCFObject(const casacore::String& telescopeName,
     152             :                                                         const casacore::Bool aTermOn,
     153             :                                                         const casacore::Bool psTermOn,
     154             :                                                         const casacore::Bool wTermOn,
     155             :                                                         const casacore::Bool mTermOn,
     156             :                                                         const casacore::Bool wBAWP,
     157             :                                                         const casacore::Bool conjBeams);
     158             :     AWProjectFT();
     159             :     
     160             :     // Constructor: cachesize is the size of the cache in words
     161             :     // (e.g. a few million is a good number), tilesize is the
     162             :     // size of the tile used in gridding (cannot be less than
     163             :     // 12, 16 works in most cases). 
     164             :     // <group>
     165             :     AWProjectFT(casacore::Int nFacets, casacore::Long cachesize, 
     166             :                 casacore::CountedPtr<CFCache>& cfcache,
     167             :                 casacore::CountedPtr<ConvolutionFunction>& cf,
     168             :                 casacore::CountedPtr<VisibilityResamplerBase>& visResampler,
     169             :                 casacore::Bool applyPointingOffset=true,
     170             :                 casacore::Bool doPBCorr=true,
     171             :                 casacore::Int tilesize=16, 
     172             :                 casacore::Float pbLimit=5e-4,
     173             :                 casacore::Bool usezero=false,
     174             :                 casacore::Bool conjBeams_p=true,
     175             :                 casacore::Bool doublePrecGrid=false,
     176             :                 PolOuterProduct::MuellerType muellerType=PolOuterProduct::FULL);
     177             :     // </group>
     178             :     
     179             :     // Construct from a casacore::Record containing the AWProjectFT state
     180             :     AWProjectFT(const casacore::RecordInterface& stateRec);
     181             :     
     182             :     // Copy constructor
     183             :     AWProjectFT(const AWProjectFT &other);
     184             :     
     185             :     // Assignment operator
     186             :     AWProjectFT &operator=(const AWProjectFT &other);
     187             :     
     188             :     ~AWProjectFT();
     189             :     
     190             :     //   void setEPJones(EPJones* ep_j) {epJ = ep_j;}
     191             :     void setEPJones(SolvableVisJones* ep_j) {epJ_p = ep_j;}
     192             :     
     193           0 :     virtual void setDOPBCorrection(casacore::Bool doit=true) {doPBCorrection=doit;};
     194           0 :     virtual casacore::Bool getDOPBCorrection() {return doPBCorrection;};
     195           0 :     virtual void setConjBeams(casacore::Bool useit=true) {conjBeams_p=useit;};
     196           0 :     virtual casacore::Bool getConjBeams() {return conjBeams_p;};
     197             : 
     198           0 :     virtual casacore::Float getPBLimit() {return pbLimit_p;};
     199             :     // Initialize transform to Visibility plane using the image
     200             :     // as a template. The image is loaded and Fourier transformed.
     201             :     
     202             :     void setObservatoryLocation(const casacore::MPosition& mLocation) {mLocation_p=mLocation;};
     203             :     
     204             :     // Vectorized version of initializeToVis.  Required since
     205             :     // MultiTermFTM needs vectorized version. And this is implemented
     206             :     // in FTMachine (the baseclass).  And one relies on static_cast in
     207             :     // Imager::createFTMachine() (or is it in CSE?) to cast the
     208             :     // pointer to specific types such that this methods gets called
     209             :     // when the FTMachine pointer is of type AWProjectFT.
     210             :     virtual void initializeToVis(casacore::Block<casacore::CountedPtr<casacore::ImageInterface<casacore::Complex> > > & compImageVec,
     211             :                                  casacore::PtrBlock<casacore::SubImage<casacore::Float> *> & modelImageVec, 
     212             :                                  casacore::PtrBlock<casacore::SubImage<casacore::Float> *>& weightImageVec, 
     213             :                                  casacore::PtrBlock<casacore::SubImage<casacore::Float> *>& fluxScaleVec, 
     214             :                                  casacore::Block<casacore::Matrix<casacore::Float> >& weightsVec,
     215             :                                  const VisBuffer& vb);
     216             : 
     217             :     virtual void initializeToVis(casacore::ImageInterface<casacore::Complex>& image,
     218             :                          const VisBuffer& vb);
     219             :     // This version returns the gridded vis...should be used in conjunction 
     220             :     // with the version of 'get' that needs the gridded visdata 
     221             :     virtual void initializeToVis(casacore::ImageInterface<casacore::Complex>& image,
     222             :                          const VisBuffer& vb, casacore::Array<casacore::Complex>& griddedVis,
     223             :                          casacore::Vector<casacore::Double>& uvscale);
     224             :     
     225             :     // Finalize transform to Visibility plane: flushes the image
     226             :     // cache and shows statistics if it is being used.
     227             :     virtual void finalizeToVis();
     228             :     
     229             :     // Initialize transform to Sky plane: initializes the image
     230             :     virtual void initializeToSky(casacore::ImageInterface<casacore::Complex>& image,  casacore::Matrix<casacore::Float>& weight,
     231             :                          const VisBuffer& vb);
     232             :     
     233             :     // Finalize transform to Sky plane: flushes the image
     234             :     // cache and shows statistics if it is being used. DOES NOT
     235             :     // DO THE FINAL TRANSFORM!
     236             :     virtual void finalizeToSky();
     237             :     
     238             :     virtual void initVisBuffer(VisBuffer& vb, Type whichVBColumn);
     239             :     void initVisBuffer(VisBuffer& vb, Type whichVBColumn, casacore::Int row);
     240             : 
     241             :     // Get actual coherence from grid by degridding
     242             :     void get(VisBuffer& vb, casacore::Int row=-1);
     243             :     
     244             :     // Get the coherence from grid return it in the degrid 
     245             :     // is used especially when scratch columns are not 
     246             :     // present in ms.
     247             :     void get(VisBuffer& vb, casacore::Cube<casacore::Complex>& degrid, 
     248             :              casacore::Array<casacore::Complex>& griddedVis, casacore::Vector<casacore::Double>& scale, 
     249             :              casacore::Int row=-1);
     250             :     
     251             :     void get(VisBuffer& vb, casacore::Cube<casacore::Float>& pointingOffsets, casacore::Int row=-1,
     252             :              Type whichVBColumn=FTMachine::MODEL,casacore::Int Conj=0)
     253             :     {
     254             :       get(vb,vb,vb,pointingOffsets,row,whichVBColumn,whichVBColumn,Conj,0);
     255             :     }
     256             :     
     257             :     void get(VisBuffer& vb, VisBuffer& gradAzVB,VisBuffer& gradElVB,
     258             :              casacore::Cube<casacore::Float>& pointingOffsets,casacore::Int row=-1,
     259             :              Type whichVBColumn=FTMachine::MODEL,
     260             :              Type whichGradVBColumn=FTMachine::MODEL,
     261             :              casacore::Int Conj=0, casacore::Int doGrad=1) ;
     262             :   void nget(VisBuffer& vb,
     263             :             // These offsets should be appropriate for the VB
     264             :             casacore::Array<casacore::Float>& l_off, casacore::Array<casacore::Float>& m_off,
     265             :             casacore::Cube<casacore::Complex>& Mout,
     266             :             casacore::Cube<casacore::Complex>& dMout1,
     267             :             casacore::Cube<casacore::Complex>& dMout2,
     268             :             casacore::Int Conj=0, casacore::Int doGrad=1);
     269             :     // Get the coherence from grid return it in the degrid 
     270             :     // is used especially when scratch columns are not 
     271             :     // present in ms.
     272             :     void get(VisBuffer& vb, casacore::Cube<casacore::Complex>& degrid, 
     273             :              casacore::Array<casacore::Complex>& griddedVis, casacore::Vector<casacore::Double>& scale, 
     274             :              casacore::Cube<casacore::Float>& pointingOffsets,casacore::Int row=-1);
     275             :     
     276             :     
     277             :     // Put coherence to grid by gridding.
     278             :     void put(const VisBuffer&,
     279             :              casacore::TempImage<casacore::Complex>&, casacore::Vector<casacore::Double>&, int,
     280             :              casacore::UVWMachine*, casacore::Bool) 
     281             :     {
     282             :       //    throw(casacore::AipsError("AWProjectFT::put is not implemented"));
     283             :     }
     284             :     void put(const VisBuffer& vb, casacore::Int row=-1, casacore::Bool dopsf=false,
     285             :              FTMachine::Type type=FTMachine::OBSERVED);
     286             :     
     287             :     // Make the entire image using a ROVisIter
     288           0 :     virtual void makeImage(FTMachine::Type,
     289             :                            ROVisibilityIterator&,
     290             :                            casacore::ImageInterface<casacore::Complex>&,
     291           0 :                            casacore::Matrix<casacore::Float>&) {};
     292             : 
     293             :     // Make the entire image
     294             :     void makeImage(FTMachine::Type type,
     295             :                    VisSet& vs,
     296             :                    casacore::ImageInterface<casacore::Complex>& image,
     297             :                    casacore::Matrix<casacore::Float>& weight);
     298             :     
     299             :     // Get the final image: do the Fourier transform and
     300             :     // grid-correct, then optionally normalize by the summed weights
     301             :     virtual casacore::ImageInterface<casacore::Complex>& getImage(casacore::Matrix<casacore::Float>&, casacore::Bool normalize=true);
     302             : 
     303             :     // Get the final weights image
     304             :     void getWeightImage(casacore::ImageInterface<casacore::Float>&, casacore::Matrix<casacore::Float>&);
     305             :     
     306             :     // Save and restore the AWProjectFT to and from a record
     307             :     casacore::Bool toRecord(casacore::RecordInterface& outRec,  casacore::Bool withImage=false);
     308             :     casacore::Bool fromRecord(const casacore::RecordInterface& inRec);
     309             :     
     310             :     // Can this FTMachine be represented by Fourier convolutions?
     311           0 :     casacore::Bool isFourier() {return true;}
     312             :     
     313             :     //  casacore::Bool changed(const VisBuffer& vb) {return vpSJ->changed(vb,1);};
     314             :     //    casacore::Bool changed(const VisBuffer& vb) {return false;}
     315             :     
     316             :     virtual casacore::Int findPointingOffsets(const VisBuffer&, casacore::Array<casacore::Float>&, casacore::Array<casacore::Float>&,
     317             :                                     casacore::Bool Evaluate=true);
     318             :     virtual casacore::Int findPointingOffsets(const VisBuffer&, casacore::Cube<casacore::Float>&,
     319             :                                     casacore::Array<casacore::Float>&, casacore::Array<casacore::Float>&,
     320             :                                     casacore::Bool Evaluate=true);
     321           0 :     virtual casacore::Double getVBPA(const VisBuffer& vb) 
     322             :     {
     323             :       // if (!rotateApertureOTP_p) return currentCFPA;
     324             :       // else return getPA(vb);
     325           0 :       return getPA(vb);
     326             :     };
     327             :     casacore::MDirection::Convert makeCoordinateMachine(const VisBuffer&,
     328             :                                               const casacore::MDirection::Types&,
     329             :                                               const casacore::MDirection::Types&,
     330             :                                               casacore::MEpoch& last);
     331             :     //
     332             :     // Make a sensitivity image (sensitivityImage), given the gridded
     333             :     // weights (wtImage).  These are related to each other by a
     334             :     // Fourier transform and normalization by the sum-of-weights
     335             :     // (sumWt) and normalization by the product of the 2D FFT size
     336             :     // along each axis.  If doFFTNorm=false, normalization by the FFT
     337             :     // size is not done.  If sumWt is not provided, normalization by
     338             :     // the sum of weights is also not done.
     339             :     //
     340           0 :     virtual void makeSensitivityImage(casacore::Lattice<casacore::Complex>&,// wtImage,
     341             :                                       casacore::ImageInterface<casacore::Float>&,// sensitivityImage,
     342             :                                       const casacore::Matrix<casacore::Float>&,// sumWt=casacore::Matrix<casacore::Float>(),
     343           0 :                                       const casacore::Bool& ) {};
     344             :     virtual void makeSensitivityImage(const VisBuffer& vb, const casacore::ImageInterface<casacore::Complex>& imageTemplate,
     345             :                                       casacore::ImageInterface<casacore::Float>& sensitivityImage);
     346             : 
     347             :     //
     348             :     // Given the sky image (Fourier transform of the visibilities),
     349             :     // sum of weights and the sensitivity image, this method replaces
     350             :     // the skyImage with the normalized image of the sky.
     351             :     //
     352             :     // These are now implement in the FTMachine base class.  
     353             :     //
     354             :     // These can't be left here since now the design depends on
     355             :     // getting the correct version called due to static type casting
     356             :     // of FTM pointer and not on inheretance and and specialization
     357             :     // via overloading.
     358             : 
     359             :     // virtual void normalizeImage(casacore::Lattice<casacore::Complex>& skyImage,
     360             :     //                          const casacore::Matrix<casacore::Double>& sumOfWts,
     361             :     //                          casacore::Lattice<casacore::Float>& sensitivityImage,
     362             :     //                          casacore::Bool fftNorm=true);
     363             :     // virtual void normalizeImage(casacore::Lattice<casacore::Complex>& skyImage,
     364             :     //                          const casacore::Matrix<casacore::Double>& sumOfWts,
     365             :     //                          casacore::Lattice<casacore::Float>& sensitivityImage,
     366             :     //                          casacore::Lattice<casacore::Complex>& sensitivitySqImage,
     367             :     //                          casacore::Bool fftNorm=true);
     368             :     
     369           0 :     virtual casacore::ImageInterface<casacore::Float>& getSensitivityImage() {return *avgPB_p;}
     370           0 :     virtual casacore::Matrix<casacore::Double>& getSumOfWeights() {return sumWeight;};
     371           0 :     virtual casacore::Matrix<casacore::Double>& getSumOfCFWeights() {return sumCFWeight;};
     372             : 
     373             :     void makeConjPolMap(const VisBuffer& vb, const casacore::Vector<casacore::Int> cfPolMap, casacore::Vector<casacore::Int>& conjPolMap);
     374             :     //    casacore::Vector<casacore::Int> makeConjPolMap(const VisBuffer& vb);
     375             :     void makeCFPolMap(const VisBuffer& vb, const casacore::Vector<casacore::Int>& cfstokes, casacore::Vector<casacore::Int>& polM);
     376             :     //    void reset() {vpSJ->reset();}
     377           0 :     void reset() {paChangeDetector.reset();}
     378             : 
     379             :     void setPAIncrement(const casacore::Quantity &computePAIncr, const casacore::Quantity &rotateOTFPAIncr);
     380             : 
     381             :     casacore::Vector<casacore::Int>& getPolMap() {return polMap;};
     382           0 :     virtual casacore::String name() const { return "AWProjectFT";};
     383           0 :     virtual casacore::Bool verifyAvgPB(casacore::ImageInterface<casacore::Float>& pb, casacore::ImageInterface<casacore::Float>& sky)
     384           0 :     {return verifyShapes(pb.shape(),sky.shape());}
     385             : 
     386           0 :     virtual casacore::Bool verifyAvgPB(casacore::ImageInterface<casacore::Float>& pb, casacore::ImageInterface<casacore::Complex>& sky)
     387           0 :     {return verifyShapes(pb.shape(),sky.shape());}
     388             : 
     389             :     virtual casacore::Bool verifyShapes(casacore::IPosition shape0, casacore::IPosition shape1);
     390             : 
     391           0 :     inline virtual casacore::Float pbFunc(const casacore::Float& a, const casacore::Float& limit) 
     392           0 :     {casacore::Float tt=sqrt(a);return  (abs(tt) >= limit)?tt:1.0;};
     393             :     // {if (abs(a) >= limit) return (a);else return 1.0;};
     394             : 
     395           0 :     inline virtual casacore::Complex pbFunc(const casacore::Complex& a, const casacore::Float& limit) 
     396           0 :     {if (abs(a)>=limit) return (a); else return casacore::Complex(1.0,0.0);};
     397             : 
     398           0 :     virtual void setMiscInfo(const casacore::Int qualifier)
     399             :     {
     400           0 :       sensitivityPatternQualifier_p=qualifier;
     401           0 :       sensitivityPatternQualifierStr_p = ".tt"+casacore::String::toString(sensitivityPatternQualifier_p);
     402           0 :     }
     403             :     virtual void ComputeResiduals(VisBuffer&vb, casacore::Bool useCorrected);
     404             :     void makeWBCFWt(CFStore2& cfs,const casacore::Double imRefFreq);
     405             : 
     406             :     CFBStruct cfbst_pub;
     407             :     // Image Scaling and offset
     408             :     casacore::Vector<casacore::Double> uvScale, uvOffset;
     409             :   protected:
     410             :     
     411             :     casacore::Int nint(casacore::Double val) {return casacore::Int(floor(val+0.5));};
     412             :     // Locate convolution functions on the disk
     413             :     //    casacore::Int locateConvFunction(const casacore::Int Nw, const casacore::Float pa);
     414             :     //    void cacheConvFunction(casacore::Int which, casacore::Array<casacore::Complex>& cf, casacore::CoordinateSystem& coord);
     415             :     // Find the convolution function
     416             :     void findConvFunction(const casacore::ImageInterface<casacore::Complex>& image,
     417             :                           const VisBuffer& vb);
     418             :     
     419             :     // Get the appropriate data pointer
     420             :     casacore::Array<casacore::Complex>* getDataPointer(const casacore::IPosition&, casacore::Bool);
     421             :     
     422             :     void ok();
     423             :     
     424             :     void init();
     425             :     //    virtual void initPolInfo(const VisBuffer& vb);
     426             :     // Is this record on Grid? check both ends. This assumes that the
     427             :     // ends bracket the middle
     428             :     casacore::Bool recordOnGrid(const VisBuffer& vb, casacore::Int rownr) const;
     429             :     
     430             :     // Padding in FFT
     431             :     casacore::Float padding_p;
     432             :     
     433             :     casacore::Int nWPlanes_p;
     434             :     // Image cache
     435             :     casacore::LatticeCache<casacore::Complex> * imageCache;
     436             :     
     437             :     // Sizes
     438             :     casacore::Long cachesize;
     439             :     casacore::Int tilesize;
     440             :     
     441             :     // Gridder
     442             :     casacore::ConvolveGridder<casacore::Double, casacore::Complex>* gridder;
     443             :     
     444             :     // Is this tiled?
     445             :     casacore::Bool isTiled;
     446             :     
     447             :     // casacore::Array lattice
     448             :     casacore::CountedPtr<casacore::Lattice<casacore::Complex> > arrayLattice;
     449             :     
     450             :     // Lattice. For non-tiled gridding, this will point to arrayLattice,
     451             :     //  whereas for tiled gridding, this points to the image
     452             :     casacore::CountedPtr<casacore::Lattice<casacore::Complex> > lattice;
     453             :     
     454             :     casacore::Float maxAbsData;
     455             :     
     456             :     // Useful IPositions
     457             :     casacore::IPosition centerLoc, offsetLoc;
     458             :     
     459             :     // // Image Scaling and offset
     460             :     // casacore::Vector<casacore::Double> uvScale, uvOffset;
     461             :     
     462             :    
     463             :     //    casacore::DirectionCoordinate directionCoord;
     464             :     casacore::MDirection::Convert* pointingToImage;
     465             :     
     466             :     // Grid/degrid zero spacing points?
     467             :     casacore::Bool usezero_p;
     468             :     
     469             :     //    casacore::CountedPtr<ConvolutionFunction> telescopeConvFunc_p;
     470             :     //    CFStore cfs_p, cfwts_p;
     471             :     // casacore::Array<casacore::Complex> convFunc_p, convWeights_p;
     472             :     //
     473             :     // casacore::Vector to hold the support size info. for the convolution
     474             :     // functions pointed to by the elements of convFunctions_p.  The
     475             :     // co-ordinates of this array are (W-term, Poln, PA).
     476             :     //
     477             :     casacore::Int // convSize,
     478             :       convSampling, wConvSize, lastIndex_p;
     479             :     
     480             :     //
     481             :     // The average PB for sky image normalization
     482             :     //
     483             :     casacore::CountedPtr<casacore::ImageInterface<casacore::Float> > avgPB_p;
     484             :     casacore::CountedPtr<casacore::ImageInterface<casacore::Complex> > avgPBSq_p;
     485             :     //
     486             :     // No. of vis. polarization planes used in making the user defined
     487             :     // casacore::Stokes images
     488             :     //
     489             :     casacore::Int maxConvSupport;
     490             :     //
     491             :     // Percentage of the peak of the PB after which the image is set
     492             :     // to zero.
     493             :     //
     494             :     casacore::CountedPtr<SolvableVisJones> epJ_p;
     495             :     casacore::Double sigma;
     496             :     casacore::Int Nant_p, doPointing;
     497             :     casacore::Bool doPBCorrection, makingPSF, conjBeams_p;
     498             :     
     499             :     //    casacore::CountedPtr<CFCache> cfCache_p;
     500             :     ParAngleChangeDetector paChangeDetector;
     501             :     casacore::Double rotateOTFPAIncr_p, computePAIncr_p;
     502             : 
     503             :     casacore::Unit Second, Radian, Day;
     504             :     casacore::Array<casacore::Float> l_offsets,m_offsets;
     505             :     casacore::Vector<casacore::Float> pbPeaks, paList;
     506             : 
     507             :     casacore::Double currentCFPA, cfRefFreq_p, imRefFreq_p;
     508             :     casacore::Float lastPAUsedForWtImg;
     509             :     casacore::Bool pbNormalized_p;
     510             :     casacore::Vector<casacore::Bool> paNdxProcessed_p;
     511             :     //
     512             :     //----------------------------------------------------------------------
     513             :     //
     514             :     virtual void normalizeAvgPB();
     515             :     virtual void normalizeAvgPB(casacore::ImageInterface<casacore::Complex>& inImage,
     516             :                                 casacore::ImageInterface<casacore::Float>& outImage);
     517             :     virtual void resampleDataToGrid(casacore::Array<casacore::Complex>& griddedData, VBStore& vbs, 
     518             :                                     const VisBuffer& vb, casacore::Bool& dopsf);
     519             :     virtual void resampleDataToGrid(casacore::Array<casacore::DComplex>& griddedData, VBStore& vbs, 
     520             :                                     const VisBuffer& vb, casacore::Bool& dopsf);
     521             :     virtual void resampleGridToData(VBStore& vbs, casacore::Array<casacore::Complex>& griddedData,
     522             :                                     const VisBuffer& vb);
     523             : 
     524             :     virtual void makeThGridCoords(VBStore& vbs, const casacore::Vector<casacore::Int>& gridShape);
     525             :     virtual void setupVBStore(VBStore& vbs,
     526             :                               const VisBuffer& vb,
     527             :                               const casacore::Matrix<casacore::Float>& imagingweight,
     528             :                               const casacore::Cube<casacore::Complex>& visData,
     529             :                               const casacore::Matrix<casacore::Double>& uvw,
     530             :                               const casacore::Cube<casacore::Int>& flagCube,
     531             :                               const casacore::Vector<casacore::Double>& dphase,
     532             :                               const casacore::Bool& doPSF,
     533             :                               const casacore::Vector<casacore::Int> &gridShape);
     534             : 
     535             :     //    AWVisResampler visResampler_p;
     536             :     casacore::CountedPtr<VisibilityResamplerBase> visResampler_p;
     537             :     casacore::Int sensitivityPatternQualifier_p;
     538             :     casacore::String sensitivityPatternQualifierStr_p;
     539             :     CFStore rotatedConvFunc_p;
     540             :     //casacore::CountedPtr<CFStore2> cfs2_p, cfwts2_p;
     541             :     casacore::Vector<casacore::Int> ConjCFMap_p, CFMap_p;
     542             : 
     543             :     casacore::Timer timer_p;
     544             :     casacore::Double runTime1_p;
     545             : 
     546             :     PolOuterProduct::MuellerType muellerType_p;
     547             : 
     548             :     Int previousSPWID_p;
     549             : 
     550             : #include "AWProjectFT.FORTRANSTUFF.INC"
     551             :   };
     552             : } //# NAMESPACE CASA - END
     553             : 
     554             : #endif

Generated by: LCOV version 1.16