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

base class that defines a HDU More...

#include <hdu.h>

Inheritance diagram for casa::HeaderDataUnit:
casa::ExtensionHeaderDataUnit casa::PrimaryArray< TYPE > casa::BinaryTableExtension casa::ImageExtension< TYPE > casa::PrimaryGroup< TYPE > casa::PrimaryTable< TYPE > casa::AsciiTableExtension casa::BinaryTable casa::FITSIDItoMS1

List of all members.

Public Types

enum  HDUErrs {
  OK,
  NOMEM,
  MISSKEY,
  BADBITPIX,
  NOAXISN,
  NOPCOUNT,
  NOGCOUNT,
  BADPCOUNT,
  BADGCOUNT,
  NOGROUPS,
  BADNAXIS,
  BADREC,
  BADTYPE,
  BADRULES,
  BADSIZE,
  BADOPER,
  BADCONV,
  BADIO
}
 error handling and error codes that can be returned More...

Public Member Functions

virtual ~HeaderDataUnit ()
Int dims () const
Int dim (int n) const
OFF_T fitsdatasize () const
FITS::ValueType datatype () const
Int fitsitemsize () const
Int localitemsize () const
FITS::HDUType hdutype () const
int err () const
int skip (uInt n)
 skipping one or more HDU's
int skip ()
int write_hdr (FitsOutput &)
 write the current header
ConstFitsKeywordListkwlist ()
 Operations on the HDU's keyword list.
Vector< Stringkwlist_str (Bool length80=False)
 return the header of the chdu as a vector of String.
void firstkw ()
void lastkw ()
const FitsKeywordnextkw ()
const FitsKeywordprevkw ()
const FitsKeywordcurrkw ()
const FitsKeywordkw (int n)
const FitsKeywordkw (const FITS::ReservedName &n)
const FitsKeywordnextkw (FITS::ReservedName &n)
const FitsKeywordkw (FITS::ReservedName &n, int i)
const FitsKeywordnextkw (FITS::ReservedName &n, int i)
const FitsKeywordkw (const char *n)
const FitsKeywordnextkw (const char *n)
void mk (FITS::ReservedName k, Bool v, const char *c=0)
void mk (FITS::ReservedName k, const char *v=0, const char *c=0)
void mk (FITS::ReservedName k, Int v, const char *c=0)
void mk (FITS::ReservedName k, double v, const char *c=0)
void mk (int n, FITS::ReservedName k, Bool v, const char *c=0)
void mk (int n, FITS::ReservedName k, const char *v, const char *c=0)
void mk (int n, FITS::ReservedName k, Int v, const char *c=0)
void mk (int n, FITS::ReservedName k, double v, const char *c=0)
void mk (const char *n, Bool v, const char *c=0)
void mk (const char *n, const char *v=0, const char *c=0)
void mk (const char *n, Int v, const char *c=0)
void mk (const char *n, float v, const char *c=0)
void mk (const char *n, double v, const char *c=0)
void mk (const char *n, Int r, Int i, const char *c=0)
void mk (const char *n, float r, float i, const char *c=0)
void mk (const char *n, double r, double i, const char *c=0)
void spaces (const char *n=0, const char *c=0)
void comment (const char *n=0, const char *c=0)
void history (const char *c=0)
Bool notnull (double x) const
 
         

Bool notnull (char *s) const
Bool notnull (Int l) const
int get_hdr (FITS::HDUType, FitsKeywordList &)
int read_data (char *, Int)
int write_data (FitsOutput &, char *, Int)
OFF_T read_all_data (char *)
int write_all_data (FitsOutput &, char *)

Static Public Member Functions

static Bool determine_type (FitsKeywordList &, FITS::HDUType &, FITS::ValueType &, FITSErrorHandler, HDUErrs &)
 Determines the HDU type and the data type Parameterss: keyword list, hdu type, data type, error handler and error status.
