casa::SDRecord Class Reference

#include <SDRecord.h>

List of all members.


Detailed Description

This class enforces the structure of SDRecord expected by SDRecord consumers.

Intended use:

Part of API

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

An SDRecord has a Record with a structure particularly suited for single dish data.

Synopsis

An SDRecord is a fixed format Record with the following structure: data TpRecord (fixed) desc TpRecord - things which describe the data chan_freq - Quantum<Vector<Double> > - chan_freq cell values refframe - String - frequency reference frame reffrequency - Double - frequence at value of reference pixel, same units as chan_freq chan_width - Double - channel width at reffrequency, for use in selection, same units as chan_freq restfrequency - Douuble - Hz corr_type - Vector<String> - Stokes values converted to string representation units - String - units of the arr array (the data units) arr (TpArrayFloat || TpArrayComplex)(nchan, nstokes) flag TpArrayBool (nchan, nstokes) when flag(i,j) == True arr(i,j) is bad and should not be used weight TpArrayFloat (nchan, nstokes) sigma TpArrayFloat (nchan, nstokes) header TpRecord (fixed) time - MEpoch as a MeasureHolder scan_number - TpInt source_name - TpString direction - MDirection as a MeasureHolder refdirection - MDirection as a MeasureHolder veldef - TpString - velocity definition (RADIO, OPTICAL, .\..) transition - TpString exposure - Double - seconds duration - DOuble - seconds observer - TpString project - TpString resolution - Double - channel resulution at reffrequency - Hz bandwidth - Double - total bandwidth - Hz tcal - TpArrayFloat(nstokes) - K trx - TpArrayFloat(nstokes) - K tsys - TpArrayFloat(nstokes) - K telescope - TpString telescope_position - MPosition as MeasureHolder pressure - hPa dewpoint - K tambient - K wind_dir - rad wind_speed - m/s azel - MDirection as MeasureHolder hist TpArrayString - the history of this SDRecord other - TpRecord - the contents of this depend on the data source if the source is a MeaurementSet, this record contains sub-records having the same names as the subtables found in the MeasurementSet. The contents of these records will be the appropriate single row from that subtable. Each record has an interp_method attribut which is a String that indicates how that row was filled from the Measurements. "direct" means that the row was directly indexed and no interpolation was necessary. "nearest" means that the nearest row in time and falling within the appropriate interval, as appropriate, was used. Other interpolation schemes are planned. In addition to the sub-table records, there will also be a "keys" record to hold the keys from the Main table. Non-standard subtables will be included here IF they have a TIME column and optionally an INTERVAL column or if they have an NS_KEYS keyword which indicates integer key columns. if the source is a table from an SDFITS binary table, any column/keyword not used should be added to an sdfits subrecord in the other record. if the source is an Image, any information not used in data and header should be added to an image subrecord in the other record

Anything with the above structure is a valid SDRecord It is intended to hold data originally from a MeasurementSet, a table constructed from an SDFITS table, or from an image cube and still be independent from these original data sources. As such, the data and header and intended to contain the most comonly used standard information about single dish data. Some data sources, most notably the MeasurementSet, will also typically duplicate some of the information found in the data and header records in the other records.

This class also provides convenient access to the required fields.

Example

Motivation

DISH works on individual rows of a MS and this structure helps that.

Thrown Exceptions

To Do

Definition at line 162 of file SDRecord.h.

Public Member Functions

 SDRecord (DataType dataType=TpFloat)
 The default SDRecord has the basic structure but indicates an empty data array, a default CoordinateSystem, empty header values and indexes.
 SDRecord (const SDRecord &other)
 SDRecords are generally constructed within an SDIterator Sets this to an empty SDRecord and raises the error flag if other is not valid.
 SDRecord (const Record &other)
 ~SDRecord ()
SDRecordoperator= (const SDRecord &other)
const Record & data () const
 the data sub-record
Record & data ()
const Record & desc () const
 the desc sub-record
Record & desc ()
const Record & header () const
 the header record
Record & header ()
const Array< String > & hist () const
 the history vector
