casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::FITSMultiTable Class Reference

View multiple FITS files as a single table. More...

#include <FITSMultiTable.h>

Inheritance diagram for casacore::FITSMultiTable:
casacore::FITSTabular

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. More...
 
 ~FITSMultiTable ()
 
virtual Bool isValid () const
 isValid() returns False if this object isn't a valid Tabular data structure. More...
 
virtual const TableRecordkeywords () const
 Returns keywords which are associated with the underlying FITS files. More...
 
virtual const RecordDescdescription () const
 Returns the description of the underlying FITS table. More...
 
virtual const Recordunits () 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). More...
 
virtual const RecorddisplayFormats () 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). More...
 
virtual const Recordnulls () 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). More...
 
virtual const Stringname () const
 return the name More...
 
virtual Bool pastEnd () const
 Only returns True when all files are exhausted. More...
 
virtual void next ()
 When end of data is hit on the current file, the next file is opened automatically. More...
 
virtual const RecordcurrentRow () const
 Return the currentRow. More...
 
const Vector< String > & fileNames () const
 get the list of file names More...
 
virtual Bool hasChanged () const
 Has the descriptor changed from when the file was opened. More...
 
void resetChangedFlag ()
 set hasChanged to False - used after hasChanged has been checked More...
 
- Public Member Functions inherited from casacore::FITSTabular
virtual ~FITSTabular ()
 
virtual Bool reopen (const String &)
 Reopen the table, default behavior is to do nothing, return False. More...
 

Static Public Member Functions

static Vector< StringfilesInTimeRange (const String &directoryName, const Time &startTime, const Time &endTime, Bool verboseErrors=False, Bool verboseStatus=False)
 A helper function to generate a list of fileNames. More...
 
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 More...
 
- Static Public Member Functions inherited from casacore::FITSTabular
static TableRecord keywordsFromHDU (HeaderDataUnit &hdu, Bool allKeywords=False)
 Helper function for retrieving keywords from a native-FITS hdu. More...
 
static RecordDesc descriptionFromHDU (BinaryTableExtension &hdu)
 Helper function for retrieving a description from a native-FITS hdu. More...
 
static Record subStringShapeFromHDU (BinaryTableExtension &hdu)
 Help function for retrieving any shape information from String columns using the SubString convention. More...
 
static Record unitsFromHDU (BinaryTableExtension &hdu)
 Helper function for retrieving the TUNITnnn from a native-FITS hdu. More...
 
static Record displayFormatsFromHDU (BinaryTableExtension &hdu)
 Helper function for retrieving the TDISPnnn from a native-FITS hdu. More...
 
static Record nullsFromHDU (BinaryTableExtension &hdu)
 Helper function for retrieving the TNULLnnn from a native-FITS hdu. More...
 
static TableDesc tableDesc (const FITSTabular &fitstabular)
 Get a TableDesc appropriate to hold a FITSTabular the keywords, description, units, displayFormats, and nulls are all used. More...
 

Private Member Functions

 FITSMultiTable ()
 Undefined and inaccessible. More...
 
 FITSMultiTable (const FITSMultiTable &other)
 
FITSMultiTableoperator= (const FITSMultiTable &other)
 
FITSTabulardefaultMaker (const String &fileName)
 

Private Attributes

FITSTabulartable_p
 
Vector< Stringfile_names_p
 
uInt nfiles_p
 
uInt which_file_p
 
Bool hasChanged_p
 
Record row_p
 

Detailed Description

View multiple FITS files as a single table.

Intended use:

Internal

Review Status

Date Reviewed:
yyyy/mm/dd

Synopsis

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.

Example

Motivation

Definition at line 65 of file FITSMultiTable.h.

Constructor & Destructor Documentation

casacore::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.

casacore::FITSMultiTable::~FITSMultiTable ( )
casacore::FITSMultiTable::FITSMultiTable ( )
private

Undefined and inaccessible.

casacore::FITSMultiTable::FITSMultiTable ( const FITSMultiTable other)
private

Member Function Documentation

virtual const Record& casacore::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 casacore::FITSTabular.

FITSTabular* casacore::FITSMultiTable::defaultMaker ( const String fileName)
private
virtual const RecordDesc& casacore::FITSMultiTable::description ( ) const
virtual

Returns the description of the underlying FITS table.

Implements casacore::FITSTabular.

virtual const Record& casacore::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 casacore::FITSTabular.

const Vector<String>& casacore::FITSMultiTable::fileNames ( ) const
inline

get the list of file names

Definition at line 93 of file FITSMultiTable.h.

References file_names_p.

static Vector<String> casacore::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 casacore::FITSMultiTable::hasChanged ( ) const
inlinevirtual

Has the descriptor changed from when the file was opened.

Reimplemented from casacore::FITSTabular.

Definition at line 96 of file FITSMultiTable.h.

References hasChanged_p.

virtual Bool casacore::FITSMultiTable::isValid ( ) const
virtual

isValid() returns False if this object isn't a valid Tabular data structure.

Implements casacore::FITSTabular.

virtual const TableRecord& casacore::FITSMultiTable::keywords ( ) const
virtual

Returns keywords which are associated with the underlying FITS files.

Implements casacore::FITSTabular.

virtual const String& casacore::FITSMultiTable::name ( ) const
inlinevirtual

return the name

Implements casacore::FITSTabular.

Definition at line 83 of file FITSMultiTable.h.

References casacore::FITSTabular::name(), and table_p.

virtual void casacore::FITSMultiTable::next ( )
virtual

When end of data is hit on the current file, the next file is opened automatically.

Implements casacore::FITSTabular.

virtual const Record& casacore::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 casacore::FITSTabular.

FITSMultiTable& casacore::FITSMultiTable::operator= ( const FITSMultiTable other)
private
virtual Bool casacore::FITSMultiTable::pastEnd ( ) const
virtual

Only returns True when all files are exhausted.

Implements casacore::FITSTabular.

void casacore::FITSMultiTable::resetChangedFlag ( )
inlinevirtual

set hasChanged to False - used after hasChanged has been checked

Reimplemented from casacore::FITSTabular.

Definition at line 99 of file FITSMultiTable.h.

References casacore::False, and hasChanged_p.

static Time casacore::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& casacore::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 casacore::FITSTabular.

Member Data Documentation

Vector<String> casacore::FITSMultiTable::file_names_p
private

Definition at line 125 of file FITSMultiTable.h.

Referenced by fileNames().

Bool casacore::FITSMultiTable::hasChanged_p
private

Definition at line 128 of file FITSMultiTable.h.

Referenced by hasChanged(), and resetChangedFlag().

uInt casacore::FITSMultiTable::nfiles_p
private

Definition at line 126 of file FITSMultiTable.h.

Record casacore::FITSMultiTable::row_p
private

Definition at line 130 of file FITSMultiTable.h.

FITSTabular* casacore::FITSMultiTable::table_p
private

Definition at line 123 of file FITSMultiTable.h.

Referenced by name().

uInt casacore::FITSMultiTable::which_file_p
private

Definition at line 127 of file FITSMultiTable.h.


The documentation for this class was generated from the following file: