casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::refim::SDGrid Class Reference

An FTMachine for Gridding Single Dish data. More...

#include <SDGrid.h>

Inheritance diagram for casa::refim::SDGrid:
casa::refim::FTMachine

Public Member Functions

 SDGrid (SkyJones &sj, casacore::Int cachesize, casacore::Int tilesize, casacore::String convType="BOX", casacore::Int userSupport=-1, casacore::Bool useImagingWeight=false)
 Constructor: cachesize is the size of the cache in words (e.g. More...
 
 SDGrid (casacore::MPosition &ml, SkyJones &sj, casacore::Int cachesize, casacore::Int tilesize, casacore::String convType="BOX", casacore::Int userSupport=-1, casacore::Float minweight=0., casacore::Bool clipminmax=false, casacore::Bool useImagingWeight=false)
 
 SDGrid (casacore::Int cachesize, casacore::Int tilesize, casacore::String convType="BOX", casacore::Int userSupport=-1, casacore::Bool useImagingWeight=false)
 
 SDGrid (casacore::MPosition &ml, casacore::Int cachesize, casacore::Int tilesize, casacore::String convType="BOX", casacore::Int userSupport=-1, casacore::Float minweight=0., casacore::Bool clipminmax=false, casacore::Bool useImagingWeight=false)
 
 SDGrid (casacore::MPosition &ml, casacore::Int cachesize, casacore::Int tilesize, casacore::String convType="TGAUSS", casacore::Float truncate=-1.0, casacore::Float gwidth=0.0, casacore::Float jwidth=0.0, casacore::Float minweight=0., casacore::Bool clipminmax=false, casacore::Bool useImagingWeight=false)
 
 SDGrid (const SDGrid &other)
 Copy constructor. More...
 
SDGridoperator= (const SDGrid &other)
 Assignment operator. More...
 
 ~SDGrid ()
 
void initializeToVis (casacore::ImageInterface< casacore::Complex > &image, const vi::VisBuffer2 &vb)
 Initialize transform to Visibility plane using the image as a template. More...
 
void finalizeToVis ()
 Finalize transform to Visibility plane: flushes the image cache and shows statistics if it is being used. More...
 
void initializeToSky (casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight, const vi::VisBuffer2 &vb)
 Initialize transform to Sky plane: initializes the image. More...
 
void finalizeToSky ()
 Finalize transform to Sky plane: flushes the image cache and shows statistics if it is being used. More...
 
void get (vi::VisBuffer2 &vb, casacore::Int row=-1)
 Get actual coherence from grid by degridding. More...
 
void put (const vi::VisBuffer2 &vb, casacore::Int row=-1, casacore::Bool dopsf=false, FTMachine::Type type=FTMachine::OBSERVED)
 Put coherence to grid by gridding. More...
 
virtual void makeImage (FTMachine::Type type, vi::VisibilityIterator2 &vi, casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight)
 Make the entire image using a ROVisIter... More...
 
casacore::ImageInterface
< casacore::Complex > & 
getImage (casacore::Matrix< casacore::Float > &, casacore::Bool normalize=true)
 Get the final image: optionally normalize by the summed weights. More...
 
virtual void normalizeImage (casacore::Lattice< casacore::Complex > &, const casacore::Matrix< casacore::Double > &, casacore::Lattice< casacore::Float > &, casacore::Bool)
 
virtual casacore::Bool useWeightImage ()
 SDGrind needs to fill weightimage. More...
 
void getWeightImage (casacore::ImageInterface< casacore::Float > &, casacore::Matrix< casacore::Float > &)
 Get the final weights image. More...
 
virtual casacore::Bool changed (const vi::VisBuffer2 &vb)
 Has this operator changed since the last application? More...
 
virtual void setMiscInfo (const casacore::Int qualifier)
 set the order of the Taylor term for MFS this is to tell A-casacore::Projection to qualify the accumulated avgPB for each Taylor term in the CFCache. More...
 
virtual void ComputeResiduals (vi::VisBuffer2 &, casacore::Bool)
 Make the VB and VBStore interefaces for the interim re-factoring work. More...
 
virtual casacore::String name () const
 Return the name of the machine. More...
 
- Public Member Functions inherited from casa::refim::FTMachine
 FTMachine ()
 
 FTMachine (casacore::CountedPtr< CFCache > &cfcache, casacore::CountedPtr< ConvolutionFunction > &cfctor)
 
 FTMachine (const FTMachine &other)
 
FTMachineoperator= (const FTMachine &other)
 
void setBasePrivates (const FTMachine &other)
 
virtual ~FTMachine ()
 
virtual FTMachinecloneFTM ()
 clone copy should make it pure virtual forcing every ftm to have a cloner More...
 
virtual void initializeToVisNew (const vi::VisBuffer2 &vb, casacore::CountedPtr< SIImageStore > imstore)
 
virtual void initializeToSkyNew (const casacore::Bool dopsf, const vi::VisBuffer2 &vb, casacore::CountedPtr< SIImageStore > imstore)
 
virtual void initBriggsWeightor (vi::VisibilityIterator2 &vi)
 

This function has to be called after initMaps to initialize Briggs Cube weighting scheme More...

 
virtual void finalizeToSky (casacore::ImageInterface< casacore::Complex > &iimage)
 
virtual void finalizeToSkyNew (casacore::Bool dopsf, const vi::VisBuffer2 &vb, casacore::CountedPtr< SIImageStore > imstore)
 
virtual void put (vi::VisBuffer2 &vb, casacore::Int row=-1, casacore::Bool dopsf=false, refim::FTMachine::Type type=refim::FTMachine::OBSERVED)
 Non const vb version - so that weights can be modified in-place Currently, used only by MultiTermFT. More...
 
virtual void correlationToStokes (casacore::ImageInterface< casacore::Complex > &compImage, casacore::ImageInterface< casacore::Float > &resImage, const casacore::Bool dopsf)
 
More...
 
virtual void stokesToCorrelation (casacore::ImageInterface< casacore::Float > &modelImage, casacore::ImageInterface< casacore::Complex > &compImage)
 
virtual void normalizeImage (casacore::ImageInterface< casacore::Float > &skyImage, casacore::Matrix< casacore::Float > &sumOfWts, casacore::ImageInterface< casacore::Float > &sensitivityImage, casacore::Bool dopsf, casacore::Float pblimit, casacore::Int normtype)
 
virtual casacore::Bool isSkyJonesSet ()
 
virtual casacore::Bool isSkyJonesChanged (vi::VisBuffer2 &vb, casacore::Int row)
 
virtual void setSkyJones (casacore::Vector< casacore::CountedPtr< SkyJones > > &sj)
 Set SkyJones if image domain corrections /applycation are needed To reset the the FTMachine for stopping image based correction/applycation set in a casacore::Vector of size 0. More...
 
casacore::Bool changedSkyJonesLogic (const vi::VisBuffer2 &vb, casacore::Bool &firstRow, casacore::Bool &internalRow)
 
template<typename T >
void getGrid (casacore::Array< T > &thegrid)
 
More...
 
virtual const
casacore::CountedPtr
< refim::ConvolutionFunction > & 
getAWConvFunc ()
 
virtual void findConvFunction (const casacore::ImageInterface< casacore::Complex > &, const vi::VisBuffer2 &)
 
virtual void getFluxImage (casacore::ImageInterface< casacore::Float > &image)
 Get a flux (divide by this to get a flux density correct image) image if there is one. More...
 
void rotateUVW (casacore::Matrix< casacore::Double > &uvw, casacore::Vector< casacore::Double > &dphase, const vi::VisBuffer2 &vb)
 
More...
 
void girarUVW (casacore::Matrix< casacore::Double > &uvw, casacore::Vector< casacore::Double > &dphase, const vi::VisBuffer2 &vb)
 rotate with facetting style rephasing..for multifield mosaic More...
 
void refocus (casacore::Matrix< casacore::Double > &uvw, const casacore::Vector< casacore::Int > &ant1, const casacore::Vector< casacore::Int > &ant2, casacore::Vector< casacore::Double > &dphase, const vi::VisBuffer2 &vb)
 Refocus on a finite distance. More...
 
virtual casacore::Bool toRecord (casacore::String &error, casacore::RecordInterface &outRecord, casacore::Bool withImage=false, const casacore::String diskimagename="")
 Save and restore the FTMachine to and from a record. More...
 
virtual casacore::Bool fromRecord (casacore::String &error, const casacore::RecordInterface &inRecord)
 
virtual casacore::Bool isFourier ()
 Can this FTMachine be represented by Fourier convolutions? More...
 
casacore::Bool setFrameValidity (casacore::Bool validFrame)
 set otf spectral frame transform is on or off; More...
 
virtual casacore::Bool doublePrecGrid ()
 return whether the ftmachine is using a double precision grid More...
 
virtual void setNoPadding (casacore::Bool nopad)
 To make sure no padding is used in certain gridders. More...
 
virtual void setLocation (const casacore::MPosition &loc)
 set and get the location used for frame More...
 
virtual casacore::MPositiongetLocation ()
 
virtual void setMovingSource (const casacore::String &sourcename, const casacore::String &ephemtable="")
 set a moving source aka planets or comets => adjust phase center on the fly for gridding More...
 
virtual void setMovingSource (const casacore::MDirection &mdir)
 
virtual void reset ()
 reset stuff in an FTMachine More...
 
virtual void setFreqInterpolation (const casacore::String &method)
 set frequency interpolation type More...
 
virtual void setFreqInterpolation (const casacore::InterpolateArray1D< casacore::Double, casacore::Complex >::InterpolationMethod type)
 
virtual void setPointingDirColumn (const casacore::String &column="DIRECTION")
 tell ftmachine which Pointing table column to use for Direction Mosaic or Single dish ft use this for example More...
 
virtual casacore::String getPointingDirColumnInUse ()
 
virtual void setSpwChanSelection (const casacore::Cube< casacore::Int > &spwchansels)
 
virtual void setSpwFreqSelection (const casacore::Matrix< casacore::Double > &spwfreqs)
 
virtual void setCanComputeResiduals (casacore::Bool &b)
 
virtual casacore::Bool canComputeResiduals ()
 
virtual casacore::Float getPBLimit ()
 
void setnumthreads (casacore::Int n)
 virtual void ComputeResiduals(VBStore& vb)=0; get and set numthreads More...
 
casacore::Int getnumthreads ()
 
virtual void setCFCache (casacore::CountedPtr< CFCache > &cfc, const casacore::Bool resetCFC=true)
 
casacore::CountedPtr< CFCachegetCFCache ()
 
casacore::String getCacheDir ()
 
virtual void setDryRun (casacore::Bool val)
 
virtual casacore::Bool dryRun ()
 
virtual casacore::Bool isUsingCFCache ()
 
virtual const
casacore::CountedPtr
< refim::FTMachine > & 
getFTM2 (const casacore::Bool)
 
void setPseudoIStokes (casacore::Bool pseudoI)
 
void setPhaseCenterTime (const casacore::Double time)
 set and get Time to calculate phasecenter -1.0 means using the time available at each iteration..this is used when the phasecenter in the field table is either a polynomial or has a ephemerides tables associated with it Using double in the units and epoch-frame of the ms(s)..caller is responsible for conversion More...
 
casacore::Double getPhaseCenterTime ()
 
casacore::Vector< casacore::IntchannelMap (const vi::VisBuffer2 &vb)
 
casacore::Matrix
< casacore::Double
getSumWeights ()
 
void setBriggsCubeWeight (casacore::CountedPtr< refim::BriggsCubeWeightor > bwght)
 Functions associated with Briggs weighting for cubes. More...
 
void getImagingWeight (casacore::Matrix< casacore::Float > &imwght, const vi::VisBuffer2 &vb)
 
virtual casacore::Long estimateRAM (const casacore::CountedPtr< SIImageStore > &imstore)
 utility function that returns a rough estimate of memory needed. More...
 

Private Member Functions

void findPBAsConvFunction (const casacore::ImageInterface< casacore::Complex > &image, const vi::VisBuffer2 &vb)
 Find the Primary beam and convert it into a convolution buffer. More...
 
casacore::Array
< casacore::Complex > * 
getDataPointer (const casacore::IPosition &, casacore::Bool)
 Get the appropriate data pointer. More...
 
casacore::Array
< casacore::Float > * 
getWDataPointer (const casacore::IPosition &, casacore::Bool)
 
void ok ()
 
void init ()
 
void clipMinMax ()
 
casacore::Int getIndex (const casacore::ROMSPointingColumns &mspc, const casacore::Double &time, const casacore::Double &interval=-1.0, const casacore::Int &antid=-1)
 
casacore::Bool getXYPos (const vi::VisBuffer2 &vb, casacore::Int row)
 
casacore::MDirection directionMeas (const casacore::ROMSPointingColumns &mspc, const casacore::Int &index)
 get the casacore::MDirection from a chosen column of pointing table More...
 
casacore::MDirection directionMeas (const casacore::ROMSPointingColumns &mspc, const casacore::Int &index, const casacore::Double &time)
 
casacore::MDirection interpolateDirectionMeas (const casacore::ROMSPointingColumns &mspc, const casacore::Double &time, const casacore::Int &index, const casacore::Int &index1, const casacore::Int &index2)
 
void pickWeights (const vi::VisBuffer2 &vb, casacore::Matrix< casacore::Float > &weight)
 

Private Attributes

SkyJonessj_p
 
casacore::LatticeCache
< casacore::Complex > * 
imageCache
 Image cache. More...
 
casacore::LatticeCache
< casacore::Float > * 
wImageCache
 
casacore::Int cachesize
 Sizes. More...
 
casacore::Int tilesize
 
casacore::Bool isTiled
 Is this tiled? More...
 
casacore::ImageInterface
< casacore::Float > * 
wImage
 Storage for weights. More...
 
casacore::Lattice
< casacore::Complex > * 
arrayLattice
 casacore::Array lattice More...
 
casacore::Lattice
< casacore::Float > * 
wArrayLattice
 
casacore::Lattice
< casacore::Complex > * 
lattice
 Lattice. More...
 
casacore::Lattice
< casacore::Float > * 
wLattice
 
casacore::String convType
 
casacore::IPosition centerLoc
 Useful IPositions. More...
 
casacore::IPosition offsetLoc
 
casacore::Array< casacore::FloatwGriddedData
 casacore::Array for non-tiled gridding More...
 
casacore::DirectionCoordinate directionCoord
 
casacore::MDirection::ConvertpointingToImage
 
casacore::Vector
< casacore::Double
xyPos
 
casacore::Vector
< casacore::Double
xyPosMovingOrig_p
 Original xypos of moving source. More...
 
casacore::MDirection worldPosMeas
 
casacore::Cube< casacore::Intflags
 
casacore::Vector< casacore::FloatconvFunc
 
casacore::Int convSampling
 
casacore::Int convSize
 
casacore::Int convSupport
 
casacore::Int userSetSupport_p
 
casacore::Float truncate_p
 
casacore::Float gwidth_p
 
casacore::Float jwidth_p
 
casacore::Float minWeight_p
 
casacore::Int lastIndex_p
 
casacore::Vector< casacore::IntlastIndexPerAnt_p
 
casacore::Bool useImagingWeight_p
 
casacore::Int lastAntID_p
 
casacore::Int msId_p
 
casacore::Bool isSplineInterpolationReady
 
SDPosInterpolatorinterpolator
 
casacore::Bool clipminmax_
 for minmax clipping More...
 
casacore::Array
< casacore::Complex > 
gmin_
 
casacore::Array
< casacore::Complex > 
gmax_
 
casacore::Array< casacore::Floatwmin_
 
casacore::Array< casacore::Floatwmax_
 
casacore::Array< casacore::Intnpoints_
 

Additional Inherited Members

- Public Types inherited from casa::refim::FTMachine
enum  Type {
  OBSERVED,
  MODEL,
  CORRECTED,
  RESIDUAL,
  PSF,
  COVERAGE,
  N_types,
  DEFAULT
}
 Types of known Images that may be made using the makeImage method. More...
 
- Static Public Member Functions inherited from casa::refim::FTMachine
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)
 helper function for openmp to call...no private dependency More...
 
