hdu.h

Classes

HeaderDataUnit -- base class that defines a HDU (full description)
PrimaryArray -- templated primary array base class of given type (full description)
ImageExtension -- IMAGE extension of given type (full description)
PrimaryGroup -- Random Group datastructure (full description)
ExtensionHeaderDataUnit -- base class for generalized exentensions HDU (full description)
FitsBase -- helper class ??? (full description)
FitsField -- helper class ??? (full description)
FitsField -- helper class ??? (full description)
FitsArray -- FITS array of given type (full description)
FitsArray -- FITS array of FitsBit type (full description)
BinaryTableExtension -- BINTABLE extension (full description)
AsciiTableExtension -- (ascii) TABLE extension (full description)

class HeaderDataUnit

Types

enum HDUErrs

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

Interface

friend std::ostream & operator << (std::ostream &, HeaderDataUnit &)
Public Members
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)
int skip()
int write_hdr(FitsOutput &)
static Bool determine_type(FitsKeywordList &, FITS::HDUType &, FITS::ValueType &, FITSErrorHandler, HDUErrs &)
static Bool compute_size(FitsKeywordList &, OFF_T &, Int &, FITS::HDUType &, FITS::ValueType &, FITSErrorHandler, HDUErrs &)
ConstFitsKeywordList &kwlist()
Vector<String> kwlist_str(Bool length80=False)
void firstkw()
void lastkw()
const FitsKeyword *nextkw()
const FitsKeyword *prevkw()
const FitsKeyword *currkw()
const FitsKeyword *kw(int n)
const FitsKeyword *kw(const FITS::ReservedName &n)
const FitsKeyword *nextkw(FITS::ReservedName &n)
const FitsKeyword *kw(FITS::ReservedName &n, int i)
const FitsKeyword *nextkw(FITS::ReservedName &n, int i)
const FitsKeyword *kw(char *n)
const FitsKeyword *nextkw(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
Protected Members
HeaderDataUnit(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
HeaderDataUnit(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler, ErrorHandler * = 0)
HeaderDataUnit(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler, ErrorHandler * = 0)
bool init_data_unit( FITS::HDUType t )
void posEnd()
void errmsg(HDUErrs, char *)
char * assign(FITS::ReservedName)
char * assign(FITS::ReservedName, int)
double asgdbl(FITS::ReservedName, double)
double asgdbl(FITS::ReservedName, int, double)
Public Members
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 *)

Description

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	                   | 
					                   | 
							BinaryTableExtension
							   /
							  /
					AsciiTableExtension

Member Description

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

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

enum HDUErrs

int err() const

error handling and error codes that can be returned

int skip(uInt n)
int skip()

skipping one or more HDU's

int write_hdr(FitsOutput &)

write the current header

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. Returns False if a serious error was detected, otherwise True

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

Vector<String> kwlist_str(Bool length80=False)

Operations on the HDU's keyword list

return the header of the chdu as a vector of String. You can force the strings to be length 80 (padded with spaces)

const FitsKeyword *kw(const FITS::ReservedName &n)

Operations on the HDU's keyword list

ConstFitsKeywordList &kwlist()
void firstkw()
void lastkw()
const FitsKeyword *nextkw()
const FitsKeyword *prevkw()
const FitsKeyword *currkw()
const FitsKeyword *kw(int n)
const FitsKeyword *nextkw(FITS::ReservedName &n)
const FitsKeyword *kw(FITS::ReservedName &n, int i)
const FitsKeyword *nextkw(FITS::ReservedName &n, int i)
const FitsKeyword *kw(char *n)
const FitsKeyword *nextkw(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)

Operations on the HDU's keyword list

Bool notnull(double x) const

Bool notnull(char *s) const

Bool notnull(Int l) const

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, ErrorHandler * = 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. The kwflag comments above are not important now.

HeaderDataUnit(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler, ErrorHandler * = 0)

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().

bool init_data_unit( FITS::HDUType t )

for write required keywords only to use.

void posEnd()

void errmsg(HDUErrs, char *)

char * assign(FITS::ReservedName)
char * assign(FITS::ReservedName, int)
double asgdbl(FITS::ReservedName, double)
double asgdbl(FITS::ReservedName, int, double)

char to pad FITS data block

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 *)


