casa
$Rev:20696$
|
Performs for MeasurementSets various fixes which do not involve calibrating. This includes (in order of implementation): More...
#include <FixVis.h>
Public Member Functions | |
FixVis (MeasurementSet &ms, const String &dataColName=String("all")) | |
Constructor. | |
FixVis & | operator= (FixVis &other) |
Assignment (only copies reference to MS, need to reset selection etc) | |
~FixVis () | |
Destructor. | |
uInt | setFields (const Vector< Int > &fieldIds) |
Set the required field Ids and return the # of selected fields. | |
Select by | observationIDs (problematic at best) void setObsIDs(const String &obs) |
Specifies new phase tracking centers for the selected fields *void | setPhaseDirs (const Vector< MDirection > &phaseDirs) |
void | setDistances (const Vector< Double > &distances) |
Specifies distances for each selected field according to distances, which must be in m and the same order as the Vector given to setFields. | |
Bool | calc_uvw (const String &refcode, const Bool reuse=true) |
Calculate the (u, v, w)s and store them in ms_p. | |
void | rotateUVW (const MDirection &indir, const MDirection::Ref &newref) |
Convert the UVW column to a new reference frame by rotating the old baselines instead of calculating fresh ones. | |
Bool | fixvis (const String &refcode) |
For things like rotation, differential aberration correction, etc., when there already is a UVW column, using FTMachine. | |
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 | |
Vector< Int > | getFieldIdx (const String &fields) |
Interpret field indices (MSSelection) | |
Bool | ready_msc_p () |
Makes sure msc_p is ready, and returns false if it fails. | |
void | convertFieldDirs (const MDirection::Types outType) |
Convert the directions (phase tracking centers, + DELAY_DIR and REFERENCE_DIR if they start in the same frame) in the FIELD table to newFrame. | |
void | convertFieldCols (MSFieldColumns &msfcs, const MDirection::Ref &newFrame, const Bool doAll3) |
Private worker function for convertFieldDirs(). | |
Bool | makeSelection (const Int selectedField) |
Calls ready_msc_p() as a side effect. | |
void | processSelected (uInt numInSel) |
Does phase tracking center and distance adjustment for mssel_p. | |
ImageInterface< Complex > & | getImage (Matrix< float > &, Bool) |
FTMachine declares a LOT of pure virtual functions which FixVis does not need. | |
virtual void | normalizeImage (Lattice< Complex > &, const Matrix< Double > &, Lattice< Float > &, Bool) |
void | getWeightImage (ImageInterface< float > &, Matrix< float > &) |
Get the final weights image. | |
void | get (VisBuffer &, Int) |
void | put (const VisBuffer &, Int, Bool, FTMachine::Type) |
Put coherence to grid. | |
void | ok () |
Bool getRestFreq(Vector<Double>& restFreq, const Int spw, const Int fldID); void setObsInfo(ObsInfo& obsinfo);. | |
void | init () |
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. | |
void | initializeToSky (ImageInterface< Complex > &image, Matrix< Float > &weight, const VisBuffer &vb) |
Initialize transform to Sky plane: initializes the image. | |
void | finalizeToSky () |
Defined here only because FTMachine declares it purely virtual. | |
Bool | setImageField (const Int fieldid, const Bool dotrackDir=false) |
TODO?: trackDir. | |
Bool | lock () |
void | unlock () |
LogIO & | logSink () |
Private Attributes | |
LogIO | sink_p |
Log functions and variables. | |
MeasurementSet | ms_p |
Initialized in ctor. | |
MSColumns * | msc_p |
uInt | nsel_p |
uInt | nAllFields_p |
const uInt | npix_p |
const IPosition | cimageShape_p |
const IPosition | tileShape_p |
const TiledShape | tiledShape_p |
Bool | antennaSel_p |
Bool | freqFrameValid_p |
Vector< Int > | antennaId_p |
conversions can be done (or not) String obsString_p; // obsID selection | |
Vector< String > | antennaSelStr_p |
work with Vector<uInt>. | |
Vector< Double > | distances_p |
Vector< MS::PredefinedColumns > | dataCols_p |
field | |
uInt | nDataCols_p |
uInt | nchan_p |
Vector< Int > | spectralwindowids_p |
uInt | lockCounter_p |
MeasurementSet | mssel_p |
Not initialized in ctor. | |
ObsInfo | latestObsInfo_p |
Vector< Int > | DDIds_p |
Vector< Int > | FieldIds_p |
Vector< MDirection > | phaseDirs_p |
Int | nSpw_p |
field | |
MPosition | mLocation_p |
Default Position used for phase rotations. | |
Bool | doTrackSource_p |
Int | fieldid_p |
Performs for MeasurementSets various fixes which do not involve calibrating. This includes (in order of implementation):
Public interface
It is a variation on the UVFIX task of AIPS.
(u, v, w)s are needed for imaging, but some data sets may not come with them included.
FixVis can also be used to shift the tangent point, and correct for differential aberration.
MS inMS(fileName); FixVis uvwfixer(inMS); uvwfixer.setDataDescriptionIds(ddIds); uvwfixer.setFields(fieldIds); uvwfixer.fixuvw();
A FixVis
object is constructed and the baselines are calculated and stored in inMS.
Currently (10/30/2008), ASDMs from either the ALMA Test Facility or the EVLA do not come with (u, v, w)s, and need to be processed with the UVFIX task in AIPS. It would be preferable to process them entirely inside CASA.
class FixVis;
casa::FixVis::FixVis | ( | MeasurementSet & | ms, |
const String & | dataColName = String("all") |
||
) |
Constructor.
Destructor.
Bool casa::FixVis::calc_uvw | ( | const String & | refcode, |
const Bool | reuse = true |
||
) |
Calculate the (u, v, w)s and store them in ms_p.
virtual void casa::FixVis::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.
void casa::FixVis::convertFieldCols | ( | MSFieldColumns & | msfcs, |
const MDirection::Ref & | newFrame, | ||
const Bool | doAll3 | ||
) | [private] |
Private worker function for convertFieldDirs().
void casa::FixVis::convertFieldDirs | ( | const MDirection::Types | outType | ) | [private] |
Convert the directions (phase tracking centers, + DELAY_DIR and REFERENCE_DIR if they start in the same frame) in the FIELD table to newFrame.
Note that each direction column in the table only allows one reference frame for the entire column, so all fields must share the same frame. Calls ready_msc_p() as a side effect.
void casa::FixVis::finalizeToSky | ( | ) | [inline, private, virtual] |
Defined here only because FTMachine declares it purely virtual.
Implements casa::FTMachine.
void casa::FixVis::finalizeToVis | ( | ) | [private, virtual] |
Finalize transform to Visibility plane.
Implements casa::FTMachine.
Bool casa::FixVis::fixvis | ( | const String & | refcode | ) |
For things like rotation, differential aberration correction, etc., when there already is a UVW column, using FTMachine.
Returns true if any fields are modified.
void casa::FixVis::get | ( | VisBuffer & | vb, |
Int | row | ||
) | [inline, private, virtual] |
Vector<Int> casa::FixVis::getFieldIdx | ( | const String & | fields | ) | [private] |
Interpret field indices (MSSelection)
ImageInterface<Complex>& casa::FixVis::getImage | ( | Matrix< float > & | , |
Bool | |||
) | [inline, private, virtual] |
FTMachine declares a LOT of pure virtual functions which FixVis does not need.
They are declared as no-ops here for now.
Implements casa::FTMachine.
Definition at line 172 of file FixVis.h.
References casa::FTMachine::image.
void casa::FixVis::getWeightImage | ( | ImageInterface< float > & | weightImage, |
Matrix< float > & | weights | ||
) | [inline, private, virtual] |
void casa::FixVis::init | ( | ) | [private] |
void casa::FixVis::initializeToSky | ( | ImageInterface< Complex > & | image, |
Matrix< Float > & | weight, | ||
const VisBuffer & | vb | ||
) | [private, virtual] |
Initialize transform to Sky plane: initializes the image.
Implements casa::FTMachine.
void casa::FixVis::initializeToVis | ( | ImageInterface< Complex > & | image, |
const VisBuffer & | vb | ||
) | [private, virtual] |
Initialize transform to Visibility plane using the image as a template.
Implements casa::FTMachine.
Bool casa::FixVis::lock | ( | ) | [private] |
LogIO& casa::FixVis::logSink | ( | ) | [inline, private] |
Bool casa::FixVis::makeSelection | ( | const Int | selectedField | ) | [private] |
Calls ready_msc_p() as a side effect.
virtual String casa::FixVis::name | ( | ) | const [inline, virtual] |
Return the name of the machine.
Implements casa::FTMachine.
virtual void casa::FixVis::normalizeImage | ( | Lattice< Complex > & | , |
const Matrix< Double > & | , | ||
Lattice< Float > & | , | ||
Bool | |||
) | [inline, private, virtual] |
Reimplemented from casa::FTMachine.
Select by casa::FixVis::observationIDs | ( | problematic at | best | ) | const [inline] |
void casa::FixVis::ok | ( | ) | [private, virtual] |
Bool getRestFreq(Vector<Double>& restFreq, const Int spw, const Int fldID); void setObsInfo(ObsInfo& obsinfo);.
Reimplemented from casa::FTMachine.
Assignment (only copies reference to MS, need to reset selection etc)
void casa::FixVis::processSelected | ( | uInt | numInSel | ) | [private] |
Does phase tracking center and distance adjustment for mssel_p.
void casa::FixVis::put | ( | const VisBuffer & | vb, |
Int | row, | ||
Bool | dopsf, | ||
FTMachine::Type | type | ||
) | [inline, private, virtual] |
Bool casa::FixVis::ready_msc_p | ( | ) | [private] |
Makes sure msc_p is ready, and returns false if it fails.
void casa::FixVis::rotateUVW | ( | const MDirection & | indir, |
const MDirection::Ref & | newref | ||
) |
Convert the UVW column to a new reference frame by rotating the old baselines instead of calculating fresh ones.
void casa::FixVis::setDistances | ( | const Vector< Double > & | distances | ) |
Specifies distances for each selected field according to distances, which must be in m and the same order as the Vector given to setFields.
Throws an exception if distances.nelements() != nsel_p. Because of the way refocus() works, zeroes are ignored (no refocusing done), but negative distances are accepted!
uInt casa::FixVis::setFields | ( | const Vector< Int > & | fieldIds | ) |
Set the required field Ids and return the # of selected fields.
Bool casa::FixVis::setImageField | ( | const Int | fieldid, |
const Bool | dotrackDir = false |
||
) | [private] |
TODO?: trackDir.
virtual void casa::FixVis::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.
Specifies new phase tracking centers for the selected fields* void casa::FixVis::setPhaseDirs | ( | const Vector< MDirection > & | phaseDirs | ) |
void casa::FixVis::unlock | ( | ) | [private] |
Vector<Int> casa::FixVis::antennaId_p [private] |
Bool casa::FixVis::antennaSel_p [private] |
Vector<String> casa::FixVis::antennaSelStr_p [private] |
work with Vector<uInt>.
const IPosition casa::FixVis::cimageShape_p [private] |
Vector<MS::PredefinedColumns> casa::FixVis::dataCols_p [private] |
Vector<Int> casa::FixVis::DDIds_p [private] |
Vector<Double> casa::FixVis::distances_p [private] |
Bool casa::FixVis::doTrackSource_p [private] |
Int casa::FixVis::fieldid_p [private] |
Vector<Int> casa::FixVis::FieldIds_p [private] |
Bool casa::FixVis::freqFrameValid_p [private] |
Reimplemented from casa::FTMachine.
ObsInfo casa::FixVis::latestObsInfo_p [private] |
uInt casa::FixVis::lockCounter_p [private] |
MPosition casa::FixVis::mLocation_p [private] |
Default Position used for phase rotations.
Reimplemented from casa::FTMachine.
MeasurementSet casa::FixVis::ms_p [private] |
MSColumns* casa::FixVis::msc_p [private] |
MeasurementSet casa::FixVis::mssel_p [private] |
uInt casa::FixVis::nAllFields_p [private] |
uInt casa::FixVis::nchan_p [private] |
uInt casa::FixVis::nDataCols_p [private] |
const uInt casa::FixVis::npix_p [private] |
uInt casa::FixVis::nsel_p [private] |
Int casa::FixVis::nSpw_p [private] |
Vector<MDirection> casa::FixVis::phaseDirs_p [private] |
LogIO casa::FixVis::sink_p [private] |
Vector<Int> casa::FixVis::spectralwindowids_p [private] |
const TiledShape casa::FixVis::tiledShape_p [private] |
const IPosition casa::FixVis::tileShape_p [private] |