- Public Attributes inherited from casa::refim::FTMachine
casacore::Bool isDryRun
 
- Protected Member Functions inherited from casa::refim::FTMachine
casacore::LogIOlogIO ()
 
virtual void initMaps (const vi::VisBuffer2 &vb)
 
virtual void initPolInfo (const vi::VisBuffer2 &vb)
 
virtual void gridOk (casacore::Int gridsupport)
 check if image is big enough for gridding More...
 
casacore::Bool matchChannel (const casacore::Int &spw, const VisBuffer &vb)
 
casacore::Bool matchChannel (const vi::VisBuffer2 &vb)
 
casacore::Bool matchAllSpwChans (const VisBuffer &vb)
 redo all spw chan match especially if ms has changed underneath More...
 
virtual casacore::Bool interpolateFrequencyTogrid (const vi::VisBuffer2 &vb, const casacore::Matrix< casacore::Float > &wt, casacore::Cube< casacore::Complex > &data, casacore::Cube< casacore::Int > &flag, casacore::Matrix< casacore::Float > &weight, FTMachine::Type type=FTMachine::OBSERVED)
 casacore::Bool matchAllSpwChans(const vi::VisBuffer2& vb); interpolate visibility data of vb to grid frequency definition flag will be set the one as described in interpolateArray1D return false if no interpolation is done...for e.g for nearest case More...
 
virtual casacore::Bool interpolateFrequencyFromgrid (vi::VisBuffer2 &vb, casacore::Cube< casacore::Complex > &data, FTMachine::Type type=FTMachine::MODEL)
 degridded data interpolated back onto visibilities More...
 
virtual void getInterpolateArrays (const vi::VisBuffer2 &vb, casacore::Cube< casacore::Complex > &data, casacore::Cube< casacore::Int > &flag)
 Interpolate visibilities to be degridded upon. More...
 
void setSpectralFlag (const vi::VisBuffer2 &vb, casacore::Cube< casacore::Bool > &modflagcube)
 
casacore::Bool storeMovingSourceState (casacore::String &error, casacore::RecordInterface &outRecord)
 Save/Recover some elements of state of ftmachine in/from record. More...
 
casacore::Bool saveMeasure (casacore::RecordInterface &rec, const casacore::String &name, casacore::String &error, const casacore::Measure &ms)
 helper to save Measures in a record More...
 
casacore::Bool recoverMovingSourceState (casacore::String &error, const casacore::RecordInterface &inRecord)
 
casacore::Matrix
< casacore::Double
negateUV (const vi::VisBuffer2 &vb)
 
virtual void findGridSector (const casacore::Int &nxp, const casacore::Int &nyp, const casacore::Int &ixsub, const casacore::Int &iysub, const casacore::Int &minx, const casacore::Int &miny, const casacore::Int &icounter, casacore::Int &x0, casacore::Int &y0, casacore::Int &nxsub, casacore::Int &nysub, const casacore::Bool linear)
 