Array< String > & hist ()
const Record & other () const
 the other record
Record & other ()
Bool resize (const IPosition &newShape)
 resize all standard array fields to be consistent with the new data shape
const IPosition & shape () const
 return the current data shape
Bool isValid () const
 verify that this SDRecord is still valid
Bool isConsistent (String &errmsg) const
 verify that this SDRecord is consistent, a message describing the first failed inconsistency is return in errmsg when the return value is False.
DataType arrType () const
 what type of a data array is this
ostream & show (ostream &os) const
 used by ostream << operator
const RORecordFieldPtr< Array<
Float > > & 
rotsys () const
 These methods provide quick access to some fields.
const RORecordFieldPtr< Double > & roduration () const
const RORecordFieldPtr< Double > & roexposure () const
const RORecordFieldPtr< Double > & rorestfrequency () const
const RORecordFieldPtr< String > & roveldef () const
const RORecordFieldPtr< String > & rorefframe () const
const RORecordFieldPtr< Record > & rochan_freq () const
const RORecordFieldPtr< Double > & roreffrequency () const
const RORecordFieldPtr< Array<
Bool > > & 
roflag () const
const RORecordFieldPtr< Array<
Float > > & 
roweight () const
const RORecordFieldPtr< Array<
Float > > & 
rosigma () const
RecordFieldPtr< Array< Float > > & tsys ()
RecordFieldPtr< Double > & duration ()
RecordFieldPtr< Double > & exposure ()
RecordFieldPtr< Double > & restfrequency ()
RecordFieldPtr< String > & veldef ()
RecordFieldPtr< String > & refframe ()
RecordFieldPtr< Record > & chan_freq ()
RecordFieldPtr< Double > & reffrequency ()
RecordFieldPtr< Array< Bool > > & flag ()
RecordFieldPtr< Array< Float > > & weight ()
RecordFieldPtr< Array< Float > > & sigma ()
const RORecordFieldPtr< Array<
Float > > & 
rofarr () const
 arr field when this contains Floats
RecordFieldPtr< Array< Float > > & farr ()
const RORecordFieldPtr< Array<
Complex > > & 
rocarr () const
 arr field when this contains Complex data
RecordFieldPtr< Array< Complex > > & carr ()

Static Public Member Functions

static Bool isValid (const Record &rec)
 verify that a record is a valid SDRecord
static RecordDesc requiredDesc (DataType dataType)
 return the minimum required description
static ostream & showRecord (ostream &os, const Record &rec)
 this actually does the work, hierachically on each subrecord

Private Member Functions

void initPointers ()
 initialize the pointers
void defaultValues ()
 set the default values
void defaultMatValues ()
 set the default values for variable shaped matrices
void defaultVecValues ()
 set the default values for variable shaped vectors
void cacheShape ()
 get shape from the arr field
void clear ()
 function to set all fields to their default values by type

Static Private Member Functions

static void initStatics ()
 function to initialize itsBasicDesc and itsBasicComplexDesc

Private Attributes

RecordFieldPtr< Record > itsData
RecordFieldPtr< Record > itsDesc
RecordFieldPtr< Record > itsHeader
RecordFieldPtr< Record > itsOther
RecordFieldPtr< Array< Bool > > itsFlag
RecordFieldPtr< Array< Float > > itsTsys
RecordFieldPtr< Array< Float > > itsWeight
RecordFieldPtr< Array< Float > > itsSigma
RecordFieldPtr< Array< Float > > itsFarr
RecordFieldPtr< Array< Float > > itsTcal
RecordFieldPtr< Array< Float > > itsTrx
RecordFieldPtr< Array< Complex > > itsCarr
RecordFieldPtr< Double > itsTdur
RecordFieldPtr< Double > itsTexp
RecordFieldPtr< Double > itsFrest
RecordFieldPtr< Double > itsFref
RecordFieldPtr< String > itsVeldef
RecordFieldPtr< String > itsRefFrame
RecordFieldPtr< Record > itsChanFreq
RORecordFieldPtr< Array< Bool > > itsROFlag
RORecordFieldPtr< Array< Float > > itsROTsys
RORecordFieldPtr< Array< Float > > itsROWeight
RORecordFieldPtr< Array< Float > > itsROSigma
RORecordFieldPtr< Array< Float > > itsROFarr
RORecordFieldPtr< Array< Complex > > itsROCarr
RORecordFieldPtr< Double > itsROTdur
RORecordFieldPtr< Double > itsROTexp
RORecordFieldPtr< Double > itsROFrest
RORecordFieldPtr< Double > itsROFref
RORecordFieldPtr< String > itsROVeldef
RORecordFieldPtr< String > itsRORefFrame
RORecordFieldPtr< Record > itsROChanFreq
RecordFieldPtr< Array< String > > itsHist
RecordFieldPtr< Array< String > > itsCorrType
IPosition itsShape
 cache the size

