Loading...
Searching...
No Matches
casacore::FITSTable Class Reference
fits package (libcasa_fits) » FITS_module

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
Public Member Functions inherited from casacore::FITSTabular
virtual | ~FITSTabular ()
virtual Bool | hasChanged () const
| Has the description changed since construction, default is False.
virtual void | resetChangedFlag ()
| reset the changed flag, default do nothing

## 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

## 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.
static RecordDesc | descriptionFromHDU (BinaryTableExtension &hdu)
| Helper function for retrieving a description from a native-FITS hdu.
static Record | subStringShapeFromHDU (BinaryTableExtension &hdu)
| Help function for retrieving any shape information from String columns using the SubString convention.
static Record | unitsFromHDU (BinaryTableExtension &hdu)
| Helper function for retrieving the TUNITnnn from a native-FITS hdu.
static Record | displayFormatsFromHDU (BinaryTableExtension &hdu)
| Helper function for retrieving the TDISPnnn from a native-FITS hdu.
static Record | nullsFromHDU (BinaryTableExtension &hdu)
| Helper function for retrieving the TNULLnnn from a native-FITS hdu.
static TableDesc | tableDesc (const FITSTabular &fitstabular)
| Get a TableDesc appropriate to hold a FITSTabular the keywords, description, units, displayFormats, and nulls are all used.

## Detailed Description

Attach a FITSTabular to a binary or ASCII table.

### Intended use:

Public interface

### Review Status

Date Reviewed:
  yyyy/mm/dd

### Prerequisite

- General knowledge of FITS binary and ASCII tables.

### 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 197 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.

References casacore::False.

Referenced by FITSTable(), and operator=().

## 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.

References casacore::False.

## ~FITSTable()

casacore::FITSTable::~FITSTable | ( |  | ) |

inline

Definition at line 211 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.

References FITSTable().

## 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.

References casacore::Record().

## description()

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

inline virtual

Returns the description of the underlying FITS table.

Implements casacore::FITSTabular.

Definition at line 223 of file FITSTable.h.

References description_p.

## displayFormats()

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

Definition at line 225 of file FITSTable.h.

References disps_p, and casacore::Record().

## eof()

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

inline virtual

Has the end of file been reached yet.

Definition at line 214 of file FITSTable.h.

References io_p.

## fill_row()

void casacore::FITSTable::fill_row | ( |  | ) |

private

## isValid()

virtual Bool casacore::FITSTable::isValid | ( |  | ) | const

inline virtual

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

Implements casacore::FITSTabular.

Definition at line 220 of file FITSTable.h.

References isValid_p.

## keywords()

virtual const TableRecord & casacore::FITSTable::keywords | ( |  | ) | const

inline virtual

Returns keywords which are associated with the underlying FITS files.

Implements casacore::FITSTabular.

Definition at line 222 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

inline virtual

return the name

Implements casacore::FITSTabular.

Definition at line 218 of file FITSTable.h.

References name_p.

Referenced by casacore::SDFITSTable::coreKeyword(), casacore::SDFITSTable::isSDFitsColumn(), and reopenAtFirstHDU().

## 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

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 235 of file FITSTable.h.

References raw_table_p.

## nulls()

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

Definition at line 226 of file FITSTable.h.

References nulls_p, and casacore::Record().

## operator=()

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

private

References FITSTable().

## 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

inline virtual

the keywords from the Primary HDU

Definition at line 248 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.

References name().

## rownr()

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

inline virtual

these tables should also know where they are

Definition at line 238 of file FITSTable.h.

References row_nr_p.

## units()

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

Definition at line 224 of file FITSTable.h.

References casacore::Record(), and 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 289 of file FITSTable.h.

## description_p

RecordDesc casacore::FITSTable::description_p

private

Definition at line 283 of file FITSTable.h.

Referenced by description().

## disps_p

Record casacore::FITSTable::disps_p

private

Definition at line 286 of file FITSTable.h.

Referenced by displayFormats().

## field_types_p

Block<Int> casacore::FITSTable::field_types_p

private

Definition at line 293 of file FITSTable.h.

## hdu_nr_p

uInt casacore::FITSTable::hdu_nr_p

private

Definition at line 276 of file FITSTable.h.

## io_p

FitsInput* casacore::FITSTable::io_p

private

Definition at line 280 of file FITSTable.h.

Referenced by eof().

## isValid_p

Bool casacore::FITSTable::isValid_p

private

Definition at line 272 of file FITSTable.h.

Referenced by isValid().

## keywords_p

TableRecord casacore::FITSTable::keywords_p

private

Definition at line 281 of file FITSTable.h.

Referenced by keywords().

## name_p

String casacore::FITSTable::name_p

private

Definition at line 274 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 291 of file FITSTable.h.

## nulls_p

Record casacore::FITSTable::nulls_p

private

Definition at line 287 of file FITSTable.h.

Referenced by nulls().

## primaryKeys_p

TableRecord casacore::FITSTable::primaryKeys_p

private

Definition at line 282 of file FITSTable.h.

Referenced by primaryKeywords().

## promoted_p

Block<Bool> casacore::FITSTable::promoted_p

private

Definition at line 294 of file FITSTable.h.

## raw_table_p

BinaryTableExtension* casacore::FITSTable::raw_table_p

private

Definition at line 279 of file FITSTable.h.

Referenced by nrow().

## row_fields_p

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

private

Definition at line 292 of file FITSTable.h.

## row_nr_p

Int casacore::FITSTable::row_nr_p

private

Definition at line 278 of file FITSTable.h.

Referenced by rownr().

## row_p

Record casacore::FITSTable::row_p

private

Definition at line 284 of file FITSTable.h.

## subStrShapes_p

Record casacore::FITSTable::subStrShapes_p

private

Definition at line 288 of file FITSTable.h.

## tdims_p

Block<Int> casacore::FITSTable::tdims_p

private

Definition at line 295 of file FITSTable.h.

## theheap_p

char* casacore::FITSTable::theheap_p

private

Definition at line 301 of file FITSTable.h.

## units_p

Record casacore::FITSTable::units_p

private

Definition at line 285 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 300 of file FITSTable.h.

## vaptr_p

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

private

Definition at line 298 of file FITSTable.h.

## vatypes_p

Block<Int> casacore::FITSTable::vatypes_p

private

these are used by VADESC columns

Definition at line 297 of file FITSTable.h.

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

- fits/FITS/FITSTable.h