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, Bool useImagingWeight=False)
 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, Float minweight=0., Bool clipminmax=False, Bool useImagingWeight=False)
 SDGrid (Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1, Bool useImagingWeight=False)
 SDGrid (MPosition &ml, Int cachesize, Int tilesize, String convType="BOX", Int userSupport=-1, Float minweight=0., Bool clipminmax=False, Bool useImagingWeight=False)
 SDGrid (MPosition &ml, Int cachesize, Int tilesize, String convType="TGAUSS", Float truncate=-1.0, Float gwidth=0.0, Float jwidth=0.0, Float minweight=0., Bool clipminmax=False, Bool useImagingWeight=False)
 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.
virtual void makeImage (FTMachine::Type type, ROVisibilityIterator &vi, ImageInterface< Complex > &image, Matrix< Float > &weight)
 Make the entire image using a ROVisIter.
ImageInterface< Complex > & getImage (Matrix< Float > &, Bool normalize=True)
 Get the final image: 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 ()
void clipMinMax ()
Int getIndex (const ROMSPointingColumns &mspc, const Double &time, const Double &interval=-1.0, const Int &antid=-1)
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)
void pickWeights (const VisBuffer &vb, Matrix< Float > &weight)

Private Attributes

SkyJonessj_p
 Vector<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< Float > wGriddedData
 Array for non-tiled gridding.
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
Float minWeight_p
Int lastIndex_p
Bool useImagingWeight_p
Int lastAntID_p
Int msId_p
Bool isSplineInterpolationReady
SDPosInterpolatorinterpolator
Bool clipminmax_
 for minmax clipping
Array< Complex > gmin_
Array< Complex > gmax_
Array< Float > wmin_
Array< Float > wmax_
Array< Int > npoints_

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,
Bool  useImagingWeight = False 
)

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 USEIMAGINGWEIGHT The parameter useImagingWeight in the constructors is to explicitly use vb.imagingweight while gridding, When doing just SD imaging then setting it to False is fine (in fact recommended as vb.imagingweight is set to zero if any pol is flagged this may change later .....today being 2014/08/06) when using it in conjuction with interferometer gridding then set useImagingWeight to True this is to allow for proper non natural weighting scheme while imaging

casa::SDGrid::SDGrid ( MPosition &  ml,
SkyJones sj,
Int  cachesize,
Int  tilesize,
String  convType = "BOX",
Int  userSupport = -1,
Float  minweight = 0.,
Bool  clipminmax = False,
Bool  useImagingWeight = False 
)
casa::SDGrid::SDGrid ( Int  cachesize,
Int  tilesize,
String  convType = "BOX",
Int  userSupport = -1,
Bool  useImagingWeight = False 
)
casa::SDGrid::SDGrid ( MPosition &  ml,
Int  cachesize,
Int  tilesize,
String  convType = "BOX",
Int  userSupport = -1,
Float  minweight = 0.,
Bool  clipminmax = False,
Bool  useImagingWeight = False 
)
casa::SDGrid::SDGrid ( MPosition &  ml,
Int  cachesize,
Int  tilesize,
String  convType = "TGAUSS",
Float  truncate = -1.0,
Float  gwidth = 0.0,
Float  jwidth = 0.0,
Float  minweight = 0.,
Bool  clipminmax = False,
Bool  useImagingWeight = False 
)
casa::SDGrid::SDGrid ( const SDGrid other  ) 

Copy constructor.

casa::SDGrid::~SDGrid (  ) 

Member Function Documentation

virtual Bool casa::SDGrid::changed ( const VisBuffer vb  )  [virtual]

Has this operator changed since the last application?

Reimplemented from casa::FTMachine.

void casa::SDGrid::clipMinMax (  )  [private]
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 213 of file SDGrid.h.

MDirection casa::SDGrid::directionMeas ( const ROMSPointingColumns &  mspc,
const Int &  index,
const Double &  time 
) [private]
MDirection casa::SDGrid::directionMeas ( const ROMSPointingColumns &  mspc,
const Int &  index 
) [private]

get the MDirection from a chosen column of pointing table

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: optionally normalize by the summed weights.

Implements casa::FTMachine.

