Imager.h

Classes

Imager -- Class that contains functions needed for imager (full description)

class Imager

Interface

Public Members
Imager()
Imager(MeasurementSet& ms, Bool compress=False)
Imager(MeasurementSet& ms, PGPlotter& pgplotter, Bool compress=False)
Imager(const Imager&)
Imager& operator=(const Imager&)
virtual ~Imager()
virtual Bool openSubTables()
virtual Bool lock()
virtual Bool unlock()
Bool selectDataChannel(VisSet& vs, Vector<Int>& spectralwindowids, String& dataMode, Vector<Int>& dataNchan, Vector<Int>& dataStart, Vector<Int>& dataStep, MRadialVelocity& mDataStart, MRadialVelocity& mDataStep)
virtual Bool checkCoord(CoordinateSystem& coordsys, String& imageName)
virtual void setImageParam(Int& nx, Int& ny, Int& npol, Int& nchan)
virtual void makeVisSet(VisSet* & vs, MeasurementSet& ms, Bool compress=False, Bool mosaicOrder=False)
virtual void makeVisSet(MeasurementSet& ms, Bool compress=False, Bool mosaicOrder=False)
virtual void writeHistory(LogIO& os)
virtual void writeCommand(LogIO& os)
Bool makeEmptyImage(CoordinateSystem& imageCoord, String& name, Int fieldID=0)
Bool makePBImage(ImageInterface<Float>& pbImage, Bool useSymmetricBeam=True)
Bool makePBImage(const CoordinateSystem& imageCoord, const String& telescopeName, const String& diskPBName, Bool useSymmetricBeam=True)
Bool makePBImage(const CoordinateSystem& imageCoord, const Table& vpTable, const String& diskPBName)
Bool makePBImage(const Table& vpTable, ImageInterface<Float>& pbImage)
Bool makePBImage(const CoordinateSystem& imageCoord, PBMath& pbMath, const String& diskPBName)
Bool makePBImage(PBMath& pbMath, ImageInterface<Float>& pbImage)
void setObsInfo(ObsInfo& obsinfo)
ObsInfo& latestObsInfo()
Bool open(MeasurementSet &thems, Bool compress=False)
Bool close()
String name() const
virtual Bool setimage(const Int nx, const Int ny, const Quantity& cellx, const Quantity& celly, const String& stokes, Bool doShift, const String& phaseCenter, const Quantity& shiftx, const Quantity& shifty, const String& mode, const Int nchan, const Int start, const Int step, const MDirection& mStart, const MDirection& mStep, const MRadialVelocity<Int>& spectralwindowids, const Int fieldid, const Int facets, const Quantity& distance, const Float &paStep, const Float &pbLimit)
virtual Bool setDataPerMS(const String& msname, const String& mode, const Vector<Int>& nchan, const Vector<Int>& start, const Vector<Int>& step, const Vector<Int>& spectralwindowids, const Vector<Int>& fieldid, const String& msSelect="")
Bool setdata(const String& mode, const Vector<Int>& nchan, const Vector<Int>& start, const Vector<Int>& step, const MRadialVelocity& mStart, const MRadialVelocity& mStep, const Vector<Int>& spectralwindowids, const Vector<Int>& fieldid, const String& msSelect="")
Bool setoptions(const String& ftmachine, const Long cache, const Int tile, const String& gridfunction, const MPosition& mLocation, const Float padding, const Bool usemodelcol=True, const Int wprojplanes=1, const String& epJTableName="", const Bool applyPointingOffsets=True, const Bool doPointingCorrection=True, const String& cfCacheDirName="")
Bool setsdoptions(const Float scale, const Float weight, const Int convsupport=-1)
Bool setvp(const Bool dovp, const Bool defaultVP, const String& vpTable, const Bool doSquint, const Quantity &parAngleInc, const Quantity &skyPosThreshold, String defaultTel="")
Bool settaylorterms(const Int intaylor)
Bool advise(const Bool takeAdvice, const Float amplitudeloss, const Quantity& fieldOfView, Quantity& cell, Int& npixels, Int& facets, MDirection& phaseCenter)
Bool summary()
String state()
Bool imagecoordinates(CoordinateSystem& coordInfo)
IPosition imageshape() const
Bool weight(const String& algorithm, const String& rmode, const Quantity& noise, const Double robust, const Quantity& fieldofview, const Int npixels)
Bool filter(const String& type, const Quantity& bmaj, const Quantity& bmin, const Quantity& bpa)
Bool uvrange(const Double& uvmin, const Double& uvmax)
Bool sensitivity(Quantity& pointsourcesens, Double& relativesens, Double& sumwt)
Bool makeimage(const String& type, const String& imageName)
Bool makeimage(const String& type, const String& imageName, const String& complexImageName)
Bool boxmask(const String& mask, const Vector<Int>& blc, const Vector<Int>& trc, const Float value)
Bool clipimage(const String& image, const Quantity& threshold)
Bool mask(const String& mask, const String& imageName, const Quantity& threshold)
Bool restore(const Vector<String>& model, const String& complist, const Vector<String>& image, const Vector<String>& residual)
Bool setbeam(const Quantity& bmaj, const Quantity& bmin, const Quantity& bpa)
Bool residual(const Vector<String>& model, const String& complist, const Vector<String>& image)
Bool approximatepsf(const Vector<String>& model, const Vector<String>& psf)
Bool smooth(const Vector<String>& model, const Vector<String>& image, Bool usefit, Quantity& bmaj, Quantity& bmin, Quantity& bpa, Bool normalizeVolume)
Bool clean(const String& algorithm, const Int niter, const Float gain, const Quantity& threshold, const Bool displayProgress, const Vector<String>& model, const Vector<Bool>& fixed, const String& complist, const Vector<String>& mask, const Vector<String>& restored, const Vector<String>& residual)
Bool mem(const String& algorithm, const Int niter, const Quantity& sigma, const Quantity& targetflux, const Bool constrainflux, const Bool displayProgress, const Vector<String>& model, const Vector<Bool>& fixed, const String& complist, const Vector<String>& prior, const Vector<String>& mask, const Vector<String>& restored, const Vector<String>& residual)
Bool pixon(const String& algorithm, const Quantity& sigma, const String& model)
Bool nnls(const String& algorithm, const Int niter, const Float tolerance, const Vector<String>& model, const Vector<Bool>& fixed, const String& complist, const Vector<String>& fluxMask, const Vector<String>& dataMask, const Vector<String>& restored, const Vector<String>& residual)
Bool setmfcontrol(const Float cyclefactor, const Float cyclespeedup, const Int stoplargenegatives, const Int stoppointmode, const String& scaleType, const Float minPB, const Float constPB, const Vector<String>& fluxscale)
Bool feather(const String& image, const String& highres, const String& lowres, const String& lowpsf)
Bool pb(const String& inimage, const String& outimage, const String& incomps, const String& outcomps, const String& operation, const MDirection& pointngCenter, const Quantity& pa, const String& pborvp)
Bool linearmosaic(const String& mosaic, const String& fluxscale, const String& sensitivity, const Vector<String>& images, const Vector<Int>& fieldids)
Bool ft(const Vector<String>& model, const String& complist, Bool incremental=False)
Bool setjy(const Int fieldid, const Int spectralwindowid, const Vector<Double>& fluxDensity, const String& standard)
Bool make(const String& model)
Bool makemodelfromsd(const String& sdImage, const String& modelimage, const String& lowPSF, String& maskImage)
Bool clone(const String& imageName, const String& newImageName)
Bool fitpsf(const String& psf, Quantity& mbmaj, Quantity& mbmin, Quantity& mbpa)
Bool correct(const Bool doparallactic, const Quantity& t)
Bool plotuv(const Bool rotate)
Bool plotvis(const String& type, const Int increment)
Bool plotweights(const Bool gridded, const Int increment)
Bool plotsummary()
Bool clipvis(const Quantity& threshold)
PGPlotter& getPGPlotter()
void setPGPlotter(PGPlotter& thePlotter)
Bool valid() const
Protected Members
void defaults()
Bool detached() const
Bool createFTMachine()
Bool removeTable(const String& tablename)
Bool createSkyEquation(const String complist="")
Bool createSkyEquation(const Vector<String>& image, const Vector<Bool>& fixed, const String complist="")
Bool createSkyEquation(const Vector<String>& image, const String complist="")
Bool createSkyEquation(const Vector<String>& image, const Vector<Bool>& fixed, const Vector<String>& mask, const String complist="")
Bool createSkyEquation(const Vector<String>& image, const Vector<Bool>& fixed, const Vector<String>& mask, const Vector<String>& fluxMask, const String complist="")
void destroySkyEquation()
Bool addResidualsToSkyEquation(const Vector<String>& residual)
Bool addMasksToSkyEquation(const Vector<String>& mask)
Bool restoreImages(const Vector<String>& restored)
Bool writeFluxScales(const Vector<String>& fluxScaleNames)
String imageName()
Bool pbguts(ImageInterface<Float>& in, ImageInterface<Float>& out, const MDirection&, const Quantity&)
Bool assertDefinedImageParameters() const
virtual void setWFCleanImageSkyModel()
virtual void setClarkCleanImageSkyModel()
virtual void setSkyEquation()
String frmtTime(const Double time)

