GridBoth.h
Classes
- GridBoth -- An FTMachine for Gridding Single Dish data (full description)
Interface
- Public Members
- GridBoth(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, String sdConvType="BOX", String synConvType="SF", Float padding=1.0, Float sdScale=1.0, Float sdWeight=1.0)
- GridBoth(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, MPosition mLocation, String sdConvType="BOX", String synConvType="SF", Float padding=1.0, Float sdScale=1.0, Float sdWeight=1.0)
- GridBoth(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, MPosition mLocation, MDirection mTangent, String sdConvType="BOX", String synConvType="SF", Float padding=1.0, Float sdScale=1.0, Float sdWeight=1.0)
- GridBoth(const GridBoth &other)
- GridBoth &operator=(const GridBoth &other)
- ~GridBoth()
- GridBoth(const RecordInterface& stateRec)
- 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 toRecord(String& error, RecordInterface& outRec, Bool withImage=False)
- virtual Bool fromRecord(String& error, const RecordInterface& inRec)
- virtual Bool changed(const VisBuffer& vb)
- Private Members
- void ok()
- void init()
Prerequisite
Etymology
FTMachine is a Machine for Fourier Transforms. GridBoth 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.
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.
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
GridBoth(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, String sdConvType="BOX", String synConvType="SF", Float padding=1.0, Float sdScale=1.0, Float sdWeight=1.0)
GridBoth(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, MPosition mLocation, String sdConvType="BOX", String synConvType="SF", Float padding=1.0, Float sdScale=1.0, Float sdWeight=1.0)
GridBoth(MeasurementSet& ms, SkyJones& sj, Int cachesize, Int tilesize, MPosition mLocation, MDirection mTangent, String sdConvType="BOX", String synConvType="SF", Float padding=1.0, Float sdScale=1.0, 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.
GridBoth(const GridBoth &other)
Copy constructor
GridBoth &operator=(const GridBoth &other)
Assignment operator
GridBoth(const RecordInterface& stateRec)
Construct from a Record containing the GridFT state
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
virtual Bool toRecord(String& error, RecordInterface& outRec, Bool withImage=False)
Save and restore the GridFT to and from a record
virtual Bool fromRecord(String& error, const RecordInterface& inRec)
Has this operator changed since the last application?
void ok()