casa
$Rev:20696$
|
An FTMachine for Gridding Single Dish data. More...
#include <SDGrid.h>
Public Member Functions | |
SDGrid (SkyJones &sj, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1) | |
Constructor: cachesize is the size of the cache in words (e.g. | |
SDGrid (MPosition &ml, SkyJones &sj, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1) | |
SDGrid (Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1) | |
SDGrid (MPosition &ml, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1) | |
SDGrid (MPosition &ml, Int cachesize, Int tilesize, String convType="TGAUSS", Float truncate=-1.0, Float gwidth=0.0, Float jwidth=0.0) | |
SDGrid (const SDGrid &other) | |
Copy constructor. | |
SDGrid & | operator= (const SDGrid &other) |
Assignment operator. | |
~SDGrid () | |
void | initializeToVis (ImageInterface< Complex > &image, const VisBuffer &vb) |
Initialize transform to Visibility plane using the image as a template. | |
void | finalizeToVis () |
Finalize transform to Visibility plane: flushes the image cache and shows statistics if it is being used. | |
void | initializeToSky (ImageInterface< Complex > &image, Matrix< Float > &weight, const VisBuffer &vb) |
Initialize transform to Sky plane: initializes the image. | |
void | finalizeToSky () |
Finalize transform to Sky plane: flushes the image cache and shows statistics if it is being used. | |
void | get (VisBuffer &vb, Int row=-1) |
Get actual coherence from grid by degridding. | |
void | put (const VisBuffer &vb, Int row=-1, Bool dopsf=False, FTMachine::Type type=FTMachine::OBSERVED) |
Put coherence to grid by gridding. | |
ImageInterface< Complex > & | getImage (Matrix< Float > &, Bool normalize=True) |
Get the final image: do the Fourier transform and grid-correct, then optionally normalize by the summed weights. | |
virtual void | normalizeImage (Lattice< Complex > &, const Matrix< Double > &, Lattice< Float > &, Bool) |
void | getWeightImage (ImageInterface< Float > &, Matrix< Float > &) |
Get the final weights image. | |
virtual Bool | changed (const VisBuffer &vb) |
Has this operator changed since the last application? | |
virtual void | setMiscInfo (const Int qualifier) |
set the order of the Taylor term for MFS this is to tell A-Projection to qualify the accumulated avgPB for each Taylor term in the CFCache. | |
virtual void | ComputeResiduals (VisBuffer &, Bool) |
Make the VB and VBStore interefaces for the interim re-factoring work. | |
virtual String | name () const |
Return the name of the machine. | |
Private Member Functions | |
void | findPBAsConvFunction (const ImageInterface< Complex > &image, const VisBuffer &vb) |
Find the Primary beam and convert it into a convolution buffer. | |
Array< Complex > * | getDataPointer (const IPosition &, Bool) |
Get the appropriate data pointer. | |
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) |
MDirection | directionMeas (const ROMSPointingColumns &mspc, const Int &index) |
get the MDirection from a chosen column of pointing table | |
MDirection | directionMeas (const ROMSPointingColumns &mspc, const Int &index, const Double &time) |
MDirection | interpolateDirectionMeas (const ROMSPointingColumns &mspc, const Double &time, const Int &index, const Int &index1, const Int &index2) |
Private Attributes | |
SkyJones * | sj_p |
LatticeCache< Complex > * | imageCache |
Image cache. | |
LatticeCache< Float > * | wImageCache |
Int | cachesize |
Sizes. | |
Int | tilesize |
Bool | isTiled |
Is this tiled? | |
ImageInterface< Float > * | wImage |
Storage for weights. | |
Lattice< Complex > * | arrayLattice |
Array lattice. | |
Lattice< Float > * | wArrayLattice |
Lattice< Complex > * | lattice |
Lattice. | |
Lattice< Float > * | wLattice |
String | convType |
IPosition | centerLoc |
Useful IPositions. | |
IPosition | offsetLoc |
Array< Complex > | griddedData |
Array for non-tiled gridding. | |
Array< Float > | wGriddedData |
DirectionCoordinate | directionCoord |
MDirection::Convert * | pointingToImage |
Vector< Double > | xyPos |
Vector< Double > | xyPosMovingOrig_p |
Original xypos of moving source. | |
MDirection | worldPosMeas |
Cube< Int > | flags |
Vector< Float > | convFunc |
Int | convSampling |
Int | convSize |
Int | convSupport |
Int | userSetSupport_p |
Float | truncate_p |
Float | gwidth_p |
Float | jwidth_p |
Int | lastIndex_p |
An FTMachine for Gridding Single Dish data.
Public interface
FTMachine is a Machine for Fourier Transforms. SDGrid 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. 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.
See the example for SkyModel .
Define an interface to allow efficient processing of chunks of visibility data
casa::SDGrid::SDGrid | ( | SkyJones & | sj, |
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
casa::SDGrid::SDGrid | ( | MPosition & | ml, |
SkyJones & | sj, | ||
Int | cachesize, | ||
Int | tilesize, | ||
String | convType = "BOX" , |
||
Int | userSupport = -1 |
||
) |
casa::SDGrid::SDGrid | ( | Int | cachesize, |
Int | tilesize, | ||
String | convType = "BOX" , |
||
Int | userSupport = -1 |
||
) |
casa::SDGrid::SDGrid | ( | MPosition & | ml, |
Int | cachesize, | ||
Int | tilesize, | ||
String | convType = "BOX" , |
||
Int | userSupport = -1 |
||
) |
casa::SDGrid::SDGrid | ( | MPosition & | ml, |
Int | cachesize, | ||
Int | tilesize, | ||
String | convType = "TGAUSS" , |
||
Float | truncate = -1.0 , |
||
Float | gwidth = 0.0 , |
||
Float | jwidth = 0.0 |
||
) |
casa::SDGrid::SDGrid | ( | const SDGrid & | other | ) |
Copy constructor.
virtual Bool casa::SDGrid::changed | ( | const VisBuffer & | vb | ) | [virtual] |
Has this operator changed since the last application?
Reimplemented from casa::FTMachine.
virtual void casa::SDGrid::ComputeResiduals | ( | VisBuffer & | vb, |
Bool | useCorrected | ||
) | [inline, virtual] |
Make the VB and VBStore interefaces for the interim re-factoring work.
Finally removed the VB interface.
Implements casa::FTMachine.
MDirection casa::SDGrid::directionMeas | ( | const ROMSPointingColumns & | mspc, |
const Int & | index | ||
) | [private] |
get the MDirection from a chosen column of pointing table
MDirection casa::SDGrid::directionMeas | ( | const ROMSPointingColumns & | mspc, |
const Int & | index, | ||
const Double & | time | ||
) | [private] |
void casa::SDGrid::finalizeToSky | ( | ) | [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.
void casa::SDGrid::finalizeToVis | ( | ) | [virtual] |
Finalize transform to Visibility plane: flushes the image cache and shows statistics if it is being used.
Implements casa::FTMachine.
void casa::SDGrid::findPBAsConvFunction | ( | const ImageInterface< Complex > & | image, |
const VisBuffer & | vb | ||
) | [private] |
Find the Primary beam and convert it into a convolution buffer.
void casa::SDGrid::get | ( | VisBuffer & | vb, |
Int | row = -1 |
||
) | [virtual] |
Get actual coherence from grid by degridding.
Implements casa::FTMachine.
Array<Complex>* casa::SDGrid::getDataPointer | ( | const IPosition & | , |
Bool | |||
) | [private] |
Get the appropriate data pointer.
ImageInterface<Complex>& casa::SDGrid::getImage | ( | Matrix< Float > & | , |
Bool | normalize = True |
||
) | [virtual] |
Get the final image: do the Fourier transform and grid-correct, then optionally normalize by the summed weights.
Implements casa::FTMachine.
Int casa::SDGrid::getIndex | ( | const ROMSPointingColumns & | mspc, |
const Double & | time, | ||
const Double & | interval | ||
) | [private] |
Array<Float>* casa::SDGrid::getWDataPointer | ( | const IPosition & | , |
Bool | |||
) | [private] |
void casa::SDGrid::getWeightImage | ( | ImageInterface< Float > & | , |
Matrix< Float > & | |||
) | [virtual] |
Get the final weights image.
Implements casa::FTMachine.
Bool casa::SDGrid::getXYPos | ( | const VisBuffer & | vb, |
Int | row | ||
) | [private] |
void casa::SDGrid::init | ( | ) | [private] |
void casa::SDGrid::initializeToSky | ( | ImageInterface< Complex > & | image, |
Matrix< Float > & | weight, | ||
const VisBuffer & | vb | ||
) | [virtual] |
Initialize transform to Sky plane: initializes the image.
Implements casa::FTMachine.
void casa::SDGrid::initializeToVis | ( | ImageInterface< Complex > & | image, |
const VisBuffer & | vb | ||
) | [virtual] |
Initialize transform to Visibility plane using the image as a template.
The image is loaded and Fourier transformed.
Implements casa::FTMachine.
MDirection casa::SDGrid::interpolateDirectionMeas | ( | const ROMSPointingColumns & | mspc, |
const Double & | time, | ||
const Int & | index, | ||
const Int & | index1, | ||
const Int & | index2 | ||
) | [private] |
virtual String casa::SDGrid::name | ( | ) | const [virtual] |
Return the name of the machine.
Implements casa::FTMachine.
virtual void casa::SDGrid::normalizeImage | ( | Lattice< Complex > & | , |
const Matrix< Double > & | , | ||
Lattice< Float > & | , | ||
Bool | |||
) | [inline, virtual] |
Reimplemented from casa::FTMachine.
void casa::SDGrid::ok | ( | ) | [private, virtual] |
Reimplemented from casa::FTMachine.
void casa::SDGrid::put | ( | const VisBuffer & | vb, |
Int | row = -1 , |
||
Bool | dopsf = False , |
||
FTMachine::Type | type = FTMachine::OBSERVED |
||
) | [virtual] |
Put coherence to grid by gridding.
Implements casa::FTMachine.
virtual void casa::SDGrid::setMiscInfo | ( | const Int | qualifier | ) | [inline, virtual] |
set the order of the Taylor term for MFS this is to tell A-Projection to qualify the accumulated avgPB for each Taylor term in the CFCache.
Implements casa::FTMachine.
Lattice<Complex>* casa::SDGrid::arrayLattice [private] |
Int casa::SDGrid::cachesize [private] |
IPosition casa::SDGrid::centerLoc [private] |
Vector<Float> casa::SDGrid::convFunc [private] |
Int casa::SDGrid::convSampling [private] |
Int casa::SDGrid::convSize [private] |
Int casa::SDGrid::convSupport [private] |
String casa::SDGrid::convType [private] |
Cube<Int> casa::SDGrid::flags [private] |
Array<Complex> casa::SDGrid::griddedData [private] |
Float casa::SDGrid::gwidth_p [private] |
LatticeCache<Complex>* casa::SDGrid::imageCache [private] |
Bool casa::SDGrid::isTiled [private] |
Float casa::SDGrid::jwidth_p [private] |
Int casa::SDGrid::lastIndex_p [private] |
Lattice<Complex>* casa::SDGrid::lattice [private] |
IPosition casa::SDGrid::offsetLoc [private] |
MDirection::Convert* casa::SDGrid::pointingToImage [private] |
SkyJones* casa::SDGrid::sj_p [private] |
Int casa::SDGrid::tilesize [private] |
Float casa::SDGrid::truncate_p [private] |
Int casa::SDGrid::userSetSupport_p [private] |
Lattice<Float>* casa::SDGrid::wArrayLattice [private] |
Array<Float> casa::SDGrid::wGriddedData [private] |
ImageInterface<Float>* casa::SDGrid::wImage [private] |
LatticeCache<Float>* casa::SDGrid::wImageCache [private] |
Lattice<Float>* casa::SDGrid::wLattice [private] |
MDirection casa::SDGrid::worldPosMeas [private] |
Vector<Double> casa::SDGrid::xyPos [private] |
Vector<Double> casa::SDGrid::xyPosMovingOrig_p [private] |