FITSIDItoMS converts a FITS-IDI file to a CASA Measurement Set. More...
#include <FitsIDItoMS.h>
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 with the content of FREQUENCY | |
Bool | fillCorrelatorModelTable () |
fill the optional Correlator Model table with the content of INTERFEROMETER_MODEL | |
Bool | fillSysCalTable () |
fill the optional SysCal table with the content of SYSTEM_TEMPERATURE | |
Bool | fillFlagCmdTable () |
fill the optional FlagCmd table with the content of FLAG | |
Bool | fillWeatherTable () |
fill the optional Weather table with the content of WEATHER | |
Bool | handleGainCurve () |
store the information from the GAIN_CURVE table in a calibration table | |
Bool | handlePhaseCal () |
store the information from the PHASE-CAL table in a calibration table | |
Bool | handleModelComps () |
store the information from the MODEL_COMPS 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. | |
const Table & | nextRow () |
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, Bool addCorrMod=False, Bool addSyscal=False, Bool addWeather=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< Int > | itsNelem |
The number of elements for each column of the BinaryTableExtension. | |
Vector< Bool > | itsIsArray |
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< String > | itsMSKC |
Vector< String > | itsMSKN |
Vector< String > | itsMSKV |
Vector< Bool > | itsgotMSK |
String | msFile_p |
FitsInput . | |
Vector< Int > | nPixel_p |
Vector< Int > | corrType_p |
Block< Int > | corrIndex_p |
Matrix< Int > | corrProduct_p |
Vector< String > | coordType_p |
Vector< Double > | refVal_p |
Vector< Double > | refPix_p |
Vector< Double > | delta_p |
String | object_p |
String | timsys_p |
Double | epoch_p |
Int | nAnt_p |
Vector< Double > | receptorAngle_p |
MFrequency::Types | freqsys_p |
Double | restfreq_p |
LogIO * | itsLog |
Double | startTime_p |
Int nIF_p;. | |
Double | lastTime_p |
Int | itsObsType |
MeasurementSet | ms_p |
MSColumns * | msc_p |
Bool | weather_hasWater_p |
Bool | weather_hasElectron_p |
Bool | uv_data_hasWeights_p |
Bool | weightKwPresent_p |
Bool | weightypKwPresent_p |
String | weightyp_p |
Matrix< Float > | weightsFromKW_p |
Static Private Attributes | |
static String | array_p |
static Double | rdate |
static Bool | firstMain |
static Bool | firstSyscal |
static Bool | firstWeather |
static SimpleOrderedMap< Int, Int > | antIdFromNo |
FITSIDItoMS converts a FITS-IDI file to a CASA Measurement Set.
Public interface
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.
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.
We need a way to get FITS-IDI data (typically from VLBI observations) into CASA.
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.
casacore::FITSIDItoMS1::FITSIDItoMS1 | ( | FitsInput & | in, | |
const Int & | obsType = 0 , |
|||
const Bool & | initFirstMain = True | |||
) |
The only constructor is from a FitsInput.
casacore::FITSIDItoMS1::~FITSIDItoMS1 | ( | ) |
void casacore::FITSIDItoMS1::convertKeywords | ( | ) | [private] |
Build part of the keywords of the itsCurRowTab.
void casacore::FITSIDItoMS1::convertMSKeywords | ( | ) | [private] |
Convert the MS-specific keywords in the FITS binary table.
void casacore::FITSIDItoMS1::describeColumns | ( | ) | [private] |
Convert FITS field descriptions to TableColumn descriptions.
void casacore::FITSIDItoMS1::fillAntennaTable | ( | ) |
Read a binary table extension of type ANTENNA and create an antenna table void fillAntennaTable(BinaryTable& bt);.
Bool casacore::FITSIDItoMS1::fillCorrelatorModelTable | ( | ) |
fill the optional Correlator Model table with the content of INTERFEROMETER_MODEL
void casacore::FITSIDItoMS1::fillFeedTable | ( | ) |
fill the Feed table with minimal info needed for synthesis processing
void casacore::FITSIDItoMS1::fillFieldTable | ( | ) |
fill the Field table void fillFieldTable(Int nField);
Bool casacore::FITSIDItoMS1::fillFlagCmdTable | ( | ) |
fill the optional FlagCmd table with the content of FLAG
void casacore::FITSIDItoMS1::fillMSMainTable | ( | const String & | MSFileName, | |
Int & | nField, | |||
Int & | nSpW | |||
) | [protected] |
Fill the main table from the Primary group data.
void casacore::FITSIDItoMS1::fillObsTables | ( | ) |
Fill the Observation and ObsLog tables.
void casacore::FITSIDItoMS1::fillRow | ( | ) | [private] |
Fill in each row as needed.
void casacore::FITSIDItoMS1::fillSpectralWindowTable | ( | ) |
fill the Spectral Window table with the content of FREQUENCY
Bool casacore::FITSIDItoMS1::fillSysCalTable | ( | ) |
fill the optional SysCal table with the content of SYSTEM_TEMPERATURE
Bool casacore::FITSIDItoMS1::fillWeatherTable | ( | ) |
fill the optional Weather table with the content of WEATHER
void casacore::FITSIDItoMS1::fixEpochReferences | ( | ) |
fix up the EPOCH MEASURE_REFERENCE keywords
void casacore::FITSIDItoMS1::getAxisInfo | ( | ) | [protected] |
Read the axis info, throws an exception if required axes are missing.
const TableDesc& casacore::FITSIDItoMS1::getDescriptor | ( | ) |
TableRecord& casacore::FITSIDItoMS1::getKeywords | ( | ) |
Return the Table keywords (this is the same TableRecord used in any Table objects returned by this class.
Bool casacore::FITSIDItoMS1::handleGainCurve | ( | ) |
store the information from the GAIN_CURVE table in a calibration table
Bool casacore::FITSIDItoMS1::handleModelComps | ( | ) |
store the information from the MODEL_COMPS table
Bool casacore::FITSIDItoMS1::handlePhaseCal | ( | ) |
store the information from the PHASE-CAL table in a calibration table
Bool casacore::FITSIDItoMS1::isfirstMain | ( | ) | [inline] |
is this the first UV_DATA extension
Definition at line 220 of file FitsIDItoMS.h.
References firstMain.
Float casacore::FITSIDItoMS1::msVersion | ( | ) | const [inline] |
Get the version of the archived MS.
Definition at line 211 of file FitsIDItoMS.h.
References itsVersion.
const Table& casacore::FITSIDItoMS1::nextRow | ( | ) |
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 casacore::FITSIDItoMS1::setupMeasurementSet | ( | const String & | MSFileName, | |
Bool | useTSM = True , |
|||
Bool | mainTbl = False , |
|||
Bool | addCorrMod = False , |
|||
Bool | addSyscal = False , |
|||
Bool | addWeather = 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
const Table& casacore::FITSIDItoMS1::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.
void casacore::FITSIDItoMS1::updateTables | ( | const String & | tabName | ) |
update the Polarization table
SimpleOrderedMap<Int,Int> casacore::FITSIDItoMS1::antIdFromNo [static, private] |
Definition at line 305 of file FitsIDItoMS.h.
String casacore::FITSIDItoMS1::array_p [static, private] |
Definition at line 280 of file FitsIDItoMS.h.
Vector<String> casacore::FITSIDItoMS1::coordType_p [private] |
Definition at line 278 of file FitsIDItoMS.h.
Block<Int> casacore::FITSIDItoMS1::corrIndex_p [private] |
Definition at line 276 of file FitsIDItoMS.h.
Matrix<Int> casacore::FITSIDItoMS1::corrProduct_p [private] |
Definition at line 277 of file FitsIDItoMS.h.
Vector<Int> casacore::FITSIDItoMS1::corrType_p [private] |
Definition at line 275 of file FitsIDItoMS.h.
Vector<Double> casacore::FITSIDItoMS1::delta_p [private] |
Definition at line 279 of file FitsIDItoMS.h.
Double casacore::FITSIDItoMS1::epoch_p [private] |
Definition at line 282 of file FitsIDItoMS.h.
Bool casacore::FITSIDItoMS1::firstMain [static, private] |
Definition at line 295 of file FitsIDItoMS.h.
Referenced by isfirstMain().
Bool casacore::FITSIDItoMS1::firstSyscal [static, private] |
Definition at line 296 of file FitsIDItoMS.h.
Bool casacore::FITSIDItoMS1::firstWeather [static, private] |
Definition at line 297 of file FitsIDItoMS.h.
Definition at line 286 of file FitsIDItoMS.h.
Table casacore::FITSIDItoMS1::itsCurRowTab [private] |
The scratch table containing the current row.
Definition at line 242 of file FitsIDItoMS.h.
Vector<Bool> casacore::FITSIDItoMS1::itsgotMSK [private] |
Definition at line 270 of file FitsIDItoMS.h.
Vector<Bool> casacore::FITSIDItoMS1::itsIsArray [private] |
For each column: is it an array?
Definition at line 249 of file FitsIDItoMS.h.
TableRecord casacore::FITSIDItoMS1::itsKwSet [private] |
Table keyword set.
Definition at line 252 of file FitsIDItoMS.h.
LogIO* casacore::FITSIDItoMS1::itsLog [private] |
Definition at line 288 of file FitsIDItoMS.h.
Vector<String> casacore::FITSIDItoMS1::itsMSKC [private] |
Definition at line 267 of file FitsIDItoMS.h.
Vector<String> casacore::FITSIDItoMS1::itsMSKN [private] |
Definition at line 268 of file FitsIDItoMS.h.
Vector<String> casacore::FITSIDItoMS1::itsMSKV [private] |
Definition at line 269 of file FitsIDItoMS.h.
Vector<Int> casacore::FITSIDItoMS1::itsNelem [private] |
The number of elements for each column of the BinaryTableExtension.
Definition at line 246 of file FitsIDItoMS.h.
uInt casacore::FITSIDItoMS1::itsNrMSKs [private] |
Buffer for storing the MSK's, MS-specific FITS keywords.
Definition at line 266 of file FitsIDItoMS.h.
Int casacore::FITSIDItoMS1::itsObsType [private] |
Definition at line 292 of file FitsIDItoMS.h.
Table descriptor for construction.
Definition at line 255 of file FitsIDItoMS.h.
Table info.
Definition at line 258 of file FitsIDItoMS.h.
Float casacore::FITSIDItoMS1::itsVersion [private] |
Double casacore::FITSIDItoMS1::lastTime_p [private] |
Definition at line 291 of file FitsIDItoMS.h.
MeasurementSet casacore::FITSIDItoMS1::ms_p [private] |
Definition at line 293 of file FitsIDItoMS.h.
MSColumns* casacore::FITSIDItoMS1::msc_p [private] |
Definition at line 294 of file FitsIDItoMS.h.
String casacore::FITSIDItoMS1::msFile_p [private] |
Definition at line 274 of file FitsIDItoMS.h.
Int casacore::FITSIDItoMS1::nAnt_p [private] |
Definition at line 284 of file FitsIDItoMS.h.
Vector<Int> casacore::FITSIDItoMS1::nPixel_p [private] |
Definition at line 275 of file FitsIDItoMS.h.
String casacore::FITSIDItoMS1::object_p [private] |
Definition at line 281 of file FitsIDItoMS.h.
Double casacore::FITSIDItoMS1::rdate [static, private] |
Definition at line 283 of file FitsIDItoMS.h.
Vector<Double> casacore::FITSIDItoMS1::receptorAngle_p [private] |
Definition at line 285 of file FitsIDItoMS.h.
Vector<Double> casacore::FITSIDItoMS1::refPix_p [private] |
Definition at line 279 of file FitsIDItoMS.h.
Vector<Double> casacore::FITSIDItoMS1::refVal_p [private] |
Definition at line 279 of file FitsIDItoMS.h.
Double casacore::FITSIDItoMS1::restfreq_p [private] |
Definition at line 287 of file FitsIDItoMS.h.
Double casacore::FITSIDItoMS1::startTime_p [private] |
Int nIF_p;.
Definition at line 290 of file FitsIDItoMS.h.
String casacore::FITSIDItoMS1::timsys_p [private] |
Definition at line 281 of file FitsIDItoMS.h.
Definition at line 300 of file FitsIDItoMS.h.
Definition at line 299 of file FitsIDItoMS.h.
Definition at line 298 of file FitsIDItoMS.h.
Definition at line 301 of file FitsIDItoMS.h.
Matrix<Float> casacore::FITSIDItoMS1::weightsFromKW_p [private] |
Definition at line 304 of file FitsIDItoMS.h.
String casacore::FITSIDItoMS1::weightyp_p [private] |
Definition at line 303 of file FitsIDItoMS.h.
Definition at line 302 of file FitsIDItoMS.h.