casa
$Rev:20696$
|
Attach a FITSTabular to a binary or ASCII table. More...
#include <FITSTable.h>
Public Member Functions | |
FITSTable (uInt whichHDU=1, Bool allKeywords=False) | |
this creates an invalid (isValid() return False) FITSTable Its primary purpose is so that FITSTables can be created before the file name is known. | |
FITSTable (const String &fileName, uInt whichHDU=1, Bool allKeywords=False) | |
0-relative HDU. | |
~FITSTable () | |
virtual Bool | eof () const |
Has the end of file been reached yet. | |
virtual Bool | reopen (const String &fileName) |
Attach this FITSTable to a new file name, same HDU# as at open time. | |
virtual const String & | name () const |
return the name | |
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 Bool | pastEnd () const |
Returns True if we have advanced past the end of data. | |
virtual void | next () |
Advance the row if possible (guaranteed harmless if pastEnd() is True. | |
virtual const Record & | currentRow () const |
Return the currentRow. | |
virtual uInt | nrow () const |
single FITS tables know how many rows there are unlike general FITSTabulars, which may not know (e.g. | |
virtual Int | rownr () const |
these tables should also know where they are | |
virtual void | move (Int torow) |
and it should be possible to move to a desired row the rownr() member can be used to verify that a move was successful - this will happen if the requested row was < rownr() or >= nrow() - i.e. | |
virtual const TableRecord & | primaryKeywords () const |
the keywords from the Primary HDU | |
Protected Member Functions | |
Bool | virtualColumns (const Vector< String > &keyNames) |
SDFITSTable needs to make some keywords appear as columns, this requires access to description_p, keywords_p, and row_p. | |
Private Member Functions | |
FITSTable (const FITSTable &) | |
Undefined and inaccessible. | |
FITSTable & | operator= (const FITSTable &) |
void | fill_row () |
void | clear_self () |
void | reopenAtFirstHDU (const String &name) |
It is necessary to read the PDA to get the primary keywords. | |
Private Attributes | |
Bool | isValid_p |
String | name_p |
uInt | hdu_nr_p |
Int | row_nr_p |
BinaryTableExtension * | raw_table_p |
FitsInput * | io_p |
TableRecord | keywords_p |
TableRecord | primaryKeys_p |
RecordDesc | description_p |
Record | row_p |
Record | units_p |
Record | disps_p |
Record | nulls_p |
Record | subStrShapes_p |
Bool | allKeys_p |
uInt | nfields_p |
One per field in row_p, of the right type. | |
Block< void * > | row_fields_p |
Block< Int > | field_types_p |
Block< Bool > | promoted_p |
Block< Int > | tdims_p |
Block< Int > | vatypes_p |
these are used by VADESC columns | |
Block< void * > | vaptr_p |
VADescFitsField * | va_p |
I had trouble making a Block<VADescFitsField> | |
char * | theheap_p |
Attach a FITSTabular to a binary or ASCII table.
Public interface
FITSTable is a FITSTabular which is attached to a FITS table (on disk only presently), either Binary or ASCII.
Definition at line 200 of file FITSTable.h.
casa::FITSTable::FITSTable | ( | uInt | whichHDU = 1 , |
Bool | allKeywords = False |
||
) |
casa::FITSTable::FITSTable | ( | const String & | fileName, |
uInt | whichHDU = 1 , |
||
Bool | allKeywords = False |
||
) |
0-relative HDU.
It can never be zero by the FITS rules. allKeywords is passed to FITSTabular::keywordsFromHDU See the documentation for that function for a list of excluded keywords when allKeywords is False.
casa::FITSTable::~FITSTable | ( | ) | [inline] |
Definition at line 214 of file FITSTable.h.
References clear_self().
casa::FITSTable::FITSTable | ( | const FITSTable & | ) | [private] |
Undefined and inaccessible.
An alternative would be to use reference semantics like Table.
void casa::FITSTable::clear_self | ( | ) | [private] |
Referenced by ~FITSTable().
virtual const Record& casa::FITSTable::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.
virtual const RecordDesc& casa::FITSTable::description | ( | ) | const [inline, virtual] |
Returns the description of the underlying FITS table.
Implements casa::FITSTabular.
Definition at line 226 of file FITSTable.h.
References description_p.
virtual const Record& casa::FITSTable::displayFormats | ( | ) | const [inline, 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.
Definition at line 228 of file FITSTable.h.
References disps_p.
virtual Bool casa::FITSTable::eof | ( | ) | const [inline, virtual] |
Has the end of file been reached yet.
Definition at line 217 of file FITSTable.h.
References casa::FitsIO::eof(), and io_p.
void casa::FITSTable::fill_row | ( | ) | [private] |
virtual Bool casa::FITSTable::isValid | ( | ) | const [inline, virtual] |
isValid() returns False if this object isn't a valid Tabular data structure.
Implements casa::FITSTabular.
Definition at line 223 of file FITSTable.h.
References isValid_p.
virtual const TableRecord& casa::FITSTable::keywords | ( | ) | const [inline, virtual] |
Returns keywords which are associated with the underlying FITS files.
Implements casa::FITSTabular.
Definition at line 225 of file FITSTable.h.
References keywords_p.
virtual void casa::FITSTable::move | ( | Int | torow | ) | [virtual] |
virtual const String& casa::FITSTable::name | ( | ) | const [inline, virtual] |
return the name
Implements casa::FITSTabular.
Definition at line 221 of file FITSTable.h.
References name_p.
virtual void casa::FITSTable::next | ( | ) | [virtual] |
Advance the row if possible (guaranteed harmless if pastEnd() is True.
Implements casa::FITSTabular.
virtual uInt casa::FITSTable::nrow | ( | ) | const [inline, virtual] |
single FITS tables know how many rows there are unlike general FITSTabulars, which may not know (e.g.
if it is a FITSMultiTable)
Definition at line 238 of file FITSTable.h.
References casa::BinaryTableExtension::nrows(), and raw_table_p.
virtual const Record& casa::FITSTable::nulls | ( | ) | const [inline, 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.
Definition at line 229 of file FITSTable.h.
References nulls_p.
virtual Bool casa::FITSTable::pastEnd | ( | ) | const [virtual] |
Returns True if we have advanced past the end of data.
Implements casa::FITSTabular.
virtual const TableRecord& casa::FITSTable::primaryKeywords | ( | ) | const [inline, virtual] |
the keywords from the Primary HDU
Definition at line 251 of file FITSTable.h.
References primaryKeys_p.
virtual Bool casa::FITSTable::reopen | ( | const String & | fileName | ) | [virtual] |
Attach this FITSTable to a new file name, same HDU# as at open time.
Reimplemented from casa::FITSTabular.
Reimplemented in casa::SDFITSTable.
void casa::FITSTable::reopenAtFirstHDU | ( | const String & | name | ) | [private] |
It is necessary to read the PDA to get the primary keywords.
If there is any data there, the FITS classes do not provide any way to just skip over them to get to the next HDU. The only way to do that is to actually read all of the data. If there is no data, this step is unnecessary and so this subroutine need only be called after the primary keywords have been read AND the PDA has some data in it. Closing the FitsInput and reopening it is faster in most cases than reading in each data value.
virtual Int casa::FITSTable::rownr | ( | ) | const [inline, virtual] |
these tables should also know where they are
Definition at line 241 of file FITSTable.h.
References row_nr_p.
virtual const Record& casa::FITSTable::units | ( | ) | const [inline, 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.
Definition at line 227 of file FITSTable.h.
References units_p.
Bool casa::FITSTable::virtualColumns | ( | const Vector< String > & | keyNames | ) | [protected] |
SDFITSTable needs to make some keywords appear as columns, this requires access to description_p, keywords_p, and row_p.
However, its not something that typical FITSTable users will want. Therefore, I've provided this protected function for SDFITSTable to use so as to not have to provide direct access to those data members at the public level. The named keywords and values are appended to the end of row_p and removed from keywords_p, description_p is modified appropriately. The returned value is False if any named keyword did not appear in keywords_p (however, all named keywords that DO appear in keywords_p will have been correctly moved).
Bool casa::FITSTable::allKeys_p [private] |
Definition at line 292 of file FITSTable.h.
RecordDesc casa::FITSTable::description_p [private] |
Definition at line 286 of file FITSTable.h.
Referenced by description().
Record casa::FITSTable::disps_p [private] |
Definition at line 289 of file FITSTable.h.
Referenced by displayFormats().
Block<Int> casa::FITSTable::field_types_p [private] |
Definition at line 296 of file FITSTable.h.
uInt casa::FITSTable::hdu_nr_p [private] |
Definition at line 279 of file FITSTable.h.
FitsInput* casa::FITSTable::io_p [private] |
Definition at line 283 of file FITSTable.h.
Referenced by eof().
Bool casa::FITSTable::isValid_p [private] |
Definition at line 275 of file FITSTable.h.
Referenced by isValid().
TableRecord casa::FITSTable::keywords_p [private] |
Definition at line 284 of file FITSTable.h.
Referenced by keywords().
String casa::FITSTable::name_p [private] |
Definition at line 277 of file FITSTable.h.
Referenced by name().
uInt casa::FITSTable::nfields_p [private] |
One per field in row_p, of the right type.
i.e. casting required.
Definition at line 294 of file FITSTable.h.
Record casa::FITSTable::nulls_p [private] |
Definition at line 290 of file FITSTable.h.
Referenced by nulls().
TableRecord casa::FITSTable::primaryKeys_p [private] |
Definition at line 285 of file FITSTable.h.
Referenced by primaryKeywords().
Block<Bool> casa::FITSTable::promoted_p [private] |
Definition at line 297 of file FITSTable.h.
BinaryTableExtension* casa::FITSTable::raw_table_p [private] |
Definition at line 282 of file FITSTable.h.
Referenced by nrow().
Block<void *> casa::FITSTable::row_fields_p [private] |
Definition at line 295 of file FITSTable.h.
Int casa::FITSTable::row_nr_p [private] |
Definition at line 281 of file FITSTable.h.
Referenced by rownr().
Record casa::FITSTable::row_p [private] |
Definition at line 287 of file FITSTable.h.
Record casa::FITSTable::subStrShapes_p [private] |
Definition at line 291 of file FITSTable.h.
Block<Int> casa::FITSTable::tdims_p [private] |
Definition at line 298 of file FITSTable.h.
char* casa::FITSTable::theheap_p [private] |
Definition at line 304 of file FITSTable.h.
Record casa::FITSTable::units_p [private] |
Definition at line 288 of file FITSTable.h.
Referenced by units().
VADescFitsField* casa::FITSTable::va_p [private] |
I had trouble making a Block<VADescFitsField>
Definition at line 303 of file FITSTable.h.
Block<void *> casa::FITSTable::vaptr_p [private] |
Definition at line 301 of file FITSTable.h.
Block<Int> casa::FITSTable::vatypes_p [private] |
these are used by VADESC columns
Definition at line 300 of file FITSTable.h.