Int casa::SDGrid::getIndex ( const ROMSPointingColumns &  mspc,
const Double &  time,
const Double &  interval = -1.0,
const Int &  antid = -1 
) [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 void casa::SDGrid::makeImage ( FTMachine::Type  type,
ROVisibilityIterator vi,
ImageInterface< Complex > &  image,
Matrix< Float > &  weight 
) [virtual]

Make the entire image using a ROVisIter.

.\. This is an overload for FTMachine version as SDGrid now does everything in memory so for large cube ..proceed by slices that fit in memory here.

Reimplemented from casa::FTMachine.

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 201 of file SDGrid.h.

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

Reimplemented from casa::FTMachine.

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

Assignment operator.

Reimplemented from casa::FTMachine.

void casa::SDGrid::pickWeights ( const VisBuffer vb,
Matrix< Float > &  weight 
) [private]
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 212 of file SDGrid.h.


Member Data Documentation

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

Array lattice.

Definition at line 247 of file SDGrid.h.

Int casa::SDGrid::cachesize [private]

Sizes.

Definition at line 238 of file SDGrid.h.

IPosition casa::SDGrid::centerLoc [private]

Useful IPositions.

Definition at line 258 of file SDGrid.h.

Bool casa::SDGrid::clipminmax_ [private]

for minmax clipping

Definition at line 297 of file SDGrid.h.

Vector<Float> casa::SDGrid::convFunc [private]

Definition at line 276 of file SDGrid.h.

Definition at line 277 of file SDGrid.h.

Int casa::SDGrid::convSize [private]

Definition at line 278 of file SDGrid.h.

Definition at line 279 of file SDGrid.h.

String casa::SDGrid::convType [private]

Definition at line 255 of file SDGrid.h.

DirectionCoordinate casa::SDGrid::directionCoord [private]

Definition at line 264 of file SDGrid.h.

Cube<Int> casa::SDGrid::flags [private]

Definition at line 274 of file SDGrid.h.

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

Definition at line 299 of file SDGrid.h.

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

Definition at line 298 of file SDGrid.h.

Float casa::SDGrid::gwidth_p [private]

Definition at line 283 of file SDGrid.h.

LatticeCache<Complex>* casa::SDGrid::imageCache [private]

Image cache.

Definition at line 234 of file SDGrid.h.

Definition at line 294 of file SDGrid.h.

Definition at line 293 of file SDGrid.h.

Bool casa::SDGrid::isTiled [private]

Is this tiled?

Definition at line 241 of file SDGrid.h.

Float casa::SDGrid::jwidth_p [private]

Definition at line 284 of file SDGrid.h.

Definition at line 290 of file SDGrid.h.

Definition at line 288 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 252 of file SDGrid.h.

Float casa::SDGrid::minWeight_p [private]

Definition at line 286 of file SDGrid.h.

Int casa::SDGrid::msId_p [private]

Definition at line 291 of file SDGrid.h.

Array<Int> casa::SDGrid::npoints_ [private]

Definition at line 302 of file SDGrid.h.

IPosition casa::SDGrid::offsetLoc [private]

Definition at line 258 of file SDGrid.h.

MDirection::Convert* casa::SDGrid::pointingToImage [private]

Definition at line 266 of file SDGrid.h.

Vector<SkyJones *> sj_p;.

Reimplemented from casa::FTMachine.

Definition at line 223 of file SDGrid.h.

Int casa::SDGrid::tilesize [private]

Definition at line 238 of file SDGrid.h.

Float casa::SDGrid::truncate_p [private]

Definition at line 282 of file SDGrid.h.

Definition at line 289 of file SDGrid.h.

Definition at line 280 of file SDGrid.h.

Lattice<Float>* casa::SDGrid::wArrayLattice [private]

Definition at line 248 of file SDGrid.h.

Array<Float> casa::SDGrid::wGriddedData [private]

Array for non-tiled gridding.

Definition at line 261 of file SDGrid.h.

ImageInterface<Float>* casa::SDGrid::wImage [private]

Storage for weights.

Definition at line 244 of file SDGrid.h.

LatticeCache<Float>* casa::SDGrid::wImageCache [private]

Definition at line 235 of file SDGrid.h.

Lattice<Float>* casa::SDGrid::wLattice [private]

Definition at line 253 of file SDGrid.h.

Array<Float> casa::SDGrid::wmax_ [private]

Definition at line 301 of file SDGrid.h.

Array<Float> casa::SDGrid::wmin_ [private]

Definition at line 300 of file SDGrid.h.

MDirection casa::SDGrid::worldPosMeas [private]

Definition at line 272 of file SDGrid.h.

Vector<Double> casa::SDGrid::xyPos [private]

Definition at line 268 of file SDGrid.h.

Vector<Double> casa::SDGrid::xyPosMovingOrig_p [private]

Original xypos of moving source.

Definition at line 270 of file SDGrid.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1