fits.h

Classes

NoConvert -- FITS templated helper class (full description)
FitsLogical -- FITS helper class (full description)
FitsBit -- helper class for FITS Binary Tables (full description)
FitsVADesc -- Variable Length Array Descriptor (full description)
FITS -- static functions and enumerations (full description)
ReservedFitsKeyword -- reserved FITS keyword (full description)
ReservedFitsKeywordCollection -- collection of reserved FITS keywords (full description)
FitsNameResult -- analyse the name of a header card (full description)
FitsValueResult -- analyse the value of a header card (full description)
FitsParse -- parse a header card (full description)
FitsKeyword -- FITS keyword (full description)
FitsKeywordList -- linked list of FITS keywords (full description)
ConstFitsKeywordList -- list of read-only FITS keywords (full description)
FitsKeyCardTranslator -- translator between Keyword lists and fixed FITS cars (full description)
FitsFPUtil -- Utility functions for floating point values (full description)

class NoConvert

Interface

Public Members
NoConvert()
void operator = (int)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

NoConvert is a template class that is not intended for general use, it is used internally.

Member Description

NoConvert()

void operator = (int)


class FitsLogical

Interface

friend ostream & operator << (ostream &o, const FitsLogical &)
FitsLogical() : v('\0')
FitsLogical(Bool x)
FitsLogical(const FitsLogical &x) : v(x.v)
FitsLogical & operator = (const FitsLogical &x)
FitsLogical & operator = (Bool x)
Bool isdefined() const
void undefine()
operator Bool()

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

FitsLogical is a helper class that is not intended for general use.

Example

Here is an example of the FitsLogical class.
	FitsLogical x;
	FitsLogical y(True);
	FitsLogical z = x;
	...
	x = y; y = False; x.undefine();
	Bool b;
	if (x.isdefined())
		b = x;
	b = y;  If y is undefined, b will be false.

Member Description

friend ostream & operator << (ostream &o, const FitsLogical &)

FitsLogical() : v('\0')

FitsLogical(Bool x)

FitsLogical(const FitsLogical &x) : v(x.v)

FitsLogical & operator = (const FitsLogical &x)

FitsLogical & operator = (Bool x)

Bool isdefined() const

void undefine()

operator Bool()


class FitsBit

Interface

FitsBit() : bit_array(0)
FitsBit(unsigned char x) : bit_array(x)
FitsBit(const FitsBit &x) : bit_array(x.bit_array)
FitsBit & operator = (const FitsBit &x)
FitsBit & operator = (unsigned char x)
operator unsigned char()

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

This class is not intended for general use. It only has meaning in the context of FITS Binary tables. There its use is incorporated into the concept of a FitsField, where FitsBit is given a specialized interpretation.

Member Description

FitsBit() : bit_array(0)

FitsBit(unsigned char x) : bit_array(x)

FitsBit(const FitsBit &x) : bit_array(x.bit_array)

FitsBit & operator = (const FitsBit &x)

FitsBit & operator = (unsigned char x)

operator unsigned char()


class FitsVADesc

Interface

Protected Members
friend ostream & operator << (ostream &o, const FitsVADesc &)
Public Members
FitsVADesc() : no_elements(0), rel_offset(0)
FitsVADesc(const FitsVADesc &x) : no_elements(x.no_elements), rel_offset(x.rel_offset)
FitsVADesc & operator = (const FitsVADesc &x)
FitsVADesc(int n, int o) : no_elements(n), rel_offset(o)
void set(int n, int o)
int num() const
int offset() const

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Member Description

friend ostream & operator << (ostream &o, const FitsVADesc &)

FitsVADesc() : no_elements(0), rel_offset(0)

FitsVADesc(const FitsVADesc &x) : no_elements(x.no_elements), rel_offset(x.rel_offset)

FitsVADesc & operator = (const FitsVADesc &x)

FitsVADesc(int n, int o) : no_elements(n), rel_offset(o)

void set(int n, int o)

int num() const

int offset() const


class FITS

Types

enum ValueType

NOVALUE = 0
LOGICAL = 1
BIT = 2
CHAR = 3
BYTE = 4
SHORT = 5
LONG = 6
FLOAT = 7
DOUBLE = 8
COMPLEX = 9
ICOMPLEX = 10
DCOMPLEX = 11
VADESC = 12
STRING
FSTRING
REAL

enum ReservedName

USER_DEF
AUTHOR
BITPIX
BLANK
BLOCKED
BSCALE
BUNIT
BZERO
CDELT
COMMENT
CROTA
CRPIX
CRVAL
CTYPE
DATAMAX
DATAMIN
DATE
DATE_OBS
END
EPOCH
EQUINOX
EXTEND
EXTLEVEL
EXTNAME
EXTVER
GCOUNT
GROUPS
HISTORY
INSTRUME
NAXIS
OBJECT
OBSERVER
ORIGIN
PCOUNT
PSCAL
PTYPE
PZERO_FITS
REFERENC
SIMPLE
SPACES
TBCOL
TDIM
TDISP
TELESCOP
TFIELDS
TFORM
THEAP
TNULL
TSCAL
TTYPE
TUNIT
TZERO
XTENSION
ERRWORD

enum FitsRecType

InitialState
BadBeginningRecord
HDURecord
UnrecognizableRecord
SpecialRecord
EndOfFile

enum FitsDevice

Disk
Std
Tape9

enum HDUType

NotAHDU
PrimaryArrayHDU
PrimaryGroupHDU
AsciiTableHDU
BinaryTableHDU
ImageExtensionHDU
UnknownExtensionHDU

enum FitsArrayOption

NoOpt = 0
CtoF = 1
FtoC = 2

Interface

static FITS::ValueType getfitstype(NoConvert<FitsLogical> x)
static FITS::ValueType getfitstype(NoConvert<FitsBit> x)
static FITS::ValueType getfitstype(NoConvert<char> x)
static FITS::ValueType getfitstype(NoConvert<unsigned char> x)
static FITS::ValueType getfitstype(NoConvert<short> x)
static FITS::ValueType getfitstype(NoConvert<Int> x)
static FITS::ValueType getfitstype(NoConvert<long> x)
static FITS::ValueType getfitstype(NoConvert<float> x)
static FITS::ValueType getfitstype(NoConvert<double> x)
static FITS::ValueType getfitstype(NoConvert<Complex> x)
static FITS::ValueType getfitstype(NoConvert<IComplex> x)
static FITS::ValueType getfitstype(NoConvert<DComplex> x)
static FITS::ValueType getfitstype(NoConvert<FitsVADesc> x)
static int fitssize(FITS::ValueType t)
static int localsize(FITS::ValueType t)
static void f2l(FitsLogical *,void *,int)
static void l2f(void *,FitsLogical *,int)
static void f2l(FitsBit *,void *,int)
static void l2f(void *,FitsBit *,int)
static void f2l(char *,void *,int)
static void l2f(void *,char *,int)
static void f2l(unsigned char *,void *,int)
static void l2f(void *,unsigned char *,int)
static void f2l(short *,void *,int)
static void l2f(void *,short *,int)
static void f2l(Int *,void *,int)
static void l2f(void *,Int *,int)
static void f2l(long *,void *,int)
static void l2f(void *,long *,int)
static void f2l(float *,void *,int)
static void l2f(void *,float *,int)
static void f2l(double *,void *,int)
static void l2f(void *,double *,int)
static void f2l(Complex *,void *,int)
static void l2f(void *,Complex *,int)
static void f2l(IComplex *,void *,int)
static void l2f(void *,IComplex *,int)
static void f2l(DComplex *,void *,int)
static void l2f(void *,DComplex *,int)
static void f2l(FitsVADesc *,void *,int)
static void l2f(void *,FitsVADesc *,int)
static void swap2(void *, void *, int)
static void swap4(void *, void *, int)
static void swap8(void *, void *, int)
static void valstr(ostream &o, const ValueType &ty, const void *val)
static Bool isa_digit(char c)
static int digit2bin(char c)
static Bool isa_text(char c)
static Bool isa_letter(char)
static int letter2bin(char)
static void fstr2str(char *, const char *, int)
static int str2fstr(char *, const char *, int)
static void get_name(const char *s, int len, FitsNameResult &result)
static int get_value_id(const char *s, int l, int &pos)
static void get_value(const char *s, int len, FitsValueResult &result)
static int trim_comment(const char *s, int len)
static int chk_comment(const char *s, int len)
static int get_comment(const char *s, int len, int &begpos)
static void get_numeric(const char *s, int len, FitsValueResult &result)
static void parse_vatform(const char *s, FITS::ValueType &valType, int &maxelem)
Private Members
FITS()
static double tenD(Int, int)
static float tenF(Int, int)
static int ckaccum(double &, Int, int)
static int ckaccum(float &, Int, int)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

Many of the static functions are utility functions used internally in the implementation of the member functions of the FITS classes. They are placed in a single class to encapsulate them and to avoid adding many names to the global name space. More important, from the user's perspective, are the enumerations. They form the basic vocabulary of a FITS application. For example, instead of referring to the FITS NAXIS keyword, FITS::NAXIS should be used

Member Description

enum ValueType

FITS I/O Error message types

Basic FITS Data Types for keywords and data

static FITS::ValueType getfitstype(NoConvert<FitsLogical> x)

STRING and FSTRING are used internally in parsing keywords

static FITS::ValueType getfitstype(NoConvert<FitsBit> x)

static FITS::ValueType getfitstype(NoConvert<char> x)

static FITS::ValueType getfitstype(NoConvert<unsigned char> x)

static FITS::ValueType getfitstype(NoConvert<short> x)

static FITS::ValueType getfitstype(NoConvert<Int> x)

static FITS::ValueType getfitstype(NoConvert<long> x)

static FITS::ValueType getfitstype(NoConvert<float> x)

static FITS::ValueType getfitstype(NoConvert<double> x)

static FITS::ValueType getfitstype(NoConvert<Complex> x)

static FITS::ValueType getfitstype(NoConvert<IComplex> x)

static FITS::ValueType getfitstype(NoConvert<DComplex> x)

static FITS::ValueType getfitstype(NoConvert<FitsVADesc> x)

static int fitssize(FITS::ValueType t)

static int localsize(FITS::ValueType t)

static void f2l(FitsLogical *,void *,int)

data conversion routines: FITS - local

static void l2f(void *,FitsLogical *,int)

static void f2l(FitsBit *,void *,int)

static void l2f(void *,FitsBit *,int)

static void f2l(char *,void *,int)

static void l2f(void *,char *,int)

static void f2l(unsigned char *,void *,int)

static void l2f(void *,unsigned char *,int)

static void f2l(short *,void *,int)

static void l2f(void *,short *,int)

static void f2l(Int *,void *,int)

static void l2f(void *,Int *,int)

static void f2l(long *,void *,int)

static void l2f(void *,long *,int)

static void f2l(float *,void *,int)

static void l2f(void *,float *,int)

static void f2l(double *,void *,int)

static void l2f(void *,double *,int)

static void f2l(Complex *,void *,int)

static void l2f(void *,Complex *,int)

static void f2l(IComplex *,void *,int)

static void l2f(void *,IComplex *,int)

static void f2l(DComplex *,void *,int)

static void l2f(void *,DComplex *,int)

static void f2l(FitsVADesc *,void *,int)

static void l2f(void *,FitsVADesc *,int)

static void swap2(void *, void *, int)

static void swap4(void *, void *, int)