Description

Member Description

Imager()

Default constructor

Imager(MeasurementSet& ms, Bool compress=False)

Imager(MeasurementSet& ms, PGPlotter& pgplotter, Bool compress=False)

Imager(const Imager&)

Copy constructor and assignment operator

Imager& operator=(const Imager&)

virtual ~Imager()

Destructor

virtual Bool openSubTables()

open all the subtables as userNoReadLock

virtual Bool lock()

Lock the ms and its subtables

virtual Bool unlock()

Unlock the ms and its subtables

Bool selectDataChannel(VisSet& vs, Vector<Int>& spectralwindowids, String& dataMode, Vector<Int>& dataNchan, Vector<Int>& dataStart, Vector<Int>& dataStep, MRadialVelocity& mDataStart, MRadialVelocity& mDataStep)

Utility function to do channel selection

virtual Bool checkCoord(CoordinateSystem& coordsys, String& imageName)

Utility function to check coordinate match with existing image

virtual void setImageParam(Int& nx, Int& ny, Int& npol, Int& nchan)

virtual void makeVisSet(VisSet* & vs, MeasurementSet& ms, Bool compress=False, Bool mosaicOrder=False)

VisSet and resort

virtual void makeVisSet(MeasurementSet& ms, Bool compress=False, Bool mosaicOrder=False)

