casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::MSUVWGenerator Class Reference

Generates and inserts the (u, v, w)s of a casacore::MS that may or may not already have them. Includes antenna offsets when known. More...

#include <MSUVWGenerator.h>

Public Member Functions

 MSUVWGenerator (casacore::MSColumns &ms_ref, const casacore::MBaseline::Types bltype, const casacore::Muvw::Types uvwtype)
 Constructor. More...
 
 ~MSUVWGenerator ()
 Destructor. More...
 
void uvw_bl (const casacore::uInt ant1, const casacore::uInt feed1, const casacore::uInt ant2, const casacore::uInt feed2, casacore::Array< casacore::Double > &uvw)
 Determine the uvw for a single phaseDir and timeCentroid, and pair of feeds (which may be the same). More...
 
casacore::Bool make_uvws (const casacore::Vector< casacore::Int > flds)
 Calculate the uvws for the field IDs in flds that are not -1, and set those phase directions according to phaseDirs. More...
 

Private Member Functions

void fill_bl_an (casacore::Vector< casacore::MVBaseline > &bl_an_p)
 Sets up the antenna positions as baselines (bl_an_p), the number of antennas (nant_p), and timeRes_p. More...
 
void uvw_an (const casacore::MEpoch &timeCentroid, const casacore::Int fldID, const casacore::Bool WSRTConvention=false)
 Determine antUVW_p for every member of the sequence of antennas defining a (sub)array. More...
 
casacore::LogIOlogSink ()
 

Private Attributes

casacore::MSColumnsmsc_p
 (Sub-)array parameters constraining order and size of the output vector of UVW coords triplets. More...
 
casacore::MBaseline::Ref bl_csys_p
 casacore::Coordinate system selectors. More...
 
const
casacore::ROMSAntennaColumns
antColumns_p
 
const
casacore::ROScalarMeasColumn
< casacore::MPosition > & 
antPositions_p
 The antenna positions of ms_p in ITRF. More...
 
