casa
5.7.0-16
|
An FTMachine for Gridded Fourier transforms. More...
#include <WProjectFT.h>
Public Member Functions | |
WProjectFT (casacore::Int nFacets, casacore::Long cachesize, casacore::Int tilesize=16, casacore::Bool usezero=true, casacore::Bool useDoublePrec=false, const casacore::Double minW=-1.0, const casacore::Double maxW=-1.0, const casacore::Double rmsW=-1.0) | |
Constructor: cachesize is the size of the cache in words (e.g. More... | |
WProjectFT (casacore::Int nFacets, casacore::MPosition mLocation, casacore::Long cachesize, casacore::Int tilesize=16, casacore::Bool usezero=true, casacore::Float padding=1.0, casacore::Bool useDoublePrec=false, const casacore::Double minW=-1.0, const casacore::Double maxW=-1.0, const casacore::Double rmsW=-1.0) | |
Constructor without tangent direction. More... | |
WProjectFT (casacore::Int nFacets, casacore::MDirection mTangent, casacore::MPosition mLocation, casacore::Long cachesize, casacore::Int tilesize=16, casacore::Bool usezero=true, casacore::Float padding=1.0, casacore::Bool useDoublePrec=false, const casacore::Double minW=-1.0, const casacore::Double maxW=-1.0, const casacore::Double rmsW=-1.0) | |
Deprecated no longer need ms in constructor. More... | |
WProjectFT (const casacore::RecordInterface &stateRec) | |
Construct from a casacore::Record containing the WProjectFT state. More... | |
WProjectFT (const WProjectFT &other) | |
Copy constructor. More... | |
WProjectFT & | operator= (const WProjectFT &other) |
Assignment operator. More... | |
~WProjectFT () | |
virtual FTMachine * | cloneFTM () |
clone to FTMachine pointer More... | |
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... | |
void | makeImage (FTMachine::Type type, vi::VisibilityIterator2 &vi, casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight) |
Make the entire image. More... | |
casacore::ImageInterface < casacore::Complex > & | getImage (casacore::Matrix< casacore::Float > &, casacore::Bool normalize=true) |
Get the final image: do the Fourier transform and grid-correct, then 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) |
void | getWeightImage (casacore::ImageInterface< casacore::Float > &, casacore::Matrix< casacore::Float > &) |
Get the final weights image. More... | |
casacore::Bool | toRecord (casacore::String &error, casacore::RecordInterface &outRec, casacore::Bool withImage=false, const casacore::String diskimage="") |
Save and restore the WProjectFT to and from a record. More... | |
casacore::Bool | fromRecord (casacore::String &error, const casacore::RecordInterface &inRec) |
casacore::Bool | isFourier () |
Can this FTMachine be represented by Fourier convolutions? More... | |
casacore::String | name () const |
Return name of this machine. More... | |
void | setConvFunc (casacore::CountedPtr< WPConvFunc > &pbconvFunc) |
Copy convolution function etc to another FT machine necessary if ft and ift are distinct but can share convfunctions. More... | |
casacore::CountedPtr < WPConvFunc > & | getConvFunc () |
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... | |
Public Member Functions inherited from casa::refim::FTMachine | |
FTMachine () | |
FTMachine (casacore::CountedPtr< CFCache > &cfcache, casacore::CountedPtr< ConvolutionFunction > &cfctor) | |
FTMachine (const FTMachine &other) | |
FTMachine & | operator= (const FTMachine &other) |
void | setBasePrivates (const FTMachine &other) |
virtual | ~FTMachine () |
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 | useWeightImage () |
All FTMachines that fill weightimage, need to set this. More... | |
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 | 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 | changed (const vi::VisBuffer2 &vb) |
Has this operator changed since the last application? 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::MPosition & | getLocation () |
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< CFCache > | getCFCache () |
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::Int > | channelMap (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... | |
Static Public Member Functions | |
static void | wStat (vi::VisibilityIterator2 &vi, casacore::Double &minW, casacore::Double &maxW, casacore::Double &rmsW) |
Helper function to calculate min, max, rms of W in the data set. 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... | |
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... | |
Public Attributes inherited from casa::refim::FTMachine | |
casacore::Bool | isDryRun |
An FTMachine for Gridded Fourier transforms.
Public interface
FTMachine is a Machine for Fourier Transforms. WProjectFT does Grid-based Fourier transforms.
The SkyEquation needs to be able to perform Fourier transforms on visibility data. WProjectFT allows efficient Fourier Transform 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. UVW coordinates).
Gridding and degridding in WProjectFT 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 Fourier plane, patches are swapped in and out as necessary. Thus, optimally, one would keep at least one patch per baseline.
A grid cache is defined on construction. If the gridded uv 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 all baselines. 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!
This scheme works well for arrays having a moderate number of antennas since the saving in space goes as the ratio of baselines to image size. For the ATCA, VLBA and WSRT, this ratio is quite favorable. For the VLA, one requires images of greater than about 200 pixels on a side to make it worthwhile.
The FFT step is done plane by plane for images having less than 1024 * 1024 pixels on each plane, and line by line otherwise.
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.
See the example for SkyModel.
Define an interface to allow efficient processing of chunks of visibility data
Definition at line 136 of file WProjectFT.h.
casa::refim::WProjectFT::WProjectFT | ( | casacore::Int | nFacets, |
casacore::Long | cachesize, | ||
casacore::Int | tilesize = 16 , |
||
casacore::Bool | usezero = true , |
||
casacore::Bool | useDoublePrec = false , |
||
const casacore::Double | minW = -1.0 , |
||
const casacore::Double | maxW = -1.0 , |
||
const casacore::Double | rmsW = -1.0 |
||
) |
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).
casa::refim::WProjectFT::WProjectFT | ( | casacore::Int | nFacets, |
casacore::MPosition | mLocation, | ||
casacore::Long | cachesize, | ||
casacore::Int | tilesize = 16 , |
||
casacore::Bool | usezero = true , |
||
casacore::Float | padding = 1.0 , |
||
casacore::Bool | useDoublePrec = false , |
||
const casacore::Double | minW = -1.0 , |
||
const casacore::Double | maxW = -1.0 , |
||
const casacore::Double | rmsW = -1.0 |
||
) |
Constructor without tangent direction.
casa::refim::WProjectFT::WProjectFT | ( | casacore::Int | nFacets, |
casacore::MDirection | mTangent, | ||
casacore::MPosition | mLocation, | ||
casacore::Long | cachesize, | ||
casacore::Int | tilesize = 16 , |
||
casacore::Bool | usezero = true , |
||
casacore::Float | padding = 1.0 , |
||
casacore::Bool | useDoublePrec = false , |
||
const casacore::Double | minW = -1.0 , |
||
const casacore::Double | maxW = -1.0 , |
||
const casacore::Double | rmsW = -1.0 |
||
) |
Deprecated no longer need ms in constructor.
casa::refim::WProjectFT::WProjectFT | ( | const casacore::RecordInterface & | stateRec | ) |
Construct from a casacore::Record containing the WProjectFT state.
casa::refim::WProjectFT::WProjectFT | ( | const WProjectFT & | other | ) |
Copy constructor.
casa::refim::WProjectFT::~WProjectFT | ( | ) |
|
virtual |
clone to FTMachine pointer
Reimplemented from casa::refim::FTMachine.
|
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 232 of file WProjectFT.h.
|
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.
|
virtual |
Finalize transform to Visibility plane: flushes the image cache and shows statistics if it is being used.
Implements casa::refim::FTMachine.
|
protectedvirtual |
Find the convolution function.
Reimplemented from casa::refim::FTMachine.
|
virtual |
Reimplemented from casa::refim::FTMachine.
|
virtual |
Get actual coherence from grid by degridding.
Implements casa::refim::FTMachine.
casacore::CountedPtr<WPConvFunc>& casa::refim::WProjectFT::getConvFunc | ( | ) |
|
protected |
Get the appropriate data pointer.
|
virtual |
Get the final image: do the Fourier transform and grid-correct, then optionally normalize by the summed weights.
Implements casa::refim::FTMachine.
|
protected |
|
virtual |
Get the final weights image.
Implements casa::refim::FTMachine.
|
protected |
|
virtual |
Initialize transform to Sky plane: initializes the image.
Implements casa::refim::FTMachine.
|
virtual |
Initialize transform to Visibility plane using the image as a template.
The image is loaded and Fourier transformed.
Implements casa::refim::FTMachine.
|
inlinevirtual |
Can this FTMachine be represented by Fourier convolutions?
Reimplemented from casa::refim::FTMachine.
Definition at line 219 of file WProjectFT.h.
|
virtual |
Make the entire image.
Reimplemented from casa::refim::FTMachine.
|
virtual |
Return name of this machine.
Implements casa::refim::FTMachine.
|
inlineprotected |
Definition at line 241 of file WProjectFT.h.
References casacore::floor().
|
inlinevirtual |
Reimplemented from casa::refim::FTMachine.
Definition at line 204 of file WProjectFT.h.
|
protectedvirtual |
Reimplemented from casa::refim::FTMachine.
WProjectFT& casa::refim::WProjectFT::operator= | ( | const WProjectFT & | other | ) |
Assignment operator.
|
protected |
|
virtual |
Put coherence to grid by gridding.
Implements casa::refim::FTMachine.
void casa::refim::WProjectFT::setConvFunc | ( | casacore::CountedPtr< WPConvFunc > & | pbconvFunc | ) |
Copy convolution function etc to another FT machine necessary if ft and ift are distinct but can share convfunctions.
|
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 231 of file WProjectFT.h.
|
virtual |
Save and restore the WProjectFT to and from a record.
Reimplemented from casa::refim::FTMachine.
|
static |
Helper function to calculate min, max, rms of W in the data set.
|
protected |
casacore::Array lattice
Definition at line 276 of file WProjectFT.h.
|
protected |
Sizes.
Definition at line 266 of file WProjectFT.h.
|
protected |
Useful IPositions.
Definition at line 285 of file WProjectFT.h.
|
protected |
Definition at line 295 of file WProjectFT.h.
|
protected |
Definition at line 296 of file WProjectFT.h.
|
protected |
Definition at line 297 of file WProjectFT.h.
|
protected |
Definition at line 300 of file WProjectFT.h.
|
protected |
Definition at line 298 of file WProjectFT.h.
|
protected |
Gridder.
Definition at line 270 of file WProjectFT.h.
|
protected |
Is this record on Grid? check both ends.
This assumes that the ends bracket the middle casacore::Bool recordOnGrid(const vi::VisBuffer2& vb, casacore::Int rownr) const;
Image cache
Definition at line 263 of file WProjectFT.h.
|
protected |
Is this tiled?
Definition at line 273 of file WProjectFT.h.
|
protected |
Definition at line 305 of file WProjectFT.h.
|
protected |
Lattice.
For non-tiled gridding, this will point to arrayLattice, whereas for tiled gridding, this points to the image
Definition at line 280 of file WProjectFT.h.
|
protected |
Definition at line 310 of file WProjectFT.h.
|
protected |
Definition at line 282 of file WProjectFT.h.
|
protected |
Definition at line 314 of file WProjectFT.h.
|
protected |
Definition at line 314 of file WProjectFT.h.
|
protected |
Definition at line 247 of file WProjectFT.h.
|
protected |
Definition at line 285 of file WProjectFT.h.
|
protected |
Padding in FFT.
Definition at line 239 of file WProjectFT.h.
|
protected |
Definition at line 314 of file WProjectFT.h.
|
protected |
Definition at line 289 of file WProjectFT.h.
|
protected |
Definition at line 267 of file WProjectFT.h.
|
protected |
Definition at line 313 of file WProjectFT.h.
|
protected |
Definition at line 313 of file WProjectFT.h.
|
protected |
Definition at line 313 of file WProjectFT.h.
|
protected |
Grid/degrid zero spacing points?
Definition at line 293 of file WProjectFT.h.
|
protected |
Definition at line 288 of file WProjectFT.h.
|
protected |
Image Scaling and offset.
Definition at line 288 of file WProjectFT.h.
|
protected |
Definition at line 303 of file WProjectFT.h.
|
protected |
Definition at line 312 of file WProjectFT.h.