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

FITSIDItoMS converts a FITS-IDI file to a CASA Measurement Set. More...

#include <FitsIDItoMS.h>

Inheritance diagram for casa::FITSIDItoMS1:
casa::BinaryTableExtension casa::ExtensionHeaderDataUnit casa::HeaderDataUnit

List of all members.

Public Member Functions

 FITSIDItoMS1 (FitsInput &in, const Int &obsType=0, const Bool &initFirstMain=True)
 The only constructor is from a FitsInput.
 ~FITSIDItoMS1 ()
Table oldfullTable (const String &tabName)
 Get the full table, using the supplied arguments to construct the table.
void fillObsTables ()
 Fill the Observation and ObsLog tables.
void fillAntennaTable ()
 Read a binary table extension of type ANTENNA and create an antenna table void fillAntennaTable(BinaryTable& bt);.
void fillFeedTable ()
 fill the Feed table with minimal info needed for synthesis processing
void fillFieldTable ()
 fill the Field table void fillFieldTable(Int nField);
void fillSpectralWindowTable ()
 fill the Spectral Window table
void fixEpochReferences ()
 fix up the EPOCH MEASURE_REFERENCE keywords
void updateTables (const String &tabName)
 update the Polarization table
const TableDescgetDescriptor ()
 Get an appropriate TableDesc (this is the same TableDesc used to construct any Table objects returned by this class.
TableRecordgetKeywords ()
 Return the Table keywords (this is the same TableRecord used in any Table objects returned by this class.
const TablethisRow ()
 Get a Table with a single row, the current row of the FITS table.
const TablenextRow ()
 Get a Table with a single row, the next row of the FITS table.
Float msVersion () const
 Get the version of the archived MS.
Bool readFitsFile (const String &msFile)
 Read all the data from the FITS file and create the MeasurementSet.
Bool isfirstMain ()
 is this the first UV_DATA extension

Protected Member Functions

void getAxisInfo ()
 Read the axis info, throws an exception if required axes are missing.
void setupMeasurementSet (const String &MSFileName, Bool useTSM=True, Bool mainTbl=False)
 Set up the MeasurementSet, including StorageManagers and fixed columns.
void fillMSMainTable (const String &MSFileName, Int &nField, Int &nSpW)
 Fill the main table from the Primary group data.

Private Member Functions

void fillRow ()
 Fill in each row as needed.
void convertKeywords ()
 Build part of the keywords of the itsCurRowTab.
void describeColumns ()
 Convert FITS field descriptions to TableColumn descriptions.
void convertMSKeywords ()
 Convert the MS-specific keywords in the FITS binary table.

Private Attributes

Table itsCurRowTab
 The scratch table containing the current row.
Vector< IntitsNelem
 The number of elements for each column of the BinaryTableExtension.
Vector< BoolitsIsArray
 For each column: is it an array?
TableRecord itsKwSet
 Table keyword set.
TableDesc itsTableDesc
 Table descriptor for construction.
TableInfo itsTableInfo
 Table info.
Float itsVersion
 The MS version.
uInt itsNrMSKs
 Buffer for storing the MSK's, MS-specific FITS keywords.
Vector< StringitsMSKC
Vector< StringitsMSKN
Vector< StringitsMSKV
Vector< BoolitsgotMSK
FitsInputinfile_p
String msFile_p
Vector< IntnPixel_p
Vector< IntcorrType_p
Block< IntcorrIndex_p
Matrix< IntcorrProduct_p
Vector< StringcoordType_p
Vector< DoublerefVal_p
Vector< DoublerefPix_p
Vector< Doubledelta_p
String object_p
String timsys_p
Double epoch_p
Int nAnt_p
Vector< DoublereceptorAngle_p
MFrequency::Types freqsys_p
Double restfreq_p
LogIOitsLog
Int nIF_p
Double startTime_p
Double lastTime_p
Int itsObsType
MeasurementSet ms_p
MSColumnsmsc_p
Bool uv_data_hasWeights_p
Bool weightKwPresent_p
Bool weightypKwPresent_p
String weightyp_p
Matrix< FloatweightsFromKW_p

Static Private Attributes

static String array_p
static Double rdate
static Bool firstMain
static SimpleOrderedMap< Int, IntantIdFromNo

Detailed Description

FITSIDItoMS converts a FITS-IDI file to a CASA Measurement Set.

Intended use:

Public interface

Prerequisite

Etymology

FITSIDItoMS inherits from the FITS BinaryTableExtension class and its primary use is to convert such an object to a CASA Table. This explains it's use but not its name. A better name should be found.

Synopsis

The class starts with an already existing FitsInput object, which should be set at a BinaryTableExtension HDU. Member functions provide a TableDesc appropriate for the FITS data (to help in constructing a CASA Table compatible with the BinaryTableExtension), a Table containing the current row of FITS data and a Table containing the next row of FITS data (which can be used to step through the FitsInput, copying each row using the RowCopier class), and a Table containin the entire FITS binary table from the current row to the end of the table.

Motivation

We need a way to get FITS-IDI data (typically from VLBI observations) into CASA.

Example

Open a FitsInput from a disk file, if the HDU is a BinaryTableExtension, then instantiate a MSBinaryTable object and get the entire table. A fair amount of error checking has been eliminated from this example.

       FitsInput infits("myFITSFile", FITS::Disk);
       switch (infits.hdutype()) {
          case FITS::BinaryTableHDU:
             MSBinaryTable bintab(infits);
             Table tab = bintab.fullTable("myTable");
             break;
       }

There would obviously be other cases to the switch to deal with any other HDUs (e.g. skip them via infits.skip_hdu()). The Table destructor would write "myTable" to disk.

Definition at line 116 of file FitsIDItoMS.h.


Constructor & Destructor Documentation

casa::FITSIDItoMS1::FITSIDItoMS1 ( FitsInput in,
const Int obsType = 0,
const Bool initFirstMain = True 
)

The only constructor is from a FitsInput.


Member Function Documentation

Build part of the keywords of the itsCurRowTab.

Convert the MS-specific keywords in the FITS binary table.

Convert FITS field descriptions to TableColumn descriptions.

Read a binary table extension of type ANTENNA and create an antenna table void fillAntennaTable(BinaryTable& bt);.

fill the Feed table with minimal info needed for synthesis processing

fill the Field table void fillFieldTable(Int nField);

void casa::FITSIDItoMS1::fillMSMainTable ( const String MSFileName,
Int nField,
Int nSpW 
) [protected]

Fill the main table from the Primary group data.

Fill the Observation and ObsLog tables.

void casa::FITSIDItoMS1::fillRow ( ) [private]

Fill in each row as needed.

fill the Spectral Window table

fix up the EPOCH MEASURE_REFERENCE keywords

void casa::FITSIDItoMS1::getAxisInfo ( ) [protected]

Read the axis info, throws an exception if required axes are missing.

Get an appropriate TableDesc (this is the same TableDesc used to construct any Table objects returned by this class.

Return the Table keywords (this is the same TableRecord used in any Table objects returned by this class.

is this the first UV_DATA extension

Definition at line 199 of file FitsIDItoMS.h.

References firstMain.

Get the version of the archived MS.

Definition at line 190 of file FitsIDItoMS.h.

References itsVersion.

Get a Table with a single row, the next row of the FITS table.

The returned Table is a Scratch table. The FITS input is positioned to the next row and the values translated and returned in a Table object.

Get the full table, using the supplied arguments to construct the table.

The table will contain all data from the current row to the end of the BinarTableExtension.

Read all the data from the FITS file and create the MeasurementSet.

Throws an exception when it has severe trouble interpreting the FITS file. Returns False if it encounters an unsupported extension.

void casa::FITSIDItoMS1::setupMeasurementSet ( const String MSFileName,
Bool  useTSM = True,
Bool  mainTbl = False 
) [protected]

Set up the MeasurementSet, including StorageManagers and fixed columns.

If useTSM is True, the Tiled Storage Manager will be used to store DATA, FLAG and WEIGHT_SPECTRUM

Get a Table with a single row, the current row of the FITS table.

The returned Table is a Scratch table. The standard BinaryTableExtension manipulation functions are available to position the FITS input at the desired location.

void casa::FITSIDItoMS1::updateTables ( const String tabName)

update the Polarization table


Member Data Documentation

Definition at line 279 of file FitsIDItoMS.h.

Definition at line 258 of file FitsIDItoMS.h.

Definition at line 256 of file FitsIDItoMS.h.

Definition at line 254 of file FitsIDItoMS.h.

Definition at line 255 of file FitsIDItoMS.h.

Definition at line 253 of file FitsIDItoMS.h.

Definition at line 257 of file FitsIDItoMS.h.

Definition at line 260 of file FitsIDItoMS.h.

Definition at line 273 of file FitsIDItoMS.h.

Referenced by isfirstMain().

Definition at line 264 of file FitsIDItoMS.h.

Definition at line 251 of file FitsIDItoMS.h.

The scratch table containing the current row.

Definition at line 220 of file FitsIDItoMS.h.

Definition at line 248 of file FitsIDItoMS.h.

For each column: is it an array?

Definition at line 227 of file FitsIDItoMS.h.

Table keyword set.

Definition at line 230 of file FitsIDItoMS.h.

Definition at line 266 of file FitsIDItoMS.h.

Definition at line 245 of file FitsIDItoMS.h.

Definition at line 246 of file FitsIDItoMS.h.

Definition at line 247 of file FitsIDItoMS.h.

The number of elements for each column of the BinaryTableExtension.

Definition at line 224 of file FitsIDItoMS.h.

Buffer for storing the MSK's, MS-specific FITS keywords.

Definition at line 244 of file FitsIDItoMS.h.

Definition at line 270 of file FitsIDItoMS.h.

Table descriptor for construction.

Definition at line 233 of file FitsIDItoMS.h.

Table info.

Definition at line 236 of file FitsIDItoMS.h.

The MS version.

Definition at line 239 of file FitsIDItoMS.h.

Referenced by msVersion().

Definition at line 269 of file FitsIDItoMS.h.

Definition at line 271 of file FitsIDItoMS.h.

Definition at line 272 of file FitsIDItoMS.h.

Definition at line 252 of file FitsIDItoMS.h.

Definition at line 262 of file FitsIDItoMS.h.

Definition at line 267 of file FitsIDItoMS.h.

Definition at line 253 of file FitsIDItoMS.h.

Definition at line 259 of file FitsIDItoMS.h.

Double casa::FITSIDItoMS1::rdate [static, private]

Definition at line 261 of file FitsIDItoMS.h.

Definition at line 263 of file FitsIDItoMS.h.

Definition at line 257 of file FitsIDItoMS.h.

Definition at line 257 of file FitsIDItoMS.h.

Definition at line 265 of file FitsIDItoMS.h.

Definition at line 268 of file FitsIDItoMS.h.

Definition at line 259 of file FitsIDItoMS.h.

Definition at line 274 of file FitsIDItoMS.h.

Definition at line 275 of file FitsIDItoMS.h.

Definition at line 278 of file FitsIDItoMS.h.

Definition at line 277 of file FitsIDItoMS.h.

Definition at line 276 of file FitsIDItoMS.h.


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