28 # if !defined(AIPS_FITS)
48 class ReservedFitsKeywordCollection;
50 class FitsValueResult;
96 v = (x ==
True ?
'T' :
'F');
return *
this; }
101 operator Bool()
const {
return v ==
'T'; }
210 static void f2l(
char *,
void *,
int);
211 static void l2f(
void *,
char *,
int);
212 static void f2l(
unsigned char *,
void *,
int);
213 static void l2f(
void *,
unsigned char *,
int);
214 static void f2l(
short *,
void *,
int);
215 static void l2f(
void *,
short *,
int);
216 static void f2l(
Int *,
void *,
int);
217 static void l2f(
void *,
Int *,
int);
218 static void f2l(
long *,
void *,
int);
219 static void l2f(
void *,
long *,
int);
220 static void f2l(
float *,
void *,
int);
221 static void l2f(
void *,
float *,
int);
222 static void f2l(
double *,
void *,
int);
223 static void l2f(
void *,
double *,
int);
232 static void swap2(
void *,
void *,
int);
233 static void swap4(
void *,
void *,
int);
234 static void swap8(
void *,
void *,
int);
279 static void fstr2str(
char *,
const char *,
int);
280 static int str2fstr(
char *,
const char *,
int);
282 static int get_value_id(
const char *s,
int l,
int &pos);
286 static int get_comment(
const char *s,
int len,
int &begpos);
332 ((pow < 0) ? (((double)numb) /
tenpowerD[-
pow]) : ((
double)numb));
336 ((pow < 0) ? (((float)numb) /
tenpowerF[-
pow]) : ((
float)numb));
345 const char *
aname()
const;
351 # if defined(TURBOCPP)
382 const void *, int,
const char *&)
const;
384 const void *, int,
const char *&)
const;
388 const void *,
int,
const char *&)
const;
492 const char *
err(
int)
const;
530 const char *
name()
const;
540 const char *
comm()
const;
561 const void *
value()
const;
577 void comm(
const char *);
580 void name(
const char *);
620 void setcomm(
const char *,
int);
623 static void memchk(
void *);
644 name_(0), kw_(0), comm_(0), val(0) {
init(k); }
671 return vallen ? (
const char *)
val :
""; }
675 cerr <<
"Unexpected keyword type in FitsKeyword::asInt()\n";
688 cerr <<
"Unexpected keyword type in asFloat()\n";
701 cerr <<
"Unexpected keyword type in asDouble()\n";
782 void mk(
const char *n,
Bool v,
const char *
c = 0);
783 void mk(
const char *n,
const char *v = 0,
const char *
c = 0);
784 void mk(
const char *n,
Int v,
const char *
c = 0);
785 void mk(
const char *n,
long v,
const char *
c = 0);
786 void mk(
const char *n,
float v,
const char *
c = 0);
787 void mk(
const char *n,
double v,
const char *
c = 0);
788 void mk(
const char *n,
Int r,
Int i,
const char *
c = 0);
789 void mk(
const char *n,
float r,
float i,
const char *
c = 0);
790 void mk(
const char *n,
double r,
double i,
const char *
c = 0);
794 void spaces(
const char *n = 0,
const char *
c = 0);
797 void comment(
const char *n = 0,
const char *
c = 0);
839 void parse(
const char *,
int);
864 const void *val,
const char *errmsg);
871 total(0), cursor(0) { }
880 int ndx) {
first();
return next(n,ndx); }
993 const char *
err(
int)
const;
1033 static void setNaN(
double &val);
1034 static void setNaN(
float &val);
static const ReservedFitsKeyword & user_def_item
FitsVADesc(const FitsVADesc &x)
FitsKeywordList & operator=(const FitsKeywordList &)
static const int resalpha[26]
static FITS::ValueType getfitstype(NoConvert< DComplex > x)
const char * aname() const
static int digit2bin(char c)
static const int no_items
IComplex asIComplex() const
FitsKeyword & operator=(const FitsKeyword &)
static const int minfltexp
FITS templated helper class.
FitsKeyword * next(const FITS::ReservedName &)
void parse(const char *, int)
For parsing a single string.
const char * parse_err(int) const
static void swap2(void *, void *, int)
std::complex< Float > Complex
static const ReservedFitsKeyword & error_item
static void setNaN(double &val)
For blanking purposes, we need to be able to get a NaN.
DComplex asDComplex() const
void mk(FITS::ReservedName k, Bool v, const char *c=0)
Add (make) a reserved keyword with the given value and optional comment The comment will be truncated...
void undefine()
ARO 2021-02-20: Removed the following function, because it seems incorrectly implemented and isn't us...
const FitsKeyword * next(const FITS::ReservedName &x, int n)
int essential_name(const char *, int) const
const ReservedFitsKeyword & spaces() const
FitsKeyCardTranslator(int=100)
void comment(const char *n=0, const char *c=0)
add a comment card
const ReservedFitsKeyword & kw() const
std::string toString() const
Convert the list to a string containing the 80-byte FITS headers.
int no_parse_errs() const
int isreserved(const char *, int) const
const ReservedFitsKeyword & userdef_item() const
void insert(FitsKeyword &)
FitsKeyword(const FitsKeyword &)
A word about friends: FitsKeywordList accesses the next and prev pointers and the FitsKeyword constru...
int build(char *, FitsKeywordList &)
static int localsize(FITS::ValueType t)
static void parse_vatform(const char *s, FITS::ValueType &valType, int &maxelem)
utility function to parse the binary table variable array column (i.e.
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
Complex asComplex() const
const char * asString() const
const ReservedFitsKeyword & end_item() const
static functions and enumerations
void init(const FitsKeyword &)
static FITS::ValueType getfitstype(NoConvert< IComplex > x)
static float tenpowerF[39]
FITS::ValueType type_
the keyword value
FITS::ValueType type() const
the datatype of the keyword
const ReservedFitsKeyword & err_item() const
static FITS::ValueType getfitstype(NoConvert< char > x)
static const ReservedFitsKeyword & history_item
void(* FITSErrorHandler)(const char *errMessage, FITSError::ErrorLevel severity)
Define a typedef for the handler function signature for convenience.
static Bool isa_letter(char)
helper class for FITS Binary Tables
static const int maxdblexp
HDUType
Types of FITS Header-Data Units.
static int ckaccum(double &, Int, int)
static void fmtcard(char *, const FitsKeyword &)
ValueType
FITS I/O Error message types.
static void fstr2str(char *, const char *, int)
const char * name() const
get info about the name
const char * comm() const
access the keyword comment
static int get_value_id(const char *s, int l, int &pos)
FitsBit & operator=(unsigned char x)
const FitsKeyword * operator()(int n)
static double tenD(Int, int)
const ReservedFitsKeyword & history() const
int err_cardno(int) const
static FITS::ValueType getfitstype(NoConvert< Int > x)
static const int maxfltexp
static void swap4(void *, void *, int)
static Bool isFP(const float *)
These functions are useful to tell if some type is a floating point type.
analyse the value of a header card
int rules(FitsKeyword &, FITSErrorHandler errhandler=FITSError::defaultHandler)
static void get_numeric(const char *s, int len, FitsValueResult &result)
const ReservedFitsKeyword & get_essential(int, Bool, FITS::ValueType, const void *, int, const char *&) const
static void l2f(void *, FitsLogical *, int)
const FitsKeyword * next()
FITS::ValueType type() const
const ReservedFitsKeyword & operator[](int i) const
const char * err(int) const
static float tenF(Int, int)
static FITS::ValueType getfitstype(NoConvert< double > x)
static Bool isa_digit(char c)
FitsDevice
Supported FITS Physical Devices.
void end()
add the end card.
std::complex< Double > DComplex
collection of reserved FITS keywords
Utility functions for floating point values.
FitsKeyword & parse(const char *, int)
void del()
delete the current keyword (the thing returned by curr()) from the list
const FitsKeyword * next(const char *x)
static FITS::ValueType getfitstype(NoConvert< FitsBit > x)
static int chk_comment(const char *s, int len)
static FITS::ValueType getfitstype(NoConvert< short > x)
const FitsKeyword * prev()
static const ReservedFitsKeyword & end__item
const FitsKeyword * curr()
const char * aname(FITS::ReservedName) const
static const float minfloat
static const double mindouble
static const ReservedFitsKeyword resword[]
bool Bool
Define the standard types used by Casacore.
void setval(const FITS::ValueType &, const void *, int)
static void f2l(FitsLogical *, void *, int)
data conversion routines: FITS - local
FitsRecType
Types of FITS Records.
list of read-only FITS keywords
static FITS::ValueType getfitstype(NoConvert< FitsVADesc > x)
FitsVADesc & operator=(const FitsVADesc &x)
const char * err(int) const
static int get_comment(const char *s, int len, int &begpos)
friend ostream & operator<<(ostream &o, const FitsVADesc &)
static void valstr(ostream &o, const ValueType &ty, const void *val)
static FITS::ValueType getfitstype(NoConvert< long > x)
void history(const char *c=0)
add a history card
char * comm_
the keyword comment if comm_ is 0, there is no comment
static ReservedFitsKeywordCollection & ResWord
static int letter2bin(char)
friend ostream & operator<<(ostream &o, const FitsLogical &)
char * name_
the keyword name if name_ is 0, keyword is not a user defined name if ndx is 0, there is no index ...
Bool requires_value(int) const
static const ReservedFitsKeyword & spaces_item
FITS::ReservedName name() const
FitsKeyword & make(const char *nm, FITS::ValueType t, const void *v, const char *c)
static const int maxsigdigits
static FITS::ValueType getfitstype(NoConvert< float > x)
void setcomm(const char *, int)
static Bool isa_text(char c)
FitsKeywordList & parse(const char *, FitsKeywordList &, int, FITSErrorHandler, Bool)
FitsKeyword * operator()(int)
Retrieve specific keywords – these also set the current mark.
int rules(const ReservedFitsKeyword &, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
FitsLogical & operator=(Bool x)
const ReservedFitsKeyword * kw_
static int trim_comment(const char *s, int len)
static const float maxfloat
linked list of FITS keywords
static FITS::ValueType getfitstype(NoConvert< Complex > x)
FitsKeyword & mkerr(const char *s, int len)
static double tenpowerD[309]
FitsArrayOption
Options on FITS array manipulations.
const Double c
Fundamental physical constants (SI units):
static FITS::ValueType getfitstype(NoConvert< unsigned char > x)
static void memchk(void *)
static void get_value(const char *s, int len, FitsValueResult &result)
analyse the name of a header card
const void * value() const
const FitsKeyword * next(const FITS::ReservedName &x)
ConstFitsKeywordList(FitsKeywordList &x)
const ReservedFitsKeyword & comment() const
static const int mindblexp
static const int maxexpdig
static const double maxdouble
Bool asBool() const
access the value of the keyword
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
translator between Keyword lists and fixed FITS cars
static void get_name(const char *s, int len, FitsNameResult &result)
const ReservedFitsKeyword & match(int, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
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 ...
static void swap8(void *, void *, int)
Variable Length Array Descriptor.
static const ReservedFitsKeyword & comment_item
static int fitssize(FITS::ValueType t)
static int str2fstr(char *, const char *, int)
int FitsLong
All FITS code seems to assume longs are 4 bytes.
void spaces(const char *n=0, const char *c=0)
add a spaces line
int err() const
access the error status
ReservedName
FITS Reserved Names.
static void defaultHandler(const char *errMessage, ErrorLevel severity)
The default error handler.
static FITS::ValueType getfitstype(NoConvert< FitsLogical > x)
STRING and FSTRING are used internally in parsing keywords.