Just to create the SORTED_TABLE

virtual void writeHistory(LogIO& os)

virtual void writeCommand(LogIO& os)

Bool makeEmptyImage(CoordinateSystem& imageCoord, String& name, Int fieldID=0)

make an empty image

Bool makePBImage(ImageInterface<Float>& pbImage, Bool useSymmetricBeam=True)

Functions to make Primary beams

Bool makePBImage(const CoordinateSystem& imageCoord, const String& telescopeName, const String& diskPBName, Bool useSymmetricBeam=True)

Bool makePBImage(const CoordinateSystem& imageCoord, const Table& vpTable, const String& diskPBName)

Bool makePBImage(const Table& vpTable, ImageInterface<Float>& pbImage)

Bool makePBImage(const CoordinateSystem& imageCoord, PBMath& pbMath, const String& diskPBName)

Bool makePBImage(PBMath& pbMath, ImageInterface<Float>& pbImage)

void setObsInfo(ObsInfo& obsinfo)

ObsInfo& latestObsInfo()

Bool open(MeasurementSet &thems, Bool compress=False)

Close the current ms, and replace it with the supplied ms. Optionally compress the attached calibration data columns if they are created here.

Bool close()

Flush the ms to disk and detach from the ms file. All function calls after this will be a no-op.

String name() const

Return the name of the MeasurementSet

virtual Bool setimage(const Int nx, const Int ny, const Quantity& cellx, const Quantity& celly, const String& stokes, Bool doShift, const String& phaseCenter, const Quantity& shiftx, const Quantity& shifty, const String& mode, const Int nchan, const Int start, const Int step, const MDirection& mStart, const MDirection& mStep, const MRadialVelocity<Int>& spectralwindowids, const Int fieldid, const Int facets, const Quantity& distance, const Float &paStep, const Float &pbLimit)

The following setup methods define the state of the imager.

Set image construction parameters

