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

Attach a FITSTabular to a binary or ASCII table. More...

#include <FITSTable.h>

Inheritance diagram for casa::FITSTable:
casa::FITSTabular casa::SDFITSTable

List of all members.

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 Stringname () const
 return the name
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 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 RecordcurrentRow () 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 TableRecordprimaryKeywords () 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.
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.

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.
Block< void * > row_fields_p
Block< Intfield_types_p
Block< Boolpromoted_p
Block< Inttdims_p
Block< Intvatypes_p
 these are used by VADESC columns
Block< void * > vaptr_p
VADescFitsFieldva_p
 I had trouble making a Block<VADescFitsField>
char * theheap_p

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

casa::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.

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.

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.


Member Function Documentation

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]

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.

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.

FITSTable& casa::FITSTable::operator= ( const FITSTable ) [private]
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).


Member Data Documentation

Definition at line 292 of file FITSTable.h.

Definition at line 286 of file FITSTable.h.

Referenced by description().

Definition at line 289 of file FITSTable.h.

Referenced by displayFormats().

Definition at line 296 of file FITSTable.h.

Definition at line 279 of file FITSTable.h.

Definition at line 283 of file FITSTable.h.

Referenced by eof().

Definition at line 275 of file FITSTable.h.

Referenced by isValid().

Definition at line 284 of file FITSTable.h.

Referenced by keywords().

Definition at line 277 of file FITSTable.h.

Referenced by name().

One per field in row_p, of the right type.

i.e. casting required.

Definition at line 294 of file FITSTable.h.

Definition at line 290 of file FITSTable.h.

Referenced by nulls().

Definition at line 285 of file FITSTable.h.

Referenced by primaryKeywords().

Definition at line 297 of file FITSTable.h.

Definition at line 282 of file FITSTable.h.

Referenced by nrow().

Definition at line 295 of file FITSTable.h.

Definition at line 281 of file FITSTable.h.

Referenced by rownr().

Definition at line 287 of file FITSTable.h.

Definition at line 291 of file FITSTable.h.

Definition at line 298 of file FITSTable.h.

char* casa::FITSTable::theheap_p [private]

Definition at line 304 of file FITSTable.h.

Definition at line 288 of file FITSTable.h.

Referenced by units().

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.

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: