casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
casa::FITSMultiTable Class Reference

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

#include <FITSMultiTable.h>

Inheritance diagram for casa::FITSMultiTable:
casa::FITSTabular

List of all members.

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 TableRecordkeywords () const
 Returns keywords which are associated with the underlying FITS files.
virtual const RecordDescdescription () const
 Returns the description of the underlying FITS table.
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).
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).
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).
virtual const Stringname () 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 RecordcurrentRow () 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< 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.
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)
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

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.

Undefined and inaccessible.


Member Function Documentation

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]

get the list of file names

Definition at line 93 of file FITSMultiTable.h.

References file_names_p.

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.


Member Data Documentation

Definition at line 125 of file FITSMultiTable.h.

Referenced by fileNames().

Definition at line 128 of file FITSMultiTable.h.

Referenced by hasChanged(), and resetChangedFlag().

Definition at line 126 of file FITSMultiTable.h.

Definition at line 130 of file FITSMultiTable.h.

Definition at line 123 of file FITSMultiTable.h.

Referenced by name().

Definition at line 127 of file FITSMultiTable.h.


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