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

Generated by: LCOV version 1.16