virtual void tweakGridSector (const casacore::Int &nx, const casacore::Int &ny, const casacore::Int &ixsub, const casacore::Int &iysub)
 
void initSourceFreqConv ()
 
void shiftFreqToSource (casacore::Vector< casacore::Double > &freqs)
 
- Protected Attributes inherited from casa::refim::FTMachine
casacore::LogIO logIO_p
 
casacore::ImageInterface
< casacore::Complex > * 
image
 
casacore::UVWMachineuvwMachine_p
 
casacore::CountedPtr
< casacore::UVWMachine
phaseShifter_p
 
casacore::MeasFrame mFrame_p
 
casacore::Bool tangentSpecified_p
 Direction of desired tangent plane. More...
 
casacore::MDirection mTangent_p
 
casacore::MDirection mImage_p
 
casacore::MDirection movingDir_p
 moving source stuff More...
 
casacore::Bool fixMovingSource_p
 
casacore::String ephemTableName_p
 
casacore::MDirection firstMovingDir_p
 
casacore::MVDirection movingDirShift_p
 This will hold the angular difference between movingDir and firstMovingDir with the frame conversion done properly etc. More...
 
casacore::Double distance_p
 
casacore::uInt nAntenna_p
 
casacore::Int lastFieldId_p
 
casacore::Int lastMSId_p
 