static void swap8(void *, void *, int)

enum ReservedName

FITS Reserved Names. PZERO is named strangely because it can conflict with a standard #define in sys/param.h.

enum FitsRecType

Types of FITS Records

enum FitsDevice

Supported FITS Physical Devices

enum HDUType

Types of FITS Header-Data Units

enum FitsArrayOption

Options on FITS array manipulations

static void valstr(ostream &o, const ValueType &ty, const void *val)

static Bool isa_digit(char c)

static int digit2bin(char c)

static Bool isa_text(char c)

static Bool isa_letter(char)

static int letter2bin(char)

static void fstr2str(char *, const char *, int)

static int str2fstr(char *, const char *, int)

static void get_name(const char *s, int len, FitsNameResult &result)

static int get_value_id(const char *s, int l, int &pos)

static void get_value(const char *s, int len, FitsValueResult &result)

static int trim_comment(const char *s, int len)

static int chk_comment(const char *s, int len)

static int get_comment(const char *s, int len, int &begpos)

static void get_numeric(const char *s, int len, FitsValueResult &result)

static void parse_vatform(const char *s, FITS::ValueType &valType, int &maxelem)

utility function to parse the binary table variable array column (i.e. uses the heap) of the form nPt(dddd) where n is either 0 or 1, t is one of the standard FITS binary table column types and dddd is the maximum number of elements used by this column. If there is a format error in the input string (*s), then valType will have the value NOVALUE and maxelem will be -1.

FITS()

static double tenD(Int, int)

max digits in an exponent

static float tenF(Int, int)

static int ckaccum(double &, Int, int)

static int ckaccum(float &, Int, int)


class ReservedFitsKeyword

Interface

Public Members
const char *aname() const
FITS::ReservedName name() const
int namesize() const
FITS::ValueType type() const
Bool isindexed() const
Bool isessential() const
# if defined(TURBOCPP)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Member Description

const char *aname() const

FITS::ReservedName name() const

int namesize() const

FITS::ValueType type() const

Bool isindexed() const

Bool isessential() const

# if defined(TURBOCPP)


class ReservedFitsKeywordCollection

Interface

