FitsIDItoMS.h

Classes

FITSIDItoMS1 -- FITSIDItoMS converts a FITS-IDI binary table to an AIPS++ Table. (full description)

class FITSIDItoMS1 : public BinaryTableExtension

Interface

Public Members
FITSIDItoMS1(FitsInput&)
~FITSIDItoMS1()
Table createTable(const String& tabName)
Table fillTable(const String& tabName)
Table oldfullTable(const String& tabName)
Table fullTable(const String& tabName, const Table::TableOption = Table::NewNoReplace, Bool useMiriadSM = False)
Table createMainTable(const String& tabName)
Table fillMainTable(const String& tabName)
void fillObsTables()
void fillAntennaTable()
void fillFeedTable()
void fillFieldTable()
void fillSpectralWindowTable()
void fixEpochReferences()
void updateTables(const String& tabName)
const TableDesc& getDescriptor()
TableRecord& getKeywords()
const Table &thisRow()
const Table &nextRow()
Float msVersion() const
void readFitsFile(const String& msFile)
Bool isfirstMain()
Protected Members
void getAxisInfo()
void setupMeasurementSet(const String& MSFileName, Bool useTSM=True, Bool mainTbl=False)
void fillMSMainTable(const String& MSFileName, Int& nField, Int& nSpW)
Private Members
void fillRow()
void convertKeywords()
void describeColumns()
void convertMSKeywords()

Description

Prerequisite

Etymology

FITSIDItoMS inherits from the FITS BinaryTableExtension class and its primary use is to convert such an object to an AIPS++ 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 an aips++ 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 data into aips++ Tables.

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.

To Do

Member Description

FITSIDItoMS1(FitsInput&)

The only constructor is from a FitsInput.

FITSIDItoMS1(const String& msFile, const String& fitsFile);

~FITSIDItoMS1()

Table createTable(const String& tabName)

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.

Table fillTable(const String& tabName)

Table oldfullTable(const String& tabName)

Table fullTable(const String& tabName, const Table::TableOption = Table::NewNoReplace, Bool useMiriadSM = False)

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.If useMiriadSM is True, use the Miriad storage manager for all columns, otherwise AipsIO.

Table createMainTable(const String& tabName)

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.

Table fillMainTable(const String& tabName)

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.

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 TableDesc& getDescriptor()

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

TableRecord& getKeywords()

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

const Table &thisRow()

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.

const Table &nextRow()

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.

Float msVersion() const

Get the version of the archived MS.

void readFitsFile(const String& msFile)

Read all the data from the FITS file and create the MeasurementSet. Throws an exception when it has severe trouble interpreting the FITS file.

Bool isfirstMain()

is this the first UV_DATA extension

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. If useTSM is True, the Tiled Storage Manager will be used to store DATA, FLAG and WEIGHT_SPECTRUM

void fillMSMainTable(const String& MSFileName, Int& nField, Int& nSpW)

Fill the main table from the Primary group data

void fillRow()

char *theheap_p;

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.