casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
VLASDA Class Reference

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

#include <VLASDA.h>

Public Member Functions

 VLASDA ()
 The default constructor creates a unusable object. More...
 
 VLASDA (casacore::ByteSource &record, casacore::uInt offset)
 Construct this object to read data from the SDA of the given VLA logical record. More...
 
 ~VLASDA ()
 The destructor is trivial;. More...
 
 VLASDA (const VLASDA &other)
 The copy constructor uses reference semantics. More...
 
VLASDAoperator= (const VLASDA &other)
 The assignment constructor uses reference semantics. More...
 
void attach (casacore::ByteSource &record, casacore::uInt offset)
 Re-initialise this object so that it now reads data from the given VLA logical record. More...
 
casacore::uInt trueChannels (VLAEnum::CDA cda) const
 returns the number of data channels in the specified CDA (including the average channel) More...
 
casacore::uInt nChannels (VLAEnum::CDA cda) const
 returns the number of spectral channels in the specified CDA (excludes channel zero) More...
 
casacore::Double obsFrequency (VLAEnum::CDA cda) const
 returns the observed frequency (in Hz), at the band centre for the specified CDA. More...
 
casacore::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. More...
 
casacore::Bool dopplerTracking (VLAEnum::CDA cda) const
 returns true if Doppler tracking has been turned on for the specified CDA. More...
 
casacore::Double restFrequency (VLAEnum::CDA cda) const
 returns the assumed rest frequency of the source radiation in Hz (for the specified CDA). More...
 
casacore::Double radialVelocity (VLAEnum::CDA cda) const
 returns the assumed radial velocity of the source in m/sec (for the specified CDA). More...
 
casacore::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). More...
 
casacore::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). More...
 
casacore::Double channelWidth (VLAEnum::CDA cda) const
 returns the bandwidth of an individual channel, in Hz, of the data in the specified CDA. More...
 
casacore::Double correlatedBandwidth (VLAEnum::CDA cda) const
 returns the total bandwidth, in Hz, over all the channels of the data in the specified CDA. More...
 
casacore::Double filterBandwidth (VLAEnum::CDA cda) const
 returns the total bandwidth, in Hz, of the front end filter in the specified CDA. More...
 
VLAEnum::CorrMode correlatorMode () const
 Return the correlator mode for this record. More...
 
casacore::uInt electronicPath (VLAEnum::CDA cda) const
 Return the 'electronic path' that the data in the specified CDA has travveled through. More...
 
casacore::uInt npol (VLAEnum::CDA cda) const
 Return the number of polarisations in the specified CDA. More...
 
casacore::Matrix< VLAEnum::IFifUsage (VLAEnum::CDA cda) const
 return a casacore::Matrix indicating which if's contributed to which correlations within the specified CDA. More...
 
casacore::uInt subArray () const
 Return the subarray ID. More...
 
casacore::String arrayConfig () const
 Return the casacore::Array configuration as a string. More...
 
casacore::Vector
< casacore::Double
sourceDir () const
 Return the source RA and Dec at the standard epoch of this integration (given by the epoch function). More...
 
casacore::String sourceName () const
 Return the source name as typed in by the observer. More...
 
casacore::Int sourceQual () const
 Return the source qualifier as typed in by the observer. More...
 
casacore::Double intTime () const
 Return the integration time in seconds. More...
 
casacore::Double obsTime () const
 Return the observation time in seconds of the centre of this integration. More...
 
casacore::String obsId () const
 Return the observation program id. More...
 
casacore::String obsMode () const
 Return the observing mode. More...
 
casacore::String obsModeFull () const
 Return the observing mode in full glory. More...
 
casacore::String calCode () const
 Return the calibration code. More...
 
casacore::MDirection::Types epoch () const
 return the reference frame for the field directions. More...
 
casacore::Bool smoothed () const
 returns whether the data spectrum has been Hanning smoothed (and every second channel discarded). More...
 

Private Attributes

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

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.

casacore::ByteSource VLARecord(...);
VLARCA rca;
VLASDA sda(VLARecord, rca.SDAOffset());
cout << "The record has " << rca.nAntennas() << " antennas." << endl;
for (casacore::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 (casacore::AipsError).

To Do

Definition at line 117 of file VLASDA.h.

Constructor & Destructor Documentation

VLASDA::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::VLASDA ( casacore::ByteSource record,
casacore::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::~VLASDA ( )

The destructor is trivial;.

VLASDA::VLASDA ( const VLASDA other)

The copy constructor uses reference semantics.

Member Function Documentation

casacore::String VLASDA::arrayConfig ( ) const

Return the casacore::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 ( casacore::ByteSource record,
casacore::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.

casacore::String VLASDA::calCode ( ) const

Return the calibration code.

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

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

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

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

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

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

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

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

casacore::MDirection::Types VLASDA::epoch ( ) const

return the reference frame for the field directions.

returns MDiretion::N_types when epoch is not valid usually that means epoch = 0 and B1950_VLA should be used.

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

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

return a casacore::Matrix indicating which if's contributed to which correlations within the specified CDA.

The return casacore::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.

casacore::Double VLASDA::intTime ( ) const

Return the integration time in seconds.

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

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

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

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

casacore::String VLASDA::obsId ( ) const

Return the observation program id.

casacore::String VLASDA::obsMode ( ) const

Return the observing mode.

casacore::String VLASDA::obsModeFull ( ) const

Return the observing mode in full glory.

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

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

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

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

casacore::Bool VLASDA::smoothed ( ) const

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

Always returns false for continuum data.

casacore::Vector<casacore::Double> VLASDA::sourceDir ( ) const

Return the source RA and Dec at the standard epoch of this integration (given by the epoch function).

The returned casacore::Vector will always have two elements being the RA and Dec in radians.

casacore::String VLASDA::sourceName ( ) const

Return the source name as typed in by the observer.

casacore::Int VLASDA::sourceQual ( ) const

Return the source qualifier as typed in by the observer.

This is really the scan number.

casacore::uInt VLASDA::subArray ( ) const

Return the subarray ID.

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

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

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

Member Data Documentation

casacore::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 284 of file VLASDA.h.

casacore::ByteSource VLASDA::itsRecord
mutableprivate

Definition at line 281 of file VLASDA.h.


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