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

GBTCorrelation holds spectral window and polarization information. More...

#include <GBTCorrelation.h>

List of all members.

Public Member Functions

 GBTCorrelation (Int nstate, Int nchan)
 Construct one with no feed information.
 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.
 GBTCorrelation (const GBTCorrelation &other)
 copy constructor
 ~GBTCorrelation ()
GBTCorrelationoperator= (const GBTCorrelation &other)
 Assignment operator, uses copy syntax.
Bool operator== (const GBTCorrelation &other) const
 comparison operator.
Int nstate () const
 The number of states used in the constructor.
const Stringbank () const
 The bank used in the constructor.
void setsrbank (const String &srbank)
 Set the name of the other bank for switched data.
const Stringsrbank () 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.
void setDataDescId (Int ddid, Int state)
 Set the associated DATA_DESC_ID for the given state.
Int polId () const
 The POLARIZATION_ID appropriate for this correlation and state.
void setPolId (Int pid)
 Set the associated POLARIZATION_ID for the given state.
Bool setSamplerRow (Int samplerRow, const String &polA, const String &polB, const String &receptorA, const String &receptorB)
 Set up information about a given sampler row.
Bool mergeCorr (const GBTCorrelation &otherCorr, Bool bankCheck)
 Merge the unfrozen aspects of otherCorr with this GBTCorr.
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.
const Vector< Int > & samplerRows () const
 The samplerRows associated with corrType.
Int numCorr () const
 the number of correlations.
const Vector< Int > & corrType () const
 The polarization of the numCorr correlations.
const Vector< String > & corrTypeAsString () const
 The polarizations as strings.
const Matrix< Int > & corrProduct () const
 The receptor cross-products.
const Vector< String > & receptors () const
 The receptors names used, one for each correlation pair.
const IPosition & shape () const
 The shape of this correlation.

Private Member Functions

 GBTCorrelation ()
 unimplemented and unavailable

Private Attributes

Int itsNstate
Int itsPolId
uInt itsNumCorr
uInt itsNumPol
Bool itsFrozen
Bool itsIsDefault
String itsBank
String itsSrbank
IPosition itsShape
Vector< Int > itsDataDescId
SimpleOrderedMap< String, Int > itsRecptMap
Vector< Int > itsCorrType
Vector< Int > itsSamplerRows
Matrix< Int > itsCorrProduct
Vector< StringitsReceptors
Vector< StringitsCorrTypeString

Detailed Description

GBTCorrelation holds spectral window and polarization information.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd
Test programs:
tGBTCorrelation

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.

Definition at line 79 of file GBTCorrelation.h.


Constructor & Destructor Documentation

GBTCorrelation::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::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.

copy constructor

Definition at line 104 of file GBTCorrelation.h.

unimplemented and unavailable


Member Function Documentation

const String& GBTCorrelation::bank ( ) const [inline]

The bank used in the constructor.

Definition at line 117 of file GBTCorrelation.h.

References itsBank.

const Matrix<Int>& GBTCorrelation::corrProduct ( ) const [inline]

The receptor cross-products.

The actual returned value is not specified if it has not yet been frozen

Definition at line 195 of file GBTCorrelation.h.

References itsCorrProduct.

const Vector<Int>& GBTCorrelation::corrType ( ) const [inline]

The polarization of the numCorr correlations.

The actual returned value is not specified if it has not yet been frozen.

Definition at line 187 of file GBTCorrelation.h.

References itsCorrType.

const Vector<String>& GBTCorrelation::corrTypeAsString ( ) const [inline]

The polarizations as strings.

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

Definition at line 191 of file GBTCorrelation.h.

References itsCorrTypeString.

Int GBTCorrelation::dataDescId ( Int  state) const [inline]

The DATA_DESC_ID appropriate for this correlation and the requested state.

Returns -1 if unset.

Definition at line 127 of file GBTCorrelation.h.

References itsDataDescId.

Freeze this correlation with the sampler row information already provided.

Additional calls to setSamplerRow return False and are ignored.

Bool GBTCorrelation::mergeCheck ( const GBTCorrelation otherCorr,
Bool  bankCheck 
)

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

Bool GBTCorrelation::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.