casacore::CountedPtr
< casacore::ROMSColumns
romscol_p
 
casacore::Bool useDoubleGrid_p
 Use douple precision grid in gridding process. More...
 
casacore::Matrix
< casacore::Double
sumWeight
 Sum of weights per polarization and per chan. More...
 
casacore::Matrix
< casacore::Double
sumCFWeight
 
casacore::Int nx
 Sizes. More...
 
casacore::Int ny
 
casacore::Int npol
 
casacore::Int nchan
 
casacore::Int nvischan
 
casacore::Int nvispol
 
casacore::Vector< casacore::IntchanMap
 Maps of channels and polarization. More...
 
casacore::Vector< casacore::IntpolMap
 
casacore::Bool isPseudoI_p
 Stokes pseudo I only? single parallel flagged will be allowed. More...
 
casacore::MPosition mLocation_p
 Default Position used for phase rotations. More...
 
casacore::Bool doUVWRotation_p
 Set if uvwrotation is necessary. More...
 
casacore::Vector< casacore::IntnVisChan_p
 
setup multiple spectral window for cubes

casacore::Block <casacore::Vector <casacore::Int> > multiChanMap_p; casacore::Vector<casacore::Int> selectedSpw_p; More...

 
casacore::SpectralCoordinate spectralCoord_p
 Private variables needed for spectral frame conversion. More...
 
casacore::Bool freqFrameValid_p
 casacore::Vector<casacore::Bool> doConversion_p; More...
 
casacore::Vector
< casacore::Double
imageFreq_p
 
casacore::Vector
< casacore::Double
lsrFreq_p
 casacore::Vector of float lsrfreq needed for regridding More...
 
casacore::Vector
< casacore::Double
interpVisFreq_p
 
casacore::InterpolateArray1D
< casacore::Double,
casacore::Complex >
::InterpolationMethod 
freqInterpMethod_p
 
casacore::String pointingDirCol_p
 
casacore::Cube< casacore::IntspwChanSelFlag_p
 
casacore::Matrix
< casacore::Double
spwFreqSel_p
 
casacore::Matrix
< casacore::Double
expandedSpwFreqSel_p
 
casacore::Matrix
< casacore::Double
expandedSpwConjFreqSel_p
 
casacore::Vector< casacore::IntcfStokes_p
 
casacore::Int polInUse_p
 
casacore::CountedPtr< CFCachecfCache_p
 
CFStore cfs_p
 
CFStore cfwts_p
 
casacore::CountedPtr< CFStore2cfs2_p
 
casacore::CountedPtr< CFStore2cfwts2_p
 
casacore::CountedPtr
< ConvolutionFunction
convFuncCtor_p
 
casacore::CountedPtr
< PolOuterProduct
pop_p
 
casacore::Bool canComputeResiduals_p
 
casacore::Bool toVis_p
 
casacore::Int numthreads_p
 
casacore::Array
< casacore::Complex > 
griddedData
 casacore::Array for non-tiled gridding These are common to most FTmachines More...
 
casacore::Array
< casacore::DComplex > 
griddedData2
 
casacore::Float pbLimit_p
 
casacore::Vector
< casacore::CountedPtr
< SkyJones > > 
sj_p
 casacore::Vector<SkyJones *> sj_p; More...
 
casacore::CountedPtr
< casacore::ImageInterface
< casacore::Complex > > 
cmplxImage_p
 A holder for the complex image if nobody else is keeping it. More...
 
casacore::CountedPtr
< VisBufferUtil
vbutil_p
 
casacore::Double phaseCenterTime_p
 
casacore::Int doneThreadPartition_p
 Some parameters and helpers for multithreaded gridders. More...
 
casacore::Vector< casacore::Intxsect_p
 
casacore::Vector< casacore::Intysect_p
 
casacore::Vector< casacore::Intnxsect_p
 
casacore::Vector< casacore::Intnysect_p
 
casacore::CountedPtr
< refim::BriggsCubeWeightor
briggsWeightor_p
 
casacore::MRadialVelocity::Convert obsvelconv_p
 moving source spectral frame stuff More...
 
casacore::MeasTable::Types mtype_p
 
FFT2D ft_p
 

Detailed Description

An FTMachine for Gridding Single Dish data.

Intended use:

Public interface

Prerequisite

Etymology

FTMachine is a Machine for Fourier Transforms. SDGrid does Single Dish gridding in a similar way

Synopsis

The SkyEquation needs to be able to perform Fourier transforms on visibility data and to grid single dish data. SDGrid allows efficient Single Dish processing using a VisBuffer which encapsulates a chunk of visibility (typically all baselines for one time) together with all the information needed for processing (e.g. direction coordinates).

