LCOV - code coverage report
Current view: top level - synthesis/TransformMachines - FTMachine.h (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 3 31 9.7 %
Date: 2024-12-11 20:54:31 Functions: 2 25 8.0 %

          Line data    Source code
       1             : //# FTMachine.h: Definition for FTMachine
       2             : //# Copyright (C) 1996,1997,1998,1999,2000,2001,2002,2003
       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_FTMACHINE_H
      30             : #define SYNTHESIS_FTMACHINE_H
      31             : 
      32             : #include <casacore/measures/Measures/Measure.h>
      33             : #include <casacore/measures/Measures/MDirection.h>
      34             : #include <casacore/measures/Measures/MPosition.h>
      35             : #include <casacore/casa/Arrays/Array.h>
      36             : #include <casacore/casa/Arrays/Vector.h>
      37             : #include <casacore/casa/Arrays/Matrix.h>
      38             : #include <casacore/casa/Logging/LogIO.h>
      39             : #include <casacore/casa/Logging/LogSink.h>
      40             : #include <casacore/casa/Logging/LogMessage.h>
      41             : #include <casacore/casa/Containers/RecordInterface.h>
      42             : #include <casacore/casa/Containers/Block.h>
      43             : #include <casacore/images/Images/TempImage.h>
      44             : #include <casacore/coordinates/Coordinates/SpectralCoordinate.h>
      45             : #include <casacore/scimath/Mathematics/InterpolateArray1D.h>
      46             : #include <synthesis/TransformMachines/CFCache.h>
      47             : #include <synthesis/TransformMachines/CFStore2.h>
      48             : #include <synthesis/Utilities/FFT2D.h>
      49             : #include <synthesis/TransformMachines/ConvolutionFunction.h>
      50             : #include <synthesis/TransformMachines/PolOuterProduct.h>
      51             : 
      52             : #include <casacore/images/Images/ImageInterface.h>
      53             : #include <casacore/images/Images/SubImage.h>
      54             : #include <synthesis/TransformMachines/StokesImageUtil.h>
      55             : 
      56             : #include <synthesis/ImagerObjects/SIImageStore.h>
      57             : #include <synthesis/ImagerObjects/SIImageStoreMultiTerm.h>
      58             : #include <iomanip>
      59             : 
      60             : namespace casacore{
      61             : 
      62             :   class UVWMachine;
      63             : }
      64             : 
      65             : namespace casa { //# NAMESPACE CASA - BEGIN
      66             : 
      67             :   class VisSet;
      68             :   class VisBuffer;
      69             :   class ROVisibilityIterator;
      70             :   class VisModelData;
      71             :   class SkyJones;
      72             : 
      73             : // <summary> defines interface for the Fourier Transform Machine </summary>
      74             : 
      75             : // <use visibility=export>
      76             : 
      77             : // <reviewed reviewer="" date="" tests="" demos="">
      78             : 
      79             : // <prerequisite>
      80             : //   <li> <linkto class=SkyModel>SkyModel</linkto> module
      81             : //   <li> <linkto class=SkyEquation>SkyEquation</linkto> module
      82             : //   <li> <linkto class=VisBuffer>VisBuffer</linkto> module
      83             : // </prerequisite>
      84             : //
      85             : // <etymology>
      86             : // FTMachine is a Machine for Fourier Transforms
      87             : // </etymology>
      88             : //
      89             : // <synopsis> 
      90             : // The <linkto class=SkyEquation>SkyEquation</linkto> needs to be able
      91             : // to perform Fourier transforms on visibility data. FTMachine
      92             : // allows efficient Fourier Transform processing using a 
      93             : // <linkto class=VisBuffer>VisBuffer</linkto> which encapsulates
      94             : // a chunk of visibility (typically all baselines for one time)
      95             : // together with all the information needed for processing
      96             : // (e.g. UVW coordinates).
      97             : // </synopsis> 
      98             : //
      99             : // <example>
     100             : // A simple example of a FTMachine is found in 
     101             : // <linkto class=GridFT>GridFT</linkto>.
     102             : // See the example for <linkto class=SkyModel>SkyModel</linkto>.
     103             : // </example>
     104             : //
     105             : // <motivation>
     106             : // Define an interface to allow efficient processing of chunks of 
     107             : // visibility data
     108             : //
     109             : // Note that the image must be Complex. It must contain the
     110             : // casacore::Complex casacore::Stokes values (e.g. RR,RL,LR,LL). FTMachine
     111             : // uses the image coordinate system to determine mappings
     112             : // between the polarization and frequency values in the
     113             : // casacore::PagedImage and in the VisBuffer.
     114             : //
     115             : // </motivation>
     116             : //
     117             : // <todo asof="97/10/01">
     118             : // </todo>
     119             : 
     120             : class FTMachine {
     121             : public:
     122             : 
     123             :   //# Enumerations
     124             :   // Types of known Images that may be made using the makeImage method 
     125             :   enum Type {
     126             :     OBSERVED=0,         // From OBSERVED visibility data (default)
     127             :     MODEL,              // From MODEL visibility data
     128             :     CORRECTED,          // From CORRECTED visibility data
     129             :     RESIDUAL,           // From RESIDUAL (OBSERVED-MODEL) visibility data
     130             :     PSF,                // POINT SPREAD FUNCTION
     131             :     COVERAGE,           // COVERAGE (SD only)
     132             :     N_types,            // Number of types
     133             :     DEFAULT=OBSERVED
     134             :   };
     135             : 
     136             :   FTMachine();
     137             : 
     138             : 
     139             :   FTMachine(casacore::CountedPtr<CFCache>& cfcache,casacore::CountedPtr<ConvolutionFunction>& cfctor);
     140             : 
     141             :   FTMachine(const FTMachine& other);
     142             : 
     143             :   FTMachine& operator=(const FTMachine& other);
     144             : 
     145           0 :   void setBasePrivates(const FTMachine& other){FTMachine::operator=(other);}
     146             : 
     147             :   virtual ~FTMachine();
     148             :   
     149             : 
     150             :   //clone copy
     151             :   //the default cloner clones via a Record copy
     152             :   virtual FTMachine* cloneFTM();
     153             :   // Initialize transform to Visibility plane
     154             :   virtual void initializeToVis(casacore::ImageInterface<casacore::Complex>& image, const VisBuffer& vb) = 0;
     155             : 
     156             :   // Vectorized InitializeToVis
     157             :   virtual void initializeToVis(casacore::Block<casacore::CountedPtr<casacore::ImageInterface<casacore::Complex> > > & compImageVec,
     158             :                                casacore::PtrBlock<casacore::SubImage<casacore::Float> *> & modelImageVec, 
     159             :                                casacore::PtrBlock<casacore::SubImage<casacore::Float> *>& weightImageVec, 
     160             :                                casacore::PtrBlock<casacore::SubImage<casacore::Float> *>& fluxScaleVec, 
     161             :                                casacore::Block<casacore::Matrix<casacore::Float> >& weightsVec,
     162             :                                const VisBuffer& vb);
     163             : 
     164             :   virtual void initializeToVisNew(const VisBuffer& vb,
     165             :                                              casacore::CountedPtr<SIImageStore> imstore);
     166             : 
     167             :   //-------------------------------------------------------------------------------------
     168             :   // Finalize transform to Visibility plane
     169             :   // This is mostly a no-op, and is not-even called from CubeSkyEquation.
     170             :   virtual void finalizeToVis() = 0;
     171             : 
     172             :   // Note : No vectorized form of finalizeToVis yet.....
     173             : 
     174             :   //-------------------------------------------------------------------------------------
     175             :   // Initialize transform to Sky plane
     176             :   virtual void initializeToSky(casacore::ImageInterface<casacore::Complex>& image,
     177             :                                casacore::Matrix<casacore::Float>& weight, const VisBuffer& vb) = 0;
     178             : 
     179             :   // Vectorized InitializeToSky
     180             :   virtual void initializeToSky(casacore::Block<casacore::CountedPtr<casacore::ImageInterface<casacore::Complex> > > & compImageVec,
     181             :                                casacore::Block<casacore::Matrix<casacore::Float> >& weightsVec, 
     182             :                                const VisBuffer& vb, 
     183             :                                const casacore::Bool dopsf=false);
     184             : 
     185             :   virtual void initializeToSkyNew(const casacore::Bool dopsf, 
     186             :                                   const VisBuffer& vb, 
     187             :                                   casacore::CountedPtr<SIImageStore> imstore);
     188             : 
     189             :   //-------------------------------------------------------------------------------------
     190             :   // Finalize transform to Sky plane
     191             :   virtual void finalizeToSky() = 0;
     192             : 
     193           0 :   virtual void finalizeToSky(casacore::ImageInterface<casacore::Complex>& iimage){(void)iimage;};
     194             : 
     195             :   // Vectorized finalizeToSky
     196             :   virtual void finalizeToSky(casacore::Block<casacore::CountedPtr<casacore::ImageInterface<casacore::Complex> > > & compImageVec, 
     197             :                              casacore::PtrBlock<casacore::SubImage<casacore::Float> *> & resImageVec, 
     198             :                              casacore::PtrBlock<casacore::SubImage<casacore::Float> *>& weightImageVec, 
     199             :                              casacore::PtrBlock<casacore::SubImage<casacore::Float> *>& fluxScaleVec, 
     200             :                              casacore::Bool dopsf, 
     201             :                              casacore::Block<casacore::Matrix<casacore::Float> >& weightsVec, const VisBuffer& vb);
     202             : 
     203             :   virtual void finalizeToSkyNew(casacore::Bool dopsf, 
     204             :                                            const VisBuffer& vb,
     205             :                                            casacore::CountedPtr<SIImageStore> imstore  );
     206             : 
     207             :   //-------------------------------------------------------------------------------------
     208             : 
     209             :   // Get actual coherence from grid
     210             :   virtual void get(VisBuffer& vb, casacore::Int row=-1) = 0;
     211             : 
     212             : 
     213             :   // Put coherence to grid
     214             :   virtual void put(const VisBuffer& vb, casacore::Int row=-1, casacore::Bool dopsf=false, 
     215             :                    FTMachine::Type type= FTMachine::OBSERVED)=0;
     216             : 
     217             :   // Non const vb version - so that weights can be modified in-place
     218             :   // Currently, used only by MultiTermFT
     219         263 :   virtual void put(VisBuffer& vb, casacore::Int row=-1, casacore::Bool dopsf=false, 
     220             :                    FTMachine::Type type= FTMachine::OBSERVED)
     221         263 :                     {put((const VisBuffer&)vb,row,dopsf,type);};
     222             : 
     223             :   //-------------------------------------------------------------------------------------
     224             :   virtual void correlationToStokes(casacore::ImageInterface<casacore::Complex>& compImage, 
     225             :                                    casacore::ImageInterface<casacore::Float>& resImage, 
     226             :                                    const casacore::Bool dopsf);
     227             :  
     228             :   virtual void stokesToCorrelation(casacore::ImageInterface<casacore::Float>& modelImage,
     229             :                                    casacore::ImageInterface<casacore::Complex>& compImage);
     230             : 
     231             :   /*
     232             :   virtual void normalizeSumWeight(casacore::ImageInterface<casacore::Float>& inOutImage, 
     233             :                                casacore::ImageInterface<casacore::Float>& weightImage, 
     234             :                                const casacore::Bool dopsf);
     235             :   */
     236             : 
     237           0 :   virtual void normalizeImage(casacore::Lattice<casacore::Complex>&,//skyImage,
     238             :                               const casacore::Matrix<casacore::Double>&,// sumOfWts,
     239             :                               casacore::Lattice<casacore::Float>&,// sensitivityImage,
     240           0 :                               casacore::Bool /*fftNorm*/){return;};
     241             : 
     242             :   virtual void normalizeImage(casacore::ImageInterface<casacore::Float>& skyImage,
     243             :                               casacore::Matrix<casacore::Float>& sumOfWts,
     244             :                               casacore::ImageInterface<casacore::Float>& sensitivityImage,
     245             :                               casacore::Bool dopsf, casacore::Float pblimit, casacore::Int normtype);
     246             : 
     247             : 
     248             :   // All FTMachines that fill weightimage, need to set this.
     249             :   // TODO : Make this pure virtual.
     250           0 :   virtual casacore::Bool useWeightImage(){return false;}; 
     251           0 :   virtual casacore::Bool isSkyJonesSet(){return (sj_p.nelements()>0) && !(sj_p[0]).null()  ;}
     252           0 :   virtual casacore::Bool isSkyJonesChanged(VisBuffer& vb, casacore::Int row){if(sj_p.nelements()>0){return sj_p[0]->changed(vb,row);} else {return false;} };
     253             : 
     254             :   // Set SkyJones if image domain corrections /applycation are needed
     255             :   // To reset the the FTMachine for stopping image based correction/applycation
     256             :   // set in a casacore::Vector of size 0.
     257             :   // The pointers have to be handled by the caller ..no delete happening here
     258             :   virtual void setSkyJones(casacore::Vector<casacore::CountedPtr<SkyJones> >& sj);
     259             :   
     260             :   casacore::Bool changedSkyJonesLogic(const VisBuffer& vb, casacore::Bool& firstRow, casacore::Bool& internalRow);
     261             : 
     262             :  
     263             :   //-------------------------------------------------------------------------------------
     264             : 
     265             :   // Get the gridded visibilities or weight 
     266             :   template <typename T> void getGrid(casacore::Array<T>& thegrid);
     267             :    // Get the final image
     268             :   virtual casacore::ImageInterface<casacore::Complex>& getImage(casacore::Matrix<casacore::Float>&, casacore::Bool normalize=true) = 0;
     269             : 
     270           0 :   virtual const casacore::CountedPtr<ConvolutionFunction>& getAWConvFunc() {return convFuncCtor_p;};
     271             : 
     272           0 :   virtual void findConvFunction(const casacore::ImageInterface<casacore::Complex>&,// image,
     273           0 :                                 const VisBuffer& /*vb*/) {};
     274             :   // Get the final weights image
     275             :   virtual void getWeightImage(casacore::ImageInterface<casacore::Float>& weightImage, casacore::Matrix<casacore::Float>& weights) = 0;
     276             : 
     277             :   // Get a flux (divide by this to get a flux density correct image) 
     278             :   // image if there is one
     279           0 :   virtual void getFluxImage(casacore::ImageInterface<casacore::Float>& image){(void)image;};
     280             : 
     281             :   // Make the entire image
     282             :   virtual void makeImage(FTMachine::Type type,
     283             :                          VisSet& vs,
     284             :                          casacore::ImageInterface<casacore::Complex>& image,
     285             :                          casacore::Matrix<casacore::Float>& weight);
     286             :   // Make the entire image using a ROVisIter
     287             :   virtual void makeImage(FTMachine::Type type,
     288             :                          ROVisibilityIterator& vi,
     289             :                          casacore::ImageInterface<casacore::Complex>& image,
     290             :                          casacore::Matrix<casacore::Float>& weight);
     291             : 
     292             :   //-------------------------------------------------------------------------------------
     293             : 
     294             :   // Rotate the uvw from the observed phase center to the
     295             :   // desired phase center.
     296             :   void girarUVW(casacore::Matrix<casacore::Double>& uvw, casacore::Vector<casacore::Double>& dphase,
     297             :                 const VisBuffer& vb);
     298             :   void rotateUVW(casacore::Matrix<casacore::Double>& uvw, casacore::Vector<casacore::Double>& dphase,
     299             :                  const VisBuffer& vb);
     300             : 
     301             :   // Refocus on a finite distance
     302             :   void refocus(casacore::Matrix<casacore::Double>& uvw, const casacore::Vector<casacore::Int>& ant1,
     303             :                const casacore::Vector<casacore::Int>& ant2,
     304             :                casacore::Vector<casacore::Double>& dphase, const VisBuffer& vb);
     305             : 
     306             :   //helper function for openmp to call ...no private dependency
     307             :   static void locateuvw(const casacore::Double*& uvw, const casacore::Double*&dphase, const casacore::Double*& freq, const casacore::Int& nchan, const casacore::Double*& scale, const casacore::Double*& offset,  const casacore::Int& sampling, casacore::Int*& loc,casacore::Int*& off, casacore::Complex*& phasor, const casacore::Int& row, const casacore::Bool& doW=false); 
     308             :                  
     309             : 
     310             :   // Save and restore the FTMachine to and from a record
     311             :   virtual casacore::Bool toRecord(casacore::String& error, casacore::RecordInterface& outRecord, 
     312             :                         casacore::Bool withImage=false, const casacore::String diskimagename="");
     313             :   virtual casacore::Bool fromRecord(casacore::String& error, const casacore::RecordInterface& inRecord);
     314             : 
     315             :   // Has this operator changed since the last application?
     316             :   virtual casacore::Bool changed(const VisBuffer& vb);
     317             : 
     318             :   // Can this FTMachine be represented by Fourier convolutions?
     319           0 :   virtual casacore::Bool isFourier() {return false;}
     320             : 
     321             :   //set  spw for cube that will be used;
     322             :   casacore::Bool setSpw(casacore::Vector<casacore::Int>& spw, casacore::Bool validFrame);
     323             : 
     324             :   //return whether the ftmachine is using a double precision grid
     325             :   virtual casacore::Bool doublePrecGrid();
     326             : 
     327             :   // To make sure no padding is used in certain gridders
     328           0 :   virtual void setNoPadding(casacore::Bool nopad){(void)nopad;};
     329             :   
     330             :   // Return the name of the machine
     331             : 
     332             :   virtual casacore::String name() const =0;// { return "None";};
     333             :  
     334             :   // set and get the location used for frame 
     335             :   void setLocation(const casacore::MPosition& loc);
     336             :   casacore::MPosition& getLocation();
     337             : 
     338             :   // set a moving source aka planets or comets =>  adjust phase center
     339             :   // on the fly for gridding 
     340             :   virtual void setMovingSource(const casacore::String& sourcename);
     341             :   virtual void setMovingSource(const casacore::MDirection& mdir);
     342             : 
     343             :   //set and get Time to calculate phasecenter  -1.0 means using the time available at 
     344             :   //each iteration..this is used when the phasecenter in the field table is either 
     345             :   //a polynomial or has a ephemerides tables associated with it
     346             :   //Using double in the units and epoch-frame of the ms(s) ..caller is responsible for conversion
     347         248 :   void setPhaseCenterTime(const casacore::Double time){phaseCenterTime_p=time;};
     348           0 :   casacore::Double getPhaseCenterTime(){return phaseCenterTime_p;};
     349             :   //reset stuff in an FTMachine
     350           0 :   virtual void reset(){};
     351             : 
     352             :   //set frequency interpolation type
     353             :   virtual void setFreqInterpolation(const casacore::String& method);
     354             : 
     355             :   //tell ftmachine which Pointing table column to use for Direction
     356             :   //Mosaic or Single dish ft use this for example
     357             :   virtual void setPointingDirColumn(const casacore::String& column="DIRECTION");
     358             : 
     359             :   virtual casacore::String getPointingDirColumnInUse();
     360             : 
     361             :   virtual void setSpwChanSelection(const casacore::Cube<casacore::Int>& spwchansels);
     362           0 :   virtual casacore::Cube<casacore::Int> getSpwChanSelection(){return spwChanSelFlag_p;};
     363             :   virtual void setSpwFreqSelection(const casacore::Matrix<casacore::Double>& spwfreqs);
     364           0 :   virtual casacore::Matrix<casacore::Double> getSpwFreqSelection() {return spwFreqSel_p;};
     365             : 
     366             :   // set the order of the Taylor term for MFS this is to tell
     367             :   // A-casacore::Projection to qualify the accumulated avgPB for each Taylor
     368             :   // term in the CFCache.
     369             :   virtual void setMiscInfo(const casacore::Int qualifier)=0;
     370             : 
     371           0 :   virtual void setCanComputeResiduals(casacore::Bool& b) {canComputeResiduals_p=b;};
     372           0 :   virtual casacore::Bool canComputeResiduals() {return canComputeResiduals_p;};
     373             :   //
     374             :   // Make the VB and VBStore interefaces for the interim re-factoring
     375             :   // work.  Finally removed the VB interface.
     376             :   virtual void ComputeResiduals(VisBuffer&vb, casacore::Bool useCorrected) = 0;
     377           0 :   virtual casacore::Float getPBLimit() {return pbLimit_p;};
     378             :   //virtual void ComputeResiduals(VBStore& vb)=0;
     379             :   //get and set numthreads
     380             :   void setnumthreads(casacore::Int n);
     381             :   casacore::Int getnumthreads();
     382             : 
     383             :   virtual void setCFCache(casacore::CountedPtr<CFCache>& cfc, const casacore::Bool resetCFC=true);
     384           0 :   casacore::CountedPtr<CFCache> getCFCache() {return cfCache_p;};
     385           0 :   casacore::String getCacheDir() { return cfCache_p->getCacheDir(); };
     386             : 
     387           0 :   virtual void setDryRun(casacore::Bool val) 
     388             :   {
     389           0 :     isDryRun=val;
     390             :     //cerr << "FTM: " << isDryRun << endl;
     391           0 :   };
     392           0 :   virtual casacore::Bool dryRun() {return isDryRun;}
     393           0 :   virtual casacore::Bool isUsingCFCache() 
     394             :   {
     395             :     // cerr << "@#%$@% = " << cfCache_p.nrefs() << endl;
     396           0 :     return (cfCache_p.nrefs()!=0);
     397             :   }
     398             :   casacore::Bool isDryRun;
     399             : 
     400             : protected:
     401             : 
     402             :   friend class VisModelData;
     403             :   friend class MultiTermFT;
     404             :   friend class MultiTermFTNew;
     405             :   casacore::LogIO logIO_p;
     406             : 
     407             :   casacore::LogIO& logIO();
     408             : 
     409             :   casacore::ImageInterface<casacore::Complex>* image;
     410             : 
     411             :   casacore::UVWMachine* uvwMachine_p;
     412             :   casacore::CountedPtr<casacore::UVWMachine> phaseShifter_p;
     413             : 
     414             :   casacore::MeasFrame mFrame_p;
     415             : 
     416             :   // Direction of desired tangent plane
     417             :   casacore::Bool tangentSpecified_p;
     418             :   casacore::MDirection mTangent_p;
     419             : 
     420             :   casacore::MDirection mImage_p;
     421             : 
     422             :   // moving source stuff
     423             :   casacore::MDirection movingDir_p;
     424             :   casacore::Bool fixMovingSource_p;
     425             :   casacore::MDirection firstMovingDir_p;
     426             :     
     427             : 
     428             :   casacore::Double distance_p;
     429             : 
     430             :   casacore::uInt nAntenna_p;
     431             : 
     432             :   casacore::Int lastFieldId_p;
     433             :   casacore::Int lastMSId_p;
     434             :   //Use douple precision grid in gridding process
     435             :   casacore::Bool useDoubleGrid_p;
     436             : 
     437             :   virtual void initMaps(const VisBuffer& vb);
     438             :   virtual void initPolInfo(const VisBuffer& vb);
     439             : 
     440             : 
     441             :   // Sum of weights per polarization and per chan
     442             :   casacore::Matrix<casacore::Double> sumWeight, sumCFWeight;
     443             : 
     444             :   // Sizes
     445             :   casacore::Int nx, ny, npol, nchan, nvischan, nvispol;
     446             : 
     447             :   // Maps of channels and polarization
     448             :   casacore::Vector<casacore::Int> chanMap, polMap;
     449             :   
     450             : 
     451             :   // Is casacore::Stokes I only? iso XX,XY,YX,YY or LL,LR,RL,RR.
     452             :   casacore::Bool isIOnly;
     453             : 
     454             :   // Default Position used for phase rotations
     455             :   casacore::MPosition mLocation_p;
     456             : 
     457             :   // Set if uvwrotation is necessary
     458             : 
     459             :   casacore::Bool doUVWRotation_p;
     460             :   virtual void ok();
     461             : 
     462             :   // check if image is big enough for gridding
     463             :   
     464             :   virtual void gridOk (casacore::Int gridsupport);
     465             : 
     466             :   
     467             :   // setup multiple spectral window for cubes
     468             :   casacore::Block <casacore::Vector <casacore::Int> > multiChanMap_p;
     469             :   casacore::Vector<casacore::Int> selectedSpw_p;
     470             :   casacore::Vector<casacore::Int> nVisChan_p;
     471             :   casacore::Bool matchChannel(const casacore::Int& spw, 
     472             :                     const VisBuffer& vb);
     473             : 
     474             :   //redo all spw chan match especially if ms has changed underneath 
     475             :   casacore::Bool matchAllSpwChans(const VisBuffer& vb);
     476             : 
     477             :   //interpolate visibility data of vb to grid frequency definition
     478             :   //flag will be set the one as described in interpolateArray1D
     479             :   //return false if no interpolation is done...for e.g for nearest case
     480             :   virtual casacore::Bool interpolateFrequencyTogrid(const VisBuffer& vb, 
     481             :                                           const casacore::Matrix<casacore::Float>& wt,
     482             :                                           casacore::Cube<casacore::Complex>& data, 
     483             :                                           casacore::Cube<casacore::Int>& flag,
     484             :                                           casacore::Matrix<casacore::Float>& weight,
     485             :                                           FTMachine::Type type=FTMachine::OBSERVED ); 
     486             :   //degridded data interpolated back onto visibilities
     487             :   virtual casacore::Bool interpolateFrequencyFromgrid(VisBuffer& vb, 
     488             :                                             casacore::Cube<casacore::Complex>& data,
     489             :                                             FTMachine::Type type=FTMachine::MODEL );
     490             :   
     491             : 
     492             :   //Interpolate visibilities to be degridded upon
     493             :   virtual void getInterpolateArrays(const VisBuffer& vb,
     494             :                                     casacore::Cube<casacore::Complex>& data, casacore::Cube<casacore::Int>& flag);
     495             : 
     496             : 
     497             :   void setSpectralFlag(const VisBuffer& vb, casacore::Cube<casacore::Bool>& modflagcube); 
     498             : 
     499             :   //helper to save Measures in a record
     500             :   casacore::Bool saveMeasure(casacore::RecordInterface& rec, const casacore::String& name, casacore::String& error, const casacore::Measure& ms);
     501             : 
     502             :   // Private variables needed for spectral frame conversion 
     503             :   casacore::SpectralCoordinate spectralCoord_p;
     504             :   casacore::Vector<casacore::Bool> doConversion_p;
     505             :   casacore::Bool freqFrameValid_p;
     506             :   casacore::Vector<casacore::Double> imageFreq_p;
     507             :   //casacore::Vector of float lsrfreq needed for regridding
     508             :   casacore::Vector<casacore::Double> lsrFreq_p;
     509             :   casacore::Vector<casacore::Double> interpVisFreq_p;
     510             :   casacore::InterpolateArray1D<casacore::Double,casacore::Complex>::InterpolationMethod freqInterpMethod_p;
     511             :   casacore::String pointingDirCol_p;
     512             :   casacore::Cube<casacore::Int> spwChanSelFlag_p;
     513             :   casacore::Matrix<casacore::Double> spwFreqSel_p, expandedSpwFreqSel_p,expandedSpwConjFreqSel_p;
     514             :   casacore::Vector<casacore::Int> cfStokes_p;
     515             :   casacore::Int polInUse_p;
     516             : 
     517             :   casacore::CountedPtr<CFCache> cfCache_p;
     518             :   CFStore cfs_p, cfwts_p;
     519             :   casacore::CountedPtr<CFStore2> cfs2_p, cfwts2_p;
     520             : 
     521             :   casacore::CountedPtr<ConvolutionFunction> convFuncCtor_p;
     522             :   casacore::CountedPtr<PolOuterProduct> pop_p;
     523             : 
     524             :   casacore::Bool canComputeResiduals_p;
     525             :   casacore::Bool toVis_p;
     526             :   casacore::Int numthreads_p;
     527             :   
     528             :   // casacore::Array for non-tiled gridding
     529             :   // These are common to most FTmachines
     530             :   casacore::Array<casacore::Complex> griddedData;
     531             :   casacore::Array<casacore::DComplex> griddedData2;
     532             : 
     533             : 
     534             :   casacore::Float pbLimit_p;
     535             :   //  casacore::Vector<SkyJones *> sj_p;
     536             :   casacore::Vector<casacore::CountedPtr<SkyJones> > sj_p;
     537             :   //A holder for the complex image if nobody else is keeping it
     538             :   casacore::CountedPtr<casacore::ImageInterface<casacore::Complex> > cmplxImage_p;
     539             : 
     540             :   FFT2D ft_p;
     541             :   casacore::Double phaseCenterTime_p;
     542             :  private:
     543             :   //Some temporary wasteful function for swapping axes because we don't 
     544             :   //Interpolation along the second axis...will need to implement 
     545             :   //interpolation on y axis of a cube. 
     546             :   
     547             :   void swapyz(casacore::Cube<casacore::Complex>& out, const casacore::Cube<casacore::Complex>& in);
     548             :   void swapyz(casacore::Cube<casacore::Complex>& out, const casacore::Cube<casacore::Bool>& outFlag, const casacore::Cube<casacore::Complex>& in);
     549             :   void swapyz(casacore::Cube<casacore::Bool>& out, const casacore::Cube<casacore::Bool>& in);
     550             :   void convUVW(casacore::Double& dphase, casacore::Vector<casacore::Double>& thisrow);
     551             :   
     552             : 
     553             : };
     554             : 
     555             : #include <synthesis/TransformMachines/FTMachine.tcc>
     556             : 
     557             : 
     558             : } //# NAMESPACE CASA - END
     559             : 
     560             : #endif
     561             : 
     562             : 
     563             : 

Generated by: LCOV version 1.16