const
casacore::ROScalarMeasColumn
< casacore::MPosition > & 
antOffset_p
 The offsets between the phase reference point (see feed_offsets below for clarification) of each antenna and the closest point which is fixed relative to the antenna position (i.e. More...
 
casacore::MPosition refpos_p
 The position of the first antenna. More...
 
const
casacore::ROScalarMeasColumn
< casacore::MPosition > & 
feedOffset_p
 Ditto for feed. More...
 
casacore::MBaseline::Types refposref_p
 
casacore::Vector
< casacore::MVBaseline
bl_an_p
 The antenna positions - refpos_p.getValue(). More...
 
casacore::uInt nant_p
 
casacore::Double timeRes_p
 The minimum time difference for forcing an update of the UVWs. More...
 
casacore::LogIO sink_p
 
casacore::Vector
< casacore::Vector
< casacore::Double > > 
antUVW_p
 map<Tag, ArrayParam> m_array_p; // FIX: Tag More...
 
casacore::ArrayColumn
< casacore::Double
phaseDir_p
 the 3 fundamental attributes of the state machine More...
 

Detailed Description

Generates and inserts the (u, v, w)s of a casacore::MS that may or may not already have them. Includes antenna offsets when known.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

It generates a UVW column for the casacore::MS, whether or not it already has one. It is an adaptation of alma/apps/asdm2MS/UvwCoords to work with MSes instead of ASDMs.

Synopsis

(u, v, w)s are needed for imaging, but some data sets may not come with them included, or the (u, v, w)s may need correction.

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.

Definition at line 88 of file MSUVWGenerator.h.

Constructor & Destructor Documentation

casa::MSUVWGenerator::MSUVWGenerator ( casacore::MSColumns ms_ref,
const casacore::MBaseline::Types  bltype,
const casacore::Muvw::Types  uvwtype 
)

Constructor.

Parameters
ms_refReference to the casacore::MS's columns.
Postcondition
- The relative positions for all the antennas in the Antenna table are in bl_an_p.
  • timeRes_p has been conservatively calculated using rough estimates of the maximum baseline length and field of view.
casa::MSUVWGenerator::~MSUVWGenerator ( )

Destructor.

Member Function Documentation

void casa::MSUVWGenerator::fill_bl_an ( casacore::Vector< casacore::MVBaseline > &  bl_an_p)
private

Sets up the antenna positions as baselines (bl_an_p), the number of antennas (nant_p), and timeRes_p.

casacore::LogIO& casa::MSUVWGenerator::logSink ( )
inlineprivate

Definition at line 230 of file MSUVWGenerator.h.

References sink_p.

casacore::Bool casa::MSUVWGenerator::make_uvws ( const casacore::Vector< casacore::Int flds)

Calculate the uvws for the field IDs in flds that are not -1, and set those phase directions according to phaseDirs.

Parameters
fldsA map from row numbers in the FIELD table to indices in phaseDirs. For example, if the casacore::MS has 5 fields, and the user wants to (re)calculate the UVWs of only 0, 2, and 4, phaseDirs will have 3 entries and flds will be [0, -1, 1, -1, 2].
void casa::MSUVWGenerator::uvw_an ( const casacore::MEpoch timeCentroid,
const casacore::Int  fldID,
const casacore::Bool  WSRTConvention = false 
)
private

Determine antUVW_p for every member of the sequence of antennas defining a (sub)array.

Parameters
timeCentroidAn epoch, the 'when' characterization.
fldIDThe row number in the FIELD table which gives the phase tracking center.
WSRTConventionIf true (WSRT only?), the l in the ul + vm phase calculation decreases toward increasing RA. If false (VLA), it increases with increasing RA. See the code for more info.
Note
This function only calculates UVWs for a single time and a single phase center. Fields can potentially have multiple phase directions, so be prepared to call this function from within a loop that also takes care of setting timeCentroid and phaseDir.
Warning
timeCentroid can be initialized like casacore::MEpoch timeCentroid(casacore::Quantity(<double>, "s"), casacore::MEpoch::TAI); but the accuracy is limited since there is no extra precision attribute (see Main table of casacore::MS v2).
void casa::MSUVWGenerator::uvw_bl ( const casacore::uInt  ant1,
const casacore::uInt  feed1,
const casacore::uInt  ant2,
const casacore::uInt  feed2,
casacore::Array< casacore::Double > &  uvw 
)

Determine the uvw for a single phaseDir and timeCentroid, and pair of feeds (which may be the same).

Parameters
ant1Row number in the ANTENNA table of the 1st antenna.
feed1Row number in the FEED table of the 1st feed.
ant1Row number in the ANTENNA table of the 2nd antenna.
feed2Row number in the FEED table of the 2nd feed.
uvwThe returned UVW coordinates.

Member Data Documentation

const casacore::ROMSAntennaColumns& casa::MSUVWGenerator::antColumns_p
private

Definition at line 177 of file MSUVWGenerator.h.

const casacore::ROScalarMeasColumn<casacore::MPosition>& casa::MSUVWGenerator::antOffset_p
private

The offsets between the phase reference point (see feed_offsets below for clarification) of each antenna and the closest point which is fixed relative to the antenna position (i.e.

an axis). Since no one else has defined it yet, I am defining it as the offset when the antenna is pointing at zenith, oriented so that if it slewed down, it would move toward the north. (x, y, z) = (east, north, up).

This appears to be a required column of the ANTENNA table in version 2.0 of the casacore::MeasurementSet definition (http://aips2.nrao.edu/docs/notes/229/229.html), so it is assumed to be present. However, it is usually a set of zeroes, based on the common belief that it is only needed for heterogeneous arrays, since the receivers of homogeneous arrays move in concert. That is not true when there are independent pointing errors.

Definition at line 199 of file MSUVWGenerator.h.

const casacore::ROScalarMeasColumn<casacore::MPosition>& casa::MSUVWGenerator::antPositions_p
private

The antenna positions of ms_p in ITRF.

It cannot be const because of the need to update satellite positions. antPositions_p and antOffset_p are references and must therefore be initialized in the initialization list.

Definition at line 183 of file MSUVWGenerator.h.

casacore::Vector<casacore::Vector<casacore::Double> > casa::MSUVWGenerator::antUVW_p
private

map<Tag, ArrayParam> m_array_p; // FIX: Tag

The UVW "positions" of each antenna being used during a time bin, i.e. the (u, v, w) of the baseline between antennas m and n is antUVW_p[n] - antUVW_p[m].

Definition at line 240 of file MSUVWGenerator.h.

casacore::Vector<casacore::MVBaseline> casa::MSUVWGenerator::bl_an_p
private

The antenna positions - refpos_p.getValue().

Definition at line 216 of file MSUVWGenerator.h.

casacore::MBaseline::Ref casa::MSUVWGenerator::bl_csys_p
private

casacore::Coordinate system selectors.

Definition at line 175 of file MSUVWGenerator.h.

const casacore::ROScalarMeasColumn<casacore::MPosition>& casa::MSUVWGenerator::feedOffset_p
private

Ditto for feed.

const casacore::ROMSFeedColumns *feedColumns_;

The offset between the feed and the phase reference point of each antenna in the same frame as ant_offsets. Therefore the feed position is ant_positions_p(ant) + [rotation matrix](pointing) (ant_offsets_p[ant] + feed_offsets_p[ant])

Definition at line 211 of file MSUVWGenerator.h.

casacore::MSColumns& casa::MSUVWGenerator::msc_p
private

(Sub-)array parameters constraining order and size of the output vector of UVW coords triplets.

struct ArrayParam{ public: casacore::Int subarrayId; // (sub)array identifier vector<Tag> v_ant; //<! sequence of antennas unsigned int nrepeat; //<! number of casacore::MS main table rows per antenna baseline Enum<CorrelationMode> e_correlationMode; //<! correlation mode (original mode passed through the user filter) (FOLLOWUP: is this needed?) string show(){ ostringstream os; os << " nrepeat " << nrepeat; return os.str(); } };

               Member variables ********************************

             Initialized by ctor, ******************************
             so they should appear ******************************
             here in the same order ******************************
             as they do in the ctor. ******************************

Definition at line 172 of file MSUVWGenerator.h.

casacore::uInt casa::MSUVWGenerator::nant_p
private

Definition at line 218 of file MSUVWGenerator.h.

casacore::ArrayColumn<casacore::Double> casa::MSUVWGenerator::phaseDir_p
private

the 3 fundamental attributes of the state machine

Definition at line 243 of file MSUVWGenerator.h.

casacore::MPosition casa::MSUVWGenerator::refpos_p
private

The position of the first antenna.

Definition at line 202 of file MSUVWGenerator.h.

casacore::MBaseline::Types casa::MSUVWGenerator::refposref_p
private

Definition at line 213 of file MSUVWGenerator.h.

casacore::LogIO casa::MSUVWGenerator::sink_p
private

Definition at line 229 of file MSUVWGenerator.h.

Referenced by logSink().

casacore::Double casa::MSUVWGenerator::timeRes_p
private

The minimum time difference for forcing an update of the UVWs.

We're not trying to do time averaging here, so it should be small, but not so small that uvw_an() is called for every baseline, even when the times are practically the same.

Definition at line 224 of file MSUVWGenerator.h.


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