virtual Bool setDataPerMS(const String& msname, const String& mode, const Vector<Int>& nchan, const Vector<Int>& start, const Vector<Int>& step, const Vector<Int>& spectralwindowids, const Vector<Int>& fieldid, const String& msSelect="")

The following setup methods define the state of the imager.

Set the data selection parameters

Bool setoptions(const String& ftmachine, const Long cache, const Int tile, const String& gridfunction, const MPosition& mLocation, const Float padding, const Bool usemodelcol=True, const Int wprojplanes=1, const String& epJTableName="", const Bool applyPointingOffsets=True, const Bool doPointingCorrection=True, const String& cfCacheDirName="")

The following setup methods define the state of the imager.

Set the processing options

Bool setsdoptions(const Float scale, const Float weight, const Int convsupport=-1)

The following setup methods define the state of the imager.

Set the single dish processing options

Bool setvp(const Bool dovp, const Bool defaultVP, const String& vpTable, const Bool doSquint, const Quantity &parAngleInc, const Quantity &skyPosThreshold, String defaultTel="")

The following setup methods define the state of the imager.

Set the voltage pattern

Bool settaylorterms(const Int intaylor)

The following setup methods define the state of the imager.

Set the number of taylor series terms in the expansion of the image as a function of frequency.

Bool setdata(const String& mode, const Vector<Int>& nchan, const Vector<Int>& start, const Vector<Int>& step, const MRadialVelocity& mStart, const MRadialVelocity& mStep, const Vector<Int>& spectralwindowids, const Vector<Int>& fieldid, const String& msSelect="")

The following setup methods define the state of the imager.

Bool advise(const Bool takeAdvice, const Float amplitudeloss, const Quantity& fieldOfView, Quantity& cell, Int& npixels, Int& facets, MDirection& phaseCenter)

Advise on suitable values

Bool summary()

Output a summary of the state of the object

String state()

Return the state of the object as a string

Bool imagecoordinates(CoordinateSystem& coordInfo)

Return the image coordinates

IPosition imageshape() const

Return the image shape

Bool weight(const String& algorithm, const String& rmode, const Quantity& noise, const Double robust, const Quantity& fieldofview, const Int npixels)

Weight the MeasurementSet

Bool filter(const String& type, const Quantity& bmaj, const Quantity& bmin, const Quantity& bpa)

Filter the MeasurementSet

Bool uvrange(const Double& uvmin, const Double& uvmax)

Apply a uvrange

Bool sensitivity(Quantity& pointsourcesens, Double& relativesens, Double& sumwt)

Sensitivity

Bool makeimage(const String& type, const String& imageName)

Make plain image

Bool makeimage(const String& type, const String& imageName, const String& complexImageName)

Make plain image: keep the complex image as well

Bool boxmask(const String& mask, const Vector<Int>& blc, const Vector<Int>& trc, const Float value)

Fill in a region of a mask

Bool clipimage(const String& image, const Quantity& threshold)

Clip on Stokes I

Bool mask(const String& mask, const String& imageName, const Quantity& threshold)

Make a mask image

Bool restore(const Vector<String>& model, const String& complist, const Vector<String>& image, const Vector<String>& residual)

Restore

Bool setbeam(const Quantity& bmaj, const Quantity& bmin, const Quantity& bpa)

Setbeam

Bool residual(const Vector<String>& model, const String& complist, const Vector<String>& image)

Residual

Bool approximatepsf(const Vector<String>& model, const Vector<String>& psf)

Approximate PSF

Bool smooth(const Vector<String>& model, const Vector<String>& image, Bool usefit, Quantity& bmaj, Quantity& bmin, Quantity& bpa, Bool normalizeVolume)

Smooth

Bool clean(const String& algorithm, const Int niter, const Float gain, const Quantity& threshold, const Bool displayProgress, const Vector<String>& model, const Vector<Bool>& fixed, const String& complist, const Vector<String>& mask, const Vector<String>& restored, const Vector<String>& residual)

Clean algorithm

Bool mem(const String& algorithm, const Int niter, const Quantity& sigma, const Quantity& targetflux, const Bool constrainflux, const Bool displayProgress, const Vector<String>& model, const Vector<Bool>& fixed, const String& complist, const Vector<String>& prior, const Vector<String>& mask, const Vector<String>& restored, const Vector<String>& residual)

