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

Class for baseline-based metadata objects, one type of component in SDM data objects. More...

#include <BaselineMetadata.h>

Public Member Functions

int numValue ()
 Total (cross+auto) number of metadata values. More...
 
virtual int numAnt ()=0
 Accessor to a generic number of antennas $ N_{ant} $ Specifities are defined in the derived classes. More...
 
virtual int actualNumAnt ()=0
 Accessor to an actual number of antennas $ N'_{ant} $ Specifities are defined in the derived classes. More...
 
int numBaseline ()
 Accessor to the number of baselines. More...
 
int numBaseband ()
 Accessor to the number of basebands. More...
 
int numPolProduct (int basebandNum) throw (Error)
 Accessor to the number of polarization products of a given baseband. More...
 
std::vector< int > numPolProduct ()
 Accessor to the number of polarization products. More...
 
int numBin (int basebandNum) throw (Error)
 Accessor to the number of bins (steps or phases in scwitching cycles) for a given baseband. More...
 
std::vector< int > numBin ()
 Accessor to the number of bins (steps or phases in scwitching cycles) for each baseband. More...
 
int correlationMode ()
 Accessor to the correlation mode. More...
 
int numAutoPolProduct (int basebandNum) throw (Error)
 Accessor to the (derived) number of polarization products for the zero baselines for a given baseband. More...
 
std::vector< int > numAutoPolProduct ()
 Accessor to the (derived) number of polarization products for the zero baselines for all the basebands. More...
 
virtual std::vector< int > antennaIndexUsed (unsigned long int valLimit)=0
 Method to get the list of the antenna indices restricted to those which are not flagged above a certain critical limit in all baseband. More...
 
int baselineNum (int anti, int antj) throw (Error)
 Baseline number (one-based) given a pair of antenna indices. More...
 
int at (int npp, int nbin, int nbb, int i, int j)
 Index in a container of baseline-based metadata given a node specified by a full set of indices of the parameter space. More...
 
std::vector< int > at (int npp, int nbb, int i, int j)
 Set of indices, one per polarization product, in a container of baseline-based metadata given a set of nodes specified by a subset of indices of the parameter space. More...
 
std::vector< int > at (int npp, int nbin, int nbb)
 Set of indices, one per non-zero basleine, in a container of baseline-based metadata given a set of nodes specified by a subset of indices of the parameter space. More...
 
std::vector< std::vector< int > > at (int nbin, int nbb)
 Set of indices in a container of baseline-based metadata given a set of nodes node specified by a subset of indices of the parameter space. More...
 
std::vector< std::vector
< std::vector< int > > > 
at (bool cross, int i)
 Set of indices in a container of baseline-based metadata given a set of nodes node specified by a subset of indices of the parameter space. More...
 

Static Public Attributes

static int FLAGLIMIT
 

Protected Member Functions

 BaselineMetadata ()
 Default constructor. More...
 
virtual ~BaselineMetadata ()
 Virtual destructor. More...
 
void mkBaselineMetadata (std::vector< int > v_npp, std::vector< int > v_nbin, int nbb, int nant, int correlationMode)
 Method to instantiate the base of the hierarchy. More...
 
bool wrongBasebandNum (int basebandNum)
 Utility to access the validity of an input basebandNum. More...
 
bool notFor (bool interfero)
 Utility method to check that a query is relevant or not for interferometric data. More...
 
bool wrongAntennaIndex (int antIndex)
 Utility method to check that the input value of antenna index in a query is valid or not. More...
 
bool wrongBasebandIndex (int bbIndex)
 Utility method to check that the input baseband index value in a query is valid or not. More...
 
bool wrongPolProductIndex (int ppIndex, int bbIndex, int antIndex_i, int antIndex_j)
 Utility method to check that the input set of index values in a query is valid or not. More...
 
virtual void display ()=0
 Common part shared by the derived classes for summary information Display, for each baseband sizes (i.e. More...
 

Protected Attributes

std::vector< int > v_numPolProduct_
 Number of cross polarization products for every baseband. More...
 
std::vector< int > v_numBin_
 Number of phases in SwitchCycles for every baseband. More...
 
int numBaseband_
 Number of basebands. More...
 
int numAnt_
 Number of antennas. More...
 
int numBaseline_
 Number of baselines. More...
 
int autoSize_
 Number of metadata values for all the zero baselines (second part in size formula) More...
 
int crossSize_
 Number of metadata values for all the non-zero baselines (first part in size formula) More...
 
int correlationMode_
 Correlation mode. More...
 
std::vector< int > v_numAutoPolProduct_
 Number of auto polarization products for every baseband. More...
 

Private Member Functions

void sizes ()
 Method to get the size (in number of typed values). More...
 

Private Attributes

int numValPerBaseline_
 Number of metadata values per non-zero baseline (first sum in size formula) More...
 
int numValPerZeroBaseline_
 Number of metadata values per zero baseline (second sum in size formula) More...
 

Detailed Description

Class for baseline-based metadata objects, one type of component in SDM data objects.


There are three baseline-based metadata in these objects, the flags, the actual times (the mid-point) and the actual durations. Sharing the same type of tree structure they derive from this BaselineMetadata virtual class, the common base.
An example of how to Access to the baseline-based metadata is given in a test program which uses methods defined in this base but also other methods which are extensions defined in the BaselineFlagsMetada and the ActualTimeDurations classes.

Definition at line 14 of file BaselineMetadata.h.

Constructor & Destructor Documentation

sdmbin::BaselineMetadata::BaselineMetadata ( )
protected

Default constructor.

virtual sdmbin::BaselineMetadata::~BaselineMetadata ( )
protectedvirtual

Virtual destructor.

Member Function Documentation

virtual int sdmbin::BaselineMetadata::actualNumAnt ( )
pure virtual

Accessor to an actual number of antennas $ N'_{ant} $ Specifities are defined in the derived classes.

virtual std::vector<int> sdmbin::BaselineMetadata::antennaIndexUsed ( unsigned long int  valLimit)
pure virtual

Method to get the list of the antenna indices restricted to those which are not flagged above a certain critical limit in all baseband.

Parameters
valLimitcritical flagging limit
Returns
The list of antenna indices fulfilling the criterion
int sdmbin::BaselineMetadata::at ( int  npp,
int  nbin,
int  nbb,
int  i,
int  j 
)

Index in a container of baseline-based metadata given a node specified by a full set of indices of the parameter space.

Parameters
npppolarization product index
nbinbin index (always 0 when there is no switching mode used)
nbbbaseband index
iantenna index i
jantenna index j (if i=j this means a zero-baseline)
Returns
the index in the container of baseline-based metadata for this node.
std::vector<int> sdmbin::BaselineMetadata::at ( int  npp,
int  nbb,
int  i,
int  j 
)

Set of indices, one per polarization product, in a container of baseline-based metadata given a set of nodes specified by a subset of indices of the parameter space.

Parameters
npppolarization product index
nbbbaseband index
iantenna index i
jantenna index j (if i=j this means a zero-baseline)
Returns
A set of indices, one per bin, defining locations in the container of baseline-based metadata for this set of nodes.
std::vector<int> sdmbin::BaselineMetadata::at ( int  npp,
int  nbin,
int  nbb 
)

Set of indices, one per non-zero basleine, in a container of baseline-based metadata given a set of nodes specified by a subset of indices of the parameter space.

Parameters
npppolarization product index
nbinbin index (always 0 when there is no switching mode used)
nbbbaseband index
Returns
A set of indices, one per non-zero baseline, defining locations in the container of baseline-based metadata for this set of nodes.
std::vector<std::vector<int> > sdmbin::BaselineMetadata::at ( int  nbin,
int  nbb 
)

Set of indices in a container of baseline-based metadata given a set of nodes node specified by a subset of indices of the parameter space.

Parameters
nbinbin index (always 0 when there is no switching mode used)
nbbbaseband index
Returns
a two levels tree of indices (a set of subsets of indices)
std::vector<std::vector<std::vector<int> > > sdmbin::BaselineMetadata::at ( bool  cross,
int  i 
)

Set of indices in a container of baseline-based metadata given a set of nodes node specified by a subset of indices of the parameter space.

Parameters
crosstrue to select the indices for the non-zero baselines, else false for the zero baselines
iantenna index i to select all baselines involving this antenna of index i
Returns
a three levels tree (polarization product, baseband, baseline) of indices
int sdmbin::BaselineMetadata::baselineNum ( int  anti,
int  antj 
)
throw (Error
)

Baseline number (one-based) given a pair of antenna indices.

Parameters
antiindex (zero-based) for antenna i
antjindex (zero-based) for antenna i
Returns
The baseline number
Exceptions
Errorthe indices anti and/or antj exceed the limit for the number of baselines.
int sdmbin::BaselineMetadata::correlationMode ( )

Accessor to the correlation mode.

Returns
The correlation mode:
  • 0 means that the data contains only interferometric data. This does not imply that the baseline-based metadata are exclusively for the non-zero baselines! See the documentation of the sizes() method.
  • 1 means that the data are exclusively for the zero baselines. In this case the baseline-based metadata are also exclusively for the zero baselines.
  • 2 means that both the non-zero and zero baselines are present.
virtual void sdmbin::BaselineMetadata::display ( )
protectedpure virtual

Common part shared by the derived classes for summary information Display, for each baseband sizes (i.e.

number of branches in the baseline-based metadata tree)

void sdmbin::BaselineMetadata::mkBaselineMetadata ( std::vector< int >  v_npp,
std::vector< int >  v_nbin,
int  nbb,
int  nant,
int  correlationMode 
)
protected

Method to instantiate the base of the hierarchy.

Parameters
v_nppNumber of polarization product for every baseband
v_nbinNumber of bins (phases in a switch cycle) for every baseband
nbbNumber of baseband (should be the size of v_npp and v_nbin)
nantNumber of antennas ( $ N_{ant} $)
correlationModeThe correlation mode (must be 0 or 1 or 2).
bool sdmbin::BaselineMetadata::notFor ( bool  interfero)
protected

Utility method to check that a query is relevant or not for interferometric data.

Parameters
interfero
Returns
True or false depending on the correlationMode value
virtual int sdmbin::BaselineMetadata::numAnt ( )
pure virtual

Accessor to a generic number of antennas $ N_{ant} $ Specifities are defined in the derived classes.

int sdmbin::BaselineMetadata::numAutoPolProduct ( int  basebandNum)
throw (Error
)

Accessor to the (derived) number of polarization products for the zero baselines for a given baseband.

Parameters
basebandNumThe baseband number (one-based)
Returns
The number of products for that baseband number
Exceptions
Errorthe method returns -1 in lax mode
std::vector<int> sdmbin::BaselineMetadata::numAutoPolProduct ( )

Accessor to the (derived) number of polarization products for the zero baselines for all the basebands.

Returns
The number of products for each of the basebands in the configuration
int sdmbin::BaselineMetadata::numBaseband ( )

Accessor to the number of basebands.

Returns
The number of basebands $ N_{bb} $
int sdmbin::BaselineMetadata::numBaseline ( )

Accessor to the number of baselines.

Returns
the number of baselines $ N_{bl} $
int sdmbin::BaselineMetadata::numBin ( int  basebandNum)
throw (Error
)

Accessor to the number of bins (steps or phases in scwitching cycles) for a given baseband.

Parameters
basebandNumThe basbabnd number (one-based)
Returns
The number of bins
Exceptions
Errorthe method returns -1 in lax mode
std::vector<int> sdmbin::BaselineMetadata::numBin ( )

Accessor to the number of bins (steps or phases in scwitching cycles) for each baseband.

Returns
A vector of number of bins, one number per baseband.
int sdmbin::BaselineMetadata::numPolProduct ( int  basebandNum)
throw (Error
)

Accessor to the number of polarization products of a given baseband.

Parameters
basebandNumBaseband number (one-based)
Returns
The number of polarization products ( $ N_{pp}^{oo} $
Exceptions
Errorthe method returns -1 in lax mode
Note
Use the method numAutoPolProduct(int) to get the antenna-based number of product $ N_{pp}^{o}$ if correlationMode=1.
std::vector<int> sdmbin::BaselineMetadata::numPolProduct ( )

Accessor to the number of polarization products.

The constraint is that all spectral windows in a baseband are associated with a common polarization identifier.

Returns
a vector of numbers of products, one number per baseband.
Note
Use the method numAutoPolProduct() to get the antenna-based number of products if correlationMode=1.
int sdmbin::BaselineMetadata::numValue ( )

Total (cross+auto) number of metadata values.

Returns
The sum of the cross and auto baseline-based metadata values
Note
The size is determined in the method sizes() from the following formula:
$ N_{bl}~ \sum_{i=1}^{N_{bb}} N_{bin}(i)~N_{pp}^{oo}(i) + N_{ant}~\sum_{i=1}^{N_{bb}} N_{bin}(i)~N_{pp}^{o}(i) $
and the peculiar non-standard mode ({ correlationMode}=0) by:
$ N_{bl}~ \sum_{i=1}^{N_{bb}} N_{bin}(i)~N_{pp}^{oo}(i) + N_{ant}~\sum_{i=1}^{N_{bb}} N_{bin}(i)~f(N_{pp})(i)~ $
with in this specific case
$ f(N_{pp}(i)) = \left\| \begin{array} {r@{\quad if\quad}l} 1 & N_{pp}^{oo}(i)=1\\ 2 & N_{pp}^{oo}(i)>1\\ \end{array} \right. $
In this abstract class $N_{ant}$ must be considered as generic. Its actual value depends of the context in the derived classes.
The size of the containers for the baseline-based metadata may also be obtained, in number of bytes, with methods of the asdmBinary::BinaryHeaderElement class.
void sdmbin::BaselineMetadata::sizes ( )
private

Method to get the size (in number of typed values).

The size is determined from the following formula:
$ N_{bl}~ \sum_{i=1}^{N_{bb}} N_{bin}(i)~N_{pp}^{oo}(i) + N_{ant}~\sum_{i=1}^{N_{bb}} N_{bin}(i)~N_{pp}^{o}(i) $
and the peculiar non-standard mode (correlationMode=0) by:
$ N_{bl}~ \sum_{i=1}^{N_{bb}} N_{bin}(i)~N_{pp}^{oo}(i) + N_{ant}~\sum_{i=1}^{N_{bb}} N_{bin}(i)~f(N_{pp})(i)~ $
with in this specific case
$ f(N_{pp}(i)) = \left\| \begin{array} {r@{\quad if\quad}l} 1 & N_{pp}^{oo}(i)=1\\ 2 & N_{pp}^{oo}(i)>1\\ \end{array} \right. $
In this abstract class $N_{ant}$ must be considered as generic. Its actual value depends of the context in the derived classes.

Note
The size of the containers for the baseline-based metadata may also be obtained, in number of bytes, with methods of the asdmBinary::BinaryHeaderElement class.
bool sdmbin::BaselineMetadata::wrongAntennaIndex ( int  antIndex)
protected

Utility method to check that the input value of antenna index in a query is valid or not.

Parameters
antIndexThe antenna index
Returns
True or false depending on the upper limit coming from the number of antennas
bool sdmbin::BaselineMetadata::wrongBasebandIndex ( int  bbIndex)
protected

Utility method to check that the input baseband index value in a query is valid or not.

Parameters
bbIndexThe baseband index
Returns
True or false depending on the upper limit coming from the number of basebands set in the configuartion
bool sdmbin::BaselineMetadata::wrongBasebandNum ( int  basebandNum)
protected

Utility to access the validity of an input basebandNum.

Parameters
basebandNumBaseband number
Returns
True if not one-based or exceeds the number of basebands in the configuration, else false
bool sdmbin::BaselineMetadata::wrongPolProductIndex ( int  ppIndex,
int  bbIndex,
int  antIndex_i,
int  antIndex_j 
)
protected

Utility method to check that the input set of index values in a query is valid or not.

Parameters
ppIndexThe polarization product index
bbIndexThe baseband index
antIndex_iThe antenna index for antenna i
antIndex_jThe antenna index for antenna j
Returns
True or false depending on the upper limit for each of these items. Note that ppIndex is a function of the baseband index.

Member Data Documentation

int sdmbin::BaselineMetadata::autoSize_
protected

Number of metadata values for all the zero baselines (second part in size formula)

Definition at line 206 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::correlationMode_
protected

Correlation mode.

Definition at line 208 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::crossSize_
protected

Number of metadata values for all the non-zero baselines (first part in size formula)

Definition at line 207 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::FLAGLIMIT
static

Definition at line 181 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::numAnt_
protected

Number of antennas.

Definition at line 203 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::numBaseband_
protected

Number of basebands.

Definition at line 202 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::numBaseline_
protected

Number of baselines.

Definition at line 204 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::numValPerBaseline_
private

Number of metadata values per non-zero baseline (first sum in size formula)

Definition at line 256 of file BaselineMetadata.h.

int sdmbin::BaselineMetadata::numValPerZeroBaseline_
private

Number of metadata values per zero baseline (second sum in size formula)

Definition at line 257 of file BaselineMetadata.h.

std::vector<int> sdmbin::BaselineMetadata::v_numAutoPolProduct_
protected

Number of auto polarization products for every baseband.

Definition at line 209 of file BaselineMetadata.h.

std::vector<int> sdmbin::BaselineMetadata::v_numBin_
protected

Number of phases in SwitchCycles for every baseband.

Definition at line 201 of file BaselineMetadata.h.

std::vector<int> sdmbin::BaselineMetadata::v_numPolProduct_
protected

Number of cross polarization products for every baseband.

Definition at line 200 of file BaselineMetadata.h.


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