Gridding and degridding in SDGrid are performed using a novel sort-less algorithm. In this approach, the gridded plane is divided into small patches, a cache of which is maintained in memory using a general-purpose LatticeCache class. As the (time-sorted) visibility data move around slowly in the image plane, patches are swapped in and out as necessary. Thus, optimally, one would keep at least one patch per scan line of data.

A grid cache is defined on construction. If the gridded image plane is smaller than this, it is kept entirely in memory and all gridding and degridding is done entirely in memory. Otherwise a cache of tiles is kept an paged in and out as necessary. Optimally the cache should be big enough to hold all polarizations and frequencies for one complete scan line. The paging rate will then be small. As the cache size is reduced below this critical value, paging increases. The algorithm will work for only one patch but it will be very slow!

The gridding and degridding steps are implemented in Fortran for speed. In gridding, the visibilities are added onto the grid points in the neighborhood using a weighting function. In degridding, the value is derived by a weight summ of the same points, using the same weighting function.

Example

See the example for SkyModel.

Motivation

Define an interface to allow efficient processing of chunks of visibility data

Definition at line 121 of file SDGrid.h.

Constructor & Destructor Documentation

casa::refim::SDGrid::SDGrid ( SkyJones sj,
casacore::Int  cachesize,
casacore::Int  tilesize,
casacore::String  convType = "BOX",
casacore::Int  userSupport = -1,
casacore::Bool  useImagingWeight = false 
)

Constructor: cachesize is the size of the cache in words (e.g.

a few million is a good number), tilesize is the size of the tile used in gridding (cannot be less than 12, 16 works in most cases), and convType is the type of gridding used (SF is prolate spheriodal wavefunction, and BOX is plain box-car summation). mLocation is the position to be used in some phase rotations. If mTangent is specified then the uvw rotation is done for that location iso the image center. userSupport is to allow larger support for the convolution if the user wants it..-1 will use the default i.e 1 for BOX and 3 for others USEIMAGINGWEIGHT The parameter useImagingWeight in the constructors is to explicitly use vb.imagingweight while gridding, When doing just SD imaging then setting it to false is fine (in fact recommended as vb.imagingweight is set to zero if any pol is flagged this may change later.....today being 2014/08/06) when using it in conjuction with interferometer gridding then set useImagingWeight to true this is to allow for proper non natural weighting scheme while imaging

casa::refim::SDGrid::SDGrid ( casacore::MPosition ml,
SkyJones sj,
casacore::Int  cachesize,
casacore::Int  tilesize,
casacore::String  convType = "BOX",
casacore::Int  userSupport = -1,
casacore::Float  minweight = 0.,
casacore::Bool  clipminmax = false,
casacore::Bool  useImagingWeight = false 
)
casa::refim::SDGrid::SDGrid ( casacore::Int  cachesize,
casacore::Int  tilesize,
casacore::String  convType = "BOX",
casacore::Int  userSupport = -1,
casacore::Bool  useImagingWeight = false 
)
casa::refim::SDGrid::SDGrid ( casacore::MPosition ml,
casacore::Int  cachesize,
casacore::Int  tilesize,
casacore::String  convType = "BOX",
casacore::Int  userSupport = -1,
casacore::Float  minweight = 0.,
casacore::Bool  clipminmax = false,
casacore::Bool  useImagingWeight = false 
)
casa::refim::SDGrid::SDGrid ( casacore::MPosition ml,
casacore::Int  cachesize,
casacore::Int  tilesize,
casacore::String  convType = "TGAUSS",
casacore::Float  truncate = -1.0,
casacore::Float  gwidth = 0.0,
casacore::Float  jwidth = 0.0,
casacore::Float  minweight = 0.,
casacore::Bool  clipminmax = false,
casacore::Bool  useImagingWeight = false 
)
casa::refim::SDGrid::SDGrid ( const SDGrid other)

Copy constructor.

casa::refim::SDGrid::~SDGrid ( )

Member Function Documentation

virtual casacore::Bool casa::refim::SDGrid::changed ( const vi::VisBuffer2 vb)
virtual

Has this operator changed since the last application?

Reimplemented from casa::refim::FTMachine.

void casa::refim::SDGrid::clipMinMax ( )
private
virtual void casa::refim::SDGrid::ComputeResiduals ( vi::VisBuffer2 vb,
casacore::Bool  useCorrected 
)
inlinevirtual

Make the VB and VBStore interefaces for the interim re-factoring work.

Finally removed the VB interface.

Implements casa::refim::FTMachine.

Definition at line 219 of file SDGrid.h.

casacore::MDirection casa::refim::SDGrid::directionMeas ( const casacore::ROMSPointingColumns mspc,
const casacore::Int index 
)
private

get the casacore::MDirection from a chosen column of pointing table

casacore::MDirection casa::refim::SDGrid::directionMeas ( const casacore::ROMSPointingColumns mspc,
const casacore::Int index,
const casacore::Double time 
)
private
void casa::refim::SDGrid::finalizeToSky ( )
virtual

Finalize transform to Sky plane: flushes the image cache and shows statistics if it is being used.

DOES NOT DO THE FINAL TRANSFORM!

Implements casa::refim::FTMachine.

void casa::refim::SDGrid::finalizeToVis ( )
virtual

