casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Member Functions | Private Attributes
casa::SDGrid Class Reference

An FTMachine for Gridding Single Dish data. More...

#include <SDGrid.h>

Inheritance diagram for casa::SDGrid:
casa::FTMachine

List of all members.

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.
SDGridoperator= (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

SkyJonessj_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< FloatwGriddedData
DirectionCoordinate directionCoord
MDirection::ConvertpointingToImage
Vector< DoublexyPos
Vector< DoublexyPosMovingOrig_p
 Original xypos of moving source.
MDirection worldPosMeas
Cube< Intflags
Vector< FloatconvFunc
Int convSampling
Int convSize
Int convSupport
Int userSetSupport_p
Float truncate_p
Float gwidth_p
Float jwidth_p
Int lastIndex_p

Detailed Description

An FTMachine for Gridding Single Dish data.

Intended use:

Public interface

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

Definition at line 118 of file SDGrid.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Definition at line 194 of file SDGrid.h.

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.

Definition at line 182 of file SDGrid.h.

void casa::SDGrid::ok ( ) [private, virtual]

Reimplemented from casa::FTMachine.

SDGrid& casa::SDGrid::operator= ( const SDGrid other)

Assignment operator.

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.

Definition at line 193 of file SDGrid.h.


Member Data Documentation

Lattice<Complex>* casa::SDGrid::arrayLattice [private]

Array lattice.

Definition at line 228 of file SDGrid.h.

Sizes.

Definition at line 219 of file SDGrid.h.

Useful IPositions.

Definition at line 239 of file SDGrid.h.

Definition at line 258 of file SDGrid.h.

Definition at line 259 of file SDGrid.h.

Definition at line 260 of file SDGrid.h.

Definition at line 261 of file SDGrid.h.

Definition at line 236 of file SDGrid.h.

Definition at line 246 of file SDGrid.h.

Definition at line 256 of file SDGrid.h.

Array<Complex> casa::SDGrid::griddedData [private]

Array for non-tiled gridding.

Definition at line 242 of file SDGrid.h.

Definition at line 265 of file SDGrid.h.

Image cache.

Definition at line 215 of file SDGrid.h.

Is this tiled?

Definition at line 222 of file SDGrid.h.

Definition at line 266 of file SDGrid.h.

Definition at line 268 of file SDGrid.h.

Lattice<Complex>* casa::SDGrid::lattice [private]

Lattice.

For non-tiled gridding, this will point to arrayLattice, whereas for tiled gridding, this points to the image

Definition at line 233 of file SDGrid.h.

Definition at line 239 of file SDGrid.h.

Definition at line 248 of file SDGrid.h.

Definition at line 204 of file SDGrid.h.

Definition at line 219 of file SDGrid.h.

Definition at line 264 of file SDGrid.h.

Definition at line 262 of file SDGrid.h.

Definition at line 229 of file SDGrid.h.

Definition at line 243 of file SDGrid.h.

Storage for weights.

Definition at line 225 of file SDGrid.h.

Definition at line 216 of file SDGrid.h.

Definition at line 234 of file SDGrid.h.

Definition at line 254 of file SDGrid.h.

Definition at line 250 of file SDGrid.h.

Original xypos of moving source.

Definition at line 252 of file SDGrid.h.


The documentation for this class was generated from the following file: