Go to the documentation of this file.
28 # if !defined(AIPS_FITS)
32 # include <casacore/casa/aips.h>
35 # include <casacore/casa/iostream.h>
36 # include <casacore/casa/BasicSL/Complex.h>
37 # include <casacore/casa/BasicSL/IComplex.h>
38 # include <casacore/fits/FITS/FITSError.h>
48 class ReservedFitsKeywordCollection;
50 class FitsValueResult;
97 v = x.
v;
return *
this; }
99 v = (x ==
True ?
'T' :
'F');
return *
this; }
214 static void f2l(
char *,
void *,
int);
215 static void l2f(
void *,
char *,
int);
216 static void f2l(
unsigned char *,
void *,
int);
217 static void l2f(
void *,
unsigned char *,
int);
218 static void f2l(
short *,
void *,
int);
219 static void l2f(
void *,
short *,
int);
222 static void f2l(
long *,
void *,
int);
223 static void l2f(
void *,
long *,
int);
224 static void f2l(
float *,
void *,
int);
225 static void l2f(
void *,
float *,
int);
226 static void f2l(
double *,
void *,
int);
227 static void l2f(
void *,
double *,
int);
236 static void swap2(
void *,
void *,
int);
237 static void swap4(
void *,
void *,
int);
238 static void swap8(
void *,
void *,
int);
349 const char *
aname()
const;
355 # if defined(TURBOCPP)
386 const void *,
int,
const char *&)
const;
388 const void *,
int,
const char *&)
const;
392 const void *,
int,
const char *&)
const;
496 const char *
err(
int)
const;
534 const char *
name()
const;
544 const char *
comm()
const;
648 name_(0), kw_(0), comm_(0), val(0) {
init(k); }
675 return vallen ? (
const char *)
val :
""; }
679 cerr <<
"Unexpected keyword type in FitsKeyword::asInt()\n";
692 cerr <<
"Unexpected keyword type in asFloat()\n";
705 cerr <<
"Unexpected keyword type in asDouble()\n";
786 void mk(
const char *n,
Bool v,
const char *
c = 0);
787 void mk(
const char *n,
const char *v = 0,
const char *
c = 0);
788 void mk(
const char *n,
Int v,
const char *
c = 0);
789 void mk(
const char *n,
long v,
const char *
c = 0);
790 void mk(
const char *n,
float v,
const char *
c = 0);
791 void mk(
const char *n,
double v,
const char *
c = 0);
792 void mk(
const char *n,
Int r,
Int i,
const char *
c = 0);
793 void mk(
const char *n,
float r,
float i,
const char *
c = 0);
794 void mk(
const char *n,
double r,
double i,
const char *
c = 0);
798 void spaces(
const char *n = 0,
const char *
c = 0);
801 void comment(
const char *n = 0,
const char *
c = 0);
843 void parse(
const char *,
int);
868 const void *val,
const char *errmsg);
875 total(0), cursor(0) { }
884 int ndx) {
first();
return next(n,ndx); }
997 const char *
err(
int)
const;
const char * aname(FITS::ReservedName) const
static const ReservedFitsKeyword & comment_item
static int ckaccum(float &, Int, int)
static void fmtcard(char *, const FitsKeyword &)
std::string toString() const
Convert the list to a string containing the 80-byte FITS headers.
static void l2f(void *, char *, int)
static float tenF(Int, int)
static int chk_comment(const char *s, int len)
FitsKeyword & operator=(const FitsKeyword &)
void spaces(const char *n=0, const char *c=0)
add a spaces line
ReservedName
FITS Reserved Names.
void comm(const char *)
change the comment of the keyword
const ReservedFitsKeyword & history() const
static const ReservedFitsKeyword & user_def_item
FitsKeyword(const FitsKeyword &)
A word about friends: FitsKeywordList accesses the next and prev pointers and the FitsKeyword constru...
helper class for FITS Binary Tables
const char * err(int) const
static void f2l(float *, void *, int)
static void l2f(void *, FitsVADesc *, int)
Utility functions for floating point values.
FitsKeywordList & operator=(const FitsKeywordList &)
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...
const FitsKeyword * curr()
friend ostream & operator<<(ostream &o, const FitsVADesc &)
void init(const FitsKeyword &)
static const int no_items
FitsKeyword & make(const char *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)
static int str2fstr(char *, const char *, int)
static int digit2bin(char c)
static void l2f(void *, DComplex *, int)
static void swap2(void *, void *, int)
std::complex< Double > DComplex
static int localsize(FITS::ValueType t)
FitsKeyword & mkerr(const char *s, int len)
static void get_name(const char *s, int len, FitsNameResult &result)
const FitsKeyword * next(const FITS::ReservedName &x, int n)
static int fitssize(FITS::ValueType t)
void history(const char *c=0)
add a history card
FitsKeyword & parse(const char *, int)
static void f2l(FitsBit *, void *, int)
FitsVADesc & operator=(const FitsVADesc &x)
const FitsKeyword * next(const FITS::ReservedName &x)
int rules(const ReservedFitsKeyword &, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
static void l2f(void *, FitsBit *, int)
IComplex asIComplex() const
static FITS::ValueType getfitstype(NoConvert< Int > x)
static const float maxfloat
static void f2l(DComplex *, void *, int)
static const double maxdouble
static const int maxexpdig
const ReservedFitsKeyword & comment() const
FitsDevice
Supported FITS Physical Devices.
int err() const
access the error status
static void f2l(Complex *, void *, int)
static double tenD(Int, int)
Bool asBool() const
access the value of the keyword
const char * asString() const
FitsKeyword * operator()(int)
Retrieve specific keywords – these also set the current mark.
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
static void parse_vatform(const char *s, FITS::ValueType &valType, int &maxelem)
utility function to parse the binary table variable array column (i.e.
FitsLogical & operator=(const FitsLogical &x)
static void l2f(void *, short *, int)
const FitsKeyword * next(const char *x)
static const int maxdblexp
int err_cardno(int) const
static void f2l(FitsVADesc *, void *, int)
FitsLogical(const FitsLogical &x)
analyse the name of a header card
FitsKeywordList(const FitsKeywordList &)
const FitsKeyword * next()
static void l2f(void *, Complex *, int)
static FITS::ValueType getfitstype(NoConvert< IComplex > x)
static FITS::ValueType getfitstype(NoConvert< FitsBit > x)
ConstFitsKeywordList(FitsKeywordList &x)
void(* FITSErrorHandler)(const char *errMessage, FITSError::ErrorLevel severity)
Define a typedef for the handler function signature for convenience.
static const ReservedFitsKeyword & history_item
static const int maxsigdigits
Variable Length Array Descriptor.
static FITS::ValueType getfitstype(NoConvert< float > x)
static Bool isa_digit(char c)
static const int maxfltexp
analyse the value of a header card
static void swap8(void *, void *, int)
static Bool isa_text(char c)
FitsKeywordList(ConstFitsKeywordList &)
static functions and enumerations
const ReservedFitsKeyword & spaces() const
static FITS::ValueType getfitstype(NoConvert< char > x)
static const int minfltexp
static FITS::ValueType getfitstype(NoConvert< unsigned char > x)
FITS::ValueType type_
the keyword value
void end()
add the end card.
FitsVADesc(const FitsVADesc &x)
static void defaultHandler(const char *errMessage, ErrorLevel severity)
The default error handler.
int no_parse_errs() const
void del()
delete the current keyword (the thing returned by curr()) from the list
static void f2l(IComplex *, void *, int)
static void setNaN(float &val)
int build(char *, FitsKeywordList &)
const char * parse_err(int) const
FitsKeyword(const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)
constructs reserved keywords parms: resword, index, val, vallen, comm, commlen
static void valstr(ostream &o, const ValueType &ty, const void *val)
static void swap4(void *, void *, int)
static void l2f(void *, float *, int)
const char * aname() const
friend ostream & operator<<(ostream &o, const FitsLogical &)
ValueType
FITS I/O Error message types.
static FITS::ValueType getfitstype(NoConvert< double > x)
static void l2f(void *, FitsLogical *, int)
const char * name() const
get info about the name
static void f2l(char *, void *, int)
const ReservedFitsKeyword & userdef_item() const
int rules(FITSErrorHandler errhandler=FITSError::defaultHandler)
FitsKeywordList & parse(const char *, FitsKeywordList &, int, FITSErrorHandler, Bool)
void setval(const FITS::ValueType &, const void *, int)
static FITS::ValueType getfitstype(NoConvert< short > x)
static FITS::ValueType getfitstype(NoConvert< FitsVADesc > x)
static void get_numeric(const char *s, int len, FitsValueResult &result)
FitsKeyword * next(const FITS::ReservedName &, int)
DComplex asDComplex() const
void parse(const char *, int)
For parsing a single string.
void setcomm(const char *, int)
const ReservedFitsKeyword & kw() const
this file contains all the compiler specific defines
char * comm_
the keyword comment if comm_ is 0, there is no comment
FITS::ReservedName name() const
FitsKeyCardTranslator(int=100)
static void f2l(FitsLogical *, void *, int)
data conversion routines: FITS - local
const char * comm() const
access the keyword comment
static const float minfloat
const Double c
Fundamental physical constants (SI units):
static FITS::ValueType getfitstype(NoConvert< Complex > x)
FITS::ValueType type() const
static int ckaccum(double &, Int, int)
static Bool isa_letter(char)
static Bool isFP(const float *)
These functions are useful to tell if some type is a floating point type.
FitsKeyword * next(const FITS::ReservedName &)
const ReservedFitsKeyword & get_essential(int, Bool, FITS::ValueType, const void *, int, const char *&) const
static void l2f(void *, double *, int)
void insert(FitsKeyword &)
static void fstr2str(char *, const char *, int)
static int get_comment(const char *s, int len, int &begpos)
static void get_value(const char *s, int len, FitsValueResult &result)
const ReservedFitsKeyword * kw_
static const ReservedFitsKeyword & end__item
translator between Keyword lists and fixed FITS cars
static float tenpowerF[39]
FITS::ValueType type() const
the datatype of the keyword
char * name_
the keyword name if name_ is 0, keyword is not a user defined name if ndx is 0, there is no index
static FITS::ValueType getfitstype(NoConvert< FitsLogical > x)
STRING and FSTRING are used internally in parsing keywords.
static const ReservedFitsKeyword & spaces_item
static const ReservedFitsKeyword resword[]
static Bool isFP(const void *)
const ReservedFitsKeyword & get(FITS::ReservedName, Bool, FITS::ValueType, const void *, int, const char *&) const
static void f2l(unsigned char *, void *, int)
HDUType
Types of FITS Header-Data Units.
const FitsKeyword * prev()
static Bool isFP(const double *)
void comment(const char *n=0, const char *c=0)
add a comment card
FitsKeyword * next(const char *)
Complex asComplex() const
const ReservedFitsKeyword & end_item() const
int isreserved(const char *, int) const
static const double mindouble
FitsBit & operator=(const FitsBit &x)
bool Bool
Define the standard types used by Casacore.
static ReservedFitsKeywordCollection & ResWord
std::complex< Float > Complex
static void f2l(long *, void *, int)
linked list of FITS keywords
collection of reserved FITS keywords
const void * value() const
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
static void setNaN(double &val)
For blanking purposes, we need to be able to get a NaN.
void name(const char *)
change the name of the keyword
static int trim_comment(const char *s, int len)
static void l2f(void *, IComplex *, int)
static void f2l(double *, void *, int)
const ReservedFitsKeyword & get(const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
int essential_name(const char *, int) const
list of read-only FITS keywords
const ReservedFitsKeyword & err_item() const
static void err(const char *, const FITS::ValueType &, const void *, const char *)
FitsArrayOption
Options on FITS array manipulations.
static void f2l(short *, void *, int)
const ReservedFitsKeyword & operator[](int i) const
static FITS::ValueType getfitstype(NoConvert< long > x)
static const int resalpha[26]
FitsKeyword & make(FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
static void l2f(void *, Int *, int)
static void l2f(void *, unsigned char *, int)
Bool requires_value(int) const
FitsKeyword(const char *, int, FITS::ValueType, const void *, int, const char *, int)
private constructors for use by friends
const char * err(int) const
static const int mindblexp
FitsBit(const FitsBit &x)
int rules(FitsKeyword &, FITSErrorHandler errhandler=FITSError::defaultHandler)
const FitsKeyword * operator()(int n)
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 int get_value_id(const char *s, int l, int &pos)
static int letter2bin(char)
static const ReservedFitsKeyword & error_item
const ReservedFitsKeyword & match(int, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
static void memchk(void *)
static double tenpowerD[309]
FitsRecType
Types of FITS Records.
static void l2f(void *, long *, int)
static void f2l(Int *, void *, int)
static FITS::ValueType getfitstype(NoConvert< DComplex > x)