Static Private Attributes

static RecordDesc itsBasicDesc
static RecordDesc itsBasicComplexDesc

Friends

ostream & operator<< (ostream &os, const SDRecord &rec)
 This is mostly useful during debugging.


Constructor & Destructor Documentation

casa::SDRecord::SDRecord ( DataType  dataType = TpFloat  ) 

The default SDRecord has the basic structure but indicates an empty data array, a default CoordinateSystem, empty header values and indexes.

Primarily useful for assignments except within SDIterator which starts from this and constructs the full record. The type of an SDRecord can be either TpFloat or TpComplex. This determines the data type of the arr field and it must be set when the SDRecord is first constructed.

casa::SDRecord::SDRecord ( const SDRecord other  ) 

SDRecords are generally constructed within an SDIterator Sets this to an empty SDRecord and raises the error flag if other is not valid.

The data type of this SDRecord will be the same as that of other

casa::SDRecord::SDRecord ( const Record &  other  ) 

casa::SDRecord::~SDRecord (  ) 


Member Function Documentation

SDRecord& casa::SDRecord::operator= ( const SDRecord other  ) 

const Record& casa::SDRecord::data (  )  const [inline]

the data sub-record

Definition at line 190 of file SDRecord.h.

References itsData.

Referenced by arrType(), casa::SDTableIterator::getData(), and casa::SDMSIterator::getData().

Record& casa::SDRecord::data (  )  [inline]

Definition at line 191 of file SDRecord.h.

References itsData.

const Record& casa::SDRecord::desc (  )  const [inline]

the desc sub-record

Definition at line 194 of file SDRecord.h.

References itsDesc.

Record& casa::SDRecord::desc (  )  [inline]

Definition at line 195 of file SDRecord.h.

References itsDesc.

const Record& casa::SDRecord::header (  )  const [inline]

the header record

Definition at line 198 of file SDRecord.h.

References itsHeader.

Referenced by casa::SDTableIterator::getHeader(), and casa::SDMSIterator::getHeader().

Record& casa::SDRecord::header (  )  [inline]

Definition at line 199 of file SDRecord.h.

References itsHeader.

const Array<String>& casa::SDRecord::hist (  )  const [inline]

the history vector

Definition at line 202 of file SDRecord.h.

References itsHist.

Array<String>& casa::SDRecord::hist (  )  [inline]

Definition at line 203 of file SDRecord.h.

References itsHist.

const Record& casa::SDRecord::other (  )  const [inline]

the other record

Definition at line 206 of file SDRecord.h.

References itsOther.

Referenced by casa::SDTableIterator::getOther(), and casa::SDMSIterator::getOther().

Record& casa::SDRecord::other (  )  [inline]

Definition at line 207 of file SDRecord.h.

References itsOther.

Bool casa::SDRecord::resize ( const IPosition &  newShape  ) 

resize all standard array fields to be consistent with the new data shape

const IPosition& casa::SDRecord::shape (  )  const [inline]

return the current data shape

Definition at line 213 of file SDRecord.h.

References itsShape.

Bool casa::SDRecord::isValid (  )  const [inline]

verify that this SDRecord is still valid

Definition at line 216 of file SDRecord.h.

