VLASDA.h

Classes

VLASDA -- Interprets the data in an sub-array data area of a VLA logical record. (full description)

class VLASDA

Interface

Public Members
VLASDA()
VLASDA(ByteSource& record, uInt offset)
~VLASDA()
VLASDA(const VLASDA& other)
VLASDA& operator=(const VLASDA& other)
void attach(ByteSource& record, uInt offset)
uInt trueChannels(VLAEnum::CDA cda) const
uInt nChannels(VLAEnum::CDA cda) const
Double obsFrequency(VLAEnum::CDA cda) const
Double edgeFrequency(VLAEnum::CDA cda) const
Bool dopplerTracking(VLAEnum::CDA cda) const
Double restFrequency(VLAEnum::CDA cda) const
Double radialVelocity(VLAEnum::CDA cda) const
MFrequency::Types restFrame(VLAEnum::CDA cda) const
MDoppler::Types dopplerDefn(VLAEnum::CDA cda) const
Double channelWidth(VLAEnum::CDA cda) const
Double correlatedBandwidth(VLAEnum::CDA cda) const
Double filterBandwidth(VLAEnum::CDA cda) const
VLAEnum::CorrMode correlatorMode() const
uInt electronicPath(VLAEnum::CDA cda) const
uInt npol(VLAEnum::CDA cda) const
Matrix<VLAEnum::IF> ifUsage(VLAEnum::CDA cda) const
uInt subArray() const
String arrayConfig() const
Vector<Double> sourceDir() const
String sourceName() const
Int sourceQual() const
Double intTime() const
Double obsTime() const
String obsId() const
String obsMode() const
String obsModeFull() const
String calCode() const
MDirection::Types epoch() const
Bool smoothed() const

Description

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

The sub-array data is, in memo 188, frequently shortened to the acronym SDA. As this is specific to the VLA the name VLAADA seemed appropriate.

Synopsis

This class contains functions which access and interpret the data in the sub-array data area of a VLA logical record.

The functions in this class access the specified data in the sub-array data area and may convert the units and data types to something more suitable for general use. They also interpret the data and provide some derived quantities eg., the nPol function.

Example

This code fragment shows how to initialise a VLASDA object and then use this object to determine how much data is in this record. It is assumed that the Bytesource object contains a VLA Logical record.

   ByteSource VLARecord(...);
   VLARCA rca;
   VLASDA sda(VLARecord, rca.SDAOffset());
   cout << "The record has " << rca.nAntennas() <<  " antennas." << endl;
   for (uInt c = 0; c < 4; c++) {
       cout << "CDA " << c;
     if (rca.CDAOffset() == 0) {
       cout << " is not used." << endl;
     else {
       cout << " has " << sda.nChannels(c) << " spectral channels and"
            << sda.npol(c) << " polarisations." << endl;
     }
   }

Motivation

This class was needed as part of the VLA filler application.

Thrown Exceptions

To Do

Member Description

VLASDA()

The default constructor creates a unusable object. You need to use the assignment operator or the attach function to create a usable object.

VLASDA(ByteSource& record, uInt offset)

Construct this object to read data from the SDA of the given VLA logical record. The SDA must begin at the specified number of bytes from the beginning of the record (see the example above).

~VLASDA()

The destructor is trivial;

VLASDA(const VLASDA& other)

The copy constructor uses reference semantics.

VLASDA& operator=(const VLASDA& other)

The assignment constructor uses reference semantics.

void attach(ByteSource& record, uInt offset)

Re-initialise this object so that it now reads data from the given VLA logical record. The sub-array data area that will be used begins at the specified number of bytes from the beginning of the record.

uInt trueChannels(VLAEnum::CDA cda) const

returns the number of data channels in the specified CDA (including the average channel)

uInt nChannels(VLAEnum::CDA cda) const

returns the number of spectral channels in the specified CDA (excludes channel zero)

Double obsFrequency(VLAEnum::CDA cda) const

returns the observed frequency (in Hz), at the band centre for the specified CDA. This is the observed frequency after Doppler tracking has been applied. It will correspond to the middle of the centre channel if there are an odd number of channels and takes into account that some channels may have been correlated but discarded prior to archiving.

Double edgeFrequency(VLAEnum::CDA cda) const

returns the observed frequency at the lower edge of the band, after correcting for channels that have been correlated and discarded prior to archiving the data. ie it returns the observed frequency of the lower edge of the first channel in the data.

Bool dopplerTracking(VLAEnum::CDA cda) const

returns true if Doppler tracking has been turned on for the specified CDA. If so then the observed frequency is calculated from the source radial velocity, the line rest frequency and the component of the earths velocity relative to the source (in the specified reference Frame).

Double restFrequency(VLAEnum::CDA cda) const

returns the assumed rest frequency of the source radiation in Hz (for the specified CDA). This number is supplied by the observer and used in the doppler tracking calculations. The returned value is not meaningful if doppler tracking is not used.

Double radialVelocity(VLAEnum::CDA cda) const

returns the assumed radial velocity of the source in m/sec (for the specified CDA). This number is supplied by the observer and used in the doppler tracking calculations. The returned value is not meaningful if doppler tracking is not used.

MFrequency::Types restFrame(VLAEnum::CDA cda) const

Return the assumed rest frame that will be used when calculating the observers motion relative to the source (for the specified CDA). This frame is supplied by the observer and used in the Doppler tracking calculations. The returned value is not meaningful of Doppler tracking is not used.

MDoppler::Types dopplerDefn(VLAEnum::CDA cda) const

Return the definition of Doppler shift used to convert the radial velocity to a frequency (for the specified CDA). This is supplied by the observer and used in the Doppler tracking calculations. The returned value is not meaningful of Doppler tracking is not used.

Double channelWidth(VLAEnum::CDA cda) const

returns the bandwidth of an individual channel, in Hz, of the data in the specified CDA.

Double correlatedBandwidth(VLAEnum::CDA cda) const

returns the total bandwidth, in Hz, over all the channels of the data in the specified CDA. Throws an exception if which > 3.

Double filterBandwidth(VLAEnum::CDA cda) const

returns the total bandwidth, in Hz, of the front end filter in the specified CDA. Throws an exception if which > 3.

VLAEnum::CorrMode correlatorMode() const

Return the correlator mode for this record. Only useful if you know what these codes are. The functions immediatly following this one are probably more useful as they interpret this code for you.

uInt electronicPath(VLAEnum::CDA cda) const

Return the 'electronic path' that the data in the specified CDA has travveled through. Returns 0 if the data in the specified CDA is from IF's A or C and 1 if the data is from IF's B or D. The returned value is meaningless if the CDA is not used in the current record. This information is obtained from knowing what the correlator modes represent.

uInt npol(VLAEnum::CDA cda) const

Return the number of polarisations in the specified CDA. This information is obtained from knowing what the correlator modes represent.

Matrix<VLAEnum::IF> ifUsage(VLAEnum::CDA cda) const

return a Matrix indicating which if's contributed to which correlations within the specified CDA. The return Matrix always has two columns and the same number of rows as there are correlations. Each row indicates which IF from antennas one & two respectrively contributed to thw correlation. This function encodes the information in Appendix F1 of memo 188.

uInt subArray() const

Return the subarray ID. This is a number between 1 and 4 indicating which subarray this data corresponds to.

String arrayConfig() const

Return the Array configuration as a string. The string will contain at between one and two characters and be somethings like "A", "D", "AD", etc

Vector<Double> sourceDir() const

Return the source RA and Dec at the standard epoch of this integration (given by the epoch function). The returned Vector will always have two elements being the RA and Dec in radians.

String sourceName() const

Return the source name as typed in by the observer.

Int sourceQual() const

Return the source qualifier as typed in by the observer. This is really the scan number.

Double intTime() const

Return the integration time in seconds.

Double obsTime() const

Return the observation time in seconds of the centre of this integration. Zero seconds means midnight on the day specified win the RCA.

String obsId() const

Return the observation program id.

String obsMode() const

Return the observing mode

String obsModeFull() const

Return the observing mode in full glory

String calCode() const

Return the calibration code.

MDirection::Types epoch() const

return the reference frame for the field directions.

Bool smoothed() const

returns whether the data spectrum has been Hanning smoothed (and every second channel discarded). Always returns False for continuum data.