casa
5.7.0-16
|
An FTMachine for Gridding Single Dish data. More...
#include <GridBoth.h>
Public Member Functions | |
GridBoth (SkyJones &sj, casacore::Long cachesize, casacore::Int tilesize, casacore::String sdConvType="BOX", casacore::String synConvType="SF", casacore::Float padding=1.0, casacore::Float sdScale=1.0, casacore::Float sdWeight=1.0) | |
Constructor: cachesize is the size of the cache in words (e.g. More... | |
GridBoth (SkyJones &sj, casacore::Long cachesize, casacore::Int tilesize, casacore::MPosition mLocation, casacore::String sdConvType="BOX", casacore::String synConvType="SF", casacore::Float padding=1.0, casacore::Float sdScale=1.0, casacore::Float sdWeight=1.0) | |
GridBoth (SkyJones &sj, casacore::Long cachesize, casacore::Int tilesize, casacore::MPosition mLocation, casacore::MDirection mTangent, casacore::String sdConvType="BOX", casacore::String synConvType="SF", casacore::Float padding=1.0, casacore::Float sdScale=1.0, casacore::Float sdWeight=1.0) | |
GridBoth (const GridBoth &other) | |
Copy constructor. More... | |
GridBoth & | operator= (const GridBoth &other) |
Assignment operator. More... | |
~GridBoth () | |
GridBoth (const casacore::RecordInterface &stateRec) | |
Construct from a casacore::Record containing the GridFT state. More... | |
void | initializeToVis (casacore::ImageInterface< casacore::Complex > &image, const VisBuffer &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 VisBuffer &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 (VisBuffer &vb, casacore::Int row=-1) |
Get actual coherence from grid by degridding. More... | |
void | put (const VisBuffer &vb, casacore::Int row=-1, casacore::Bool dopsf=false, FTMachine::Type type=FTMachine::OBSERVED) |
Put coherence to grid by gridding. 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... | |
virtual casacore::Bool | toRecord (casacore::String &error, casacore::RecordInterface &outRec, casacore::Bool withImage=false, const casacore::String diskimage="") |
Save and restore the GridFT to and from a record. More... | |
virtual casacore::Bool | fromRecord (casacore::String &error, const casacore::RecordInterface &inRec) |
virtual casacore::Bool | changed (const VisBuffer &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 (VisBuffer &, 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::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 FTMachine * | cloneFTM () |
clone copy the default cloner clones via a Record copy More... | |
virtual void | initializeToVis (casacore::Block< casacore::CountedPtr< casacore::ImageInterface< casacore::Complex > > > &compImageVec, casacore::PtrBlock< casacore::SubImage< casacore::Float > * > &modelImageVec, casacore::PtrBlock< casacore::SubImage< casacore::Float > * > &weightImageVec, casacore::PtrBlock< casacore::SubImage< casacore::Float > * > &fluxScaleVec, casacore::Block< casacore::Matrix< casacore::Float > > &weightsVec, const VisBuffer &vb) |
Vectorized InitializeToVis. More... | |
virtual void | initializeToVisNew (const VisBuffer &vb, casacore::CountedPtr< SIImageStore > imstore) |
virtual void | initializeToSky (casacore::Block< casacore::CountedPtr< casacore::ImageInterface< casacore::Complex > > > &compImageVec, casacore::Block< casacore::Matrix< casacore::Float > > &weightsVec, const VisBuffer &vb, const casacore::Bool dopsf=false) |
Vectorized InitializeToSky. More... | |
virtual void | initializeToSkyNew (const casacore::Bool dopsf, const VisBuffer &vb, casacore::CountedPtr< SIImageStore > imstore) |
virtual void | finalizeToSky (casacore::ImageInterface< casacore::Complex > &iimage) |
virtual void | finalizeToSky (casacore::Block< casacore::CountedPtr< casacore::ImageInterface< casacore::Complex > > > &compImageVec, casacore::PtrBlock< casacore::SubImage< casacore::Float > * > &resImageVec, casacore::PtrBlock< casacore::SubImage< casacore::Float > * > &weightImageVec, casacore::PtrBlock< casacore::SubImage< casacore::Float > * > &fluxScaleVec, casacore::Bool dopsf, casacore::Block< casacore::Matrix< casacore::Float > > &weightsVec, const VisBuffer &vb) |
Vectorized finalizeToSky. More... | |
virtual void | finalizeToSkyNew (casacore::Bool dopsf, const VisBuffer &vb, casacore::CountedPtr< SIImageStore > imstore) |
virtual void | put (VisBuffer &vb, casacore::Int row=-1, casacore::Bool dopsf=false, FTMachine::Type type=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 (VisBuffer &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 VisBuffer &vb, casacore::Bool &firstRow, casacore::Bool &internalRow) |
template<typename T > | |
void | getGrid (casacore::Array< T > &thegrid) |
More... | |
virtual const casacore::CountedPtr < ConvolutionFunction > & | getAWConvFunc () |
virtual void | findConvFunction (const casacore::ImageInterface< casacore::Complex > &, const VisBuffer &) |
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... | |
virtual void | makeImage (FTMachine::Type type, VisSet &vs, casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight) |
Make the entire image. More... | |
virtual void | makeImage (FTMachine::Type type, ROVisibilityIterator &vi, casacore::ImageInterface< casacore::Complex > &image, casacore::Matrix< casacore::Float > &weight) |
Make the entire image using a ROVisIter. More... | |
void | girarUVW (casacore::Matrix< casacore::Double > &uvw, casacore::Vector< casacore::Double > &dphase, const VisBuffer &vb) |
More... | |
void | rotateUVW (casacore::Matrix< casacore::Double > &uvw, casacore::Vector< casacore::Double > &dphase, const VisBuffer &vb) |
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 VisBuffer &vb) |
Refocus on a finite distance. More... | |
virtual casacore::Bool | isFourier () |
Can this FTMachine be represented by Fourier convolutions? More... | |
casacore::Bool | setSpw (casacore::Vector< casacore::Int > &spw, casacore::Bool validFrame) |
set spw for cube that will be used; 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... | |
void | setLocation (const casacore::MPosition &loc) |
set and get the location used for frame More... | |
casacore::MPosition & | getLocation () |
virtual void | setMovingSource (const casacore::String &sourcename) |
set a moving source aka planets or comets => adjust phase center on the fly for gridding More... | |
virtual void | setMovingSource (const casacore::MDirection &mdir) |
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 () |
virtual void | reset () |
reset stuff in an FTMachine More... | |
virtual void | setFreqInterpolation (const casacore::String &method) |
set frequency interpolation type More... | |
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 casacore::Cube < casacore::Int > | getSpwChanSelection () |
virtual void | setSpwFreqSelection (const casacore::Matrix< casacore::Double > &spwfreqs) |
virtual casacore::Matrix < casacore::Double > | getSpwFreqSelection () |
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 () |
Private Member Functions | |
void | ok () |
void | init () |
Private Attributes | |
FTMachine * | synMachine_p |
FTMachine * | sdMachine_p |
FTMachine * | lastMachine_p |
casacore::TempImage < casacore::Complex > * | sdImage_p |
Images for Synthesis and SD. More... | |
casacore::TempImage < casacore::Complex > * | synImage_p |
casacore::Float | sdScale_p |
casacore::Float | sdWeight_p |
An FTMachine for Gridding Single Dish data.
Public interface
FTMachine is a Machine for Fourier Transforms. GridBoth does Single Dish gridding in a similar way
The SkyEquation needs to be able to perform Fourier transforms on visibility data and to grid single dish data. GridBoth 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 GridBoth 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.
See the example for SkyModel.
Define an interface to allow efficient processing of chunks of visibility data
Definition at line 109 of file GridBoth.h.
casa::GridBoth::GridBoth | ( | SkyJones & | sj, |
casacore::Long | cachesize, | ||
casacore::Int | tilesize, | ||
casacore::String | sdConvType = "BOX" , |
||
casacore::String | synConvType = "SF" , |
||
casacore::Float | padding = 1.0 , |
||
casacore::Float | sdScale = 1.0 , |
||
casacore::Float | sdWeight = 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), 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.
casa::GridBoth::GridBoth | ( | SkyJones & | sj, |
casacore::Long | cachesize, | ||
casacore::Int | tilesize, | ||
casacore::MPosition | mLocation, | ||
casacore::String | sdConvType = "BOX" , |
||
casacore::String | synConvType = "SF" , |
||
casacore::Float | padding = 1.0 , |
||
casacore::Float | sdScale = 1.0 , |
||
casacore::Float | sdWeight = 1.0 |
||
) |
casa::GridBoth::GridBoth | ( | SkyJones & | sj, |
casacore::Long | cachesize, | ||
casacore::Int | tilesize, | ||
casacore::MPosition | mLocation, | ||
casacore::MDirection | mTangent, | ||
casacore::String | sdConvType = "BOX" , |
||
casacore::String | synConvType = "SF" , |
||
casacore::Float | padding = 1.0 , |
||
casacore::Float | sdScale = 1.0 , |
||
casacore::Float | sdWeight = 1.0 |
||
) |
casa::GridBoth::GridBoth | ( | const GridBoth & | other | ) |
Copy constructor.
casa::GridBoth::~GridBoth | ( | ) |
casa::GridBoth::GridBoth | ( | const casacore::RecordInterface & | stateRec | ) |
Construct from a casacore::Record containing the GridFT state.
|
virtual |
Has this operator changed since the last application?
Reimplemented from casa::FTMachine.
|
inlinevirtual |
Make the VB and VBStore interefaces for the interim re-factoring work.
Finally removed the VB interface.
Implements casa::FTMachine.
Definition at line 200 of file GridBoth.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::FTMachine.
|
virtual |
Finalize transform to Visibility plane: flushes the image cache and shows statistics if it is being used.
Implements casa::FTMachine.
|
virtual |
Reimplemented from casa::FTMachine.
|
virtual |
Get actual coherence from grid by degridding.
Implements casa::FTMachine.
|
virtual |
Get the final image: do the Fourier transform and grid-correct, then optionally normalize by the summed weights.
Implements casa::FTMachine.
|
virtual |
Get the final weights image.
Implements casa::FTMachine.
|
private |
|
virtual |
Initialize transform to Sky plane: initializes the image.
Implements casa::FTMachine.
|
virtual |
Initialize transform to Visibility plane using the image as a template.
The image is loaded and Fourier transformed.
Implements casa::FTMachine.
|
inlinevirtual |
Return the name of the machine.
Implements casa::FTMachine.
Definition at line 201 of file GridBoth.h.
|
inlinevirtual |
Reimplemented from casa::FTMachine.
Definition at line 183 of file GridBoth.h.
|
privatevirtual |
Reimplemented from casa::FTMachine.
|
virtual |
Put coherence to grid by gridding.
Implements casa::FTMachine.
|
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::FTMachine.
Definition at line 199 of file GridBoth.h.
|
virtual |
Save and restore the GridFT to and from a record.
Reimplemented from casa::FTMachine.
|
private |
Definition at line 207 of file GridBoth.h.
|
private |
Images for Synthesis and SD.
Definition at line 210 of file GridBoth.h.
|
private |
Definition at line 206 of file GridBoth.h.
|
private |
Definition at line 213 of file GridBoth.h.
|
private |
Definition at line 213 of file GridBoth.h.
|
private |
Definition at line 211 of file GridBoth.h.
|
private |
Definition at line 201 of file GridBoth.h.