Bool casa::SDRecord::isConsistent ( String &  errmsg  )  const

verify that this SDRecord is consistent, a message describing the first failed inconsistency is return in errmsg when the return value is False.

DataType casa::SDRecord::arrType (  )  const [inline]

what type of a data array is this

Definition at line 223 of file SDRecord.h.

References data().

const RORecordFieldPtr<Array<Float> >& casa::SDRecord::rotsys (  )  const [inline]

These methods provide quick access to some fields.

Definition at line 227 of file SDRecord.h.

References itsROTsys.

const RORecordFieldPtr<Double>& casa::SDRecord::roduration (  )  const [inline]

Definition at line 228 of file SDRecord.h.

References itsROTdur.

const RORecordFieldPtr<Double>& casa::SDRecord::roexposure (  )  const [inline]

Definition at line 229 of file SDRecord.h.

References itsROTexp.

const RORecordFieldPtr<Double>& casa::SDRecord::rorestfrequency (  )  const [inline]

Definition at line 230 of file SDRecord.h.

References itsROFrest.

const RORecordFieldPtr<String>& casa::SDRecord::roveldef (  )  const [inline]

Definition at line 231 of file SDRecord.h.

References itsROVeldef.

const RORecordFieldPtr<String>& casa::SDRecord::rorefframe (  )  const [inline]

Definition at line 232 of file SDRecord.h.

References itsRORefFrame.

const RORecordFieldPtr<Record>& casa::SDRecord::rochan_freq (  )  const [inline]

Definition at line 233 of file SDRecord.h.

References itsROChanFreq.

const RORecordFieldPtr<Double>& casa::SDRecord::roreffrequency (  )  const [inline]

Definition at line 234 of file SDRecord.h.

References itsROFref.

const RORecordFieldPtr<Array<Bool> >& casa::SDRecord::roflag (  )  const [inline]

Definition at line 235 of file SDRecord.h.

References itsROFlag.

const RORecordFieldPtr<Array<Float> >& casa::SDRecord::roweight (  )  const [inline]

Definition at line 236 of file SDRecord.h.

References itsROWeight.

const RORecordFieldPtr<Array<Float> >& casa::SDRecord::rosigma (  )  const [inline]

Definition at line 237 of file SDRecord.h.

References itsROSigma.

RecordFieldPtr<Array<Float> >& casa::SDRecord::tsys (  )  [inline]

Definition at line 238 of file SDRecord.h.

References itsTsys.

RecordFieldPtr<Double>& casa::SDRecord::duration (  )  [inline]

Definition at line 239 of file SDRecord.h.

References itsTdur.

RecordFieldPtr<Double>& casa::SDRecord::exposure (  )  [inline]

Definition at line 240 of file SDRecord.h.

References itsTexp.

RecordFieldPtr<Double>& casa::SDRecord::restfrequency (  )  [inline]

Definition at line 241 of file SDRecord.h.

References itsFrest.

RecordFieldPtr<String>& casa::SDRecord::veldef (  )  [inline]

Definition at line 242 of file SDRecord.h.

References itsVeldef.

RecordFieldPtr<String>& casa::SDRecord::refframe (  )  [inline]

Definition at line 243 of file SDRecord.h.

References itsRefFrame.

RecordFieldPtr<Record>& casa::SDRecord::chan_freq (  )  [inline]

Definition at line 244 of file SDRecord.h.

References itsChanFreq.

RecordFieldPtr<Double>& casa::SDRecord::reffrequency (  )  [inline]

Definition at line 245 of file SDRecord.h.

References itsFref.

RecordFieldPtr<Array<Bool> >& casa::SDRecord::flag (  )  [inline]

Definition at line 246 of file SDRecord.h.

References itsFlag.

RecordFieldPtr<Array<Float> >& casa::SDRecord::weight (  )  [inline]

Definition at line 247 of file SDRecord.h.

References itsWeight.

RecordFieldPtr<Array<Float> >& casa::SDRecord::sigma (  )  [inline]

Definition at line 248 of file SDRecord.h.

References itsSigma.

const RORecordFieldPtr<Array<Float> >& casa::SDRecord::rofarr (  )  const [inline]

arr field when this contains Floats

Definition at line 255 of file SDRecord.h.

References itsROFarr.

RecordFieldPtr<Array<Float> >& casa::SDRecord::farr (  )  [inline]

Definition at line 256 of file SDRecord.h.

References itsFarr.

const RORecordFieldPtr<Array<Complex> >& casa::SDRecord::rocarr (  )  const [inline]

arr field when this contains Complex data

Definition at line 258 of file SDRecord.h.

References itsROCarr.

RecordFieldPtr<Array<Complex> >& casa::SDRecord::carr (  )  [inline]

Definition at line 259 of file SDRecord.h.

References itsCarr.

static Bool casa::SDRecord::isValid ( const Record &  rec  )  [inline, static]

verify that a record is a valid SDRecord

Definition at line 263 of file SDRecord.h.

References requiredDesc().

static RecordDesc casa::SDRecord::requiredDesc ( DataType  dataType  )  [static]

return the minimum required description

Referenced by isValid().

ostream & casa::SDRecord::show ( ostream &  os  )  const [inline]

used by ostream << operator

Definition at line 322 of file SDRecord.h.

References showRecord().

Referenced by casa::operator<<().

static ostream& casa::SDRecord::showRecord ( ostream &  os,
const Record &  rec 
) [static]

this actually does the work, hierachically on each subrecord

Referenced by show().

static void casa::SDRecord::initStatics (  )  [static, private]

function to initialize itsBasicDesc and itsBasicComplexDesc

void casa::SDRecord::initPointers (  )  [private]

initialize the pointers

void casa::SDRecord::defaultValues (  )  [private]

set the default values

void casa::SDRecord::defaultMatValues (  )  [private]

set the default values for variable shaped matrices

void casa::SDRecord::defaultVecValues (  )  [private]

set the default values for variable shaped vectors

void casa::SDRecord::cacheShape (  )  [private]

get shape from the arr field

void casa::SDRecord::clear (  )  [private]

function to set all fields to their default values by type


Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const SDRecord rec 
) [friend]

This is mostly useful during debugging.

Definition at line 327 of file SDRecord.h.


Member Data Documentation

RecordDesc casa::SDRecord::itsBasicDesc [static, private]

Definition at line 277 of file SDRecord.h.

RecordDesc casa::SDRecord::itsBasicComplexDesc [static, private]

Definition at line 278 of file SDRecord.h.

RecordFieldPtr<Record> casa::SDRecord::itsData [private]

Definition at line 280 of file SDRecord.h.

Referenced by data().

RecordFieldPtr<Record> casa::SDRecord::itsDesc [private]

Definition at line 281 of file SDRecord.h.

Referenced by desc().

RecordFieldPtr<Record> casa::SDRecord::itsHeader [private]

Definition at line 282 of file SDRecord.h.

Referenced by header().

RecordFieldPtr<Record> casa::SDRecord::itsOther [private]

Definition at line 283 of file SDRecord.h.

Referenced by other().

RecordFieldPtr<Array<Bool> > casa::SDRecord::itsFlag [private]

Definition at line 285 of file SDRecord.h.

Referenced by flag().

RecordFieldPtr<Array<Float> > casa::SDRecord::itsTsys [private]

Definition at line 286 of file SDRecord.h.

Referenced by tsys().

RecordFieldPtr<Array<Float> > casa::SDRecord::itsWeight [private]

Definition at line 286 of file SDRecord.h.

Referenced by weight().

RecordFieldPtr<Array<Float> > casa::SDRecord::itsSigma [private]

Definition at line 286 of file SDRecord.h.

Referenced by sigma().

RecordFieldPtr<Array<Float> > casa::SDRecord::itsFarr [private]

Definition at line 286 of file SDRecord.h.

Referenced by farr().

RecordFieldPtr<Array<Float> > casa::SDRecord::itsTcal [private]

Definition at line 286 of file SDRecord.h.

RecordFieldPtr<Array<Float> > casa::SDRecord::itsTrx [private]

