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

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