MSFitsInput.h

Classes

MSPrimaryGroupHolder -- A helper class for MSFitsInput (full description)
MSFitsInput -- UV FITS to MeasurementSet filler (full description)

class MSPrimaryGroupHolder

Interface

Public Members
MSPrimaryGroupHolder()
MSPrimaryGroupHolder(FitsInput& infile)
~MSPrimaryGroupHolder()
void attach(FitsInput& infile)
void detach()
Int dims()
Int dim(Int i)
Char* ctype(Int i)
Double crval(Int i)
Double crpix(Int i)
Double cdelt(Int i)
const FitsKeyword* kw(const FITS::ReservedName& n)
ConstFitsKeywordList& kwlist()
const FitsKeyword* nextkw()
Int gcount() const
Int pcount() const
Char* ptype(Int i) const
Int read()
Double parm(Int i)
Double operator () (Int i) const

Description

Etymology

This class can hold a primary group of several datatypes

Synopsis

This is a helper class to avoid cumbersome switch statements on the template type of the primary group It forwards all the PrimaryGroup member functions we need in the filler.

Member Description

MSPrimaryGroupHolder()

Construct an empty holder, used to attach to later

MSPrimaryGroupHolder(FitsInput& infile)

Construct from an input file containing a FITS primary group hdu. Throws an exception if the datatype is not Short, FitsLong or Float

~MSPrimaryGroupHolder()

void attach(FitsInput& infile)

Attach to the input file, create the appropriate PrimaryGroup. Throws an exception if the datatype is not Short, FitsLong or Float

void detach()

Detach from the input file

Int dims()

Number of dimensions

Int dim(Int i)

Length of i'th axis

Char* ctype(Int i)

Coordinate type

Double crval(Int i)

Coordinate reference value

Double crpix(Int i)

Coordinate reference pixel

Double cdelt(Int i)

Coordinate delta

const FitsKeyword* kw(const FITS::ReservedName& n)

Keyword of given type

ConstFitsKeywordList& kwlist()

All keywords

const FitsKeyword* nextkw()

Advance to next keyword

Int gcount() const

Number of groups

Int pcount() const

Number of parameters

Char* ptype(Int i) const

Parameter type

Int read()

Read the next group

Double parm(Int i)

Get i'th parameter

Double operator () (Int i) const

Get group data with index i, scaled and converted to Double


class MSFitsInput

Interface

MSFitsInput(const String& msFile, const String& fitsFile)
~MSFitsInput()
void readFitsFile(Int obsType = MSTileLayout::Standard)
Protected Members
Bool checkInput(FitsInput& infile)
void getPrimaryGroupAxisInfo()
void setupMeasurementSet(const String& MSFileName, Bool useTSM=True, Int obsType = MSTileLayout::Standard)
void fillObsTables()
void fillMSMainTableColWise(Int& nField, Int& nSpW)
void fillMSMainTable(Int& nField, Int& nSpW)
void fillAntennaTable(BinaryTable& bt)
void fillSpectralWindowTable(BinaryTable& bt, Int nSpW)
void fillSpectralWindowTable()
void fillFieldTable(BinaryTable& bt, Int nField)
void fillFieldTable(Int nField)
void fillFeedTable()
void fillExtraTables()
void fixEpochReferences()
Private Members
MSFitsInput()
MSFitsInput(const MSFitsInput& other)
MSFitsInput& operator=(const MSFitsInput& other)

Description

Prerequisite

Etymology

MSFitsInput handles the conversion of FITS files to MeasurementSets

Synopsis

UV FITS to MeasurementSet filler. This can handle single source fits and multi source fits as written by classic AIPS. Also copes with multiple arrays (i.e. multiple AN tables) but doesn't correct for 5 day offsets introduced by DBCON.

To Do

Member Description

MSFitsInput(const String& msFile, const String& fitsFile)

Create from output and input file names. This function opens the input file, and checks the output file is writable.

~MSFitsInput()

The destructor is fairly trivial.

void readFitsFile(Int obsType = MSTileLayout::Standard)

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 checkInput(FitsInput& infile)

Check that the input is a UV fits file with required contents. Returns False if not ok.

void getPrimaryGroupAxisInfo()

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

void setupMeasurementSet(const String& MSFileName, Bool useTSM=True, Int obsType = MSTileLayout::Standard)

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. Use obsType to choose the tiling scheme.

void fillObsTables()

Fill the Observation and ObsLog tables

void fillMSMainTableColWise(Int& nField, Int& nSpW)

Fill the main table from the Primary group data if we have enough memory try to do it in mem

void fillMSMainTable(Int& nField, Int& nSpW)

else do it row by row

void fillAntennaTable(BinaryTable& bt)

Read a binary table extension of type AIPS AN and create an antenna table

void fillSpectralWindowTable(BinaryTable& bt, Int nSpW)

fill spectralwindow table from FITS FQ table + header info

void fillSpectralWindowTable()

fill spectralwindow table from header

void fillFieldTable(BinaryTable& bt, Int nField)

fill Field table from FITS SU table

void fillFieldTable(Int nField)

fill Field table from header (single source fits)

void fillFeedTable()

fill the Feed table with minimal info needed for synthesis processing

void fillExtraTables()

fill the Pointing table (from Field table, all antennas are assumed to point in the field direction) and possibly the Source table.

void fixEpochReferences()

fix up the EPOCH MEASURE_REFERENCE keywords using the value found in the (last) AN table

MSFitsInput()

MSFitsInput(const MSFitsInput& other)

MSFitsInput& operator=(const MSFitsInput& other)