Definition at line 286 of file SDRecord.h.

RecordFieldPtr<Array<Complex> > casa::SDRecord::itsCarr [private]

Definition at line 287 of file SDRecord.h.

Referenced by carr().

RecordFieldPtr<Double> casa::SDRecord::itsTdur [private]

Definition at line 288 of file SDRecord.h.

Referenced by duration().

RecordFieldPtr<Double> casa::SDRecord::itsTexp [private]

Definition at line 288 of file SDRecord.h.

Referenced by exposure().

RecordFieldPtr<Double> casa::SDRecord::itsFrest [private]

Definition at line 288 of file SDRecord.h.

Referenced by restfrequency().

RecordFieldPtr<Double> casa::SDRecord::itsFref [private]

Definition at line 288 of file SDRecord.h.

Referenced by reffrequency().

RecordFieldPtr<String> casa::SDRecord::itsVeldef [private]

Definition at line 289 of file SDRecord.h.

Referenced by veldef().

RecordFieldPtr<String> casa::SDRecord::itsRefFrame [private]

Definition at line 289 of file SDRecord.h.

Referenced by refframe().

RecordFieldPtr<Record> casa::SDRecord::itsChanFreq [private]

Definition at line 290 of file SDRecord.h.

Referenced by chan_freq().

RORecordFieldPtr<Array<Bool> > casa::SDRecord::itsROFlag [private]

Definition at line 292 of file SDRecord.h.

Referenced by roflag().

RORecordFieldPtr<Array<Float> > casa::SDRecord::itsROTsys [private]

Definition at line 293 of file SDRecord.h.

Referenced by rotsys().

RORecordFieldPtr<Array<Float> > casa::SDRecord::itsROWeight [private]

Definition at line 293 of file SDRecord.h.

Referenced by roweight().

RORecordFieldPtr<Array<Float> > casa::SDRecord::itsROSigma [private]

Definition at line 293 of file SDRecord.h.

Referenced by rosigma().

RORecordFieldPtr<Array<Float> > casa::SDRecord::itsROFarr [private]

Definition at line 293 of file SDRecord.h.

Referenced by rofarr().

RORecordFieldPtr<Array<Complex> > casa::SDRecord::itsROCarr [private]

Definition at line 294 of file SDRecord.h.

Referenced by rocarr().

RORecordFieldPtr<Double> casa::SDRecord::itsROTdur [private]

Definition at line 295 of file SDRecord.h.

Referenced by roduration().

RORecordFieldPtr<Double> casa::SDRecord::itsROTexp [private]

Definition at line 295 of file SDRecord.h.

Referenced by roexposure().

RORecordFieldPtr<Double> casa::SDRecord::itsROFrest [private]

Definition at line 295 of file SDRecord.h.

Referenced by rorestfrequency().

RORecordFieldPtr<Double> casa::SDRecord::itsROFref [private]

Definition at line 295 of file SDRecord.h.

Referenced by roreffrequency().

RORecordFieldPtr<String> casa::SDRecord::itsROVeldef [private]

Definition at line 296 of file SDRecord.h.

Referenced by roveldef().

RORecordFieldPtr<String> casa::SDRecord::itsRORefFrame [private]

Definition at line 296 of file SDRecord.h.

Referenced by rorefframe().

RORecordFieldPtr<Record> casa::SDRecord::itsROChanFreq [private]

Definition at line 297 of file SDRecord.h.

Referenced by rochan_freq().

RecordFieldPtr<Array<String> > casa::SDRecord::itsHist [private]

Definition at line 299 of file SDRecord.h.

Referenced by hist().

RecordFieldPtr<Array<String> > casa::SDRecord::itsCorrType [private]

Definition at line 299 of file SDRecord.h.

IPosition casa::SDRecord::itsShape [private]

cache the size

Definition at line 302 of file SDRecord.h.

Referenced by shape().


The documentation for this class was generated from the following file:
Generated on Thu Aug 27 21:32:40 2009 for NRAOCASA by  doxygen 1.5.1