SDGrid.h
Classes
- SDGrid -- An FTMachine for Gridding Single Dish data (full description)
Interface
- Public Members
- SDGrid(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
- SDGrid(MeasurementSet& ms, MPosition& ml, SkyJones& sj, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
- SDGrid(MeasurementSet& ms, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
- SDGrid(MeasurementSet& ms, MPosition& ml, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
- SDGrid(const SDGrid &other)
- SDGrid &operator=(const SDGrid &other)
- ~SDGrid()
- void initializeToVis(ImageInterface<Complex>& image, const Complex& vb)
- void finalizeToVis()
- void initializeToSky(ImageInterface<Complex>& image, Complex<Float>& weight, const Matrix& vb)
- void finalizeToSky()
- void get(VisBuffer& vb, Int row=-1)
- void put(const VisBuffer& vb, Int row=-1, Bool dopsf=False, FTMachine::Type type=FTMachine::OBSERVED)
- ImageInterface<Complex>& getImage(Complex<Float>&, Bool normalize=True)
- void getWeightImage(ImageInterface<Float>&, Matrix<Float>&)
- virtual Bool changed(const VisBuffer& vb)
- Private Members
- void findPBAsConvFunction(const ImageInterface<Complex>& image, const Complex& vb)
- Array<Complex>* getDataPointer(const IPosition&, Bool)
- Array<Float>* getWDataPointer(const IPosition&, Bool)
- void ok()
- void init()
- Int getIndex(const ROMSPointingColumns& mspc, const Double& time, const Double& interval)
- Bool getXYPos(const VisBuffer& vb, Int row)
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
To Do
Deal with large VLA spectral line case
Member Description
SDGrid(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
SDGrid(MeasurementSet& ms, MPosition& ml, SkyJones& sj, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
SDGrid(MeasurementSet& ms, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
SDGrid(MeasurementSet& ms, MPosition& ml, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1)
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
SDGrid(const SDGrid &other)
Copy constructor
SDGrid &operator=(const SDGrid &other)
Assignment operator
void initializeToVis(ImageInterface<Complex>& image, const Complex& vb)
Initialize transform to Visibility plane using the image
as a template. The image is loaded and Fourier transformed.
Finalize transform to Visibility plane: flushes the image
cache and shows statistics if it is being used.
void initializeToSky(ImageInterface<Complex>& image, Complex<Float>& weight, const Matrix& vb)
Initialize transform to Sky plane: initializes the image
Finalize transform to Sky plane: flushes the image
cache and shows statistics if it is being used. DOES NOT
DO THE FINAL TRANSFORM!
Get actual coherence from grid by degridding
Put coherence to grid by gridding.
ImageInterface<Complex>& getImage(Complex<Float>&, Bool normalize=True)
Get the final image: do the Fourier transform and
grid-correct, then optionally normalize by the summed weights
void getWeightImage(ImageInterface<Float>&, Matrix<Float>&)
Get the final weights image
Has this operator changed since the last application?
void findPBAsConvFunction(const ImageInterface<Complex>& image, const Complex& vb)
Find the Primary beam and convert it into a convolution buffer
Get the appropriate data pointer
void ok()
Int getIndex(const ROMSPointingColumns& mspc, const Double& time, const Double& interval)