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

Performs for MeasurementSets various fixes which do not involve calibrating. This includes (in order of implementation): More...

#include <FixVis.h>

Inheritance diagram for casa::FixVis:
casa::FTMachine

List of all members.

Public Member Functions

 FixVis (MeasurementSet &ms, const String &dataColName=String("all"))
 Constructor.
FixVisoperator= (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< IntgetFieldIdx (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 ()
LogIOlogSink ()

Private Attributes

LogIO sink_p
 Log functions and variables.
MeasurementSet ms_p
 Initialized in ctor.
MSColumnsmsc_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< IntantennaId_p
 conversions can be done (or not) String obsString_p; // obsID selection
Vector< StringantennaSelStr_p
 work with Vector<uInt>.
Vector< Doubledistances_p
Vector< MS::PredefinedColumnsdataCols_p
 field
uInt nDataCols_p
uInt nchan_p
Vector< Intspectralwindowids_p
uInt lockCounter_p
MeasurementSet mssel_p
 Not initialized in ctor.
ObsInfo latestObsInfo_p
Vector< IntDDIds_p
Vector< IntFieldIds_p
Vector< MDirectionphaseDirs_p
Int nSpw_p
 field
MPosition mLocation_p
 Default Position used for phase rotations.
Bool doTrackSource_p
Int fieldid_p

Detailed Description

Performs for MeasurementSets various fixes which do not involve calibrating. This includes (in order of implementation):

  1. Generating and inserting (u, v, w)s into a MS that may or may not already have them. Includes antenna offsets when known.
  2. Correcting for differential aberration.
  3. Changing the phase tracking center.
  4. Changing the equinox (B1950 -> J2000).
  5. (maybe never) Changing the projection, i.e. SIN <-> (-)NCP.

    Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

It is a variation on the UVFIX task of AIPS.

Synopsis

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

Example

        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.

Motivation

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;

Definition at line 101 of file FixVis.h.


Constructor & Destructor Documentation

casa::FixVis::FixVis ( MeasurementSet ms,
const String dataColName = String("all") 
)

Constructor.

Destructor.


Member Function Documentation

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.

Definition at line 141 of file FixVis.h.

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.

Definition at line 203 of file FixVis.h.

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]


Get actual coherence from grid

Implements casa::FTMachine.

Definition at line 181 of file FixVis.h.

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]

Get the final weights image.

Implements casa::FTMachine.

Definition at line 180 of file FixVis.h.

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]

Definition at line 215 of file FixVis.h.

References sink_p.

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.

Definition at line 143 of file FixVis.h.

virtual void casa::FixVis::normalizeImage ( Lattice< Complex > &  ,
const Matrix< Double > &  ,
Lattice< Float > &  ,
Bool   
) [inline, private, virtual]

Reimplemented from casa::FTMachine.

Definition at line 173 of file FixVis.h.

Select by casa::FixVis::observationIDs ( problematic at  best) const [inline]

Definition at line 116 of file FixVis.h.

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.

FixVis& casa::FixVis::operator= ( FixVis other)

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]

Put coherence to grid.

Implements casa::FTMachine.

Definition at line 182 of file FixVis.h.

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.

Definition at line 140 of file FixVis.h.

Specifies new phase tracking centers for the selected fields* void casa::FixVis::setPhaseDirs ( const Vector< MDirection > &  phaseDirs)
void casa::FixVis::unlock ( ) [private]

Member Data Documentation

conversions can be done (or not) String obsString_p; // obsID selection

Definition at line 230 of file FixVis.h.

Definition at line 226 of file FixVis.h.

work with Vector<uInt>.

Definition at line 232 of file FixVis.h.

Definition at line 223 of file FixVis.h.

field

Definition at line 235 of file FixVis.h.

Definition at line 244 of file FixVis.h.

Definition at line 233 of file FixVis.h.

Definition at line 250 of file FixVis.h.

Definition at line 251 of file FixVis.h.

Definition at line 245 of file FixVis.h.

Reimplemented from casa::FTMachine.

Definition at line 227 of file FixVis.h.

Definition at line 243 of file FixVis.h.

Definition at line 239 of file FixVis.h.

Default Position used for phase rotations.

Reimplemented from casa::FTMachine.

Definition at line 249 of file FixVis.h.

Initialized in ctor.

Make sure the order there matches with the order here.

Definition at line 218 of file FixVis.h.

Definition at line 219 of file FixVis.h.

Not initialized in ctor.

Definition at line 242 of file FixVis.h.

Definition at line 221 of file FixVis.h.

Definition at line 237 of file FixVis.h.

Definition at line 236 of file FixVis.h.

const uInt casa::FixVis::npix_p [private]

Definition at line 222 of file FixVis.h.

Definition at line 220 of file FixVis.h.

field

Definition at line 248 of file FixVis.h.

Definition at line 246 of file FixVis.h.

Log functions and variables.

Definition at line 214 of file FixVis.h.

Referenced by logSink().

Definition at line 238 of file FixVis.h.

Definition at line 225 of file FixVis.h.

Definition at line 224 of file FixVis.h.


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