MEM algorithm

Bool pixon(const String& algorithm, const Quantity& sigma, const String& model)

pixon algorithm

Bool nnls(const String& algorithm, const Int niter, const Float tolerance, const Vector<String>& model, const Vector<Bool>& fixed, const String& complist, const Vector<String>& fluxMask, const Vector<String>& dataMask, const Vector<String>& restored, const Vector<String>& residual)

NNLS algorithm

Bool setmfcontrol(const Float cyclefactor, const Float cyclespeedup, const Int stoplargenegatives, const Int stoppointmode, const String& scaleType, const Float minPB, const Float constPB, const Vector<String>& fluxscale)

Multi-field control parameters

Bool feather(const String& image, const String& highres, const String& lowres, const String& lowpsf)

Feathering algorithm

Bool pb(const String& inimage, const String& outimage, const String& incomps, const String& outcomps, const String& operation, const MDirection& pointngCenter, const Quantity& pa, const String& pborvp)

Apply or correct for Primary Beam or Voltage Pattern

Bool linearmosaic(const String& mosaic, const String& fluxscale, const String& sensitivity, const Vector<String>& images, const Vector<Int>& fieldids)

Make a linear mosaic of several images

Bool ft(const Vector<String>& model, const String& complist, Bool incremental=False)

Fourier transform the model and componentlist

Bool setjy(const Int fieldid, const Int spectralwindowid, const Vector<Double>& fluxDensity, const String& standard)

Compute the model visibility using specified source flux densities

Bool make(const String& model)

Make an empty image

Bool makemodelfromsd(const String& sdImage, const String& modelimage, const String& lowPSF, String& maskImage)

make a model from a SD image. This model then can be used as initial clean model to include the shorter spacing.

Bool clone(const String& imageName, const String& newImageName)

Clone an image

Bool fitpsf(const String& psf, Quantity& mbmaj, Quantity& mbmin, Quantity& mbpa)

Fit the psf

Bool correct(const Bool doparallactic, const Quantity& t)

Correct the visibility data (OBSERVED->CORRECTED)

Bool plotuv(const Bool rotate)

Plot the uv plane

Bool plotvis(const String& type, const Int increment)

Plot the visibilities

Bool plotweights(const Bool gridded, const Int increment)

Plot the weights

Bool plotsummary()

Plot a summary

Bool clipvis(const Quantity& threshold)

Clip visibilities

PGPlotter& getPGPlotter()

This is necessary for setting from the DO...but once its set properly from the constructor...these two functions should go

void setPGPlotter(PGPlotter& thePlotter)

Bool valid() const

Check if can proceed with this object

void defaults()

Do Multi Frequency Synthesis Imaging

Set the defaults

Bool detached() const

check if it is dettahced from ms.

Bool createFTMachine()

Create the FTMachines when necessary or when the control parameters have changed.

Bool removeTable(const String& tablename)

Bool createSkyEquation(const String complist="")

Bool createSkyEquation(const Vector<String>& image, const Vector<Bool>& fixed, const String complist="")

Bool createSkyEquation(const Vector<String>& image, const String complist="")

Bool createSkyEquation(const Vector<String>& image, const Vector<Bool>& fixed, const Vector<String>& mask, const String complist="")

Bool createSkyEquation(const Vector<String>& image, const Vector<Bool>& fixed, const Vector<String>& mask, const Vector<String>& fluxMask, const String complist="")

void destroySkyEquation()

Bool addResidualsToSkyEquation(const Vector<String>& residual)

Add the residuals to the SkyEquation

Bool addMasksToSkyEquation(const Vector<String>& mask)

Add or replace the masks

Bool restoreImages(const Vector<String>& restored)

Bool writeFluxScales(const Vector<String>& fluxScaleNames)

names of flux scale images

String imageName()

Bool pbguts(ImageInterface<Float>& in, ImageInterface<Float>& out, const MDirection&, const Quantity&)

Bool assertDefinedImageParameters() const

virtual void setWFCleanImageSkyModel()

Virtual methods to set the ImageSkyModel and SkyEquation. This allows derived class pimager to set parallelized specializations.

virtual void setClarkCleanImageSkyModel()

virtual void setSkyEquation()

String frmtTime(const Double time)