Finalize transform to Visibility plane: flushes the image cache and shows statistics if it is being used.

Implements casa::refim::FTMachine.

void casa::refim::SDGrid::findPBAsConvFunction ( const casacore::ImageInterface< casacore::Complex > &  image,
const vi::VisBuffer2 vb 
)
private

Find the Primary beam and convert it into a convolution buffer.

void casa::refim::SDGrid::get ( vi::VisBuffer2 vb,
casacore::Int  row = -1 
)
virtual

Get actual coherence from grid by degridding.

Implements casa::refim::FTMachine.

casacore::Array<casacore::Complex>* casa::refim::SDGrid::getDataPointer ( const casacore::IPosition ,
casacore::Bool   
)
private

Get the appropriate data pointer.

casacore::ImageInterface<casacore::Complex>& casa::refim::SDGrid::getImage ( casacore::Matrix< casacore::Float > &  ,
casacore::Bool  normalize = true 
)
virtual

Get the final image: optionally normalize by the summed weights.

Implements casa::refim::FTMachine.

casacore::Int casa::refim::SDGrid::getIndex ( const casacore::ROMSPointingColumns mspc,
const casacore::Double time,
const casacore::Double interval = -1.0,
const casacore::Int antid = -1 
)
private
casacore::Array<casacore::Float>* casa::refim::SDGrid::getWDataPointer ( const casacore::IPosition ,
casacore::Bool   
)
private
void casa::refim::SDGrid::getWeightImage ( casacore::ImageInterface< casacore::Float > &  ,
casacore::Matrix< casacore::Float > &   
)
virtual

Get the final weights image.

Implements casa::refim::FTMachine.

casacore::Bool casa::refim::SDGrid::getXYPos ( const vi::VisBuffer2 vb,
casacore::Int  row 
)
private
void casa::refim::SDGrid::init ( )
private
void casa::refim::SDGrid::initializeToSky ( casacore::ImageInterface< casacore::Complex > &  image,
casacore::Matrix< casacore::Float > &  weight,
const vi::VisBuffer2 vb 
)
virtual

Initialize transform to Sky plane: initializes the image.

Implements casa::refim::FTMachine.

void casa::refim::SDGrid::initializeToVis ( casacore::ImageInterface< casacore::Complex > &  image,
const vi::VisBuffer2 vb 
)
virtual

Initialize transform to Visibility plane using the image as a template.

The image is loaded and Fourier transformed.

Implements casa::refim::FTMachine.

casacore::MDirection casa::refim::SDGrid::interpolateDirectionMeas ( const casacore::ROMSPointingColumns mspc,
const casacore::Double time,
const casacore::Int index,
const casacore::Int index1,
const casacore::Int index2 
)
private
virtual void casa::refim::SDGrid::makeImage ( FTMachine::Type  type,
vi::VisibilityIterator2 vi,
casacore::ImageInterface< casacore::Complex > &  image,
casacore::Matrix< casacore::Float > &  weight 
)
virtual

Make the entire image using a ROVisIter...

This is an overload for FTMachine version as SDGrid now does everything in memory so for large cube..proceed by slices that fit in memory here.

Reimplemented from casa::refim::FTMachine.

virtual casacore::String casa::refim::SDGrid::name ( ) const
virtual

Return the name of the machine.

Implements casa::refim::FTMachine.

virtual void casa::refim::SDGrid::normalizeImage ( casacore::Lattice< casacore::Complex > &  ,
const casacore::Matrix< casacore::Double > &  ,
casacore::Lattice< casacore::Float > &  ,
casacore::Bool   
)
inlinevirtual

Reimplemented from casa::refim::FTMachine.

Definition at line 204 of file SDGrid.h.

void casa::refim::SDGrid::ok ( )
privatevirtual

Reimplemented from casa::refim::FTMachine.

SDGrid& casa::refim::SDGrid::operator= ( const SDGrid other)

Assignment operator.

void casa::refim::SDGrid::pickWeights ( const vi::VisBuffer2 vb,
casacore::Matrix< casacore::Float > &  weight 
)
private
void casa::refim::SDGrid::put ( const vi::VisBuffer2 vb,
casacore::Int  row = -1,
casacore::Bool  dopsf = false,
FTMachine::Type  type = FTMachine::OBSERVED 
)
virtual

Put coherence to grid by gridding.

Implements casa::refim::FTMachine.

virtual void casa::refim::SDGrid::setMiscInfo ( const casacore::Int  qualifier)
inlinevirtual

set the order of the Taylor term for MFS this is to tell A-casacore::Projection to qualify the accumulated avgPB for each Taylor term in the CFCache.

Implements casa::refim::FTMachine.

Definition at line 218 of file SDGrid.h.

virtual casacore::Bool casa::refim::SDGrid::useWeightImage ( )
inlinevirtual

SDGrind needs to fill weightimage.

Reimplemented from casa::refim::FTMachine.

Definition at line 211 of file SDGrid.h.

Member Data Documentation

casacore::Lattice<casacore::Complex>* casa::refim::SDGrid::arrayLattice
private

casacore::Array lattice