class PrimaryArray : public HeaderDataUnit

Interface

PrimaryArray(FitsInput &, FITSErrorHandler= FITSError::defaultHandler)
PrimaryArray(FitsKeywordList &, FITSErrorHandler= FITSError::defaultHandler)
PrimaryArray(FITSErrorHandler= FITSError::defaultHandler)
virtual ~PrimaryArray()
double bscale() const
double bzero() const
char *bunit() const
Bool isablank() const
Int blank() const
char *ctype(int n) const
double crpix(int n) const
double crota(int n) const
double crval(int n) const
double cdelt(int n) const
double datamax() const
double datamin() const
OFF_T nelements() const
double operator () (int, int, int, int, int) const
double operator () (int, int, int, int) const
double operator () (int, int, int) const
double operator () (int, int) const
double operator () (int) const
TYPE & data(int, int, int, int, int)
TYPE & data(int, int, int, int)
TYPE & data(int, int, int)
TYPE & data(int, int)
TYPE & data(int)
int store(const TYPE *source, FITS::FitsArrayOption = FITS::NoOpt)
void copy(double *target, FITS::FitsArrayOption = FITS::NoOpt) const
void copy(float *target, FITS::FitsArrayOption = FITS::NoOpt) const
void move(TYPE *target, FITS::FitsArrayOption = FITS::NoOpt) const
int store(const TYPE *source, int npixels)
void copy(double *target, int npixels) const
void copy(float *target, int npixels) const
void move(TYPE *target, int npixels) const
int write_priArr_hdr( FitsOutput &fout, int simple, int bitpix, int naxis, long naxes[], int extend )
virtual int read()
virtual int read( int )
virtual int write(FitsOutput &)
virtual OFF_T set_next(OFF_T)
Protected Members
PrimaryArray(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
PrimaryArray(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
PrimaryArray(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
int offset(int, int) const
int offset(int, int, int) const
int offset(int, int, int, int) const
int offset(int, int, int, int, int) const
void pa_assign()

Description

Synopsis

A Primary Data Array is represented by the following:
	<Type> data_array [NAXIS1][NAXIS2]...[NAXISN]

For a PrimaryArray, dims() gives the number of dimensions and dim(i) gives the value of the i-th dimension

WARNING! Multi-dimensional arrays are stored in FORTRAN order, NOT in C order. Options on the store, copy, and move functions exist to convert from one order to the other, if that is necessary.

It is important to understand the proper sequence of operations with respect to I/O and data access. For input, the `read()' functions allocate an internal buffer of the appropriate size, if not already allocated, as well as reading and converting data; a `read()' function must be performed prior to accessing the data, i. e. before executing any `()', `data()', `copy()', or `move()' function. For output, the `store()' function similarly allocates an internal buffer before transfering data, and must be executed prior to any data access or `write()' function. Note: If you call any version of store(), do not call set_next().

Writing portions of an array at a time, rather than the entire array, is a special case. The `set_next()' function is provided for this purpose. It declares the intention to write out the next N elements and must be executed prior to any `data()' function. It allocates a buffer of appropriate size, if not already allocated. Again, via the `data()' functions, one accesses the array as if the entire array were in memory. The `write()' function always writes the number of current elements in the internal buffer. The sequence of operations for each portion of the array written would be:

  • `set_next(N)',
  • fill the array using `data(N)' or other `data()' functions
  • `write(fout)'. The `set_next()' function must NOT be used with `read()' or `store()' functions; unpredictable results will occur.

    Example

    The following example illustrates the output cases.

    Suppose we have an image array with 512 rows and 1024 columns stored in C-order. The C declaration would be:

     	int source[1024][512];
    
    To write out the entire array:
     	FitsOutput fout; // some properly constructed FitsOutput
     	PrimaryArray<FitsLong> pa; // some properly constructed PrimaryArray
     	pa.store(source,CtoF);
     	pa.write(fout);
    

    Suppose we wanted to write out the two-dimensional image array a column at a time, rather than write out the entire array. For FITS, dim(0) is 512, dim(1) is 1024. The following code fragment writes one column at a time in the proper FITS Fortran-order.

     	for (i = 0; i < dim(1); ++i) {
     		pa.set_next(dim(0));
     		for (j = 0; j < dim(0); ++j)
     			data(j,i) = source[i][j];
     		pa.write(fout);
     	}
    

    Template Type Argument Requirements

    Member Description

    PrimaryArray(FitsInput &, FITSErrorHandler= FITSError::defaultHandler)

    constructor from a FitsInput

    PrimaryArray(FitsKeywordList &, FITSErrorHandler= FITSError::defaultHandler)

    constructor from a FitsKeywordList

    PrimaryArray(FITSErrorHandler= FITSError::defaultHandler)

    constructor does not require a FitsKeywordList. call write_priArr_hdr() after construction.

    virtual ~PrimaryArray()

    destructor

    double bscale() const
    double bzero() const
    char *bunit() const
    Bool isablank() const
    Int blank() const
    char *ctype(int n) const
    double crpix(int n) const
    double crota(int n) const
    double crval(int n) const
    double cdelt(int n) const
    double datamax() const
    double datamin() const
    OFF_T nelements() const

    General access routines for a primary array

    double operator () (int, int, int, int, int) const
    double operator () (int, int, int, int) const
    double operator () (int, int, int) const
    double operator () (int, int) const
    double operator () (int) const

    The overloaded operator functions `()' all return physical data, i. e., data to which bscale() and bzero() have been applied, via the formula

     	physical_data[i] = bscale() * raw_data[i] + bzero().
    

    TYPE & data(int, int, int, int, int)
    TYPE & data(int, int, int, int)
    TYPE & data(int, int, int)
    TYPE & data(int, int)
    TYPE & data(int)

    The various `data()' functions allow one to access and set the raw data itself.

    int store(const TYPE *source, int npixels)

    The `store()', `move()' and `copy()' functions allow bulk data transfer between the internal FITS array and an external data storage area. The external storage must have already been allocated and it is assumed that the entire data array is in memory. `store()' transfers raw data at `source' into the FITS array; an allowable option is CtoF, which specifies to convert the array from C-order to Fortran-order. `move()' is the opposite of `store()'. `move()' transfers raw data from the FITS array to `target'; an allowable option is FtoC, which specifies to convert the array from Fortran-order to C-order. `copy()' is similar to `move()' except that what is copied is physical data and not raw data; the physical data can be either double or float. copy() also turns blanks into NaN's.

    Use these versions if you are reading/writing "chunk by chunk." No FtoC option is available. You are responsible for ensuring that npixels corresponds to he number actually read or written. Note that copy() turns blanks into NaN's.

    int store(const TYPE *source, FITS::FitsArrayOption = FITS::NoOpt)
    void copy(double *target, FITS::FitsArrayOption = FITS::NoOpt) const
    void copy(float *target, FITS::FitsArrayOption = FITS::NoOpt) const
    void move(TYPE *target, FITS::FitsArrayOption = FITS::NoOpt) const

    The `store()', `move()' and `copy()' functions allow bulk data transfer between the internal FITS array and an external data storage area. The external storage must have already been allocated and it is assumed that the entire data array is in memory. `store()' transfers raw data at `source' into the FITS array; an allowable option is CtoF, which specifies to convert the array from C-order to Fortran-order. `move()' is the opposite of `store()'. `move()' transfers raw data from the FITS array to `target'; an allowable option is FtoC, which specifies to convert the array from Fortran-order to C-order. `copy()' is similar to `move()' except that what is copied is physical data and not raw data; the physical data can be either double or float. copy() also turns blanks into NaN's.

    void copy(double *target, int npixels) const
    void copy(float *target, int npixels) const
    void move(TYPE *target, int npixels) const

    int write_priArr_hdr( FitsOutput &fout, int simple, int bitpix, int naxis, long naxes[], int extend )

    virtual int read()
    virtual int read( int )
    virtual int write(FitsOutput &)
    virtual OFF_T set_next(OFF_T)

    The `read()' and `write()' functions control reading and writing data from the external FITS I/O medium into the FITS array. Appropriate conversions are made between FITS and local data representations. One can read the entire array into memory, or one can only read portions of the array. In the latter case, one must specify that the next N elements are to be read or written. Note that the number of elements must be specified, NOT the number of bytes. If one reads portions of the array, as opposed to the entire array, only that portion is in memory at a given time. One can still access the elements of the array via the `()' and `data()' functions, as if the entire array was in memory; obviously care must be taken in this case to access only those portions that are actually in memory.

    PrimaryArray(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    construct from a FitsInput with given HDU type

    PrimaryArray(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    construct from a FitsKeywordList with given HDU type

    PrimaryArray(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    construct witout FitsKeywordList for given HDU type( for ImageExtension and PrimaryGroup)

    int offset(int, int) const
    int offset(int, int, int) const
    int offset(int, int, int, int) const
    int offset(int, int, int, int, int) const

    factors needed to compute array position offsets

    compute a linear offset from array indicies

    void pa_assign()


    class ImageExtension : public PrimaryArray<TYPE>

    Interface

    Public Members
    ImageExtension(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    ImageExtension(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    ImageExtension(FITSErrorHandler errhandler = FITSError::defaultHandler)
    ~ImageExtension()
    char *xtension()
    char *extname()
    Int extver()
    Int extlevel()
    Int pcount()
    Int gcount()
    int write_imgExt_hdr( FitsOutput &fout, int bitpix, int naxis, long *naxes)
    Private Members
    void ie_assign()

    Description

    Template Type Argument Requirements

          typedef ImageExtension<unsigned char> ByteImageExtension;
          typedef ImageExtension<short> ShortImageExtension;
          typedef ImageExtension<FitsLong> LongImageExtension;
          typedef ImageExtension<float> FloatImageExtension;
          typedef ImageExtension<double> DoubleImageExtension;
          

    Member Description

    ImageExtension(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    ImageExtension(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    ImageExtension(FITSErrorHandler errhandler = FITSError::defaultHandler)

    constructor for header consisted required keywords only

    ~ImageExtension()

    char *xtension()

    char *extname()

    Int extver()

    Int extlevel()

    Int pcount()

    Int gcount()

    int write_imgExt_hdr( FitsOutput &fout, int bitpix, int naxis, long *naxes)

    write required keywords for ImageExtension

    void ie_assign()


    class PrimaryGroup : public PrimaryArray<TYPE>

    Interface

    Public Members
    PrimaryGroup(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    PrimaryGroup(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    PrimaryGroup(FITSErrorHandler errhandler = FITSError::defaultHandler)
    ~PrimaryGroup()
    Int gcount() const
    Int pcount() const
    char *ptype(int n) const
    double pscal(int n) const
    double pzero(int n) const
    Int currgroup() const
    double parm(int)
    TYPE & rawparm(int)
    void storeparm(const TYPE *source)
    void copyparm(double *target) const
    void copyparm(float *target) const
    void moveparm(TYPE *target) const
    int read()
    int write(FitsOutput &)
    int write_priGrp_hdr( FitsOutput &fout, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount )
    OFF_T set_next(OFF_T)
    int read(int)
    Private Members
    void pg_assign()

    Description

    Synopsis

    A Random Group Structure is represented by the following:
    	struct GroupData {
    		<Type> group_parms [PCOUNT];
    		<Type> data_array [NAXIS2][NAXIS3]...[NAXISN];
    	} group_data[GCOUNT];
    

    Template Type Argument Requirements

          typedef PrimaryGroup<unsigned char> BytePrimaryGroup;
          typedef PrimaryGroup<short> ShortPrimaryGroup;
          typedef PrimaryGroup<FitsLong> LongPrimaryGroup;
          typedef PrimaryGroup<float> FloatPrimaryGroup;
          typedef PrimaryGroup<double> DoublePrimaryGroup;
          
    Warning Please note that the NOST has deprecated the Random Group datastructure, it has been replaced by the much more powerfull BINTABLE extension.

    Member Description

    PrimaryGroup(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    PrimaryGroup(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    PrimaryGroup(FITSErrorHandler errhandler = FITSError::defaultHandler)

    constructor for header consisted required keywords only

    ~PrimaryGroup()

    Int gcount() const
    Int pcount() const
    char *ptype(int n) const
    double pscal(int n) const
    double pzero(int n) const

    Return basic parameters of a random group

    Int currgroup() const

    double parm(int)

    TYPE & rawparm(int)

    return physical parms

    void storeparm(const TYPE *source)

    access raw parms

    void copyparm(double *target) const

    void copyparm(float *target) const

    void moveparm(TYPE *target) const

    int read()
    int write(FitsOutput &)

    read, or write the next group

    int write_priGrp_hdr( FitsOutput &fout, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount )

    write the required keywords for PrimaryGroup

    OFF_T set_next(OFF_T)
    int read(int)

    disable these functions, since they are inherited from PrimaryArray

    void pg_assign()


    class ExtensionHeaderDataUnit : public HeaderDataUnit

    Interface

    Public Members
    ExtensionHeaderDataUnit(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    ExtensionHeaderDataUnit(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    ~ExtensionHeaderDataUnit()
    char *xtension()
    char *extname()
    Int extver()
    Int extlevel()
    Int pcount()
    Int gcount()
    int read(char *addr, int nbytes)
    int write(FitsOutput &fout, char *addr, int nbytes)
    Protected Members
    ExtensionHeaderDataUnit(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
    ExtensionHeaderDataUnit(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
    ExtensionHeaderDataUnit(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
    Private Members
    void ex_assign()

    Description

    Member Description

    ExtensionHeaderDataUnit(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    ExtensionHeaderDataUnit(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    ~ExtensionHeaderDataUnit()

    char *xtension()

    char *extname()

    Int extver()

    Int extlevel()

    Int pcount()

    Int gcount()

    int read(char *addr, int nbytes)

    read next N bytes into addr

    int write(FitsOutput &fout, char *addr, int nbytes)

    write next N bytes from addr to the FITS output fout

    ExtensionHeaderDataUnit(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    ExtensionHeaderDataUnit(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    ExtensionHeaderDataUnit(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    This constructor is used for writing only required keywords.

    void ex_assign()


    class FitsBase

    Interface

    Public Members
    FitsBase(const FITS::ValueType &t, int n) : no_elements(n), data_type(t)
    virtual ~FitsBase()
    unsigned int nelements() const
    virtual int fitsfieldsize() const = 0
    virtual int localfieldsize() const = 0
    virtual void *data() = 0
    virtual int dims() const
    virtual int dim(int n) const
    virtual int *vdim()
    FITS::ValueType fieldtype() const
    static FitsBase *make(const FITS::ValueType &, int = 1)
    static FitsBase *make(const FITS::ValueType &, int, int *)
    static FitsBase *make(FitsBase &)
    FitsBase & operator = (FitsBase &)
    virtual void show(std::ostream &) = 0
    Protected Members
    virtual void setaddr(void **) = 0

    Description

    Member Description

    FitsBase(const FITS::ValueType &t, int n) : no_elements(n), data_type(t)

    virtual ~FitsBase()

    unsigned int nelements() const

    virtual int fitsfieldsize() const = 0

    virtual int localfieldsize() const = 0

    virtual void *data() = 0

    virtual int dims() const

    virtual int dim(int n) const

    virtual int *vdim()

    FITS::ValueType fieldtype() const

    static FitsBase *make(const FITS::ValueType &, int = 1)

    static FitsBase *make(const FITS::ValueType &, int, int *)

    static FitsBase *make(FitsBase &)

    FitsBase & operator = (FitsBase &)

    virtual void show(std::ostream &) = 0

    virtual void setaddr(void **) = 0


    template <> class FitsField<FitsBit> : public FitsBase

    Interface

    Public Members
    FitsField(int n = 1)
    ~FitsField()
    FitsField<FitsBit> & operator () ()
    FitsField<FitsBit> & operator () (unsigned i)
    FitsField<FitsBit> & operator = (unsigned i)
    int fitsfieldsize() const
    int localfieldsize() const
    operator int()
    void *data()
    void show(std::ostream &)
    Protected Members
    void setaddr(void **addr)

    Description

    Template Type Argument Requirements

          typedef FitsField<FitsLogical> LogicalFitsField;
          typedef FitsField<FitsBit> BitFitsField;
          typedef FitsField<char> CharFitsField;
          typedef FitsField<unsigned char> ByteFitsField;
          typedef FitsField<short> ShortFitsField;
          typedef FitsField<FitsLong> LongFitsField;
          typedef FitsField<float> FloatFitsField;
          typedef FitsField<double> DoubleFitsField;
          typedef FitsField<Complex> ComplexFitsField;
          typedef FitsField<IComplex> IComplexFitsField;
          typedef FitsField<DComplex> DComplexFitsField;
          typedef FitsField<FitsVADesc> VADescFitsField;
          
    Caution Bit fields require special treatment

    Member Description

    FitsField(int n = 1)

    ~FitsField()

    FitsField<FitsBit> & operator () ()

    FitsField<FitsBit> & operator () (unsigned i)

    FitsField<FitsBit> & operator = (unsigned i)

    int fitsfieldsize() const

    int localfieldsize() const

    operator int()

    void *data()

    void show(std::ostream &)

    void setaddr(void **addr)


    template <> class FitsField<FitsBit> : public FitsBase

    Interface

    Public Members
    FitsField(int n = 1)
    ~FitsField()
    FitsField<FitsBit> & operator () ()
    FitsField<FitsBit> & operator () (unsigned i)
    FitsField<FitsBit> & operator = (unsigned i)
    int fitsfieldsize() const
    int localfieldsize() const
    operator int()
    void *data()
    void show(std::ostream &)
    Protected Members
    void setaddr(void **addr)

    Description

    Template Type Argument Requirements

          typedef FitsField<FitsLogical> LogicalFitsField;
          typedef FitsField<FitsBit> BitFitsField;
          typedef FitsField<char> CharFitsField;
          typedef FitsField<unsigned char> ByteFitsField;
          typedef FitsField<short> ShortFitsField;
          typedef FitsField<FitsLong> LongFitsField;
          typedef FitsField<float> FloatFitsField;
          typedef FitsField<double> DoubleFitsField;
          typedef FitsField<Complex> ComplexFitsField;
          typedef FitsField<IComplex> IComplexFitsField;
          typedef FitsField<DComplex> DComplexFitsField;
          typedef FitsField<FitsVADesc> VADescFitsField;
          
    Caution Bit fields require special treatment

    Member Description

    FitsField(int n = 1)

    ~FitsField()

    FitsField<FitsBit> & operator () ()

    FitsField<FitsBit> & operator () (unsigned i)

    FitsField<FitsBit> & operator = (unsigned i)

    int fitsfieldsize() const

    int localfieldsize() const

    operator int()

    void *data()

    void show(std::ostream &)

    void setaddr(void **addr)


    template <> class FitsArray<FitsBit> : public FitsField<FitsBit>

    Interface

    FitsArray(int, const int *)
    ~FitsArray()
    FitsField<FitsBit> & operator () (int d0, int d1)
    FitsField<FitsBit> & operator () (int, int, int)
    FitsField<FitsBit> & operator () (int, int, int, int)
    FitsField<FitsBit> & operator () (int, int, int, int, int)
    int dims() const
    int dim(int n) const
    int *vdim()

    Description

    Template Type Argument Requirements

          typedef FitsArray<FitsLogical> LogicalFitsArray;
          typedef FitsArray<FitsBit> BitFitsArray;
          typedef FitsArray<char> CharFitsArray;
          typedef FitsArray<unsigned char> ByteFitsArray;
          typedef FitsArray<short> ShortFitsArray;
          typedef FitsArray<FitsLong> LongFitsArray;
          typedef FitsArray<float> FloatFitsArray;
          typedef FitsArray<double> DoubleFitsArray;
          typedef FitsArray<Complex> ComplexFitsArray;
          typedef FitsArray<IComplex> IComplexFitsArray;
          typedef FitsArray<DComplex> DComplexFitsArray;
          typedef FitsArray<FitsVADesc> VADescFitsArray;
          
    We must specify a FitsArray as a specialization.

    Member Description

    FitsArray(int, const int *)

    ~FitsArray()

    FitsField<FitsBit> & operator () (int d0, int d1)

    FitsField<FitsBit> & operator () (int, int, int)

    FitsField<FitsBit> & operator () (int, int, int, int)

    FitsField<FitsBit> & operator () (int, int, int, int, int)

    int dims() const

    int dim(int n) const

    int *vdim()


    template <> class FitsArray<FitsBit> : public FitsField<FitsBit>

    Interface

    FitsArray(int, const int *)
    ~FitsArray()
    FitsField<FitsBit> & operator () (int d0, int d1)
    FitsField<FitsBit> & operator () (int, int, int)
    FitsField<FitsBit> & operator () (int, int, int, int)
    FitsField<FitsBit> & operator () (int, int, int, int, int)
    int dims() const
    int dim(int n) const
    int *vdim()

    Description

    Template Type Argument Requirements

          typedef FitsArray<FitsLogical> LogicalFitsArray;
          typedef FitsArray<FitsBit> BitFitsArray;
          typedef FitsArray<char> CharFitsArray;
          typedef FitsArray<unsigned char> ByteFitsArray;
          typedef FitsArray<short> ShortFitsArray;
          typedef FitsArray<FitsLong> LongFitsArray;
          typedef FitsArray<float> FloatFitsArray;
          typedef FitsArray<double> DoubleFitsArray;
          typedef FitsArray<Complex> ComplexFitsArray;
          typedef FitsArray<IComplex> IComplexFitsArray;
          typedef FitsArray<DComplex> DComplexFitsArray;
          typedef FitsArray<FitsVADesc> VADescFitsArray;
          
    We must specify a FitsArray as a specialization.

    Member Description

    FitsArray(int, const int *)

    ~FitsArray()

    FitsField<FitsBit> & operator () (int d0, int d1)

    FitsField<FitsBit> & operator () (int, int, int)

    FitsField<FitsBit> & operator () (int, int, int, int)

    FitsField<FitsBit> & operator () (int, int, int, int, int)

    int dims() const

    int dim(int n) const

    int *vdim()


    class BinaryTableExtension : public ExtensionHeaderDataUnit

    Interface

    BinaryTableExtension(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    BinaryTableExtension(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    BinaryTableExtension( FITSErrorHandler errhandler = FITSError::defaultHandler)
    virtual ~BinaryTableExtension()
    Int nrows() const
    Int ncols() const
    uInt rowsize() const
    Int tfields() const
    char *tform(int n) const
    double tscal(int n) const
    double tzero(int n) const
    Bool isatnull(int n) const
    Int tnull(int n) const
    char *ttype(int n) const
    char *tunit(int n) const
    char *tdisp(int n) const
    char *tdim(int n) const
    char *ctype(int n) const
    double crpix(int n) const
    double crota(int n) const
    double crval(int n) const
    double cdelt(int n) const
    Int theap() const
    char *author() const
    char *referenc() const
    int bind(int, FitsBase &)
    BinaryTableExtension & operator ++ ()
    BinaryTableExtension & operator -- ()
    BinaryTableExtension & operator () (int)
    int read()
    int read(int)
    int set_next(int)
    int write(FitsOutput &)
    int write_binTbl_hdr(FitsOutput &, long, int, char**, char**, char**, char*, long )
    FitsBase &field(int i) const
    Int currrow() const
    Protected Members
    BinaryTableExtension(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
    BinaryTableExtension(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
    BinaryTableExtension(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)
    virtual int readrow()
    virtual int writerow(FitsOutput &)
    void set_fitsrow(Int)
    Private Members
    void bt_assign()

    Description

    Member Description

    BinaryTableExtension(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    BinaryTableExtension(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    BinaryTableExtension( FITSErrorHandler errhandler = FITSError::defaultHandler)

    constructor to match write_bintbl_hdr()

    virtual ~BinaryTableExtension()

    Int nrows() const
    Int ncols() const
    uInt rowsize() const
    Int tfields() const
    char *tform(int n) const
    double tscal(int n) const
    double tzero(int n) const
    Bool isatnull(int n) const
    Int tnull(int n) const
    char *ttype(int n) const
    char *tunit(int n) const
    char *tdisp(int n) const
    char *tdim(int n) const
    char *ctype(int n) const
    double crpix(int n) const
    double crota(int n) const
    double crval(int n) const
    double cdelt(int n) const
    Int theap() const
    char *author() const
    char *referenc() const

    return basic elements of a table

    int bind(int, FitsBase &)

    binds a FitsField to a column

    BinaryTableExtension & operator ++ ()
    BinaryTableExtension & operator -- ()
    BinaryTableExtension & operator () (int)

    row selector functions

    int read()

    read entire table into memory

    int read(int)

    read next N rows into memory

    int set_next(int)

    prepare to write the next N rows

    int write(FitsOutput &)

    write current rows

    int write_binTbl_hdr(FitsOutput &, long, int, char**, char**, char**, char*, long )

    create a binary table header without using FitsKeywordList objet.

    FitsBase &field(int i) const

    select a field

    Int currrow() const

    get current row

    BinaryTableExtension(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    BinaryTableExtension(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    BinaryTableExtension(FITS::HDUType, FITSErrorHandler errhandler = FITSError::defaultHandler)

    virtual int readrow()
    virtual int writerow(FitsOutput &)

    read and write the next FITS data row

    void set_fitsrow(Int)

    tells whether optimum case exists or not

    sets field addresses in the current row

    void bt_assign()


    class AsciiTableExtension : public BinaryTableExtension

    Interface

    Public Members
    AsciiTableExtension(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    AsciiTableExtension(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)
    AsciiTableExtension(FITSErrorHandler errhandler = FITSError::defaultHandler)
    ~AsciiTableExtension()
    Int tbcol(int n)
    char *tnull(int n)
    int write_ascTbl_hdr( FitsOutput &, long, long, int, char **, long *, char **, char **, char *e)
    Protected Members
    int readrow()
    int writerow(FitsOutput &)
    Private Members
    void at_assign()

    Description

    Member Description

    AsciiTableExtension(FitsInput &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    AsciiTableExtension(FitsKeywordList &, FITSErrorHandler errhandler = FITSError::defaultHandler)

    AsciiTableExtension(FITSErrorHandler errhandler = FITSError::defaultHandler)

    ~AsciiTableExtension()

    Int tbcol(int n)

    position in which column starts

    char *tnull(int n)

    ascii string that represents the NULL value

    int write_ascTbl_hdr( FitsOutput &, long, long, int, char **, long *, char **, char **, char *e)

    write the required keywords for ASCIITableExtension

    int readrow()
    int writerow(FitsOutput &)

    converted formats of the fields

    read and write the next FITS data row

    void at_assign()