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

Interprets the data in an sub-array data area of a VLA logical record. More...

#include <VLASDA.h>

List of all members.

Public Member Functions

 VLASDA ()
 The default constructor creates a unusable object.
 VLASDA (ByteSource &record, uInt offset)
 Construct this object to read data from the SDA of the given VLA logical record.
 ~VLASDA ()
 The destructor is trivial;.
 VLASDA (const VLASDA &other)
 The copy constructor uses reference semantics.
VLASDAoperator= (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.
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.
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.
Bool dopplerTracking (VLAEnum::CDA cda) const
 returns true if Doppler tracking has been turned on for the specified CDA.
Double restFrequency (VLAEnum::CDA cda) const
 returns the assumed rest frequency of the source radiation in Hz (for the specified CDA).
Double radialVelocity (VLAEnum::CDA cda) const
 returns the assumed radial velocity of the source in m/sec (for the specified CDA).
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).
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).
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.
Double filterBandwidth (VLAEnum::CDA cda) const
 returns the total bandwidth, in Hz, of the front end filter in the specified CDA.
VLAEnum::CorrMode correlatorMode () const
 Return the correlator mode for this record.
uInt electronicPath (VLAEnum::CDA cda) const
 Return the 'electronic path' that the data in the specified CDA has travveled through.
uInt npol (VLAEnum::CDA cda) const
 Return the number of polarisations in the specified CDA.
Matrix< VLAEnum::IFifUsage (VLAEnum::CDA cda) const
 return a Matrix indicating which if's contributed to which correlations within the specified CDA.
uInt subArray () const
 Return the subarray ID.
String arrayConfig () const
 Return the Array configuration as a string.
Vector< Double > sourceDir () const
 Return the source RA and Dec at the standard epoch of this integration (given by the epoch function).
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.
Double intTime () const
 Return the integration time in seconds.
Double obsTime () const
 Return the observation time in seconds of the centre of this integration.
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).

Private Attributes

ByteSource itsRecord
uInt itsOffset
 the offset to the start of this SDA in the record.

Detailed Description

Interprets the data in an sub-array data area of a VLA logical record.

Intended use:

Public interface

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

class will throw an exception (AipSError) if you the correlator data area argument is four or more. When compiled in debug mode this class does a lot of consistancy checking. If it detects anomolies it will throw an exception (AipsError).

To Do

Definition at line 113 of file VLASDA.h.


Constructor & Destructor Documentation

The default constructor creates a unusable object.

You need to use the assignment operator or the attach function to create a usable object.

VLASDA::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).

The destructor is trivial;.

VLASDA::VLASDA ( const VLASDA other)

The copy constructor uses reference semantics.


Member Function Documentation

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

void VLASDA::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.

Return the calibration code.

Double VLASDA::channelWidth ( VLAEnum::CDA  cda) const

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

returns the total bandwidth, in Hz, over all the channels of the data in the specified CDA.

Throws an exception if which > 3.

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.

MDoppler::Types VLASDA::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.

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

uInt VLASDA::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.

MDirection::Types VLASDA::epoch ( ) const

return the reference frame for the field directions.

Double VLASDA::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.

Matrix<VLAEnum::IF> VLASDA::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.

Double VLASDA::intTime ( ) const

Return the integration time in seconds.

uInt VLASDA::nChannels ( VLAEnum::CDA  cda) const

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

uInt VLASDA::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.

Double VLASDA::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.

String VLASDA::obsId ( ) const

Return the observation program id.

Return the observing mode.

Return the observing mode in full glory.

Double VLASDA::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.

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

The assignment constructor uses reference semantics.

Double VLASDA::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 VLASDA::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.

Double VLASDA::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.

Bool VLASDA::smoothed ( ) const

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

Always returns False for continuum data.

Vector<Double> VLASDA::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.

Return the source name as typed in by the observer.

Int VLASDA::sourceQual ( ) const

Return the source qualifier as typed in by the observer.

This is really the scan number.

uInt VLASDA::subArray ( ) const

Return the subarray ID.

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

uInt VLASDA::trueChannels ( VLAEnum::CDA  cda) const

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


Member Data Documentation

uInt VLASDA::itsOffset [private]

the offset to the start of this SDA in the record.

An offset of zero means this SDA is not used in this record.

Definition at line 278 of file VLASDA.h.

ByteSource VLASDA::itsRecord [mutable, private]

Definition at line 275 of file VLASDA.h.


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