Definition at line 253 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::cachesize
private

Sizes.

Definition at line 244 of file SDGrid.h.

casacore::IPosition casa::refim::SDGrid::centerLoc
private

Useful IPositions.

Definition at line 264 of file SDGrid.h.

casacore::Bool casa::refim::SDGrid::clipminmax_
private

for minmax clipping

Definition at line 304 of file SDGrid.h.

casacore::Vector<casacore::Float> casa::refim::SDGrid::convFunc
private

Definition at line 282 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::convSampling
private

Definition at line 283 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::convSize
private

Definition at line 284 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::convSupport
private

Definition at line 285 of file SDGrid.h.

casacore::String casa::refim::SDGrid::convType
private

Definition at line 261 of file SDGrid.h.

casacore::DirectionCoordinate casa::refim::SDGrid::directionCoord
private

Definition at line 270 of file SDGrid.h.

casacore::Cube<casacore::Int> casa::refim::SDGrid::flags
private

Definition at line 280 of file SDGrid.h.

casacore::Array<casacore::Complex> casa::refim::SDGrid::gmax_
private

Definition at line 306 of file SDGrid.h.

casacore::Array<casacore::Complex> casa::refim::SDGrid::gmin_
private

Definition at line 305 of file SDGrid.h.

casacore::Float casa::refim::SDGrid::gwidth_p
private

Definition at line 289 of file SDGrid.h.

casacore::LatticeCache<casacore::Complex>* casa::refim::SDGrid::imageCache
private

Image cache.

Definition at line 240 of file SDGrid.h.

SDPosInterpolator* casa::refim::SDGrid::interpolator
private

Definition at line 301 of file SDGrid.h.

casacore::Bool casa::refim::SDGrid::isSplineInterpolationReady
private

Definition at line 300 of file SDGrid.h.

casacore::Bool casa::refim::SDGrid::isTiled
private

Is this tiled?

Definition at line 247 of file SDGrid.h.

casacore::Float casa::refim::SDGrid::jwidth_p
private

Definition at line 290 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::lastAntID_p
private

Definition at line 297 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::lastIndex_p
private

Definition at line 294 of file SDGrid.h.

casacore::Vector<casacore::Int> casa::refim::SDGrid::lastIndexPerAnt_p
private

Definition at line 295 of file SDGrid.h.

casacore::Lattice<casacore::Complex>* casa::refim::SDGrid::lattice
private

Lattice.

For non-tiled gridding, this will point to arrayLattice, whereas for tiled gridding, this points to the image

Definition at line 258 of file SDGrid.h.

casacore::Float casa::refim::SDGrid::minWeight_p
private

Definition at line 292 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::msId_p
private

Definition at line 298 of file SDGrid.h.

casacore::Array<casacore::Int> casa::refim::SDGrid::npoints_
private

Definition at line 309 of file SDGrid.h.

casacore::IPosition casa::refim::SDGrid::offsetLoc
private

Definition at line 264 of file SDGrid.h.

casacore::MDirection::Convert* casa::refim::SDGrid::pointingToImage
private

Definition at line 272 of file SDGrid.h.

SkyJones* casa::refim::SDGrid::sj_p
private

Definition at line 229 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::tilesize
private

Definition at line 244 of file SDGrid.h.

casacore::Float casa::refim::SDGrid::truncate_p
private

Definition at line 288 of file SDGrid.h.

casacore::Bool casa::refim::SDGrid::useImagingWeight_p
private

Definition at line 296 of file SDGrid.h.

casacore::Int casa::refim::SDGrid::userSetSupport_p
private

Definition at line 286 of file SDGrid.h.

casacore::Lattice<casacore::Float>* casa::refim::SDGrid::wArrayLattice
private

Definition at line 254 of file SDGrid.h.

casacore::Array<casacore::Float> casa::refim::SDGrid::wGriddedData
private

casacore::Array for non-tiled gridding

Definition at line 267 of file SDGrid.h.

casacore::ImageInterface<casacore::Float>* casa::refim::SDGrid::wImage
private

Storage for weights.

Definition at line 250 of file SDGrid.h.

casacore::LatticeCache<casacore::Float>* casa::refim::SDGrid::wImageCache
private

Definition at line 241 of file SDGrid.h.

casacore::Lattice<casacore::Float>* casa::refim::SDGrid::wLattice
private

Definition at line 259 of file SDGrid.h.

casacore::Array<casacore::Float> casa::refim::SDGrid::wmax_
private

Definition at line 308 of file SDGrid.h.

casacore::Array<casacore::Float> casa::refim::SDGrid::wmin_
private

Definition at line 307 of file SDGrid.h.

casacore::MDirection casa::refim::SDGrid::worldPosMeas
private

Definition at line 278 of file SDGrid.h.

casacore::Vector<casacore::Double> casa::refim::SDGrid::xyPos
private

Definition at line 274 of file SDGrid.h.

casacore::Vector<casacore::Double> casa::refim::SDGrid::xyPosMovingOrig_p
private

Original xypos of moving source.

Definition at line 276 of file SDGrid.h.


The documentation for this class was generated from the following file: