LCOV - code coverage report
Current view: top level - synthesis/MeasurementComponents - nPBWProjectFT.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 16 0.0 %
Date: 2024-11-06 17:42:47 Functions: 0 12 0.0 %

          Line data    Source code
       1             : //# nPBWProjectFT.h: Definition for nPBWProjectFT
       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_PBWPROJECTFT_H
      30             : #define SYNTHESIS_PBWPROJECTFT_H
      31             : 
      32             : #include <synthesis/TransformMachines/FTMachine.h>
      33             : #include <casacore/casa/Arrays/Matrix.h>
      34             : #include <casacore/scimath/Mathematics/FFTServer.h>
      35             : #include <msvis/MSVis/VisBuffer.h>
      36             : #include <casacore/images/Images/ImageInterface.h>
      37             : #include <casacore/casa/Containers/Block.h>
      38             : #include <casacore/casa/Arrays/Array.h>
      39             : #include <casacore/casa/Arrays/Vector.h>
      40             : #include <casacore/casa/Arrays/Matrix.h>
      41             : #include <casacore/scimath/Mathematics/ConvolveGridder.h>
      42             : #include <casacore/lattices/Lattices/LatticeCache.h>
      43             : #include <casacore/lattices/Lattices/ArrayLattice.h>
      44             : #include <casacore/ms/MeasurementSets/MSColumns.h>
      45             : #include <casacore/measures/Measures/Measure.h>
      46             : #include <casacore/measures/Measures/MDirection.h>
      47             : #include <casacore/measures/Measures/MPosition.h>
      48             : #include <casacore/coordinates/Coordinates/DirectionCoordinate.h>
      49             : #include <synthesis/TransformMachines/VPSkyJones.h>
      50             : #include <synthesis/TransformMachines/VLACalcIlluminationConvFunc.h>
      51             : #include <synthesis/TransformMachines/VLAIlluminationConvFunc.h>
      52             : #include <synthesis/TransformMachines/Utils.h>
      53             : 
      54             : //#include <synthesis/MeasurementComponents/EPJones.h>
      55             : #include <synthesis/MeasurementComponents/SolvableVisCal.h>
      56             : #include <synthesis/MeasurementComponents/ConvFuncDiskCache.h>
      57             : 
      58             : namespace casa { //# NAMESPACE CASA - BEGIN
      59             :   
      60             :   // <summary>  An FTMachine for Gridded Fourier transforms including effects of primary beam and pointing offsets and the w-term</summary>
      61             :   
      62             :   // <use visibility=export>
      63             :   
      64             :   // <reviewed reviewer="" date="" tests="" demos="">
      65             :   
      66             :   // <prerequisite>
      67             :   //   <li> <linkto class=FTMachine>FTMachine</linkto> module
      68             :   //   <li> <linkto class=SkyEquation>SkyEquation</linkto> module
      69             :   //   <li> <linkto class=VisBuffer>VisBuffer</linkto> module
      70             :   //   <li> <linto class=EPJones>EPJones</linkto> module
      71             :   // </prerequisite>
      72             :   //
      73             :   // <etymology> 
      74             :   // FTMachine is a Machine for Fourier Transforms. Like
      75             :   // WProjectFT, nPBWProjectFT does Grid-based Fourier transforms but
      76             :   // also includes the effects of primary beam and antenna pointing
      77             :   // offsets. 
      78             :   // </etymology>
      79             :   //
      80             :   // <synopsis> 
      81             :   //
      82             :   // The <linkto class=SkyEquation>SkyEquation</linkto> needs to be
      83             :   // able to perform Fourier transforms on visibility
      84             :   // data. nPBWProjectFT allows efficient handling of direction
      85             :   // dependent effects due to the primary beam and antenna pointing
      86             :   // offsets using a <linkto class=VisBuffer>VisBuffer</linkto> which
      87             :   // encapsulates a chunk of visibility (typically all baselines for
      88             :   // one time) together with all the information needed for processing
      89             :   // (e.g. UVW coordinates).
      90             :   //
      91             :   // Using this FTMachine, errors due antenna pointing offsets can be
      92             :   // corrected during deconvolution.  One form of antenna pointing
      93             :   // error which is known a-priori is the VLA polarization squint
      94             :   // (about 6% of the Primary beam width at any frequency).  For
      95             :   // casacore::Stokes imaging, using this FTMachine, the VLA polarization squint
      96             :   // and beam polarization can also be corrected.  Also since the
      97             :   // effects of antenna pointing errors is strongest in the range of
      98             :   // 1-2GHz band (where the sky is not quite empty while the beams are
      99             :   // not too large either), this FTMachine can also be setup to
     100             :   // correct for the w-term.
     101             :   //
     102             :   // Switches are provided in the get() method to compute the
     103             :   // derivatives with respect to the parameters of the primary beam
     104             :   // (only pointing offsets for now).  This is used in the pointing
     105             :   // offset solver.
     106             :   //
     107             :   // See the documentation of other FTMachines for details about the
     108             :   // design of the FTMachines in general.
     109             :   //
     110             :   // </synopsis> 
     111             :   //
     112             :   // <example>
     113             :   // See the example for <linkto class=SkyModel>SkyModel</linkto>.
     114             :   // </example>
     115             :   //
     116             :   // <motivation>
     117             :   //
     118             :   // Encapsulate the correction of direction dependent effects via
     119             :   // visibility plane convolutions with a potentially different
     120             :   // convolution function for each baseline.
     121             :   //
     122             :   // </motivation>
     123             :   //
     124             :   // <todo asof="2005/07/21">
     125             :   //
     126             :   // <ul> Include the antenna based complex gain term as well since
     127             :   // that can interfere with the effects of pointing offsets.  
     128             :   //
     129             :   // <ul> Factor out the actual convolution functions as a separate
     130             :   // class making FTMachines for various direction dependent effects
     131             :   // generic.
     132             :   //
     133             :   // </todo>
     134             :   
     135             :   //  class EPJones;
     136             :   class SolvableVisJones;
     137             :   class nPBWProjectFT : public FTMachine {
     138             :   public:
     139             :     
     140             :     // Constructor: cachesize is the size of the cache in words
     141             :     // (e.g. a few million is a good number), tilesize is the
     142             :     // size of the tile used in gridding (cannot be less than
     143             :     // 12, 16 works in most cases). 
     144             :     // <group>
     145             :     nPBWProjectFT(casacore::Int nFacets, casacore::Long cachesize, casacore::String& cfCacheDirName,
     146             :                   casacore::Bool applyPointingOffset=true,
     147             :                   casacore::Bool doPBCorr=true,
     148             :                   casacore::Int tilesize=16, 
     149             :                   casacore::Float paSteps=5.0, casacore::Float pbLimit=5e-2,
     150             :                   casacore::Bool usezero=false);
     151             :     // </group>
     152             :     
     153             :     // Construct from a casacore::Record containing the nPBWProjectFT state
     154             :     nPBWProjectFT(const casacore::RecordInterface& stateRec);
     155             :     
     156             :     // Copy constructor
     157             :     nPBWProjectFT(const nPBWProjectFT &other);
     158             :     
     159             :     // Assignment operator
     160             :     nPBWProjectFT &operator=(const nPBWProjectFT &other);
     161             :     
     162             :     ~nPBWProjectFT();
     163             :     
     164             :     //   void setEPJones(EPJones* ep_j) {epJ = ep_j;}
     165           0 :     void setEPJones(SolvableVisJones* ep_j) {epJ = ep_j;}
     166             :     
     167             :     void setDOPBCorrection(casacore::Bool doit=true) {doPBCorrection=doit;};
     168             :     // Initialize transform to Visibility plane using the image
     169             :     // as a template. The image is loaded and Fourier transformed.
     170             :     
     171             :     virtual void initializeToVis(casacore::ImageInterface<casacore::Complex>& image,
     172             :                          const VisBuffer& vb);
     173             :     // This version returns the gridded vis...should be used in conjunction 
     174             :     // with the version of 'get' that needs the gridded visdata 
     175             :     virtual void initializeToVis(casacore::ImageInterface<casacore::Complex>& image,
     176             :                          const VisBuffer& vb, casacore::Array<casacore::Complex>& griddedVis,
     177             :                          casacore::Vector<casacore::Double>& uvscale);
     178             :     
     179             :     // Finalize transform to Visibility plane: flushes the image
     180             :     // cache and shows statistics if it is being used.
     181             :     virtual void finalizeToVis();
     182             :     
     183             :     // Initialize transform to Sky plane: initializes the image
     184             :     virtual void initializeToSky(casacore::ImageInterface<casacore::Complex>& image,  casacore::Matrix<casacore::Float>& weight,
     185             :                          const VisBuffer& vb);
     186             :     
     187             :     // Finalize transform to Sky plane: flushes the image
     188             :     // cache and shows statistics if it is being used. DOES NOT
     189             :     // DO THE FINAL TRANSFORM!
     190             :     virtual void finalizeToSky();
     191             :     
     192             :     virtual void initVisBuffer(VisBuffer& vb, Type whichVBColumn);
     193             :     void initVisBuffer(VisBuffer& vb, Type whichVBColumn, casacore::Int row);
     194             : 
     195             :     // Get actual coherence from grid by degridding
     196             :     void get(VisBuffer& vb, casacore::Int row=-1);
     197             :     
     198             :     // Get the coherence from grid return it in the degrid 
     199             :     // is used especially when scratch columns are not 
     200             :     // present in ms.
     201             :     void get(VisBuffer& vb, casacore::Cube<casacore::Complex>& degrid, 
     202             :              casacore::Array<casacore::Complex>& griddedVis, casacore::Vector<casacore::Double>& scale, 
     203             :              casacore::Int row=-1);
     204             :     
     205             :     void get(VisBuffer& vb, casacore::Cube<casacore::Float>& pointingOffsets, casacore::Int row=-1,
     206             :              Type whichVBColumn=FTMachine::MODEL,casacore::Int Conj=0)
     207             :     {
     208             :       get(vb,vb,vb,pointingOffsets,row,whichVBColumn,whichVBColumn,Conj,0);
     209             :     }
     210             :     
     211             :     void get(VisBuffer& vb, VisBuffer& gradAzVB,VisBuffer& gradElVB,
     212             :              casacore::Cube<casacore::Float>& pointingOffsets,casacore::Int row=-1,
     213             :              Type whichVBColumn=FTMachine::MODEL,
     214             :              Type whichGradVBColumn=FTMachine::MODEL,
     215             :              casacore::Int Conj=0, casacore::Int doGrad=1) ;
     216             :   void nget(VisBuffer& vb,
     217             :             // These offsets should be appropriate for the VB
     218             :             casacore::Array<casacore::Float>& l_off, casacore::Array<casacore::Float>& m_off,
     219             :             casacore::Cube<casacore::Complex>& Mout,
     220             :             casacore::Cube<casacore::Complex>& dMout1,
     221             :             casacore::Cube<casacore::Complex>& dMout2,
     222             :             casacore::Int Conj=0, casacore::Int doGrad=1);
     223             :     // Get the coherence from grid return it in the degrid 
     224             :     // is used especially when scratch columns are not 
     225             :     // present in ms.
     226             :     void get(VisBuffer& vb, casacore::Cube<casacore::Complex>& degrid, 
     227             :              casacore::Array<casacore::Complex>& griddedVis, casacore::Vector<casacore::Double>& scale, 
     228             :              casacore::Cube<casacore::Float>& pointingOffsets,casacore::Int row=-1);
     229             :     
     230             :     
     231             :     
     232             :     
     233             :     
     234             :     
     235             :     // Put coherence to grid by gridding.
     236             :     void put(const VisBuffer&,
     237             :              casacore::TempImage<casacore::Complex>&, casacore::Vector<casacore::Double>&, int,
     238             :              casacore::UVWMachine*, casacore::Bool) 
     239             :     {
     240             :       //    throw(casacore::AipsError("nPBWProjectFT::put is not implemented"));
     241             :     }
     242             :     void put(const VisBuffer& vb, casacore::Int row=-1, casacore::Bool dopsf=false,
     243             :              FTMachine::Type type=FTMachine::OBSERVED);
     244             :     
     245             :     // Make the entire image
     246             :     void makeImage(FTMachine::Type type,
     247             :                    VisSet& vs,
     248             :                    casacore::ImageInterface<casacore::Complex>& image,
     249             :                    casacore::Matrix<casacore::Float>& weight);
     250             :     
     251             :     // Get the final image: do the Fourier transform and
     252             :     // grid-correct, then optionally normalize by the summed weights
     253             :     virtual casacore::ImageInterface<casacore::Complex>& getImage(casacore::Matrix<casacore::Float>&, casacore::Bool normalize=true);
     254           0 :     virtual void normalizeImage(casacore::Lattice<casacore::Complex>& /*skyImage*/,
     255             :                               const casacore::Matrix<casacore::Double>& /*sumOfWts*/,
     256             :                               casacore::Lattice<casacore::Float>& /*sensitivityImage*/,
     257             :                               casacore::Bool /*fftNorm*/)
     258           0 :     {throw(casacore::AipsError("nPBWProjectFT::normalizeImage() called"));}
     259             :     
     260             :     // Get the final weights image
     261             :     void getWeightImage(casacore::ImageInterface<casacore::Float>&, casacore::Matrix<casacore::Float>&);
     262             :     
     263             :     // Save and restore the nPBWProjectFT to and from a record
     264             :     casacore::Bool toRecord(casacore::String& error, casacore::RecordInterface& outRec, 
     265             :                   casacore::Bool withImage=false, const casacore::String diskimage="");
     266             :     casacore::Bool fromRecord(casacore::String& error, const casacore::RecordInterface& inRec);
     267             :     
     268             :     // Can this FTMachine be represented by Fourier convolutions?
     269           0 :     casacore::Bool isFourier() {return true;}
     270             :     
     271             :     //  casacore::Bool changed(const VisBuffer& vb) {return vpSJ->changed(vb,1);};
     272           0 :     casacore::Bool changed(const VisBuffer& ) {return false;}
     273             :     
     274             :     virtual casacore::Int findPointingOffsets(const VisBuffer&, casacore::Array<casacore::Float>&, casacore::Array<casacore::Float>&,
     275             :                                     casacore::Bool Evaluate=true);
     276             :     virtual casacore::Int findPointingOffsets(const VisBuffer&, casacore::Cube<casacore::Float>&,
     277             :                             casacore::Array<casacore::Float>&, casacore::Array<casacore::Float>&,
     278             :                             casacore::Bool Evaluate=true);
     279           0 :     virtual casacore::Double getVBPA(const VisBuffer& vb) 
     280             :     {
     281             :       // if (!rotateAperture_p) return currentCFPA;
     282             :       // else return getPA(vb);
     283           0 :       return getPA(vb);
     284             :     };
     285             :     casacore::MDirection::Convert makeCoordinateMachine(const VisBuffer&,
     286             :                                               const casacore::MDirection::Types&,
     287             :                                               const casacore::MDirection::Types&,
     288             :                                               casacore::MEpoch& last);
     289             :     /*
     290             :       void makePB(const VisBuffer& vb,
     291             :       casacore::TempImage<casacore::Float>& PB,
     292             :       casacore::IPosition& shape,casacore::CoordinateSystem& coord);
     293             :       
     294             :       void makeAveragePB(const VisBuffer& vb, 
     295             :       const casacore::ImageInterface<casacore::Complex>& image,
     296             :       casacore::Int& polInUse,
     297             :       casacore::TempImage<casacore::Float>& PB,
     298             :       casacore::TempImage<casacore::Float>& avgPB);
     299             :     */
     300             :     //
     301             :     // Make a sensitivity image (sensitivityImage), given the gridded
     302             :     // weights (wtImage).  These are related to each other by a
     303             :     // Fourier transform and normalization by the sum-of-weights
     304             :     // (sumWt) and normalization by the product of the 2D FFT size
     305             :     // along each axis.  If doFFTNorm=false, normalization by the FFT
     306             :     // size is not done.  If sumWt is not provided, normalization by
     307             :     // the sum of weights is also not done.
     308             :     //
     309             :     virtual void makeSensitivityImage(casacore::Lattice<casacore::Complex>& wtImage,
     310             :                                       casacore::ImageInterface<casacore::Float>& sensitivityImage,
     311             :                                       const casacore::Matrix<casacore::Float>& sumWt=casacore::Matrix<casacore::Float>(),
     312             :                                       const casacore::Bool& doFFTNorm=true);
     313             :     virtual casacore::Bool makeAveragePB0(const VisBuffer& vb, 
     314             :                        const casacore::ImageInterface<casacore::Complex>& image,
     315             :                        casacore::Int& polInUse,
     316             :                        casacore::TempImage<casacore::Float>& avgPB);
     317             :     /*
     318             :     void makeAveragePB(const VisBuffer& vb, 
     319             :                        const casacore::ImageInterface<casacore::Complex>& image,
     320             :                        casacore::Int& polInUse,
     321             :                        casacore::TempImage<casacore::Float>& avgPB);
     322             :     */
     323             :     void makeConjPolMap(const VisBuffer& vb, const casacore::Vector<casacore::Int> cfPolMap, casacore::Vector<casacore::Int>& conjPolMap);
     324             :     //    casacore::Vector<casacore::Int> makeConjPolMap(const VisBuffer& vb);
     325             :     void makeCFPolMap(const VisBuffer& vb, casacore::Vector<casacore::Int>& polM);
     326             :     //    void reset() {vpSJ->reset();}
     327           0 :     void reset() {paChangeDetector.reset();}
     328             : 
     329             :     void setPAIncrement(const casacore::Quantity &paIncrement);
     330             : 
     331           0 :     casacore::Vector<casacore::Int>& getPolMap() {return polMap;};
     332           0 :     virtual casacore::String name() const { return "PBWProjectFT";};
     333           0 :     virtual casacore::Bool verifyAvgPB(casacore::ImageInterface<casacore::Float>& pb, casacore::ImageInterface<casacore::Float>& sky)
     334           0 :     {return verifyShapes(pb.shape(),sky.shape());}
     335           0 :     virtual casacore::Bool verifyAvgPB(casacore::ImageInterface<casacore::Float>& pb, casacore::ImageInterface<casacore::Complex>& sky)
     336           0 :     {return verifyShapes(pb.shape(),sky.shape());}
     337             :     virtual casacore::Bool verifyShapes(casacore::IPosition shape0, casacore::IPosition shape1);
     338             :     casacore::Bool findSupport(casacore::Array<casacore::Complex>& func, casacore::Float& threshold, casacore::Int& origin, casacore::Int& R);
     339             :     void makeAntiAliasingOp(casacore::Vector<casacore::Complex>& val, const casacore::Int len);
     340             :     void makeAntiAliasingCorrection(casacore::Vector<casacore::Complex>& correction, 
     341             :                                     const casacore::Vector<casacore::Complex>& op, 
     342             :                                     const casacore::Int nx);
     343             :     void applyAntiAliasingOp(casacore::ImageInterface<casacore::Complex>& cf, 
     344             :                              casacore::Vector<casacore::IPosition>& offset,
     345             :                              casacore::Int op=0, 
     346             :                              casacore::Bool Square=false);
     347             :     void applyAntiAliasingOp(casacore::ImageInterface<casacore::Float>& cf, 
     348             :                              casacore::Vector<casacore::IPosition>& offset,
     349             :                              casacore::Int op=0, 
     350             :                              casacore::Bool Square=false);
     351             :     void correctAntiAliasing(casacore::Lattice<casacore::Complex>& cf);
     352           0 :     virtual void setMiscInfo(const casacore::Int qualifier){(void)qualifier;};
     353           0 :     virtual void ComputeResiduals(VisBuffer&/*vb*/, casacore::Bool /*useCorrected*/) {};
     354             : 
     355             :   protected:
     356             :     
     357             :     // Padding in FFT
     358             :     casacore::Float padding_p;
     359             :     
     360             :     casacore::Int nint(casacore::Double val){return casacore::Int(floor(val+0.5));};
     361             :     
     362             :     // Make the PB part of the convolution function
     363             :     casacore::Int makePBPolnCoords(//const casacore::ImageInterface<casacore::Complex>& image,
     364             :                          casacore::CoordinateSystem& coord, const VisBuffer& vb);
     365             :     // Locate convolution functions on the disk
     366             :     casacore::Int locateConvFunction(casacore::Int Nw, casacore::Int polInUse, const VisBuffer& vb, casacore::Float &pa);
     367             :     void cacheConvFunction(casacore::Int which, casacore::Array<casacore::Complex>& cf, casacore::CoordinateSystem& coord);
     368             :     // Find the convolution function
     369             :     void findConvFunction(const casacore::ImageInterface<casacore::Complex>& image,
     370             :                           const VisBuffer& vb);
     371             :     void makeConvFunction(const casacore::ImageInterface<casacore::Complex>& image,
     372             :                           const VisBuffer& vb, casacore::Float pa);
     373             :     
     374             :     casacore::Int nWPlanes_p;
     375             :     
     376             :     // Get the appropriate data pointer
     377             :     casacore::Array<casacore::Complex>* getDataPointer(const casacore::IPosition&, casacore::Bool);
     378             :     
     379             :     void ok();
     380             :     
     381             :     void init();
     382             :     //    casacore::Int getVisParams();
     383             :     casacore::Int getVisParams(const VisBuffer& vb);
     384             :     // Is this record on Grid? check both ends. This assumes that the
     385             :     // ends bracket the middle
     386             :     casacore::Bool recordOnGrid(const VisBuffer& vb, casacore::Int rownr) const;
     387             :     
     388             :     // Image cache
     389             :     casacore::LatticeCache<casacore::Complex> * imageCache;
     390             :     
     391             :     // Sizes
     392             :     casacore::Long cachesize;
     393             :     casacore::Int tilesize;
     394             :     
     395             :     // Gridder
     396             :     casacore::ConvolveGridder<casacore::Double, casacore::Complex>* gridder;
     397             :     
     398             :     // Is this tiled?
     399             :     casacore::Bool isTiled;
     400             :     
     401             :     // casacore::Array lattice
     402             :     //casacore::Lattice<casacore::Complex> * arrayLattice;
     403             :     casacore::CountedPtr<casacore::Lattice<casacore::Complex> > arrayLattice;
     404             :     
     405             :     // Lattice. For non-tiled gridding, this will point to arrayLattice,
     406             :     //  whereas for tiled gridding, this points to the image
     407             :     //casacore::Lattice<casacore::Complex>* lattice;
     408             :     casacore::CountedPtr<casacore::Lattice<casacore::Complex> > lattice;
     409             :     
     410             :     casacore::Float maxAbsData;
     411             :     
     412             :     // Useful IPositions
     413             :     casacore::IPosition centerLoc, offsetLoc;
     414             :     
     415             :     // Image Scaling and offset
     416             :     casacore::Vector<casacore::Double> uvScale, uvOffset;
     417             :     
     418             :     // casacore::Array for non-tiled gridding
     419             :     casacore::Array<casacore::Complex> griddedData;
     420             :     
     421             :     // Pointing columns
     422             :     casacore::MSPointingColumns* mspc;
     423             :     
     424             :     // Antenna columns
     425             :     casacore::MSAntennaColumns* msac;
     426             :     
     427             :     casacore::DirectionCoordinate directionCoord;
     428             :     
     429             :     casacore::MDirection::Convert* pointingToImage;
     430             :     
     431             :     casacore::Vector<casacore::Double> xyPos;
     432             :     
     433             :     casacore::MDirection worldPosMeas;
     434             :     
     435             :     casacore::Int priorCacheSize;
     436             :     
     437             :     // Grid/degrid zero spacing points?
     438             :     casacore::Bool usezero_p;
     439             :     
     440             :     casacore::Array<casacore::Complex> convFunc;
     441             :     casacore::Array<casacore::Complex> convWeights;
     442             :     casacore::CoordinateSystem convFuncCS_p;
     443             :     casacore::Int convSize;
     444             :     //
     445             :     // casacore::Vector to hold the support size info. for the convolution
     446             :     // functions pointed to by the elements of convFunctions_p.  The
     447             :     // co-ordinates of this array are (W-term, Poln, PA).
     448             :     //
     449             :     casacore::Int convSampling;
     450             :     casacore::Cube<casacore::Int> convSupport, convWtSupport;
     451             :     //
     452             :     // Holder for the pointers to the convolution functions. Each
     453             :     // convolution function itself is a complex 3D array (U,V,W) per
     454             :     // PA.
     455             :     //
     456             :     casacore::PtrBlock < casacore::Array<casacore::Complex> *> convFuncCache, convWeightsCache;
     457             :     //    casacore::Array<casacore::Complex>* convFunc_p;
     458             : 
     459             :     //
     460             :     // The index into the conv. func. cache for the current conv. func.
     461             :     // 
     462             :     casacore::Int PAIndex;
     463             :     //
     464             :     // If true, all convolution functions are in the cache.
     465             :     //
     466             :     casacore::Bool convFuncCacheReady;
     467             : 
     468             :     casacore::Int wConvSize;
     469             :     
     470             :     casacore::Int lastIndex_p;
     471             :     
     472             :     casacore::Int getIndex(const casacore::MSPointingColumns& mspc, const casacore::Double& time,
     473             :                  const casacore::Double& interval);
     474             :     
     475             :     casacore::Bool getXYPos(const VisBuffer& vb, casacore::Int row);
     476             :     //    VPSkyJones *vpSJ;
     477             :     //
     478             :     // The PA averaged (and potentially antenna averaged) PB for
     479             :     // normalization
     480             :     //
     481             :     casacore::TempImage<casacore::Float> avgPB;
     482             :     //
     483             :     // No. of vis. polarization planes used in making the user defined
     484             :     // casacore::Stokes images
     485             :     //
     486             :     casacore::Int polInUse, bandID_p;
     487             :     casacore::Int maxConvSupport;
     488             :     //
     489             :     // Percentage of the peak of the PB after which the image is set
     490             :     // to zero.
     491             :     //
     492             :     casacore::Float pbLimit_p;
     493             : 
     494             :     //    EPJones *epJ;
     495             :     SolvableVisJones *epJ;
     496             :     casacore::Double HPBW, Diameter_p, sigma;
     497             :     casacore::Int Nant_p;
     498             :     casacore::Int doPointing;
     499             :     casacore::Bool doPBCorrection;
     500             :     casacore::Bool makingPSF;
     501             :     
     502             :     casacore::Unit Second, Radian, Day;
     503             :     casacore::Array<casacore::Float> l_offsets,m_offsets;
     504             :     casacore::Int noOfPASteps;
     505             :     casacore::Vector<casacore::Float> pbPeaks;
     506             :     casacore::Bool pbNormalized,resetPBs,rotateAperture_p;
     507             :     casacore::Vector<casacore::Float> paList;
     508             :     ConvFuncDiskCache cfCache;
     509             :     casacore::Double currentCFPA;
     510             :     ParAngleChangeDetector paChangeDetector;
     511             :     casacore::Vector<casacore::Int> cfStokes;
     512             :     casacore::Vector<casacore::Complex> Area;
     513             :     casacore::Double cfRefFreq_p;
     514             :     casacore::Bool avgPBSaved;
     515             :     casacore::Bool avgPBReady;
     516             :     casacore::Vector<casacore::Complex> antiAliasingOp,antiAliasingCorrection;
     517             :     casacore::Float lastPAUsedForWtImg;
     518             :     //    VLACalcIlluminationConvFunc vlaPB;
     519             :     //
     520             :     //----------------------------------------------------------------------
     521             :     //
     522             :     virtual void normalizeAvgPB();
     523             :     virtual void runFortranGet(casacore::Matrix<casacore::Double>& uvw,casacore::Vector<casacore::Double>& dphase,
     524             :                        casacore::Cube<casacore::Complex>& visdata,
     525             :                        casacore::IPosition& s,
     526             :                        //casacore::Cube<casacore::Complex>& gradVisAzData,
     527             :                        //casacore::Cube<casacore::Complex>& gradVisElData,
     528             :                        //casacore::IPosition& gradS,
     529             :                        casacore::Int& Conj,
     530             :                        casacore::Cube<casacore::Int>& flags,casacore::Vector<casacore::Int>& rowFlags,
     531             :                        casacore::Int& rownr,casacore::Vector<casacore::Double>& actualOffset,
     532             :                        casacore::Array<casacore::Complex>* dataPtr,
     533             :                        casacore::Int& aNx, casacore::Int& aNy, casacore::Int& npol, casacore::Int& nchan,
     534             :                        VisBuffer& vb,casacore::Int& Nant_p, casacore::Int& scanNo,
     535             :                        casacore::Double& sigma,
     536             :                        casacore::Array<casacore::Float>& raoffsets,
     537             :                        casacore::Array<casacore::Float>& decoffsets,
     538             :                        casacore::Double area,
     539             :                        casacore::Int& doGrad,casacore::Int paIndex);
     540             :     virtual void runFortranPut(casacore::Matrix<casacore::Double>& uvw,casacore::Vector<casacore::Double>& dphase,
     541             :                        const casacore::Complex& visdata_p,
     542             :                        casacore::IPosition& s,
     543             :                        //casacore::Cube<casacore::Complex>& gradVisAzData,
     544             :                        //casacore::Cube<casacore::Complex>& gradVisElData,
     545             :                        //casacore::IPosition& gradS,
     546             :                        casacore::Int& Conj,
     547             :                        casacore::Cube<casacore::Int>& flags,casacore::Vector<casacore::Int>& rowFlags,
     548             :                        const casacore::Matrix<casacore::Float>& weight,
     549             :                        casacore::Int& rownr,casacore::Vector<casacore::Double>& actualOffset,
     550             :                        casacore::Array<casacore::Complex>& dataPtr,
     551             :                        casacore::Int& aNx, casacore::Int& aNy, casacore::Int& npol, casacore::Int& nchan,
     552             :                        const VisBuffer& vb,casacore::Int& Nant_p, casacore::Int& scanNo,
     553             :                        casacore::Double& sigma,
     554             :                        casacore::Array<casacore::Float>& raoffsets,
     555             :                        casacore::Array<casacore::Float>& decoffsets,
     556             :                        casacore::Matrix<casacore::Double>& sumWeight,
     557             :                        casacore::Double& area,
     558             :                        casacore::Int& doGrad,
     559             :                        casacore::Int& doPSF,casacore::Int paIndex);
     560             :   void runFortranGetGrad(casacore::Matrix<casacore::Double>& uvw,casacore::Vector<casacore::Double>& dphase,
     561             :                          casacore::Cube<casacore::Complex>& visdata,
     562             :                          casacore::IPosition& s,
     563             :                          casacore::Cube<casacore::Complex>& gradVisAzData,
     564             :                          casacore::Cube<casacore::Complex>& gradVisElData,
     565             :                          //                      casacore::IPosition& gradS,
     566             :                          casacore::Int& Conj,
     567             :                          casacore::Cube<casacore::Int>& flags,casacore::Vector<casacore::Int>& rowFlags,
     568             :                          casacore::Int& rownr,casacore::Vector<casacore::Double>& actualOffset,
     569             :                          casacore::Array<casacore::Complex>* dataPtr,
     570             :                          casacore::Int& aNx, casacore::Int& aNy, casacore::Int& npol, casacore::Int& nchan,
     571             :                          VisBuffer& vb,casacore::Int& Nant_p, casacore::Int& scanNo,
     572             :                          casacore::Double& sigma,
     573             :                          casacore::Array<casacore::Float>& l_off,
     574             :                          casacore::Array<casacore::Float>& m_off,
     575             :                          casacore::Double area,
     576             :                          casacore::Int& doGrad,
     577             :                          casacore::Int paIndex);
     578             :   };
     579             :   
     580             :   //void saveImmage(casacore::TempImage<casacore::Complex>& convFunc, casacore::Int wConvSize);
     581             : } //# NAMESPACE CASA - END
     582             : 
     583             : #endif

Generated by: LCOV version 1.16