static Bool compute_size (FitsKeywordList &, OFF_T &, Int &, FITS::HDUType &, FITS::ValueType &, FITSErrorHandler, HDUErrs &)
 Compute the total size of the data associated with an HDU.

Protected Member Functions

 HeaderDataUnit (FitsInput &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
 For input -- ~ should delete the keyword list: kwflag = 1.
 HeaderDataUnit (FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler, FitsInput *=0)
 For output -- ~ should not delete keyword list: kwflag = 0 07/21/98 AKH Clarification: HeaderDataUnit has a copy of the FitsKeywordList, and should delete it.
 HeaderDataUnit (FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler, FitsInput *=0)
 constructor for objects that write only required keyword to fits file.
bool init_data_unit (FITS::HDUType t)
 for write required keywords only to use.
void posEnd ()
void errmsg (HDUErrs, const char *)
char * assign (FITS::ReservedName)
char * assign (FITS::ReservedName, int)
double asgdbl (FITS::ReservedName, double)
double asgdbl (FITS::ReservedName, int, double)

Protected Attributes

FitsKeywordListkwlist_
ConstFitsKeywordList constkwlist_
FitsInputfin
FITSErrorHandler errfn
HDUErrs err_status
Int no_dims
Intdimn
OFF_T fits_data_size
 uInt fits_data_size; // size in bytes of total amount of data
FITS::ValueType data_type
Int fits_item_size
Int local_item_size
FITS::HDUType hdu_type
char pad_char
double double_null
char char_null
Int Int_null

Friends

std::ostream & operator<< (std::ostream &, HeaderDataUnit &)

Detailed Description

base class that defines a HDU

Synopsis

The class HeaderDataUnit contains what is common to all header-data-units, including the collection of keywords. From this class a number of FITS header-data-units are derived, each of them with their own rich assortment of functions for accessing and manipulating data of specific types. The following inheritence hierarchy illustrates the current derived classes:

                                HeaderDataUnit
                                /          | 
                               /           | 
                     PrimaryArray       ExtensionHeaderDataUnit
                      /  |  \                              | 
                     /   |   \                             | 
          PrimaryGroup   |   ImageExtension                | 
                         |                                 | 
                    PrimaryTable                        BinaryTableExtension
                                                           /
                                                          /
                                        AsciiTableExtension

Definition at line 71 of file hdu.h.


Member Enumeration Documentation

error handling and error codes that can be returned

Enumerator:
OK 
NOMEM 
MISSKEY 
BADBITPIX 
NOAXISN 
NOPCOUNT 
NOGCOUNT 
BADPCOUNT 
BADGCOUNT 
NOGROUPS 
BADNAXIS 
BADREC 
BADTYPE 
BADRULES 
BADSIZE 
BADOPER 
BADCONV 
BADIO 

Definition at line 86 of file hdu.h.


Constructor & Destructor Documentation

For input -- ~ should delete the keyword list: kwflag = 1.

For output -- ~ should not delete keyword list: kwflag = 0 07/21/98 AKH Clarification: HeaderDataUnit has a copy of the FitsKeywordList, and should delete it.

The kwflag comments above are not important now.

constructor for objects that write only required keyword to fits file.

the write method to call by these object should be those for the specific hdu, such as write_bintbl_hdr().


Member Function Documentation

double casa::HeaderDataUnit::asgdbl ( FITS::ReservedName  ,
double   
) [protected]
double casa::HeaderDataUnit::asgdbl ( FITS::ReservedName  ,
int  ,
double   
) [protected]
char* casa::HeaderDataUnit::assign ( FITS::ReservedName  ,
int   
) [protected]
void casa::HeaderDataUnit::comment ( const char *  n = 0,
const char *  c = 0 
) [inline]

Definition at line 259 of file hdu.h.

References casa::FitsKeywordList::comment(), kwlist_, and posEnd().

static Bool casa::HeaderDataUnit::compute_size ( FitsKeywordList ,
OFF_T &  ,
Int ,
FITS::HDUType ,
FITS::ValueType ,
FITSErrorHandler  ,
HDUErrs  
) [static]

Compute the total size of the data associated with an HDU.

The number of dimensions is also determined. This routine assumes that hdu type has been appropriately set, but it may be changed in the process. Data type is also determined. Returns False if a serious error was detected, otherwise True

Definition at line 128 of file hdu.h.

References casa::FitsKeywordList::curr(), and kwlist_.

Definition at line 79 of file hdu.h.

References data_type.

Determines the HDU type and the data type Parameterss: keyword list, hdu type, data type, error handler and error status.

Returns False if a serious error was detected, otherwise True

Int casa::HeaderDataUnit::dim ( int  n) const [inline]
Int casa::HeaderDataUnit::dims ( ) const [inline]

Definition at line 76 of file hdu.h.

References no_dims.

Referenced by casa::MSPrimaryTableHolder::dims(), and casa::MSPrimaryGroupHolder::dims().

int casa::HeaderDataUnit::err ( ) const [inline]

Definition at line 90 of file hdu.h.

References err_status.

void casa::HeaderDataUnit::errmsg ( HDUErrs  ,
const char *   
) [protected]
void casa::HeaderDataUnit::firstkw ( ) [inline]

Definition at line 124 of file hdu.h.

References casa::FitsKeywordList::first(), and kwlist_.

OFF_T casa::HeaderDataUnit::fitsdatasize ( ) const [inline]

Definition at line 78 of file hdu.h.

References fits_data_size.

Definition at line 80 of file hdu.h.

References fits_item_size.

Definition at line 82 of file hdu.h.

References hdu_type.

void casa::HeaderDataUnit::history ( const char *  c = 0) [inline]

Definition at line 261 of file hdu.h.

References casa::FitsKeywordList::history(), kwlist_, and posEnd().

for write required keywords only to use.

const FitsKeyword* casa::HeaderDataUnit::kw ( int  n) [inline]

Definition at line 129 of file hdu.h.

References kwlist_.

Referenced by casa::MSPrimaryTableHolder::kw(), and casa::MSPrimaryGroupHolder::kw().

Definition at line 131 of file hdu.h.

References kwlist_.

const FitsKeyword* casa::HeaderDataUnit::kw ( FITS::ReservedName n,
int  i 
) [inline]

Definition at line 135 of file hdu.h.

References kwlist_.

const FitsKeyword* casa::HeaderDataUnit::kw ( const char *  n) [inline]

Definition at line 139 of file hdu.h.

References kwlist_.

Operations on the HDU's keyword list.

Definition at line 120 of file hdu.h.

References constkwlist_.

Referenced by casa::MSPrimaryTableHolder::kwlist(), and casa::MSPrimaryGroupHolder::kwlist().

return the header of the chdu as a vector of String.

You can force the strings to be length 80 (padded with spaces)

void casa::HeaderDataUnit::lastkw ( ) [inline]

Definition at line 125 of file hdu.h.

References kwlist_, and casa::FitsKeywordList::last().

Definition at line 81 of file hdu.h.

References local_item_size.

void casa::HeaderDataUnit::mk ( FITS::ReservedName  k,
Bool  v,
const char *  c = 0 
) [inline]

Definition at line 225 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( FITS::ReservedName  k,
const char *  v = 0,
const char *  c = 0 
) [inline]

Definition at line 227 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( FITS::ReservedName  k,
Int  v,
const char *  c = 0 
) [inline]

Definition at line 229 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( FITS::ReservedName  k,
double  v,
const char *  c = 0 
) [inline]

Definition at line 231 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( int  n,
FITS::ReservedName  k,
Bool  v,
const char *  c = 0 
) [inline]

Definition at line 233 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( int  n,
FITS::ReservedName  k,
const char *  v,
const char *  c = 0 
) [inline]

Definition at line 235 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( int  n,
FITS::ReservedName  k,
Int  v,
const char *  c = 0 
) [inline]

Definition at line 237 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( int  n,
FITS::ReservedName  k,
double  v,
const char *  c = 0 
) [inline]

Definition at line 239 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
Bool  v,
const char *  c = 0 
) [inline]

Definition at line 241 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
const char *  v = 0,
const char *  c = 0 
) [inline]

Definition at line 243 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
Int  v,
const char *  c = 0 
) [inline]

Definition at line 245 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
float  v,
const char *  c = 0 
) [inline]

Definition at line 247 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
double  v,
const char *  c = 0 
) [inline]

Definition at line 249 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
Int  r,
Int  i,
const char *  c = 0 
) [inline]

Definition at line 251 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
float  r,
float  i,
const char *  c = 0 
) [inline]

Definition at line 253 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

void casa::HeaderDataUnit::mk ( const char *  n,
double  r,
double  i,
const char *  c = 0 
) [inline]

Definition at line 255 of file hdu.h.

References kwlist_, casa::FitsKeywordList::mk(), and posEnd().

Definition at line 133 of file hdu.h.

References kwlist_, and casa::FitsKeywordList::next().

const FitsKeyword* casa::HeaderDataUnit::nextkw ( FITS::ReservedName n,
int  i 
) [inline]

Definition at line 137 of file hdu.h.

References kwlist_, and casa::FitsKeywordList::next().

const FitsKeyword* casa::HeaderDataUnit::nextkw ( const char *  n) [inline]

Definition at line 140 of file hdu.h.

References kwlist_, and casa::FitsKeywordList::next().

