casacore
|
#include <FitsIDItoMS.h>
Public Member Functions | |
FITSIDItoMS1 (FitsInput &in, const String &correlat, const Int &obsType=0, const Bool &initFirstMain=True) | |
The only constructor is from a FitsInput. More... | |
~FITSIDItoMS1 () | |
Table | oldfullTable (const String &tabName) |
Get the full table, using the supplied arguments to construct the table. More... | |
void | fillObsTables () |
Fill the Observation and ObsLog tables. More... | |
void | fillAntennaTable () |
Read a binary table extension of type ANTENNA and create an antenna table void fillAntennaTable(BinaryTable& bt);. More... | |
void | fillFeedTable () |
fill the Feed table with minimal info needed for synthesis processing More... | |
void | fillFieldTable () |
fill the Field table void fillFieldTable(Int nField); More... | |
void | fillSpectralWindowTable () |
fill the Spectral Window table with the content of FREQUENCY More... | |
Bool | fillCorrelatorModelTable () |
fill the optional Correlator Model table with the content of INTERFEROMETER_MODEL More... | |
Bool | fillSysCalTable () |
fill the optional SysCal table with the content of SYSTEM_TEMPERATURE More... | |
Bool | fillFlagCmdTable () |
fill the optional FlagCmd table with the content of FLAG More... | |
Bool | fillWeatherTable () |
fill the optional Weather table with the content of WEATHER More... | |
Bool | handleGainCurve () |
store the information from the GAIN_CURVE table in a calibration table More... | |
Bool | handlePhaseCal () |
store the information from the PHASE-CAL table in a calibration table More... | |
Bool | handleModelComps () |
store the information from the MODEL_COMPS table More... | |
void | fixEpochReferences () |
fix up the EPOCH MEASURE_REFERENCE keywords More... | |
void | updateTables (const String &tabName) |
update the Polarization table More... | |
const TableDesc & | getDescriptor () |
Get an appropriate TableDesc (this is the same TableDesc used to construct any Table objects returned by this class. More... | |
TableRecord & | getKeywords () |
Return the Table keywords (this is the same TableRecord used in any Table objects returned by this class. More... | |
const Table & | thisRow () |
Get a Table with a single row, the current row of the FITS table. More... | |
const Table & | nextRow () |
Get a Table with a single row, the next row of the FITS table. More... | |
Float | msVersion () const |
Get the version of the archived MS. More... | |
Bool | readFitsFile (const String &msFile) |
Read all the data from the FITS file and create the MeasurementSet. More... | |
Bool | isfirstMain () |
is this the first UV_DATA extension More... | |
Public Member Functions inherited from casacore::BinaryTableExtension | |
BinaryTableExtension (FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
BinaryTableExtension (FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
BinaryTableExtension (FITSErrorHandler errhandler=FITSError::defaultHandler) | |
constructor to match write_bintbl_hdr() More... | |
virtual | ~BinaryTableExtension () |
Int | nrows () const |
return basic elements of a table More... | |
Int | ncols () const |
uInt | rowsize () const |
Int | tfields () const |
const char * | tform (int n) const |
double | tscal (int n) const |
double | tzero (int n) const |
Bool | isatnull (int n) const |
Int | tnull (int n) const |
const char * | ttype (int n) const |
const char * | tunit (int n) const |
const char * | tdisp (int n) const |
const char * | tdim (int n) const |
const char * | ctype (int n) const |
double | crpix (int n) const |
double | crota (int n) const |
double | crval (int n) const |
double | cdelt (int n) const |
Int | theap () const |
const char * | author () const |
const char * | referenc () const |
int | bind (int, FitsBase &) |
binds a FitsField to a column More... | |
BinaryTableExtension & | operator++ () |
row selector functions More... | |
BinaryTableExtension & | operator-- () |
BinaryTableExtension & | operator() (int) |
int | read () |
read entire table into memory More... | |
int | read (int) |
read next N rows into memory More... | |
int | set_next (int) |
prepare to write the next N rows More... | |
int | write (FitsOutput &) |
write current rows More... | |
int | write_binTbl_hdr (FitsOutput &, long, int, const char **, const char **, const char **, const char *, long) |
create a binary table header without using FitsKeywordList objet. More... | |
FitsBase & | field (int i) const |
select a field More... | |
Int | currrow () const |
get current row More... | |
Public Member Functions inherited from casacore::ExtensionHeaderDataUnit | |
ExtensionHeaderDataUnit (FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
ExtensionHeaderDataUnit (FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
~ExtensionHeaderDataUnit () | |
char * | xtension () |
char * | extname () |
Int | extver () |
Int | extlevel () |
Int | pcount () |
Int | gcount () |
int | read (char *addr, int nbytes) |
read next N bytes into addr More... | |
int | write (FitsOutput &fout, char *addr, int nbytes) |
write next N bytes from addr to the FITS output fout More... | |
Public Member Functions inherited from casacore::HeaderDataUnit | |
virtual | ~HeaderDataUnit () |
Int | dims () const |
Int | dim (int n) const |
OFF_T | fitsdatasize () const |
FITS::ValueType | datatype () const |
Int | fitsitemsize () const |
Int | localitemsize () const |
FITS::HDUType | hdutype () const |
int | err () const |
int | skip (uInt n) |
skipping one or more HDU's More... | |
int | skip () |
int | write_hdr (FitsOutput &) |
write the current header More... | |
ConstFitsKeywordList & | kwlist () |
Operations on the HDU's keyword list. More... | |
Vector< String > | kwlist_str (Bool length80=False) |
return the header of the chdu as a vector of String. More... | |
void | firstkw () |
void | lastkw () |
const FitsKeyword * | nextkw () |
const FitsKeyword * | prevkw () |
const FitsKeyword * | currkw () |
const FitsKeyword * | kw (int n) |
const FitsKeyword * | kw (const FITS::ReservedName &n) |
const FitsKeyword * | nextkw (FITS::ReservedName &n) |
const FitsKeyword * | kw (FITS::ReservedName &n, int i) |
const FitsKeyword * | nextkw (FITS::ReservedName &n, int i) |
const FitsKeyword * | kw (const char *n) |
const FitsKeyword * | nextkw (const char *n) |
void | mk (FITS::ReservedName k, Bool v, const char *c=0) |
void | mk (FITS::ReservedName k, const char *v=0, const char *c=0) |
void | mk (FITS::ReservedName k, Int v, const char *c=0) |
void | mk (FITS::ReservedName k, double v, const char *c=0) |
void | mk (int n, FITS::ReservedName k, Bool v, const char *c=0) |
void | mk (int n, FITS::ReservedName k, const char *v, const char *c=0) |
void | mk (int n, FITS::ReservedName k, Int v, const char *c=0) |
void | mk (int n, FITS::ReservedName k, double v, const char *c=0) |
void | mk (const char *n, Bool v, const char *c=0) |
void | mk (const char *n, const char *v=0, const char *c=0) |
void | mk (const char *n, Int v, const char *c=0) |
void | mk (const char *n, float v, const char *c=0) |
void | mk (const char *n, double v, const char *c=0) |
void | mk (const char *n, Int r, Int i, const char *c=0) |
void | mk (const char *n, float r, float i, const char *c=0) |
void | mk (const char *n, double r, double i, const char *c=0) |
void | spaces (const char *n=0, const char *c=0) |
void | comment (const char *n=0, const char *c=0) |
void | history (const char *c=0) |
Bool | notnull (double x) const |
Bool | notnull (char *s) const |
Bool | notnull (Int l) const |
int | get_hdr (FITS::HDUType, FitsKeywordList &) |
int | read_data (char *, Int) |
int | write_data (FitsOutput &, char *, Int) |
OFF_T | read_all_data (char *) |
int | write_all_data (FitsOutput &, char *) |
Protected Member Functions | |
void | getAxisInfo () |
Read the axis info, throws an exception if required axes are missing. More... | |
void | setupMeasurementSet (const String &MSFileName, Bool useTSM=True, Bool mainTbl=False, Bool addCorrMod=False, Bool addSyscal=False, Bool addWeather=False, Bool addGainCurve=False) |
Set up the MeasurementSet, including StorageManagers and fixed columns. More... | |
void | fillMSMainTable (const String &MSFileName, Int &nField, Int &nSpW) |
Fill the main table from the Primary group data. More... | |
Protected Member Functions inherited from casacore::BinaryTableExtension | |
BinaryTableExtension (FitsInput &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
sets field addresses in the current row void set_fitsrow(Int); More... | |
BinaryTableExtension (FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
BinaryTableExtension (FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
virtual int | readrow () |
read and write the next FITS data row More... | |
virtual int | writerow (FitsOutput &) |
void | set_fitsrow (Int) |
sets field addresses in the current row More... | |
Protected Member Functions inherited from casacore::ExtensionHeaderDataUnit | |
ExtensionHeaderDataUnit (FitsInput &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
ExtensionHeaderDataUnit (FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
ExtensionHeaderDataUnit (FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
This constructor is used for writing only required keywords. More... | |
Protected Member Functions inherited from casacore::HeaderDataUnit | |
HeaderDataUnit (FitsInput &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler) | |
For input – ~ should delete the keyword list: kwflag = 1. More... | |
HeaderDataUnit (FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler, FitsInput *=0) | |
For output – ~ should not delete keyword list: kwflag = 0 07/21/98 AKH Clarification: HeaderDataUnit has a copy of the FitsKeywordList, and should delete it. More... | |
HeaderDataUnit (FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler, FitsInput *=0) | |
constructor for objects that write only required keyword to fits file. More... | |
bool | init_data_unit (FITS::HDUType t) |
for write required keywords only to use. More... | |
void | posEnd () |
void | errmsg (HDUErrs, const char *) |
char * | assign (FITS::ReservedName) |
char * | assign (FITS::ReservedName, int) |
double | asgdbl (FITS::ReservedName, double) |
double | asgdbl (FITS::ReservedName, int, double) |
Private Member Functions | |
void | fillRow () |
Fill in each row as needed. More... | |
void | convertKeywords () |
Build part of the keywords of the itsCurRowTab. More... | |
void | describeColumns () |
Convert FITS field descriptions to TableColumn descriptions. More... | |
void | convertMSKeywords () |
Convert the MS-specific keywords in the FITS binary table. More... | |
Static Private Attributes | |
static String | array_p |
static Double | rdate |
static Bool | firstMain |
static Bool | firstSyscal |
static Bool | firstWeather |
static Bool | firstGainCurve |
static std::map< Int, Int > | antIdFromNo |
static std::map< Int, Int > | digiLevels |
static Vector< Double > | effChBw |
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.
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 117 of file FitsIDItoMS.h.
casacore::FITSIDItoMS1::FITSIDItoMS1 | ( | FitsInput & | in, |
const String & | correlat, | ||
const Int & | obsType = 0 , |
||
const Bool & | initFirstMain = True |
||
) |
The only constructor is from a FitsInput.
The correlat string should be set to the correlator name/type as contained in the CORRELAT keyword from the FITS-IDI primary header. If it is set to "DIFX" (case-sensitive) additional digital corrections appropriate for the DiFX software correlator will be applied. Other valid values include "VLBA" (for the original VLBA hardware correlator; currently unsupported) and "SFXC" (for the SFXC software correlator used by the EVN).
casacore::FITSIDItoMS1::~FITSIDItoMS1 | ( | ) |
|
private |
Build part of the keywords of the itsCurRowTab.
|
private |
Convert the MS-specific keywords in the FITS binary table.
|
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
|
protected |
Fill the main table from the Primary group data.
void casacore::FITSIDItoMS1::fillObsTables | ( | ) |
Fill the Observation and ObsLog tables.
|
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
|
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
|
inline |
is this the first UV_DATA extension
Definition at line 228 of file FitsIDItoMS.h.
References firstMain.
|
inline |
Get the version of the archived MS.
Definition at line 219 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 BinaryTableExtension.
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.
|
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
Definition at line 316 of file FitsIDItoMS.h.
|
staticprivate |
Definition at line 289 of file FitsIDItoMS.h.
Definition at line 287 of file FitsIDItoMS.h.
Definition at line 285 of file FitsIDItoMS.h.
Definition at line 286 of file FitsIDItoMS.h.
Definition at line 285 of file FitsIDItoMS.h.
Definition at line 284 of file FitsIDItoMS.h.
Definition at line 288 of file FitsIDItoMS.h.
Definition at line 317 of file FitsIDItoMS.h.
Definition at line 318 of file FitsIDItoMS.h.
|
private |
Definition at line 291 of file FitsIDItoMS.h.
|
staticprivate |
Definition at line 308 of file FitsIDItoMS.h.
|
staticprivate |
Definition at line 305 of file FitsIDItoMS.h.
Referenced by isfirstMain().
|
staticprivate |
Definition at line 306 of file FitsIDItoMS.h.
|
staticprivate |
Definition at line 307 of file FitsIDItoMS.h.
|
private |
Definition at line 295 of file FitsIDItoMS.h.
|
private |
Definition at line 302 of file FitsIDItoMS.h.
|
private |
The scratch table containing the current row.
Definition at line 251 of file FitsIDItoMS.h.
Definition at line 279 of file FitsIDItoMS.h.
For each column: is it an array?
Definition at line 258 of file FitsIDItoMS.h.
|
private |
Table keyword set.
Definition at line 261 of file FitsIDItoMS.h.
|
private |
Definition at line 297 of file FitsIDItoMS.h.
Definition at line 276 of file FitsIDItoMS.h.
Definition at line 277 of file FitsIDItoMS.h.
Definition at line 278 of file FitsIDItoMS.h.
The number of elements for each column of the BinaryTableExtension.
Definition at line 255 of file FitsIDItoMS.h.
|
private |
Buffer for storing the MSK's, MS-specific FITS keywords.
Definition at line 275 of file FitsIDItoMS.h.
|
private |
Definition at line 301 of file FitsIDItoMS.h.
|
private |
Table descriptor for construction.
Definition at line 264 of file FitsIDItoMS.h.
|
private |
Table info.
Definition at line 267 of file FitsIDItoMS.h.
|
private |
|
private |
Definition at line 300 of file FitsIDItoMS.h.
|
private |
Definition at line 303 of file FitsIDItoMS.h.
|
private |
Definition at line 304 of file FitsIDItoMS.h.
|
private |
Definition at line 283 of file FitsIDItoMS.h.
|
private |
Definition at line 293 of file FitsIDItoMS.h.
|
private |
Definition at line 315 of file FitsIDItoMS.h.
Definition at line 284 of file FitsIDItoMS.h.
|
private |
Definition at line 314 of file FitsIDItoMS.h.
|
private |
Definition at line 290 of file FitsIDItoMS.h.
|
staticprivate |
Definition at line 292 of file FitsIDItoMS.h.
Definition at line 294 of file FitsIDItoMS.h.
Definition at line 288 of file FitsIDItoMS.h.
Definition at line 288 of file FitsIDItoMS.h.
|
private |
Definition at line 296 of file FitsIDItoMS.h.
|
private |
Definition at line 299 of file FitsIDItoMS.h.
|
private |
Definition at line 290 of file FitsIDItoMS.h.
|
private |
Definition at line 311 of file FitsIDItoMS.h.
|
private |
Definition at line 310 of file FitsIDItoMS.h.
|
private |
Definition at line 309 of file FitsIDItoMS.h.
|
private |
Definition at line 313 of file FitsIDItoMS.h.
|
private |
Definition at line 312 of file FitsIDItoMS.h.