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.
Basic FITS Data Types for keywords and data
data conversion routines: FITS - local
FITS Reserved Names. PZERO is named strangely because it can conflict with
a standard #define in sys/param.h.
get info about the name
access the error status
the datatype of the keyword
access the value of the keyword
change the value of the keyword
change the comment of the keyword
change the name of the keyword
private constructors for use by friends
constructs user-defined keywords
parms: name, namelen, type, val, vallen, comm, commlen
constructs reserved keywords
parms: resword, index, val, vallen, comm, commlen
delete the current keyword (the thing returned by curr()) from the list
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.
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.
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.
add a spaces line
add a comment card
add a history card
add the end card. This must be at the end of the list.
Retrieve specific keywords -- these also set the current mark
return the i-th keyword -- keyword numbering starts with 0
Retrieve specific keywords -- these also set the current mark
return first and next non-indexed reserved keyword
Retrieve specific keywords -- these also set the current mark
return first and next indexed reserved keyword
Retrieve specific keywords -- these also set the current mark
return first and next user-defined keyword
Retrieve specific keywords -- these also set the current mark
For blanking purposes, we need to be able to get a NaN. The NaN we set
is all bits on.
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
Description
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
enum ReservedName
enum FitsRecType
enum FitsDevice
enum HDUType
enum FitsArrayOption
Interface
Description
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
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)
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
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
Description
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
Description
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
Interface
Description
Synopsis
Analyse the name of a header card
Member Description
enum ErrMsg
length of name without index
class FitsValueResult
Interface
Description
Synopsis
Analyse the value of a header card
Member Description
class FitsParse
Interface
Description
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
Description
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
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 *)
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)
FitsKeyword(const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)
class FitsKeywordList
Interface
Description
Synopsis
A linked list of FITS keywords.
Member Description
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 * operator () (const FITS::ReservedName &, int)
FitsKeyword * operator () (const char *)
FitsKeyword * next(const FITS::ReservedName &)
FitsKeyword * next(const FITS::ReservedName &, int)
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 &)
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
Description
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
Description
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
Description
Member Description
static Bool isFP(const float *)
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 Bool isFP(const double *)
static Bool isFP(const void *)
static void setNaN(double &val)
static void setNaN(float &val)