#include <FTMachine.h>
Inheritance diagram for casa::FTMachine:

Part of API
FTMachine is a Machine for Fourier Transforms
The SkyEquation needs to be able to perform Fourier transforms on visibility data. FTMachine 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).
A simple example of a FTMachine is found in GridFT . See the example for SkyModel .
Define an interface to allow efficient processing of chunks of visibility data
Note that the image must be Complex. It must contain the Complex Stokes values (e.g. RR,RL,LR,LL). FTMachine uses the image coordinate system to determine mappings between the polarization and frequency values in the PagedImage and in the VisBuffer.
Definition at line 100 of file FTMachine.h.
Public Types | |
| enum | Type { OBSERVED, MODEL, CORRECTED, RESIDUAL, PSF, COVERAGE, N_types, DEFAULT } |
| Types of known Images that may be made using the makeImage method. More... | |
Public Member Functions | |
| FTMachine () | |
| FTMachine (const FTMachine &other) | |
| FTMachine & | operator= (const FTMachine &other) |
| virtual | ~FTMachine () |
| virtual void | initializeToVis (ImageInterface< Complex > &image, const VisBuffer &vb)=0 |
| Initialize transform to Visibility plane. | |
| virtual void | initializeToVis (ImageInterface< Complex > &image, const VisBuffer &vb, Array< Complex > &griddedVis, Vector< Double > &uvscale, UVWMachine *&uvwMachine) |
| virtual void | finalizeToVis ()=0 |
| Finalize transform to Visibility plane. | |
| virtual void | initializeToSky (ImageInterface< Complex > &image, Matrix< Float > &weight, const VisBuffer &vb)=0 |
| Initialize transform to Sky plane. | |
| virtual void | initializeToSky (ImageInterface< Complex > &image, Matrix< Float > &weight, const VisBuffer &vb, Vector< Double > &uvscale, UVWMachine *&uvwmachine) |
| virtual void | finalizeToSky ()=0 |
| Finalize transform to Sky plane. | |
| virtual void | finalizeToSky (ImageInterface< Complex > &iimage) |
| virtual void | get (VisBuffer &vb, Int row=-1)=0 |
| Get actual coherence from grid. | |
| virtual void | get (VisBuffer &vb, Cube< Complex > °rid, Array< Complex > &griddedVis, Vector< Double > &scale, UVWMachine *uvwMachine, Int row=-1) |
| Get the coherence from modelImage return it in the degrid cube. | |
| virtual void | put (const VisBuffer &vb, Int row=-1, Bool dopsf=False, FTMachine::Type type=FTMachine::OBSERVED, const Matrix< Float > &imweight=Matrix< Float >(0, 0))=0 |
| Put coherence to grid. | |
| virtual void | put (const VisBuffer &vb, TempImage< Complex > &image, Vector< Double > &scale, Int row=-1, UVWMachine *uvwMachine=0, Bool dopsf=False) |
| virtual ImageInterface< Complex > & | getImage (Matrix< Float > &, Bool normalize=True)=0 |
| Get the final image. | |
| virtual void | getWeightImage (ImageInterface< Float > &, Matrix< Float > &)=0 |
| Get the final weights image. | |
| virtual void | getFluxImage (ImageInterface< Float > &image) |
| Get a flux (divide by this to get a flux density correct image) image if there is one. | |
| virtual void | makeImage (FTMachine::Type type, VisSet &vs, ImageInterface< Complex > &image, Matrix< Float > &weight) |
| Make the entire image. | |
| virtual void | makeImage (FTMachine::Type type, ROVisibilityIterator &vi, ImageInterface< Complex > &image, Matrix< Float > &weight) |
| Make the entire image using a ROVisIter. | |
| void | rotateUVW (Matrix< Double > &uvw, Vector< Double > &dphase, const VisBuffer &vb) |
| Rotate the uvw from the observed phase center to the desired phase center. | |
| void | refocus (Matrix< Double > &uvw, const Vector< Int > &ant1, const Vector< Int > &ant2, Vector< Double > &dphase, const VisBuffer &vb) |
| Refocus on a finite distance. | |
| virtual Bool | toRecord (String &error, RecordInterface &outRecord, Bool withImage=False) |
| Save and restore the FTMachine to and from a record. | |
| virtual Bool | fromRecord (String &error, const RecordInterface &inRecord) |
| virtual Bool | changed (const VisBuffer &vb) |
| Has this operator changed since the last application? | |
| virtual Bool | isFourier () |
| Can this FTMachine be represented by Fourier convolutions? | |
| Bool | setSpw (Vector< Int > &spw, Bool validFrame) |
| set spw for cube that will be used; | |
| virtual void | setNoPadding (Bool nopad) |
| To make sure no padding is used in certain gridders. | |
| virtual String | name () |
| Return the name of the machine. | |
| void | setLocation (const MPosition &loc) |
| set and get the location used for frame | |
| MPosition & | getLocation () |
| virtual void | setMovingSource (const String &sourcename) |
| set a moving source aka planets or comets => adjust phase center on the fly for gridding | |
| virtual void | setMovingSource (const MDirection &mdir) |
| virtual void | reset () |
| reset stuff in an FTMachine | |
| virtual void | setFreqInterpolation (const String &method) |
| set frequency interpolation type | |
| virtual void | setPointingDirColumn (const String &column="DIRECTION") |
| tell ftmachine which Pointing table column to use for Direction Mosaic or Single dish ft use this for example | |
| virtual String | getPointingDirColumnInUse () |
Protected Member Functions | |
| LogIO & | logIO () |
| void | initMaps (const VisBuffer &vb) |
| virtual void | ok () |
| virtual void | gridOk (Int gridsupport) |
| check if image is big enough for gridding | |
| Bool | matchChannel (const Int &spw, const VisBuffer &vb) |
| Bool | matchAllSpwChans (const VisBuffer &vb) |
| redo all spw chan match especially if ms has changed underneath | |
| virtual Bool | interpolateFrequencyTogrid (const VisBuffer &vb, const Matrix< Float > &wt, Cube< Complex > &data, Cube< Int > &flag, Matrix< Float > &weight, FTMachine::Type type=FTMachine::OBSERVED) |
| interpolate visibility data of vb to grid frequency definition flag will be set the one as described in interpolateArray1D return False if no interpolation is done. | |
| virtual Bool | interpolateFrequencyFromgrid (VisBuffer &vb, Cube< Complex > &data, FTMachine::Type type=FTMachine::MODEL) |
| degridded data interpolated back onto visibilities | |
| virtual void | getInterpolateArrays (const VisBuffer &vb, Cube< Complex > &data, Cube< Int > &flag) |
| Interpolate visibilities to be degridded upon. | |
Protected Attributes | |
| LogIO | logIO_p |
| ImageInterface< Complex > * | image |
| UVWMachine * | uvwMachine_p |
| MeasFrame | mFrame_p |
| Bool | tangentSpecified_p |
| Direction of desired tangent plane. | |
| MDirection | mTangent_p |
| MDirection | mImage_p |
| MDirection | movingDir_p |
| moving source stuff | |
| Bool | fixMovingSource_p |
| MDirection | firstMovingDir_p |
| Double | distance_p |
| uInt | nAntenna_p |
| Int | lastFieldId_p |
| Int | lastMSId_p |
| Matrix< Double > | sumWeight |
| Sum of weights per polarization and per chan. | |
| Int | nx |
| Sizes. | |
| Int | ny |
| Int | npol |
| Int | nchan |
| Int | nvischan |
| Int | nvispol |
| Vector< Int > | chanMap |
| Maps of channels and polarization. | |
| Vector< Int > | polMap |
| Bool | isIOnly |
| Is Stokes I only? iso XX,XY,YX,YY or LL,LR,RL,RR. | |
| MPosition | mLocation_p |
| Default Position used for phase rotations. | |
| Bool | doUVWRotation_p |
| Set if uvwrotation is necessary. | |
| Block< Vector< Int > > | multiChanMap_p |
| setup multiple spectral window for cubes | |
| Vector< Int > | selectedSpw_p |
| Vector< Int > | nVisChan_p |
| SpectralCoordinate | spectralCoord_p |
| Private variables needed for spectral frame conversion. | |
| Vector< Bool > | doConversion_p |
| Bool | freqFrameValid_p |
| Vector< Float > | imageFreq_p |
| Vector< Double > | interpVisFreq_p |
| InterpolateArray1D< Float, Complex >::InterpolationMethod | freqInterpMethod_p |
| String | pointingDirCol_p |
Private Member Functions | |
| void | swapyz (Cube< Complex > &out, const Cube< Complex > &in) |
| Some temporary wasteful function for swapping axes because we don't Interpolation along the second axis. | |
| void | swapyz (Cube< Bool > &out, const Cube< Bool > &in) |
Types of known Images that may be made using the makeImage method.
Definition at line 105 of file FTMachine.h.
| casa::FTMachine::FTMachine | ( | ) |
| casa::FTMachine::FTMachine | ( | const FTMachine & | other | ) |
| virtual casa::FTMachine::~FTMachine | ( | ) | [virtual] |
| virtual void casa::FTMachine::initializeToVis | ( | ImageInterface< Complex > & | image, | |
| const VisBuffer & | vb | |||
| ) | [pure virtual] |
Initialize transform to Visibility plane.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::initializeToVis | ( | ImageInterface< Complex > & | image, | |
| const VisBuffer & | vb, | |||
| Array< Complex > & | griddedVis, | |||
| Vector< Double > & | uvscale, | |||
| UVWMachine *& | uvwMachine | |||
| ) | [inline, virtual] |
Definition at line 129 of file FTMachine.h.
| virtual void casa::FTMachine::finalizeToVis | ( | ) | [pure virtual] |
Finalize transform to Visibility plane.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::initializeToSky | ( | ImageInterface< Complex > & | image, | |
| Matrix< Float > & | weight, | |||
| const VisBuffer & | vb | |||
| ) | [pure virtual] |
Initialize transform to Sky plane.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::PBMosaicFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::initializeToSky | ( | ImageInterface< Complex > & | image, | |
| Matrix< Float > & | weight, | |||
| const VisBuffer & | vb, | |||
| Vector< Double > & | uvscale, | |||
| UVWMachine *& | uvwmachine | |||
| ) | [inline, virtual] |
Definition at line 139 of file FTMachine.h.
| virtual void casa::FTMachine::finalizeToSky | ( | ) | [pure virtual] |
Finalize transform to Sky plane.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::PBMosaicFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::finalizeToSky | ( | ImageInterface< Complex > & | iimage | ) | [inline, virtual] |
Definition at line 146 of file FTMachine.h.
| virtual void casa::FTMachine::get | ( | VisBuffer & | vb, | |
| Int | row = -1 | |||
| ) | [pure virtual] |
Get actual coherence from grid.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::get | ( | VisBuffer & | vb, | |
| Cube< Complex > & | degrid, | |||
| Array< Complex > & | griddedVis, | |||
| Vector< Double > & | scale, | |||
| UVWMachine * | uvwMachine, | |||
| Int | row = -1 | |||
| ) | [inline, virtual] |
Get the coherence from modelImage return it in the degrid cube.
Is to be used especially when scratch columns are not present in ms and/or if memory is available to support such non non-disk operations.
Definition at line 155 of file FTMachine.h.
| virtual void casa::FTMachine::put | ( | const VisBuffer & | vb, | |
| Int | row = -1, |
|||
| Bool | dopsf = False, |
|||
| FTMachine::Type | type = FTMachine::OBSERVED, |
|||
| const Matrix< Float > & | imweight = Matrix< Float >(0, 0) | |||
| ) | [pure virtual] |
Put coherence to grid.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::put | ( | const VisBuffer & | vb, | |
| TempImage< Complex > & | image, | |||
| Vector< Double > & | scale, | |||
| Int | row = -1, |
|||
| UVWMachine * | uvwMachine = 0, |
|||
| Bool | dopsf = False | |||
| ) | [inline, virtual] |
Definition at line 165 of file FTMachine.h.
| virtual ImageInterface<Complex>& casa::FTMachine::getImage | ( | Matrix< Float > & | , | |
| Bool | normalize = True | |||
| ) | [pure virtual] |
Get the final image.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::PBMosaicFT, casa::SDGrid, and casa::WProjectFT.
| virtual void casa::FTMachine::getWeightImage | ( | ImageInterface< Float > & | , | |
| Matrix< Float > & | ||||
| ) | [pure virtual] |
Get the final weights image.
Implemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::SDGrid, and casa::WProjectFT.
| virtual void casa::FTMachine::getFluxImage | ( | ImageInterface< Float > & | image | ) | [inline, virtual] |
Get a flux (divide by this to get a flux density correct image) image if there is one.
Reimplemented in casa::MosaicFT.
Definition at line 178 of file FTMachine.h.
| virtual void casa::FTMachine::makeImage | ( | FTMachine::Type | type, | |
| VisSet & | vs, | |||
| ImageInterface< Complex > & | image, | |||
| Matrix< Float > & | weight | |||
| ) | [virtual] |
Make the entire image.
Reimplemented in casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, and casa::WProjectFT.
| virtual void casa::FTMachine::makeImage | ( | FTMachine::Type | type, | |
| ROVisibilityIterator & | vi, | |||
| ImageInterface< Complex > & | image, | |||
| Matrix< Float > & | weight | |||
| ) | [virtual] |
Make the entire image using a ROVisIter.
| void casa::FTMachine::rotateUVW | ( | Matrix< Double > & | uvw, | |
| Vector< Double > & | dphase, | |||
| const VisBuffer & | vb | |||
| ) |
Rotate the uvw from the observed phase center to the desired phase center.
| void casa::FTMachine::refocus | ( | Matrix< Double > & | uvw, | |
| const Vector< Int > & | ant1, | |||
| const Vector< Int > & | ant2, | |||
| Vector< Double > & | dphase, | |||
| const VisBuffer & | vb | |||
| ) |
Refocus on a finite distance.
| virtual Bool casa::FTMachine::toRecord | ( | String & | error, | |
| RecordInterface & | outRecord, | |||
| Bool | withImage = False | |||
| ) | [virtual] |
Save and restore the FTMachine to and from a record.
Reimplemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, and casa::WProjectFT.
| virtual Bool casa::FTMachine::fromRecord | ( | String & | error, | |
| const RecordInterface & | inRecord | |||
| ) | [virtual] |
Reimplemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, and casa::WProjectFT.
| virtual Bool casa::FTMachine::changed | ( | const VisBuffer & | vb | ) | [virtual] |
Has this operator changed since the last application?
Reimplemented in casa::GridBoth, casa::nPBWProjectFT, and casa::SDGrid.
| virtual Bool casa::FTMachine::isFourier | ( | ) | [inline, virtual] |
Can this FTMachine be represented by Fourier convolutions?
Reimplemented in casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, and casa::WProjectFT.
Definition at line 209 of file FTMachine.h.
| Bool casa::FTMachine::setSpw | ( | Vector< Int > & | spw, | |
| Bool | validFrame | |||
| ) |
set spw for cube that will be used;
| virtual void casa::FTMachine::setNoPadding | ( | Bool | nopad | ) | [inline, virtual] |
To make sure no padding is used in certain gridders.
Reimplemented in casa::GridFT.
Definition at line 215 of file FTMachine.h.
| virtual String casa::FTMachine::name | ( | ) | [inline, virtual] |
Return the name of the machine.
Reimplemented in casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::PBMosaicFT, and casa::WProjectFT.
Definition at line 219 of file FTMachine.h.
| void casa::FTMachine::setLocation | ( | const MPosition & | loc | ) |
set and get the location used for frame
| MPosition& casa::FTMachine::getLocation | ( | ) |
| virtual void casa::FTMachine::setMovingSource | ( | const String & | sourcename | ) | [virtual] |
set a moving source aka planets or comets => adjust phase center on the fly for gridding
| virtual void casa::FTMachine::setMovingSource | ( | const MDirection & | mdir | ) | [virtual] |
| virtual void casa::FTMachine::reset | ( | ) | [inline, virtual] |
reset stuff in an FTMachine
Reimplemented in casa::MosaicFT, and casa::nPBWProjectFT.
Definition at line 231 of file FTMachine.h.
| virtual void casa::FTMachine::setFreqInterpolation | ( | const String & | method | ) | [virtual] |
set frequency interpolation type
| virtual void casa::FTMachine::setPointingDirColumn | ( | const String & | column = "DIRECTION" |
) | [virtual] |
tell ftmachine which Pointing table column to use for Direction Mosaic or Single dish ft use this for example
| virtual String casa::FTMachine::getPointingDirColumnInUse | ( | ) | [virtual] |
| LogIO& casa::FTMachine::logIO | ( | ) | [protected] |
| void casa::FTMachine::initMaps | ( | const VisBuffer & | vb | ) | [protected] |
| virtual void casa::FTMachine::ok | ( | ) | [protected, virtual] |
Reimplemented in casa::GridBoth, casa::GridFT, casa::MosaicFT, casa::nPBWProjectFT, casa::SDGrid, casa::WProjectFT, and casa::FixVis.
| virtual void casa::FTMachine::gridOk | ( | Int | gridsupport | ) | [protected, virtual] |
check if image is big enough for gridding
| Bool casa::FTMachine::matchChannel | ( | const Int & | spw, | |
| const VisBuffer & | vb | |||
| ) | [protected] |
| Bool casa::FTMachine::matchAllSpwChans | ( | const VisBuffer & | vb | ) | [protected] |
redo all spw chan match especially if ms has changed underneath
| virtual Bool casa::FTMachine::interpolateFrequencyTogrid | ( | const VisBuffer & | vb, | |
| const Matrix< Float > & | wt, | |||
| Cube< Complex > & | data, | |||
| Cube< Int > & | flag, | |||
| Matrix< Float > & | weight, | |||
| FTMachine::Type | type = FTMachine::OBSERVED | |||
| ) | [protected, virtual] |
interpolate visibility data of vb to grid frequency definition flag will be set the one as described in interpolateArray1D return False if no interpolation is done.
\..for e.g for nearest case
| virtual Bool casa::FTMachine::interpolateFrequencyFromgrid | ( | VisBuffer & | vb, | |
| Cube< Complex > & | data, | |||
| FTMachine::Type | type = FTMachine::MODEL | |||
| ) | [protected, virtual] |
degridded data interpolated back onto visibilities
| virtual void casa::FTMachine::getInterpolateArrays | ( | const VisBuffer & | vb, | |
| Cube< Complex > & | data, | |||
| Cube< Int > & | flag | |||
| ) | [protected, virtual] |
Interpolate visibilities to be degridded upon.
| void casa::FTMachine::swapyz | ( | Cube< Complex > & | out, | |
| const Cube< Complex > & | in | |||
| ) | [private] |
Some temporary wasteful function for swapping axes because we don't Interpolation along the second axis.
\..will need to implement interpolation on y axis of a cube.
| void casa::FTMachine::swapyz | ( | Cube< Bool > & | out, | |
| const Cube< Bool > & | in | |||
| ) | [private] |
LogIO casa::FTMachine::logIO_p [protected] |
Definition at line 245 of file FTMachine.h.
ImageInterface<Complex>* casa::FTMachine::image [protected] |
UVWMachine* casa::FTMachine::uvwMachine_p [protected] |
Definition at line 251 of file FTMachine.h.
MeasFrame casa::FTMachine::mFrame_p [protected] |
Definition at line 253 of file FTMachine.h.
Bool casa::FTMachine::tangentSpecified_p [protected] |
MDirection casa::FTMachine::mTangent_p [protected] |
Definition at line 257 of file FTMachine.h.
MDirection casa::FTMachine::mImage_p [protected] |
Definition at line 259 of file FTMachine.h.
MDirection casa::FTMachine::movingDir_p [protected] |
Bool casa::FTMachine::fixMovingSource_p [protected] |
Definition at line 263 of file FTMachine.h.
MDirection casa::FTMachine::firstMovingDir_p [protected] |
Definition at line 264 of file FTMachine.h.
Double casa::FTMachine::distance_p [protected] |
Definition at line 267 of file FTMachine.h.
uInt casa::FTMachine::nAntenna_p [protected] |
Definition at line 269 of file FTMachine.h.
Int casa::FTMachine::lastFieldId_p [protected] |
Definition at line 271 of file FTMachine.h.
Int casa::FTMachine::lastMSId_p [protected] |
Definition at line 272 of file FTMachine.h.
Matrix<Double> casa::FTMachine::sumWeight [protected] |
Int casa::FTMachine::nx [protected] |
Int casa::FTMachine::ny [protected] |
Definition at line 282 of file FTMachine.h.
Int casa::FTMachine::npol [protected] |
Definition at line 282 of file FTMachine.h.
Int casa::FTMachine::nchan [protected] |
Definition at line 282 of file FTMachine.h.
Int casa::FTMachine::nvischan [protected] |
Definition at line 282 of file FTMachine.h.
Int casa::FTMachine::nvispol [protected] |
Definition at line 282 of file FTMachine.h.
Vector<Int> casa::FTMachine::chanMap [protected] |
Vector<Int> casa::FTMachine::polMap [protected] |
Bool casa::FTMachine::isIOnly [protected] |
MPosition casa::FTMachine::mLocation_p [protected] |
Default Position used for phase rotations.
Reimplemented in casa::FixVis.
Definition at line 291 of file FTMachine.h.
Referenced by casa::PBMosaicFT::setObservatoryLocation().
Bool casa::FTMachine::doUVWRotation_p [protected] |
Block<Vector <Int> > casa::FTMachine::multiChanMap_p [protected] |
Vector<Int> casa::FTMachine::selectedSpw_p [protected] |
Definition at line 304 of file FTMachine.h.
Vector<Int> casa::FTMachine::nVisChan_p [protected] |
Definition at line 305 of file FTMachine.h.
SpectralCoordinate casa::FTMachine::spectralCoord_p [protected] |
Vector<Bool> casa::FTMachine::doConversion_p [protected] |
Definition at line 334 of file FTMachine.h.
Bool casa::FTMachine::freqFrameValid_p [protected] |
Vector<Float> casa::FTMachine::imageFreq_p [protected] |
Definition at line 336 of file FTMachine.h.
Vector<Double> casa::FTMachine::interpVisFreq_p [protected] |
Definition at line 337 of file FTMachine.h.
InterpolateArray1D<Float,Complex>::InterpolationMethod casa::FTMachine::freqInterpMethod_p [protected] |
Definition at line 338 of file FTMachine.h.
String casa::FTMachine::pointingDirCol_p [protected] |
Definition at line 339 of file FTMachine.h.
1.5.1