Bool casa::HeaderDataUnit::notnull ( double  x) const [inline]

         

Definition at line 162 of file hdu.h.

References double_null, casa::False, and casa::True.

Bool casa::HeaderDataUnit::notnull ( char *  s) const [inline]

Definition at line 163 of file hdu.h.

References casa::False, and casa::True.

Bool casa::HeaderDataUnit::notnull ( Int  l) const [inline]

Definition at line 164 of file hdu.h.

References casa::False, Int_null, and casa::True.

void casa::HeaderDataUnit::posEnd ( ) [protected]

Referenced by comment(), history(), mk(), and spaces().

Definition at line 127 of file hdu.h.

References kwlist_, and casa::FitsKeywordList::prev().

int casa::HeaderDataUnit::read_data ( char *  ,
Int   
)

skipping one or more HDU's

void casa::HeaderDataUnit::spaces ( const char *  n = 0,
const char *  c = 0 
) [inline]

Definition at line 257 of file hdu.h.

References kwlist_, posEnd(), and casa::FitsKeywordList::spaces().

int casa::HeaderDataUnit::write_data ( FitsOutput ,
char *  ,
Int   
)

write the current header


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
HeaderDataUnit h 
) [friend]

Definition at line 223 of file hdu.h.


Member Data Documentation

Definition at line 212 of file hdu.h.

Definition at line 187 of file hdu.h.

Referenced by kwlist().

Definition at line 199 of file hdu.h.

Referenced by datatype().

Definition at line 196 of file hdu.h.

Referenced by dim().

Definition at line 211 of file hdu.h.

Referenced by notnull().

Definition at line 192 of file hdu.h.

Referenced by err().

Definition at line 191 of file hdu.h.

Definition at line 190 of file hdu.h.

uInt fits_data_size; // size in bytes of total amount of data

Definition at line 198 of file hdu.h.

Referenced by fitsdatasize().

Definition at line 200 of file hdu.h.

Referenced by fitsitemsize().

Definition at line 202 of file hdu.h.

Referenced by hdutype().

Definition at line 213 of file hdu.h.

Referenced by notnull().

Definition at line 186 of file hdu.h.

Referenced by comment(), currkw(), firstkw(), history(), kw(), lastkw(), mk(), nextkw(), casa::operator<<(), prevkw(), and spaces().

Definition at line 201 of file hdu.h.

Referenced by localitemsize().

Definition at line 195 of file hdu.h.

Referenced by dims().

Definition at line 203 of file hdu.h.


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