const ReservedFitsKeyword & operator [] (int i) const
int no() const
const ReservedFitsKeyword &get(FITS::ReservedName, Bool, FITS::ValueType, const void *, int, const char *&) const
const ReservedFitsKeyword &get(const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
const char *aname(FITS::ReservedName) const
int essential_name(const char *, int) const
const ReservedFitsKeyword &get_essential(int, Bool, FITS::ValueType, const void *, int, const char *&) const
int isreserved(const char *, int) const
Bool isunique(int) const
Bool requires_value(int) const
const ReservedFitsKeyword &userdef_item() const
const ReservedFitsKeyword &err_item() const
const ReservedFitsKeyword &end_item() const
const ReservedFitsKeyword &spaces() const
const ReservedFitsKeyword &comment() const
const ReservedFitsKeyword &history() const
int rules(const ReservedFitsKeyword &, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
Private Members
const ReservedFitsKeyword &match(int, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Member Description

const ReservedFitsKeyword & operator [] (int i) const

int no() const

const ReservedFitsKeyword &get(FITS::ReservedName, Bool, FITS::ValueType, const void *, int, const char *&) const

const ReservedFitsKeyword &get(const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const

const char *aname(FITS::ReservedName) const

int essential_name(const char *, int) const

const ReservedFitsKeyword &get_essential(int, Bool, FITS::ValueType, const void *, int, const char *&) const

int isreserved(const char *, int) const

Bool isunique(int) const

Bool requires_value(int) const

const ReservedFitsKeyword &userdef_item() const

const ReservedFitsKeyword &err_item() const

const ReservedFitsKeyword &end_item() const

const ReservedFitsKeyword &spaces() const

const ReservedFitsKeyword &comment() const

const ReservedFitsKeyword &history() const

int rules(const ReservedFitsKeyword &, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const

const ReservedFitsKeyword &match(int, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const

alphabetic index to table

class FitsNameResult

Types

enum ErrMsg

OK = 0
NO_0_NDX

Interface

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

Analyse the name of a header card

Member Description

enum ErrMsg

length of name without index

class FitsValueResult

Interface

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

Analyse the value of a header card

Member Description


class FitsParse

Interface

Public Members
FitsKeyword &parse(const char *, int)
int no_errs() const
const char *err(int) const
Private Members
FitsParse(int = 10)
~FitsParse()
int seterr(const char *)
FitsKeyword &mkerr(const char *s, int len)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

parse a header card

Member Description

FitsKeyword &parse(const char *, int)

int no_errs() const

Parsing one string

const char *err(int) const

FitsParse(int = 10)

~FitsParse()

int seterr(const char *)

FitsKeyword &mkerr(const char *s, int len)


class FitsKeyword

Interface

Public Members
FitsKeyword(const FitsKeyword &)
FitsKeyword & operator = (const FitsKeyword &)
~FitsKeyword()
const char *name() const
int namelen() const
Bool isreserved() const
Bool isindexed() const
const ReservedFitsKeyword &kw() const
int index() const
const char *comm() const
int commlen() const
int err() const
FITS::ValueType type() const
Bool asBool() const
const char *asString() const
int valStrlen() const
Int asInt() const
float asFloat() const
double asDouble() const
IComplex asIComplex() const
Complex asComplex() const
DComplex asDComplex() const
const void *value() const
FitsKeyword & operator = (Bool)
FitsKeyword & operator = (const char *)
FitsKeyword & operator = (Int)
FitsKeyword & operator = (float)
FitsKeyword & operator = (double)
FitsKeyword & operator = (IComplex)
FitsKeyword & operator = (Complex)
FitsKeyword & operator = (DComplex)
void comm(const char *)
void name(const char *)
Private Members
void del_val()
void init(const FitsKeyword &)
void setval(const FITS::ValueType &, const void *, int)
void setcomm(const char *, int)
static void err(const char *, const FITS::ValueType &, const void *, const char *)
static void memchk(void *)
FitsKeyword(const char *, int , FITS::ValueType, const void *, int, const char *, int)
FitsKeyword(const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

A FITS keyword contains a name, a value and a comment.

Member Description

FitsKeyword(const FitsKeyword &)

FitsKeyword & operator = (const FitsKeyword &)

~FitsKeyword()

const char *name() const

get info about the name

int namelen() const
Bool isreserved() const
Bool isindexed() const
const ReservedFitsKeyword &kw() const
int index() const

const char *comm() const
int commlen() const

int err() const

access the error status

FITS::ValueType type() const

the datatype of the keyword

Bool asBool() const
const char *asString() const
int valStrlen() const
Int asInt() const
float asFloat() const
double asDouble() const
IComplex asIComplex() const
Complex asComplex() const
DComplex asDComplex() const
const void *value() const

access the value of the keyword

FitsKeyword & operator = (Bool)
FitsKeyword & operator = (const char *)
FitsKeyword & operator = (Int)
FitsKeyword & operator = (float)
FitsKeyword & operator = (double)
FitsKeyword & operator = (IComplex)
FitsKeyword & operator = (Complex)
FitsKeyword & operator = (DComplex)

change the value of the keyword

void comm(const char *)

change the comment of the keyword

void name(const char *)

change the name of the keyword

void del_val()

void init(const FitsKeyword &)

does an appropriate delete based on type

void setval(const FITS::ValueType &, const void *, int)

void setcomm(const char *, int)

static void err(const char *, const FITS::ValueType &, const void *, const char *)

static void memchk(void *)

FitsKeyword(const char *, int , FITS::ValueType, const void *, int, const char *, int)

private constructors for use by friends

constructs user-defined keywords parms: name, namelen, type, val, vallen, comm, commlen

FitsKeyword(const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)

constructs reserved keywords parms: resword, index, val, vallen, comm, commlen


class FitsKeywordList

Interface

Public Members
FitsKeywordList()
~FitsKeywordList()
FitsKeywordList(const FitsKeywordList &)
FitsKeywordList(ConstFitsKeywordList &)
FitsKeywordList & operator = (const FitsKeywordList &)
void del()
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, long 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, long 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, long 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)
void end()
FitsKeyword * operator () (int)
FitsKeyword * operator () (const FITS::ReservedName &)
FitsKeyword * next(const FITS::ReservedName &)
FitsKeyword * operator () (const FITS::ReservedName &, int)
FitsKeyword * next(const FITS::ReservedName &, int)
FitsKeyword * operator () (const char *)
FitsKeyword * next(const char *)
Bool isempty() const
void first()
void last()
FitsKeyword *next()
FitsKeyword *prev()
FitsKeyword *curr()
void delete_all()
int rules(FitsKeyword &, FITSErrorHandler errhandler = FITSError::defaultHandler)
int rules(FITSErrorHandler errhandler = FITSError::defaultHandler)
Bool basic_rules()
void parse(const char *, int)
int no_parse_errs() const
const char *parse_err(int) const
void insert(FitsKeyword &)
Private Members
FitsKeyword &make(const char *nm, FITS::ValueType t, const void *v, const char *c)
FitsKeyword &make(FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
FitsKeyword &make(int ind, FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
FitsKeyword &makeErrKeyword(const char *name, FITS::ValueType type, const void *val, const char *errmsg)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

A linked list of FITS keywords.

Member Description

FitsKeywordList()

~FitsKeywordList()

FitsKeywordList(const FitsKeywordList &)

FitsKeywordList(ConstFitsKeywordList &)

FitsKeywordList & operator = (const FitsKeywordList &)

void del()

delete the current keyword (the thing returned by curr()) from the list

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, long v, const char *c = 0)
void mk(FITS::ReservedName k, double v, const char *c = 0)

Add (make) a reserved keyword with the given value and optional comment The comment will be truncated if necessary to fit the available space. String values must be less than 69 characters. String values longer than that will result in an ERROR keyword instead of the desired keyword.

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, long v, const char *c = 0)
void mk(int n, FITS::ReservedName k, double v, const char *c = 0)

Add (make) an indexed reserved keyword with the given value and optional comment The comment will be truncated if necessary to fit the available space. String values must be less than 69 characters. String values longer than that will result in an ERROR keyword instead of the desired keyword.

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, long 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)

Add (make) a user defined keyword with the given name, value and optional comment. The comment will be truncated if necessary to fit the available space. The name must be no longer than 8 characters. Names longer than that will result in an ERROR keyword instead of the desired keyword. String values must no longer than 69 characters. String values longer than that will result in an ERROR keyword instead of the desired keyword.

void spaces(const char *n = 0, const char *c = 0)

add a spaces line

void comment(const char *n = 0, const char *c = 0)

add a comment card

void history(const char *c = 0)

add a history card

void end()

add the end card. This must be at the end of the list.

FitsKeyword * operator () (int)

Retrieve specific keywords -- these also set the current mark

return the i-th keyword -- keyword numbering starts with 0

FitsKeyword * operator () (const FITS::ReservedName &)

Retrieve specific keywords -- these also set the current mark

return first and next non-indexed reserved keyword

FitsKeyword * operator () (const FITS::ReservedName &, int)

Retrieve specific keywords -- these also set the current mark

return first and next indexed reserved keyword

FitsKeyword * operator () (const char *)

Retrieve specific keywords -- these also set the current mark

return first and next user-defined keyword

FitsKeyword * next(const FITS::ReservedName &)
FitsKeyword * next(const FITS::ReservedName &, int)
FitsKeyword * next(const char *)

Retrieve specific keywords -- these also set the current mark

Bool isempty() const
void first()
void last()
FitsKeyword *next()
FitsKeyword *prev()
FitsKeyword *curr()

void delete_all()
int rules(FitsKeyword &, FITSErrorHandler errhandler = FITSError::defaultHandler)
int rules(FITSErrorHandler errhandler = FITSError::defaultHandler)
Bool basic_rules()

void parse(const char *, int)
int no_parse_errs() const
const char *parse_err(int) const

void insert(FitsKeyword &)

FitsKeyword &make(const char *nm, FITS::ValueType t, const void *v, const char *c)

FitsKeyword &make(FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)

FitsKeyword &make(int ind, FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)

FitsKeyword &makeErrKeyword(const char *name, FITS::ValueType type, const void *val, const char *errmsg)

construct an error keyword - this happens when a name is invalid (NULL or more than 8 characters) or a string value is too long (more than 69 characters). It is the responsibility of the caller to the several mk functions to ensure that that doesn't happen. By the time it gets here, it is assumed that such problems are true errors. This is used by the private make functions.

class ConstFitsKeywordList

Interface

Public Members
ConstFitsKeywordList(FitsKeywordList &x) : kw(x)
const FitsKeyword * operator () (int n)
const FitsKeyword * operator () (const FITS::ReservedName &x)
const FitsKeyword * next(const FITS::ReservedName &x)
const FitsKeyword * operator () (const FITS::ReservedName &x, int n)
const FitsKeyword * next(const FITS::ReservedName &x, int n)
const FitsKeyword * operator () (const char *x)
const FitsKeyword * next(const char *x)
Bool isempty() const
void first()
void last()
const FitsKeyword *next()
const FitsKeyword *prev()
const FitsKeyword *curr()

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Member Description

ConstFitsKeywordList(FitsKeywordList &x) : kw(x)

const FitsKeyword * operator () (int n)

const FitsKeyword * operator () (const FITS::ReservedName &x)

const FitsKeyword * next(const FITS::ReservedName &x)

const FitsKeyword * operator () (const FITS::ReservedName &x, int n)

const FitsKeyword * next(const FITS::ReservedName &x, int n)

const FitsKeyword * operator () (const char *x)

const FitsKeyword * next(const char *x)

Bool isempty() const

void first()

void last()

const FitsKeyword *next()

const FitsKeyword *prev()

const FitsKeyword *curr()


class FitsKeyCardTranslator

Interface

FitsKeyCardTranslator(int = 100)
~FitsKeyCardTranslator()
FitsKeywordList & parse(const char *, FitsKeywordList &, int, FITSErrorHandler, Bool)
int build(char *, FitsKeywordList &)
int no_errs() const
const char *err(int) const
int err_cardno(int) const
Private Members
void fmtcard(char *, const FitsKeyword &)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

also contains the parser ???

Member Description

FitsKeyCardTranslator(int = 100)

~FitsKeyCardTranslator()

FitsKeywordList & parse(const char *, FitsKeywordList &, int, FITSErrorHandler, Bool)

int build(char *, FitsKeywordList &)

int no_errs() const

const char *err(int) const

int err_cardno(int) const

void fmtcard(char *, const FitsKeyword &)


class FitsFPUtil

Interface

Public Members
static Bool isFP(const float *)
static Bool isFP(const double *)
static Bool isFP(const void *)
static void setNaN(double &val)
static void setNaN(float &val)

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Member Description

static Bool isFP(const float *)
static Bool isFP(const double *)
static Bool isFP(const void *)

These functions are useful to tell if some type is a floating point type. This is useful in a templated function, where the processing can vary depending on whether the type is FP or not (e.g. blank handling).

static void setNaN(double &val)
static void setNaN(float &val)

For blanking purposes, we need to be able to get a NaN. The NaN we set is all bits on.