casacore
|
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. More... | |
FITSTable (const String &fileName, uInt whichHDU=1, Bool allKeywords=False) | |
0-relative HDU. More... | |
~FITSTable () | |
virtual Bool | eof () const |
Has the end of file been reached yet. More... | |
virtual Bool | reopen (const String &fileName) |
Attach this FITSTable to a new file name, same HDU# as at open time. More... | |
virtual const String & | name () const |
return the name More... | |
virtual Bool | isValid () const |
isValid() returns False if this object isn't a valid Tabular data structure. More... | |
virtual const TableRecord & | keywords () const |
Returns keywords which are associated with the underlying FITS files. More... | |
virtual const RecordDesc & | description () const |
Returns the description of the underlying FITS table. More... | |
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). More... | |
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). More... | |
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). More... | |
virtual Bool | pastEnd () const |
Returns True if we have advanced past the end of data. More... | |
virtual void | next () |
Advance the row if possible (guaranteed harmless if pastEnd() is True. More... | |
virtual const Record & | currentRow () const |
Return the currentRow. More... | |
virtual uInt | nrow () const |
single FITS tables know how many rows there are unlike general FITSTabulars, which may not know (e.g. More... | |
virtual Int | rownr () const |
these tables should also know where they are More... | |
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. More... | |
virtual const TableRecord & | primaryKeywords () const |
the keywords from the Primary HDU More... | |
Public Member Functions inherited from casacore::FITSTabular | |
virtual | ~FITSTabular () |
virtual Bool | hasChanged () const |
Has the description changed since construction, default is False. More... | |
virtual void | resetChangedFlag () |
reset the changed flag, default do nothing More... | |
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. More... | |
Private Member Functions | |
FITSTable (const FITSTable &) | |
Undefined and inaccessible. More... | |
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. More... | |
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. More... | |
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 More... | |
Block< void * > | vaptr_p |
VADescFitsField * | va_p |
I had trouble making a Block<VADescFitsField> More... | |
char * | theheap_p |
Additional Inherited Members | |
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... | |
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.
casacore::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.
|
inline |
Definition at line 214 of file FITSTable.h.
References clear_self().
|
private |
Undefined and inaccessible.
An alternative would be to use reference semantics like Table.
|
private |
Referenced by ~FITSTable().
|
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.
|
inlinevirtual |
Returns the description of the underlying FITS table.
Implements casacore::FITSTabular.
Definition at line 226 of file FITSTable.h.
References description_p.
|
inlinevirtual |
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.
Definition at line 228 of file FITSTable.h.
References disps_p.
|
inlinevirtual |
Has the end of file been reached yet.
Definition at line 217 of file FITSTable.h.
References casacore::FitsIO::eof(), and io_p.
|
private |
|
inlinevirtual |
isValid() returns False if this object isn't a valid Tabular data structure.
Implements casacore::FITSTabular.
Definition at line 223 of file FITSTable.h.
References isValid_p.
|
inlinevirtual |
Returns keywords which are associated with the underlying FITS files.
Implements casacore::FITSTabular.
Definition at line 225 of file FITSTable.h.
References keywords_p.
|
virtual |
|
inlinevirtual |
return the name
Implements casacore::FITSTabular.
Definition at line 221 of file FITSTable.h.
References name_p.
|
virtual |
Advance the row if possible (guaranteed harmless if pastEnd() is True.
Implements casacore::FITSTabular.
|
inlinevirtual |
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 casacore::BinaryTableExtension::nrows(), and raw_table_p.
|
inlinevirtual |
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.
Definition at line 229 of file FITSTable.h.
References nulls_p.
|
virtual |
Returns True if we have advanced past the end of data.
Implements casacore::FITSTabular.
|
inlinevirtual |
the keywords from the Primary HDU
Definition at line 251 of file FITSTable.h.
References primaryKeys_p.
Attach this FITSTable to a new file name, same HDU# as at open time.
Reimplemented from casacore::FITSTabular.
Reimplemented in casacore::SDFITSTable.
|
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.
|
inlinevirtual |
these tables should also know where they are
Definition at line 241 of file FITSTable.h.
References row_nr_p.
|
inlinevirtual |
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.
Definition at line 227 of file FITSTable.h.
References units_p.
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).
|
private |
Definition at line 292 of file FITSTable.h.
|
private |
Definition at line 286 of file FITSTable.h.
Referenced by description().
|
private |
Definition at line 289 of file FITSTable.h.
Referenced by displayFormats().
Definition at line 296 of file FITSTable.h.
|
private |
Definition at line 279 of file FITSTable.h.
|
private |
Definition at line 283 of file FITSTable.h.
Referenced by eof().
|
private |
Definition at line 275 of file FITSTable.h.
Referenced by isValid().
|
private |
Definition at line 284 of file FITSTable.h.
Referenced by keywords().
|
private |
Definition at line 277 of file FITSTable.h.
Referenced by name().
|
private |
One per field in row_p, of the right type.
i.e. casting required.
Definition at line 294 of file FITSTable.h.
|
private |
Definition at line 290 of file FITSTable.h.
Referenced by nulls().
|
private |
Definition at line 285 of file FITSTable.h.
Referenced by primaryKeywords().
Definition at line 297 of file FITSTable.h.
|
private |
Definition at line 282 of file FITSTable.h.
Referenced by nrow().
|
private |
Definition at line 295 of file FITSTable.h.
|
private |
Definition at line 281 of file FITSTable.h.
Referenced by rownr().
|
private |
Definition at line 287 of file FITSTable.h.
|
private |
Definition at line 291 of file FITSTable.h.
Definition at line 298 of file FITSTable.h.
|
private |
Definition at line 304 of file FITSTable.h.
|
private |
Definition at line 288 of file FITSTable.h.
Referenced by units().
|
private |
I had trouble making a Block<VADescFitsField>
Definition at line 303 of file FITSTable.h.
|
private |
Definition at line 301 of file FITSTable.h.
these are used by VADESC columns
Definition at line 300 of file FITSTable.h.