Int GBTCorrelation::nstate ( ) const [inline]

The number of states used in the constructor.

Definition at line 114 of file GBTCorrelation.h.

References itsNstate.

Int GBTCorrelation::numCorr ( ) const [inline]

the number of correlations.

Returns 0 if called before freeze() has been called.

Definition at line 182 of file GBTCorrelation.h.

References itsFrozen, and itsNumCorr.

GBTCorrelation& GBTCorrelation::operator= ( const GBTCorrelation other)

Assignment operator, uses copy syntax.

Bool GBTCorrelation::operator== ( const GBTCorrelation other) const

comparison operator.

Checks shape, corrType, corrProduct and receptors.

Int GBTCorrelation::polId ( ) const [inline]

The POLARIZATION_ID appropriate for this correlation and state.

Returns -1 if unset.

Definition at line 136 of file GBTCorrelation.h.

References itsPolId.

const Vector<String>& GBTCorrelation::receptors ( ) const [inline]

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.

Definition at line 203 of file GBTCorrelation.h.

References itsReceptors.

const Vector<Int>& GBTCorrelation::samplerRows ( ) const [inline]

The samplerRows associated with corrType.

The actual returned value is not specified if it has not yet been frozen.

Definition at line 178 of file GBTCorrelation.h.

References itsSamplerRows.

void GBTCorrelation::setDataDescId ( Int  ddid,
Int  state 
) [inline]

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.

Definition at line 132 of file GBTCorrelation.h.

References itsDataDescId.

void GBTCorrelation::setPolId ( Int  pid) [inline]

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.

Definition at line 142 of file GBTCorrelation.h.

References itsPolId.

Bool GBTCorrelation::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()

void GBTCorrelation::setsrbank ( const String srbank) [inline]

Set the name of the other bank for switched data.

Definition at line 120 of file GBTCorrelation.h.

References itsSrbank, and srbank().

const IPosition& GBTCorrelation::shape ( ) const [inline]

The shape of this correlation.

Definition at line 206 of file GBTCorrelation.h.

References itsShape.

const String& GBTCorrelation::srbank ( ) const [inline]

Get the name of the other bank for switched data.

Definition at line 123 of file GBTCorrelation.h.

References itsSrbank.

Referenced by setsrbank().


Member Data Documentation

Definition at line 211 of file GBTCorrelation.h.

Referenced by bank().

Matrix<Int> GBTCorrelation::itsCorrProduct [private]

Definition at line 222 of file GBTCorrelation.h.

Referenced by corrProduct().

Vector<Int> GBTCorrelation::itsCorrType [private]

Definition at line 221 of file GBTCorrelation.h.

Referenced by corrType().

Definition at line 223 of file GBTCorrelation.h.

Referenced by corrTypeAsString().

Vector<Int> GBTCorrelation::itsDataDescId [private]

Definition at line 216 of file GBTCorrelation.h.

Referenced by dataDescId(), and setDataDescId().

Bool GBTCorrelation::itsFrozen [private]

Definition at line 210 of file GBTCorrelation.h.

Referenced by numCorr().

Definition at line 210 of file GBTCorrelation.h.

Definition at line 208 of file GBTCorrelation.h.

Referenced by nstate().

Definition at line 209 of file GBTCorrelation.h.

Referenced by numCorr().

uInt GBTCorrelation::itsNumPol [private]

Definition at line 209 of file GBTCorrelation.h.

Int GBTCorrelation::itsPolId [private]

Definition at line 208 of file GBTCorrelation.h.

Referenced by polId(), and setPolId().

Definition at line 223 of file GBTCorrelation.h.

Referenced by receptors().

SimpleOrderedMap<String, Int> GBTCorrelation::itsRecptMap [private]

Definition at line 219 of file GBTCorrelation.h.

Vector<Int> GBTCorrelation::itsSamplerRows [private]

Definition at line 221 of file GBTCorrelation.h.

Referenced by samplerRows().

IPosition GBTCorrelation::itsShape [private]

Definition at line 213 of file GBTCorrelation.h.

Referenced by shape().

Definition at line 211 of file GBTCorrelation.h.

Referenced by setsrbank(), and srbank().


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