casa
$Rev:20696$
|
View multiple FITS files as a single table. More...
#include <FITSMultiTable.h>
Public Member Functions | |
FITSMultiTable (const Vector< String > &fileNames, FITSTabular *(*tabMaker)(const String &)=0) | |
The FITS files associated with the fileNames must all have the same description, the second argument is a function to generate the FITSTabular If not specified, a generic FITSTable is assumed. | |
~FITSMultiTable () | |
virtual Bool | isValid () const |
isValid() returns False if this object isn't a valid Tabular data structure. | |
virtual const TableRecord & | keywords () const |
Returns keywords which are associated with the underlying FITS files. | |
virtual const RecordDesc & | description () const |
Returns the description of the underlying FITS table. | |
virtual const Record & | units () const |
Returns any TUNITnnn associated with a column (the field names are the column names, each field value is the TUNITnnn value for that field). | |
virtual const Record & | displayFormats () const |
Returns any TDISPnnn associated with a column (the field names are the column names, each field value is the TDISPnnn value for that field). | |
virtual const Record & | nulls () const |
Returns any TNULLnnn associated with a column (the field names are the column names, each field value is the TNULLnnn value for that field). | |
virtual const String & | name () const |
return the name | |
virtual Bool | pastEnd () const |
Only returns True when all files are exhausted. | |
virtual void | next () |
When end of data is hit on the current file, the next file is opened automatically. | |
virtual const Record & | currentRow () const |
Return the currentRow. | |
const Vector< String > & | fileNames () const |
get the list of file names | |
virtual Bool | hasChanged () const |
Has the descriptor changed from when the file was opened. | |
void | resetChangedFlag () |
set hasChanged to False - used after hasChanged has been checked | |
Static Public Member Functions | |
static Vector< String > | filesInTimeRange (const String &directoryName, const Time &startTime, const Time &endTime, Bool verboseErrors=False, Bool verboseStatus=False) |
A helper function to generate a list of fileNames. | |
static Time | timeFromFile (const String &fileName) |
return the time as found in the given string using the form given above There are no sanity checks in this subroutine | |
Private Member Functions | |
FITSMultiTable () | |
Undefined and inaccessible. | |
FITSMultiTable (const FITSMultiTable &other) | |
FITSMultiTable & | operator= (const FITSMultiTable &other) |
FITSTabular * | defaultMaker (const String &fileName) |
Private Attributes | |
FITSTabular * | table_p |
Vector< String > | file_names_p |
uInt | nfiles_p |
uInt | which_file_p |
Bool | hasChanged_p |
Record | row_p |
View multiple FITS files as a single table.
Internal
A FITSMultiTable is used to view a collection of FITS files on disk as a single Table. That is, when next() is called, when one Table ends the next is reopened until all files are exhausted. The FITS files must all have the same description. Something clever should be done about the keywords.
Definition at line 65 of file FITSMultiTable.h.
casa::FITSMultiTable::FITSMultiTable | ( | const Vector< String > & | fileNames, |
FITSTabular *(*)(const String &) | tabMaker = 0 |
||
) |
The FITS files associated with the fileNames must all have the same description, the second argument is a function to generate the FITSTabular If not specified, a generic FITSTable is assumed.
The returned pointer IS controlled by this object.
casa::FITSMultiTable::FITSMultiTable | ( | ) | [private] |
Undefined and inaccessible.
casa::FITSMultiTable::FITSMultiTable | ( | const FITSMultiTable & | other | ) | [private] |
virtual const Record& casa::FITSMultiTable::currentRow | ( | ) | const [virtual] |
Return the currentRow.
This is guaranteed to be valid so long as only member functions of this base class are called (so you can safely attach RecordFieldPtr objects to it. The result is undefined if pastEnd() is True.
Implements casa::FITSTabular.
FITSTabular* casa::FITSMultiTable::defaultMaker | ( | const String & | fileName | ) | [private] |
virtual const RecordDesc& casa::FITSMultiTable::description | ( | ) | const [virtual] |
Returns the description of the underlying FITS table.
Implements casa::FITSTabular.
virtual const Record& casa::FITSMultiTable::displayFormats | ( | ) | const [virtual] |
Returns any TDISPnnn associated with a column (the field names are the column names, each field value is the TDISPnnn value for that field).
Note that only those columns with a non-empty TDISPnnn have an entry in the displayFormats() Record.
Implements casa::FITSTabular.
const Vector<String>& casa::FITSMultiTable::fileNames | ( | ) | const [inline] |
static Vector<String> casa::FITSMultiTable::filesInTimeRange | ( | const String & | directoryName, |
const Time & | startTime, | ||
const Time & | endTime, | ||
Bool | verboseErrors = False , |
||
Bool | verboseStatus = False |
||
) | [static] |
A helper function to generate a list of fileNames.
This function returns all the files in "directoryName" which have the form yyyy_mm_dd_hh:mm:ss_*.fits and which are (even partially) in the time range specified by startTime and endTime. It is used to generate a set of file names for use in the FITSMultiTable constructor. If verboseStatus is True, some status messages appear on cout. If verboseErrors is True improperly named files names (not matching the above pattern) are named on cerrt.
virtual Bool casa::FITSMultiTable::hasChanged | ( | ) | const [inline, virtual] |
Has the descriptor changed from when the file was opened.
Reimplemented from casa::FITSTabular.
Definition at line 96 of file FITSMultiTable.h.
References hasChanged_p.
virtual Bool casa::FITSMultiTable::isValid | ( | ) | const [virtual] |
isValid() returns False if this object isn't a valid Tabular data structure.
Implements casa::FITSTabular.
virtual const TableRecord& casa::FITSMultiTable::keywords | ( | ) | const [virtual] |
Returns keywords which are associated with the underlying FITS files.
Implements casa::FITSTabular.
virtual const String& casa::FITSMultiTable::name | ( | ) | const [inline, virtual] |
return the name
Implements casa::FITSTabular.
Definition at line 83 of file FITSMultiTable.h.
References casa::FITSTabular::name(), and table_p.
virtual void casa::FITSMultiTable::next | ( | ) | [virtual] |
When end of data is hit on the current file, the next file is opened automatically.
Implements casa::FITSTabular.
virtual const Record& casa::FITSMultiTable::nulls | ( | ) | const [virtual] |
Returns any TNULLnnn associated with a column (the field names are the column names, each field value is the TNULLnnn value for that field).
Note that only those columns with a specific entry for TNULLnnn and which have not been promoted to doubles due TSCAL and TZERO values will have an entry in the nulls() Record. The meaning of TNULL is only defined for integer and byte columns. When a column is promoted to a double because of scaling, any TNULL values will be assigned a value of NaN.
Implements casa::FITSTabular.
FITSMultiTable& casa::FITSMultiTable::operator= | ( | const FITSMultiTable & | other | ) | [private] |
virtual Bool casa::FITSMultiTable::pastEnd | ( | ) | const [virtual] |
Only returns True when all files are exhausted.
Implements casa::FITSTabular.
void casa::FITSMultiTable::resetChangedFlag | ( | ) | [inline, virtual] |
set hasChanged to False - used after hasChanged has been checked
Reimplemented from casa::FITSTabular.
Definition at line 99 of file FITSMultiTable.h.
References casa::False, and hasChanged_p.
static Time casa::FITSMultiTable::timeFromFile | ( | const String & | fileName | ) | [static] |
return the time as found in the given string using the form given above There are no sanity checks in this subroutine
virtual const Record& casa::FITSMultiTable::units | ( | ) | const [virtual] |
Returns any TUNITnnn associated with a column (the field names are the column names, each field value is the TUNITnnn value for that field).
Note that only those columns with a non-empty TUNITnnn have an entry in the units() Record.
Implements casa::FITSTabular.
Vector<String> casa::FITSMultiTable::file_names_p [private] |
Definition at line 125 of file FITSMultiTable.h.
Referenced by fileNames().
Bool casa::FITSMultiTable::hasChanged_p [private] |
Definition at line 128 of file FITSMultiTable.h.
Referenced by hasChanged(), and resetChangedFlag().
uInt casa::FITSMultiTable::nfiles_p [private] |
Definition at line 126 of file FITSMultiTable.h.
Record casa::FITSMultiTable::row_p [private] |
Definition at line 130 of file FITSMultiTable.h.
FITSTabular* casa::FITSMultiTable::table_p [private] |
Definition at line 123 of file FITSMultiTable.h.
Referenced by name().
uInt casa::FITSMultiTable::which_file_p [private] |
Definition at line 127 of file FITSMultiTable.h.