WideBandFT.h
Classes
- WideBandFT -- An FTMachine for Gridded Fourier transforms (full description)
Interface
- Public Members
- WideBandFT(Long cachesize, Int tilesize, String convType="SF", Float padding=1.0, Bool usezero=True)
- WideBandFT(Long cachesize, Int tilesize, String convType, MPosition mLocation, Float padding=1.0, Bool usezero=True)
- WideBandFT(Long cachesize, Int tilesize, String convType, MDirection mTangent, Float padding=1.0, Bool usezero=True)
- WideBandFT(Long cachesize, Int tilesize, String convType, MPosition mLocation, MDirection mTangent, Float passing=1.0, Bool usezero=True)
- WideBandFT(const RecordInterface& stateRec)
- WideBandFT(const WideBandFT &other)
- WideBandFT &operator=(const WideBandFT &other)
- ~WideBandFT()
- void initializeToVis(ImageInterface<Complex>& image, const Complex& vb)
- void wbinitializeToVis(ImageInterface<Complex>& image, Complex<ImageInterface<Complex>* > & iimagespec, const PtrBlock& vb, Int &model, Int ntaylor)
- void initializeToVis(ImageInterface<Complex>& image, const Complex& vb, VisBuffer<Complex>& griddedVis, Array<Double>& uvscale, Vector* &uvwMachine)
- void finalizeToVis()
- void initializeToSky(ImageInterface<Complex>& iimage, Complex<Float>& weight, const Matrix& vb)
- void wbinitializeToSky(ImageInterface<Complex>& iimage, Complex<ImageInterface<Complex>* > & iimagespec, PtrBlock<Float>& weight,const Matrix& vb, Int &model, Int ntaylor)
- void initializeToSky(ImageInterface<Complex>& image, Complex<Float>& weight, const Matrix& vb, VisBuffer<Double>& uvscale, Vector* & uvwmachine)
- void finalizeToSky()
- void finalizeToSky(ImageInterface<Complex>& iimage)
- void get(VisBuffer& vb, Int row=-1)
- virtual void get(VisBuffer& vb, Cube<Complex>& degrid, Array<Complex>& griddedVis, Array<Double>& scale, Vector *uvwMachine, Int row=-1)
- void put(const VisBuffer& vb, Int row=-1, Bool dopsf=False, FTMachine::Type type=FTMachine::OBSERVED)
- void put(const VisBuffer& vb, TempImage<Complex>& iimage, Vector<Double>& scale, Int row=-1, Vector *uvwMachine=0, Bool dopsf=False)
- void makeImage(FTMachine::Type type, VisSet& vs, ImageInterface<Complex>& image, Complex<Float>& weight)
- ImageInterface<Complex>& wbgetImage(Complex<ImageInterface<Complex>* > & inpimagespec, PtrBlock<Float>&, const Bool normalize=True, Int &model=0, Int ntaylor=1)
- ImageInterface<Complex>& getImage(Complex<Float>&, const 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 isFourier()
- virtual void setNoPadding(Bool nopad)
- virtual String name()
- Bool modifyWeights(const VisBuffer& vb, Matrix<Float> &specwts, Float power)
- Bool modifySpecModelVis(const VisBuffer& vb, Cube<Complex> &specvis, Float power)
- Protected Members
- Array<Complex>* getDataPointer(const IPosition&, Bool)
- void ok()
- void init()
- Bool recordOnGrid(const VisBuffer& vb, Int rownr) const
Prerequisite
Etymology
FTMachine is a Machine for Fourier Transforms. WideBandFT does
Grid-based Fourier transforms.
Synopsis
The SkyEquation needs to be able
to perform Fourier transforms on visibility data. WideBandFT
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 WideBandFT 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.
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
WideBandFT(Long cachesize, Int tilesize, String convType="SF", Float padding=1.0, Bool usezero=True)
WideBandFT(Long cachesize, Int tilesize, String convType, MPosition mLocation, Float padding=1.0, Bool usezero=True)
WideBandFT(Long cachesize, Int tilesize, String convType, MDirection mTangent, Float padding=1.0, Bool usezero=True)
WideBandFT(Long cachesize, Int tilesize, String convType, MPosition mLocation, MDirection mTangent, Float passing=1.0, Bool usezero=True)
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.
WideBandFT(const RecordInterface& stateRec)
Construct from a Record containing the WideBandFT state
WideBandFT(const WideBandFT &other)
Copy constructor
WideBandFT &operator=(const WideBandFT &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.
void wbinitializeToVis(ImageInterface<Complex>& image, Complex<ImageInterface<Complex>* > & iimagespec, const PtrBlock& vb, Int &model, Int ntaylor)
void wbinitializeToVis(ImageInterface& image,
ImageInterface& image1,
const VisBuffer& vb);
void initializeToVis(ImageInterface<Complex>& image, const Complex& vb, VisBuffer<Complex>& griddedVis, Array<Double>& uvscale, Vector* &uvwMachine)
This version returns the gridded vis...should be used in conjunction
with the version of 'get' that needs the gridded visdata
Finalize transform to Visibility plane: flushes the image
cache and shows statistics if it is being used.
void initializeToSky(ImageInterface<Complex>& iimage, Complex<Float>& weight, const Matrix& vb)
Initialize transform to Sky plane: initializes the image
void wbinitializeToSky(ImageInterface<Complex>& iimage, Complex<ImageInterface<Complex>* > & iimagespec, PtrBlock<Float>& weight,const Matrix& vb, Int &model, Int ntaylor)
void wbinitializeToSky(ImageInterface& iimage,
ImageInterface& iimage1, Matrix& weight,
const VisBuffer& vb);
void initializeToSky(ImageInterface<Complex>& image, Complex<Float>& weight, const Matrix& vb, VisBuffer<Double>& uvscale, Vector* & uvwmachine)
Finalize transform to Sky plane: flushes the image
cache and shows statistics if it is being used. DOES NOT
DO THE FINAL TRANSFORM!
void finalizeToSky(ImageInterface<Complex>& iimage)
Get actual coherence from grid by degridding
virtual void get(VisBuffer& vb, Cube<Complex>& degrid, Array<Complex>& griddedVis, Array<Double>& scale, Vector *uvwMachine, Int row=-1)
Get the coherence from grid return it in the degrid
is used especially when scratch columns are not
present in ms.
Put coherence to grid by gridding.
void put(const VisBuffer& vb, TempImage<Complex>& iimage, Vector<Double>& scale, Int row=-1, Vector *uvwMachine=0, Bool dopsf=False)
Make the entire image
ImageInterface<Complex>& wbgetImage(Complex<ImageInterface<Complex>* > & inpimagespec, PtrBlock<Float>&, const Bool normalize=True, Int &model=0, Int ntaylor=1)
Get the final image: do the Fourier transform and
grid-correct, then optionally normalize by the summed weights
//ImageInterface& wbgetImage(PtrBlock* > & inpimagespec, Matrix&, const Bool normalize=True);
ImageInterface<Complex>& getImage(Complex<Float>&, const Bool normalize=True)
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 WideBandFT to and from a record
virtual Bool fromRecord(String& error, const RecordInterface& inRec)
Can this FTMachine be represented by Fourier convolutions?
virtual void setNoPadding(Bool nopad)
Modify Weights for Spectral psfs.
Get the appropriate data pointer
void ok()
Is this record on Grid? check both ends. This assumes that the
ends bracket the middle