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

SDM UVW engine: compute the uvw these being not present in the SDM but required to build casacore::MS main table. More...

#include <UvwCoords.h>

Classes

struct  ArrayParam
 (Sub-)array parameters constraining order and size of the output vector of 3D UVW coords triplets. More...
 

Public Member Functions

 UvwCoords (asdm::ASDM *const datasetPtr)
 Constructor. More...
 
 ~UvwCoords ()
 Destructor. More...
 
void uvw_bl (asdm::Tag configDescriptionId, const std::vector< std::vector< asdm::Angle > > &phaseDir, double timeCentroid, Enum< CorrelationModeMod::CorrelationMode > correlationMode, bool reverse, bool autoTrailing, std::vector< casacore::Vector< casacore::Double > > &v_uvw, casacore::MSFieldColumns *msfc_p=0)
 Determine the baseline-based uvw in case timeCentroid is baseline-based, spw-based and bin-based invariant within a dump (i.e. More...
 
void uvw_bl (asdm::Tag configDescriptionId, const std::vector< std::vector< asdm::Angle > > &phaseDir, const std::vector< double > &v_timeCentroid, Enum< CorrelationModeMod::CorrelationMode > correlationMode, bool reverse, bool autoTrailing, std::vector< casacore::Vector< casacore::Double > > &v_uvw, casacore::MSFieldColumns *msfc_p=0)
 Determine the baseline-based uvw in case timeCentroid may change vs baseline, spw or bin within a dump. More...
 
void uvw_bl (asdm::MainRow *mainRow, std::vector< std::pair< unsigned int, double > > v_tci, Enum< CorrelationModeMod::CorrelationMode > correlationMode, std::pair< bool, bool > dataOrder, std::vector< casacore::Vector< casacore::Double > > &v_uvw)
 Determine the baseline-based uvw for a sequence of epochs. More...
 
void uvw_bl (asdm::MainRow *mainRow, std::vector< double > v_timeCentroid, Enum< CorrelationModeMod::CorrelationMode > correlationMode, std::pair< bool, bool > dataOrder, std::vector< casacore::Vector< casacore::Double > > &v_uvw, casacore::MSFieldColumns *msfc_p=0)
 Determine the baseline-based uvw for a sequence of epochs. More...
 

Private Member Functions

std::vector< double > antPos (const std::vector< double > &stationPos, const std::vector< double > &antOffset)
 ITRF coordinates of an ITRF point on which is added an offset defined in a ASCS. More...
 
void uvw_an (double timeCentroid, const std::vector< std::vector< asdm::Angle > > &phaseDir, const std::vector< asdm::Tag > &v_antId)
 Determine antenna-based uvw for every member of the sequence of antennas defining a (sub)array. More...
 
void uvw_bl (const std::vector< asdm::Tag > &v_antennaId, unsigned int nrep, bool reverse, std::vector< casacore::Vector< casacore::Double > > &v_uvw)
 Determine the baseline-based uvw for a sequence of antenna defining a (sub)array. More...
 

Private Attributes

std::map< asdm::Tag, ArrayParamm_array_
 
std::map< asdm::Tag,
casacore::MPosition
m_antPos_
 
std::map< asdm::Tag,
casacore::Vector
< casacore::Double > > 
m_antUVW_
 
double timeCentroid_
 the 3 fundamental attributes of the state machine More...
 
std::vector< std::vector
< asdm::Angle > > 
phaseDir_
 
asdm::Tag subarrayId_
 
casacore::Vector
< casacore::Double
sduvw_
 

Detailed Description

SDM UVW engine: compute the uvw these being not present in the SDM but required to build casacore::MS main table.

This UvwCoords class is an engine to determine the UVW coordinates at any time for any antenna (sub)array. It is based on the casacore::Measure classes in CASA and the ASDM classes. It requires as input the casacore::MS timeCentroids item which is an output in the ASDM DAMs.

Todo:
  • apply the chain of offsets for the reference point in the antenna to the position of the station
  • correlationMode filter
Note
The current limitations are set by the status of the ASDM. Not supported:
  • phase direction not in J2000
  • OTF due to a limitation in the model of the phase direction item in the field table.

Definition at line 38 of file UvwCoords.h.

Constructor & Destructor Documentation

UvwCoords::UvwCoords ( asdm::ASDM *const  datasetPtr)

Constructor.

Parameters
datasetPtrA pointer to a SDM dataset
Postcondition
The following static informations have been set:
  • The positions for all the antennas in the Antenna table have been determined by applying the chain of offsets from the IERS station positions
  • All the (sub-)arrays present in the ConfigDescription table have been identified
UvwCoords::~UvwCoords ( )

Destructor.

Member Function Documentation

std::vector<double> UvwCoords::antPos ( const std::vector< double > &  stationPos,
const std::vector< double > &  antOffset 
)
private

ITRF coordinates of an ITRF point on which is added an offset defined in a ASCS.

Parameters
stationPosITRF position of a station
antPosx,y,z offset in the ASCS
Returns
resulting ITRF position by adding the offset
Note
The ASCS is the cartesian coordinate system the XY plane behing horizontal and Z defining the the local vertical.
  • its X axis points to the East
  • its Y axis points to the North direction
  • its Z axis is in the direction parallel to the local gravity and points upward.

This method is used to determine the position of the phase reference point in an antenna in IERS by applying the chain of offsets up to the station position which is defined in the IERS. ITRF is also a cartesian coordinates system, its origin at the Earth center of mass, In right-handed frame. X towards the intersection of the equator and the Greenwich meridian, Z towards the pole.

void UvwCoords::uvw_an ( double  timeCentroid,
const std::vector< std::vector< asdm::Angle > > &  phaseDir,
const std::vector< asdm::Tag > &  v_antId 
)
private

Determine antenna-based uvw for every member of the sequence of antennas defining a (sub)array.

Parameters
timeCentroidAn epoch, the 'when' characterization.
phaseDirThe (sub)array phase direction
v_antIdThe sequence of antenna identifiers defining the (sub)array
Note
  • this method is temporary given the fact that the SDM is waiting for its version 2 to implement adequately not only timeCentroid but also phaseDir (will be required for OTF)
Warning
The current implementation assumes that
  • timeCentroid is MJD in TAI, the unit in second. Futhermore the accuracy is limited because there is no extra precision attribute (see Main table of casacore::MS v2)
  • phaseDir is in J2000, the unit of the coordinates in radian
Todo:
remove this note and all these warnings (to be coordinated with the release of SDM vers. 2)
void UvwCoords::uvw_bl ( asdm::Tag  configDescriptionId,
const std::vector< std::vector< asdm::Angle > > &  phaseDir,
double  timeCentroid,
Enum< CorrelationModeMod::CorrelationMode >  correlationMode,
bool  reverse,
bool  autoTrailing,
std::vector< casacore::Vector< casacore::Double > > &  v_uvw,
casacore::MSFieldColumns msfc_p = 0 
)

Determine the baseline-based uvw in case timeCentroid is baseline-based, spw-based and bin-based invariant within a dump (i.e.

in an integration or a subintegration)

Parameters
configDescriptionIdConigDescription identifier
phaseDirPhase direction assumed to be J2000
timeCentroidcasacore::Time centroid (unit second) assumed to be MJD TAI
correlationModeCorrelation mode defined by the client (a user query) to filter out data.
reverseParameter characterizing the order of the resulting baselines.
autoTrailingtrue if the cross baselines come first, the zero baselines trailing in the output v_uvw sequence
v_uvwThe returned UVW coordinates for all the pair of antenna and, for each pair, for all the spectral windows and, for each spectral window, for each bin.
Warning
  • With this method the approximation is made that all these baselines share the same time centroid. This approximation which should be adequate in most of the use-cases is obviously more efficient than when the timCentroid changes from one baseline to the next, this because of blanking, whithin a dump.
  • This method will destroy the previous content of v_uvw.
Note
The implementation is optimized to avoid to re-compute the uvw when the same antenna (sub-)array is reused for the same timeCentroid and phaseDir in consecutive updates. In practice this means, for ALMA, that when there is one sub-integration per integration the UVW are not determined twice.
void UvwCoords::uvw_bl ( asdm::Tag  configDescriptionId,
const std::vector< std::vector< asdm::Angle > > &  phaseDir,
const std::vector< double > &  v_timeCentroid,
Enum< CorrelationModeMod::CorrelationMode >  correlationMode,
bool  reverse,
bool  autoTrailing,
std::vector< casacore::Vector< casacore::Double > > &  v_uvw,
casacore::MSFieldColumns msfc_p = 0 
)

Determine the baseline-based uvw in case timeCentroid may change vs baseline, spw or bin within a dump.

Parameters
configDescriptionIdConigDescription identifier
phaseDirPhase direction assumed to be J2000
v_timeCentroidcasacore::Sequence of time centroids (unit second) assumed to be MJD TAI. The order of these in the sequence is described by two parameters, the attributes reverse and autoTrailing.
correlationModeCorrelation mode defined by the client (his/her query) to filter out data.
reverseParameter characterizing the order of the resulting baselines.
autoTrailingtrue if the cross baselines come first, the zero baselines trailing in the output v_uvw sequence
v_uvwThe returned UVW coordinates for all the pairs of antenna and, for each pair, for all the spectral windows and, for each spectral window, for all the bins. There is a ono-to-one association between the uvw ccordinates and the time centroids v_uvw v_timeCentroid having the same size (the number of casacore::MS rows per SDM row in the Main table) and the same sequence order.
Warning
  • With this method every baseline,spectral window,bin triplet has its own time centroid. Because this generality is expensive in term of computation, this method must be avoided when the time centroid does not change vs baseline, spw or bin within a dump.
  • This method will destroy the previous content of v_uvw.
void UvwCoords::uvw_bl ( asdm::MainRow mainRow,
std::vector< std::pair< unsigned int, double > >  v_tci,
Enum< CorrelationModeMod::CorrelationMode >  correlationMode,
std::pair< bool, bool >  dataOrder,
std::vector< casacore::Vector< casacore::Double > > &  v_uvw 
)

Determine the baseline-based uvw for a sequence of epochs.

Parameters
mainRowPointer to a SDM main table row
v_tciIndexed sequence of time centroids. Every spectral window, bin, (sub)integration and baseline has a time centroid. This sequence, a vector, is provided by the method timeSequence() in the class SDMBinData. Every element is a pair, the first corresponding to the index in the output sequenve of UVW coordinate triplets and the second the time centroid for the current index in this input vector.
correlationModeCorrelation mode defined by the client (a use-query) to filter out data.
dataOrderA pair of booleans characterizing the order of the time centroids meta-data in the sequence v_timeCentroid. The first member of this pair is for the order of the baselines and the second to tell if the cross-data come first or not relative to the auto data. This dataOrder attribute is available via a static method of the class SDMBinData.
v_uvwThe returned sequence UVW coordinates. The order in this sequence is controlled by the attributes v_tci and dataOrder. There are two cases:
  • the root axis is the natural native TIM axis. In this case for all the pairs of antenna and, for each pair, for all the spectral windows and, for each spectral window, for each bin. This case is encountered when the method setPriorityDataDescription() in the class SDMBinData has not been used.
  • the root axis is a spectralWindow axis. In this case the order in the sequence is for all the spectral windows and, for each spectral window, for each bin, for all (sub)integration and, for each (sub)integration, for all the pair of antenna and, for each pair. This case is encountered when the method setPriorityDataDescription() in the class SDMBinData has been used.

Whatever the case the returned size will be equal to the size of the input sequence defined by v_ci.

Warning
This function will destroy the previous content of v_uvw.
Note
  • correlationMode must be identical to the one used with the DAMs.
  • v_tci is a product of the DAMs. Its size is the number of casacore::MS rows per SDM row in the Main tables. It is available using the method timeSequence() of the DAMs (SDMBinData).
  • for dataOrder (reverse and autoTrailing) it is available using a static method of the DAMs (SDMBinData).
void UvwCoords::uvw_bl ( asdm::MainRow mainRow,
std::vector< double >  v_timeCentroid,
Enum< CorrelationModeMod::CorrelationMode >  correlationMode,
std::pair< bool, bool >  dataOrder,
std::vector< casacore::Vector< casacore::Double > > &  v_uvw,
casacore::MSFieldColumns msfc_p = 0 
)

Determine the baseline-based uvw for a sequence of epochs.

Parameters
mainRowPointer to a SDM main table row
v_timeCentroidcasacore::Time centroid for every (sub)integration, baseline, spectral window and bin
correlationModeCorrelation mode defined by the client (a use-query) to filter out data.
dataOrderA pair of booleans characterizing the order of the time centroids meta-data in the sequence v_timeCentroid. The first member of this pair is for the order of the baselines and the second to tell if the cross-data come first or not relative to the auto data. This dataOrder attribute is available via a static method of the class SDMBinData.
v_uvwThe returned sequence UVW coordinates for all the pair of antenna and, for each pair, for all the spectral windows and, for each spectral window, for each bin. Hence the returned size will be equal to the size of the input sequence v_timeCentroid.
Warning
This function will destroy the previous content of v_uvw. Note that this method must be used only if the natural (native) TIM axis has been kept to define the root of the axis hierarchy. In that case it is more efficient than when the timeCentroid sequence is defined in a map.
Note
  • correlationMode must be identical to the one used with the DAMs.
  • v_timeCentroid is a product of the DAMs. Its size is the number of casacore::MS rows per SDM row in the Main tables
  • for dataOrder (reverse and autoTrailing) it is available using a static method of the DAMs (SDMBinData).
void UvwCoords::uvw_bl ( const std::vector< asdm::Tag > &  v_antennaId,
unsigned int  nrep,
bool  reverse,
std::vector< casacore::Vector< casacore::Double > > &  v_uvw 
)
private

Determine the baseline-based uvw for a sequence of antenna defining a (sub)array.

Parameters
v_antennaIdThe sequence of antenna identifiers defining the (sub)array
nrepThe number of repeats per baseline (i.e. SUM_k(nstep_k) where k is the spectral window index ) In case of no BIN axis nstep_k=1 and this sum is simply equal to the number of spectral windows.
reverseParameter charcterising the order of the baselines.
               Let consider v_antennaId={1,2,3,4}. 
               - With reverse=true the resulting order is (1,2) (1,3) (2,3) (1,4) (2,4) and (3,4)
               - with reverse=false the resulting order is (1,2) (1,3) (1,4) (2,3) (2,4) and (3,4)
v_uvwThe resulting sequence of uvw 'points'
Note
  • A resulting baseline is defined using the first member of the pair as a the reference and the second as relative. The pair (a,b) means a |-—> b i.e. u_ab = u_b - u_a.
  • The SDM BDF is defined with reverse=true. The current implementation of the DAM produces a sequence corresponding to reverse=false.
Warning
This function will destroy the previous content of v_uvw.

Member Data Documentation

std::map<asdm::Tag,casacore::MPosition> UvwCoords::m_antPos_
private

Definition at line 220 of file UvwCoords.h.

std::map<asdm::Tag,casacore::Vector<casacore::Double> > UvwCoords::m_antUVW_
private

Definition at line 221 of file UvwCoords.h.

std::map<asdm::Tag,ArrayParam> UvwCoords::m_array_
private

Definition at line 219 of file UvwCoords.h.

std::vector<std::vector<asdm::Angle> > UvwCoords::phaseDir_
private

Definition at line 225 of file UvwCoords.h.

casacore::Vector<casacore::Double> UvwCoords::sduvw_
private

Definition at line 228 of file UvwCoords.h.

asdm::Tag UvwCoords::subarrayId_
private

Definition at line 226 of file UvwCoords.h.

double UvwCoords::timeCentroid_
private

the 3 fundamental attributes of the state machine

Definition at line 224 of file UvwCoords.h.


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