casacore
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
casacore::FITSTable Class Reference

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 Stringname () 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 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 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 RecordcurrentRow () 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 TableRecordprimaryKeywords () 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...
 
FITSTableoperator= (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
 
BinaryTableExtensionraw_table_p
 
FitsInputio_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< Intfield_types_p
 
Block< Boolpromoted_p
 
Block< Inttdims_p
 
Block< Intvatypes_p
 these are used by VADESC columns More...
 
Block< void * > vaptr_p
 
VADescFitsFieldva_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...
 

Detailed Description

Attach a FITSTabular to a binary or ASCII table.

Intended use:

Public interface

Review Status

Date Reviewed:
yyyy/mm/dd

Prerequisite

Etymology

Synopsis

FITSTable is a FITSTabular which is attached to a FITS table (on disk only presently), either Binary or ASCII.

Example

Motivation

To Do

Definition at line 200 of file FITSTable.h.

Constructor & Destructor Documentation

◆ FITSTable() [1/3]

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

reopen() is then used to open the file.

◆ FITSTable() [2/3]

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.

◆ ~FITSTable()

casacore::FITSTable::~FITSTable ( )
inline

Definition at line 214 of file FITSTable.h.

References clear_self().

◆ FITSTable() [3/3]

casacore::FITSTable::FITSTable ( const FITSTable )
private

Undefined and inaccessible.

An alternative would be to use reference semantics like Table.

Member Function Documentation

◆ clear_self()

void casacore::FITSTable::clear_self ( )
private

Referenced by ~FITSTable().

◆ currentRow()

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

◆ description()

virtual const RecordDesc& casacore::FITSTable::description ( ) const
inlinevirtual

Returns the description of the underlying FITS table.

Implements casacore::FITSTabular.

Definition at line 226 of file FITSTable.h.

References description_p.

◆ displayFormats()

virtual const Record& casacore::FITSTable::displayFormats ( ) const
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.

◆ eof()

virtual Bool casacore::FITSTable::eof ( ) const
inlinevirtual

Has the end of file been reached yet.

Definition at line 217 of file FITSTable.h.

References casacore::FitsIO::eof(), and io_p.

◆ fill_row()

void casacore::FITSTable::fill_row ( )
private

◆ isValid()

virtual Bool casacore::FITSTable::isValid ( ) const
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.

◆ keywords()

virtual const TableRecord& casacore::FITSTable::keywords ( ) const
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.

◆ move()

virtual void casacore::FITSTable::move ( Int  torow)
virtual

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.

movements backwards or beyond the end of the file are not possible.

◆ name()

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

return the name

Implements casacore::FITSTabular.

Definition at line 221 of file FITSTable.h.

References name_p.

◆ next()

virtual void casacore::FITSTable::next ( )
virtual

Advance the row if possible (guaranteed harmless if pastEnd() is True.

Implements casacore::FITSTabular.

◆ nrow()

virtual uInt casacore::FITSTable::nrow ( ) const
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.

◆ nulls()

virtual const Record& casacore::FITSTable::nulls ( ) const
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.

◆ operator=()

FITSTable& casacore::FITSTable::operator= ( const FITSTable )
private

◆ pastEnd()

virtual Bool casacore::FITSTable::pastEnd ( ) const
virtual

Returns True if we have advanced past the end of data.

Implements casacore::FITSTabular.

◆ primaryKeywords()

virtual const TableRecord& casacore::FITSTable::primaryKeywords ( ) const
inlinevirtual

the keywords from the Primary HDU

Definition at line 251 of file FITSTable.h.

References primaryKeys_p.

◆ reopen()

virtual Bool casacore::FITSTable::reopen ( const String fileName)
virtual

Attach this FITSTable to a new file name, same HDU# as at open time.

Reimplemented from casacore::FITSTabular.

Reimplemented in casacore::SDFITSTable.

◆ reopenAtFirstHDU()

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

◆ rownr()

virtual Int casacore::FITSTable::rownr ( ) const
inlinevirtual

these tables should also know where they are

Definition at line 241 of file FITSTable.h.

References row_nr_p.

◆ units()

virtual const Record& casacore::FITSTable::units ( ) const
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.

◆ virtualColumns()

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

Member Data Documentation

◆ allKeys_p

Bool casacore::FITSTable::allKeys_p
private

Definition at line 292 of file FITSTable.h.

◆ description_p

RecordDesc casacore::FITSTable::description_p
private

Definition at line 286 of file FITSTable.h.

Referenced by description().

◆ disps_p

Record casacore::FITSTable::disps_p
private

Definition at line 289 of file FITSTable.h.

Referenced by displayFormats().

◆ field_types_p

Block<Int> casacore::FITSTable::field_types_p
private

Definition at line 296 of file FITSTable.h.

◆ hdu_nr_p

uInt casacore::FITSTable::hdu_nr_p
private

Definition at line 279 of file FITSTable.h.

◆ io_p

FitsInput* casacore::FITSTable::io_p
private

Definition at line 283 of file FITSTable.h.

Referenced by eof().

◆ isValid_p

Bool casacore::FITSTable::isValid_p
private

Definition at line 275 of file FITSTable.h.

Referenced by isValid().

◆ keywords_p

TableRecord casacore::FITSTable::keywords_p
private

Definition at line 284 of file FITSTable.h.

Referenced by keywords().

◆ name_p

String casacore::FITSTable::name_p
private

Definition at line 277 of file FITSTable.h.

Referenced by name().

◆ nfields_p

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

◆ nulls_p

Record casacore::FITSTable::nulls_p
private

Definition at line 290 of file FITSTable.h.

Referenced by nulls().

◆ primaryKeys_p

TableRecord casacore::FITSTable::primaryKeys_p
private

Definition at line 285 of file FITSTable.h.

Referenced by primaryKeywords().

◆ promoted_p

Block<Bool> casacore::FITSTable::promoted_p
private

Definition at line 297 of file FITSTable.h.

◆ raw_table_p

BinaryTableExtension* casacore::FITSTable::raw_table_p
private

Definition at line 282 of file FITSTable.h.

Referenced by nrow().

◆ row_fields_p

Block<void *> casacore::FITSTable::row_fields_p
private

Definition at line 295 of file FITSTable.h.

◆ row_nr_p

Int casacore::FITSTable::row_nr_p
private

Definition at line 281 of file FITSTable.h.

Referenced by rownr().

◆ row_p

Record casacore::FITSTable::row_p
private

Definition at line 287 of file FITSTable.h.

◆ subStrShapes_p

Record casacore::FITSTable::subStrShapes_p
private

Definition at line 291 of file FITSTable.h.

◆ tdims_p

Block<Int> casacore::FITSTable::tdims_p
private

Definition at line 298 of file FITSTable.h.

◆ theheap_p

char* casacore::FITSTable::theheap_p
private

Definition at line 304 of file FITSTable.h.

◆ units_p

Record casacore::FITSTable::units_p
private

Definition at line 288 of file FITSTable.h.

Referenced by units().

◆ va_p

VADescFitsField* casacore::FITSTable::va_p
private

I had trouble making a Block<VADescFitsField>

Definition at line 303 of file FITSTable.h.

◆ vaptr_p

Block<void *> casacore::FITSTable::vaptr_p
private

Definition at line 301 of file FITSTable.h.

◆ vatypes_p

Block<Int> casacore::FITSTable::vatypes_p
private

these are used by VADESC columns

Definition at line 300 of file FITSTable.h.


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