GBTCorrelation.h

Classes

GBTCorrelation -- GBTCorrelation holds spectral window and polarization information (full description)

class GBTCorrelation

Interface

Public Members
GBTCorrelation(Int nstate, Int nchan)
GBTCorrelation(const GBTFeed &feed, Int nstate, Int nchan, const String &bank)
GBTCorrelation(const GBTCorrelation &other)
~GBTCorrelation()
GBTCorrelation &operator=(const GBTCorrelation &other)
Bool operator==(const GBTCorrelation &other) const
Int nstate() const
const String &bank() const
void setsrbank(const String &srbank)
const String &srbank() const
Int dataDescId(Int state) const
void setDataDescId(Int ddid, Int state)
Int polId() const
void setPolId(Int pid)
Bool setSamplerRow(Int samplerRow, const String &polA, const String &polB, const String &receptorA, const String &receptorB)
Bool mergeCorr(const GBTCorrelation &otherCorr, Bool bankCheck)
Bool mergeCheck(const GBTCorrelation &otherCorr, Bool bankCheck)
void freeze()
const Vector<Int> &samplerRows() const
Int numCorr() const
const Vector<Int> &corrType() const
const Vector<String> &corrTypeAsString() const
const Matrix<Int> &corrProduct() const
const Vector<String> &receptors() const
const IPosition &shape() const
Private Members
GBTCorrelation()

Description

Review Status

Date Reviewed:
yyyy/mm/dd
Programs:
Tests:

Prerequisite

Etymology

This holds information that describes the correlation type appropriate for one row of a MS. This is used for GBT data and within the GBT filler. This information includes the data description id and the two components of the data description table (spectral window id and polarization id). It also includes information necessary to fill the polarization table. Finally, it keeps a record of which sampler row contributed to each pair of receptors in a given correlation.

Motivation

When this information was being held by a larger class, it was getting confused with other issues related to that class. By putting it in a smaller, simpler class the maintenance will be easier and usage will be less confusing.

Member Description

GBTCorrelation(Int nstate, Int nchan)

Construct one with no feed information. This will have one correlation labelled "XX". The number of states and channels must be specified at construction time. Bank defaults to the empty string.

GBTCorrelation(const GBTFeed &feed, Int nstate, Int nchan, const String &bank)

Use the indicated FEED to prepare to record the sampler row information for each receptor pair. Initially has space available for each possible combination of receptor pairs. When freeze is called, those pairs not actually set via setSamplerRow are removed and numCorr then reflects the actual receptor pairs in use (as do corrType and corrProduct). The number of states and channels must be specified at construction. The bank is used to discriminate against similar correlations in the ACS but from different banks.

GBTCorrelation(const GBTCorrelation &other)

copy constructor

~GBTCorrelation()

GBTCorrelation &operator=(const GBTCorrelation &other)

Assignment operator, uses copy syntax.

Bool operator==(const GBTCorrelation &other) const

comparison operator. Checks shape, corrType, corrProduct and receptors.

Int nstate() const

The number of states used in the constructor.

const String &bank() const

The bank used in the constructor.

void setsrbank(const String &srbank)

Set the name of the other bank for switched data

const String &srbank() const

Get the name of the other bank for switched data

Int dataDescId(Int state) const

The DATA_DESC_ID appropriate for this correlation and the requested state. Returns -1 if unset.

void setDataDescId(Int ddid, Int state)

Set the associated DATA_DESC_ID for the given state. It can be set and changed after freeze has been called. This will typically be the last item set.

Int polId() const

The POLARIZATION_ID appropriate for this correlation and state. Returns -1 if unset.

void setPolId(Int pid)

Set the associated POLARIZATION_ID for the given state. It can be set and changed after freeze has been called. This will typically be set before DATA_DESC_ID is available. It can be set and changed after freeze has been called.

Bool setSamplerRow(Int samplerRow, const String &polA, const String &polB, const String &receptorA, const String &receptorB)

Set up information about a given sampler row. If the constructor without GBTFeed was used, then this always is associated with the XX correlation, irrespective of the actual values of polA and polB. If not, then this returns False if the polA or polB receptors are not found in the feed used in the constructor. This returns False if this polA and polB combination has already been set here. Returns False after freeze() has been called. The names of the two receptors from the IF fits file are also passed in. These are later available via receptors()

Bool mergeCorr(const GBTCorrelation &otherCorr, Bool bankCheck)

Merge the unfrozen aspects of otherCorr with this GBTCorr. Returns False if the setSamplerRow would have returned False had these been added in that way or if the bank in otherCorr does not match the one used in the constructor for this object. The bank check is only done when bankCheck is True. That should only be done for ACS data.

Bool mergeCheck(const GBTCorrelation &otherCorr, Bool bankCheck)

Does the same checks that mergeCorr does without actually merging anything.

void freeze()

Freeze this correlation with the sampler row information already provided. Additional calls to setSamplerRow return False and are ignored.

const Vector<Int> &samplerRows() const

The samplerRows associated with corrType. The actual returned value is not specified if it has not yet been frozen.

Int numCorr() const

the number of correlations. Returns 0 if called before freeze() has been called.

const Vector<Int> &corrType() const

The polarization of the numCorr correlations. The actual returned value is not specified if it has not yet been frozen.

const Vector<String> &corrTypeAsString() const

The polarizations as strings. Auto-correlations are returned as single letters (i.e. "XX" becomes "X").

const Matrix<Int> &corrProduct() const

The receptor cross-products. The actual returned value is not specified if it has not yet been frozen

const Vector<String> &receptors() const

The receptors names used, one for each correlation pair. For auto-correlation data, this will be just the original receptor name. For cross-correlation data, it will be receptor A name "x" receptor B name e.g. "R1xL1". This is used when getting the tcal and trx values from the rcvr tables.

const IPosition &shape() const

The shape of this correlation

GBTCorrelation()

unimplemented and unavailable