casacore
fits.h
Go to the documentation of this file.
1 //# fits.h:
2 //# Copyright (C) 1993,1994,1995,1996,1997,1999,2000,2001,2003,2004
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 # if !defined(AIPS_FITS)
29 # define AIPS_FITS
30 
31 //# Note that aips.h has to come first for the correct definition of off_t.
32 # include <casacore/casa/aips.h>
33 # include <stdlib.h>
34 # include <ctype.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>
39 
40 namespace casacore { //# NAMESPACE CASACORE - BEGIN
41 
42 //# All FITS code seems to assume longs are 4 bytes. Currently
43 //# this corresponds to an "int" on all useful platforms.
44  typedef Int FitsLong;
45 //# recovered by GYL
46 
47 //# Forward declarations
48 class ReservedFitsKeywordCollection;
49 class FitsNameResult;
50 class FitsValueResult;
51 class FitsKeyword;
52 class FitsParse;
53 
54 //<summary> FITS templated helper class </summary>
55 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
56 // </reviewed>
57 //<synopsis>
58 // NoConvert is a template class that is not intended for
59 // general use, it is used internally.
60 //</synopsis>
61 
62 template <class TYPE>
63 class NoConvert {
64  public:
65  NoConvert() { }
66  void operator = (int) {; }
67 };
68 
69 //<summary> FITS helper class </summary>
70 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
71 // </reviewed>
72 //<synopsis>
73 // FitsLogical is a helper class that is not intended for
74 // general use.
75 //</synopsis>
76 //<example>
77 // Here is an example of the FitsLogical class.
78 //<srcblock>
79 // FitsLogical x;
80 // FitsLogical y(True);
81 // FitsLogical z = x;
82 // ...
83 // x = y; y = False; x.undefine();
84 // Bool b;
85 // if (x.isdefined())
86 // b = x;
87 // b = y; If y is undefined, b will be false.
88 //</srcblock>
89 //</example>
90 class FitsLogical {
91  friend ostream & operator << (ostream &o, const FitsLogical &);
92  public:
93  FitsLogical() : v('\0') { }
94  FitsLogical(Bool x) : v(x == True ? 'T' : 'F') { }
96  v = (x == True ? 'T' : 'F'); return *this; }
100  void undefine() { v = '\0'; }
101  operator Bool() const { return v == 'T'; }
102  protected:
103  char v;
104 };
105 
106 //<summary> helper class for FITS Binary Tables </summary>
107 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
108 // </reviewed>
109 //<synopsis>
110 // This class is not intended for general use. It only has meaning
111 // in the context of FITS Binary tables. There its use is incorporated
112 // into the concept of a FitsField, where FitsBit is given a specialized
113 // interpretation.
114 //</synopsis>
115 
116 class FitsBit {
117  public:
118  FitsBit() : bit_array(0) { }
119  FitsBit(unsigned char x) : bit_array(x) { }
120  FitsBit & operator = (unsigned char x) { bit_array = x; return *this; }
121  operator unsigned char() const { return bit_array; }
122  protected:
123  unsigned char bit_array;
124 };
125 
126 //<summary> Variable Length Array Descriptor </summary>
127 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
128 // </reviewed>
129 
130 class FitsVADesc {
131  friend ostream & operator << (ostream &o, const FitsVADesc &);
132  public:
134  FitsVADesc(const FitsVADesc &x) :
138  rel_offset = x.rel_offset; return *this; }
139  FitsVADesc(int n, int o) : no_elements(n), rel_offset(o) { }
140  void set(int n, int o) { no_elements = n; rel_offset = o; }
141  int num() const { return no_elements; }
142  int offset() const { return rel_offset; }
143  protected:
146 };
147 
148 //<summary> static functions and enumerations </summary>
149 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
150 // </reviewed>
151 //<synopsis>
152 // Many of the static functions are utility functions used internally in the
153 // implementation of the member functions of the FITS classes. They are placed
154 // in a single class to encapsulate them and to avoid adding many names to the
155 // global name space. More important, from the user's perspective, are the
156 // enumerations. They form the basic vocabulary of a FITS application. For example,
157 // instead of referring to the FITS <src>NAXIS</src> keyword,
158 // <src>FITS::NAXIS</src> should be used
159 //</synopsis>
160 
161 class FITS {
162  public:
163 
164  // FITS I/O Error message types
165 
166  // Basic FITS Data Types for keywords and data
167  enum ValueType {
168  NOVALUE = 0, LOGICAL = 1, BIT = 2, CHAR = 3, BYTE = 4,
169  SHORT = 5, LONG = 6, FLOAT = 7, DOUBLE = 8, COMPLEX = 9,
170  ICOMPLEX = 10, DCOMPLEX = 11, VADESC = 12,
172  }; // REAL means either FLOAT or DOUBLE
173  // STRING and FSTRING are used internally in parsing keywords
174 
176  x=0; return FITS::LOGICAL; }
178  x=0; return FITS::BIT; }
180  x=0; return FITS::CHAR; }
182  x=0; return FITS::BYTE; }
184  x=0; return FITS::SHORT; }
186  x=0; return FITS::LONG; }
188  x=0; return FITS::LONG; }
190  x=0; return FITS::FLOAT; }
192  x=0; return FITS::DOUBLE; }
194  x=0; return FITS::COMPLEX; }
196  x=0; return FITS::ICOMPLEX; }
198  x=0; return FITS::DCOMPLEX; }
200  x=0; return FITS::VADESC; }
201 
202  static int fitssize(FITS::ValueType t);
203  static int localsize(FITS::ValueType t);
204 
205  // data conversion routines: FITS - local
206  static void f2l(FitsLogical *,void *,int);
207  static void l2f(void *,FitsLogical *,int);
208  static void f2l(FitsBit *,void *,int);
209  static void l2f(void *,FitsBit *,int);
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);
224  static void f2l(Complex *,void *,int);
225  static void l2f(void *,Complex *,int);
226  static void f2l(IComplex *,void *,int);
227  static void l2f(void *,IComplex *,int);
228  static void f2l(DComplex *,void *,int);
229  static void l2f(void *,DComplex *,int);
230  static void f2l(FitsVADesc *,void *,int);
231  static void l2f(void *,FitsVADesc *,int);
232  static void swap2(void *, void *, int);
233  static void swap4(void *, void *, int);
234  static void swap8(void *, void *, int);
235 
236  // FITS Reserved Names. PZERO is named strangely because it can conflict with
237  // a standard #define in sys/param.h.
249  };
250 
251  // Types of FITS Records
252  enum FitsRecType {
255  };
256 
257  // Supported FITS Physical Devices
258  enum FitsDevice {
260  };
261 
262  // Types of FITS Header-Data Units
263  enum HDUType {
267  };
268 
269  // Options on FITS array manipulations
270  enum FitsArrayOption { NoOpt = 0, CtoF = 1, FtoC = 2};
271 
273  static void valstr(ostream &o, const ValueType &ty, const void *val);
274  static Bool isa_digit(char c);
275  static int digit2bin(char c);
276  static Bool isa_text(char c);
277  static Bool isa_letter(char);
278  static int letter2bin(char);
279  static void fstr2str(char *, const char *, int);
280  static int str2fstr(char *, const char *, int);
281  static void get_name(const char *s, int len, FitsNameResult &result);
282  static int get_value_id(const char *s, int l, int &pos);
283  static void get_value(const char *s, int len, FitsValueResult &result);
284  static int trim_comment(const char *s, int len);
285  static int chk_comment(const char *s, int len);
286  static int get_comment(const char *s, int len, int &begpos);
287  static void get_numeric(const char *s, int len, FitsValueResult &result);
288  // utility function to parse the binary table variable array
289  // column (i.e. uses the heap) of the form nPt(dddd) where n
290  // is either 0 or 1, t is one of the standard FITS binary table
291  // column types and dddd is the maximum number of elements used
292  // by this column. If there is a format error in the input
293  // string (*s), then valType will have the value NOVALUE and
294  // maxelem will be -1.
295  static void parse_vatform(const char *s, FITS::ValueType &valType,
296  int &maxelem);
297  static const Int minInt;
298  static const Int maxInt;
299  static const float minfloat;
300  static const float maxfloat;
301  static const double mindouble;
302  static const double maxdouble;
303 
304  private:
305  FITS();
306  static double tenpowerD[309];
307  static float tenpowerF[39];
308  static const int minfltexp;
309  static const int maxfltexp;
310  static const int mindblexp;
311  static const int maxdblexp;
312  static const int maxsigdigits;
313  static const int maxdigl; // max digits in a long
314  static const int maxexpdig; // max digits in an exponent
315  static double tenD(Int, int);
316  static float tenF(Int, int);
317  static int ckaccum(double &, Int, int);
318  static int ckaccum(float &, Int, int);
319 };
320 
321 inline FITS::FITS() { } // just a dummy function to prevent instantiation
322 inline Bool FITS::isa_digit(char c) { return isdigit(c) ? True : False; }
323 inline int FITS::digit2bin(char c) { return c - '0'; }
324 inline Bool FITS::isa_text(char c) { return isprint(c) ? True : False; }
325 inline Bool FITS::isa_letter(char c) { return isupper(c) ? True : False; }
326 inline int FITS::letter2bin(char c) { return c - 'A'; }
327 
328 ostream & operator << (ostream &, const FITS::ValueType &);
329 
330 inline double FITS::tenD(Int numb, int pow) {
331  return (pow > 0) ? (((double)numb) * tenpowerD[pow]) :
332  ((pow < 0) ? (((double)numb) / tenpowerD[-pow]) : ((double)numb));
333 }
334 inline float FITS::tenF(Int numb, int pow) {
335  return (pow > 0) ? (((float)numb) * tenpowerF[pow]) :
336  ((pow < 0) ? (((float)numb) / tenpowerF[-pow]) : ((float)numb));
337 }
338 
339 //<summary> reserved FITS keyword </summary>
340 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
341 // </reviewed>
342 
344  public:
345  const char *aname() const;
347  int namesize() const;
348  FITS::ValueType type() const;
349  Bool isindexed() const;
350  Bool isessential() const;
351 # if defined(TURBOCPP)
352  // It is best for the following to be private, but
353  // C-Front won't allow an initializer list if they are private.
354  // This issue isn't that crucial since functions in
355  // ReservedFitsKeywordCollection always return const items.
356  private:
357 # endif
359  const char *aname_;
362  Bool isindexed_; // 0 = NOT INDEXED, 1 = INDEXED
363  Bool isessential_; // 0 = NO, 1 = YES
364 };
365 
366 inline const char *ReservedFitsKeyword::aname() const { return aname_; }
367 inline int ReservedFitsKeyword::namesize() const { return namesize_; }
371  return isessential_; }
372 
373 //<summary> collection of reserved FITS keywords </summary>
374 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
375 // </reviewed>
376 
378  public:
379  const ReservedFitsKeyword & operator [] (int i) const;
380  int no() const;
382  const void *, int, const char *&) const;
383  const ReservedFitsKeyword &get(const char *, int, Bool, FITS::ValueType,
384  const void *, int, const char *&) const;
385  const char *aname(FITS::ReservedName) const;
386  int essential_name(const char *, int) const;
388  const void *, int, const char *&) const;
389  int isreserved(const char *, int) const;
390  Bool isunique(int) const;
391  Bool requires_value(int) const;
392  const ReservedFitsKeyword &userdef_item() const;
393  const ReservedFitsKeyword &err_item() const;
394  const ReservedFitsKeyword &end_item() const;
395  const ReservedFitsKeyword &spaces() const;
396  const ReservedFitsKeyword &comment() const;
397  const ReservedFitsKeyword &history() const;
398  int rules(const ReservedFitsKeyword &, const char *, int, Bool,
399  FITS::ValueType, const void *, int, const char *&) const;
400  private:
401  static const int no_items; // number of entries in the table
402  static const ReservedFitsKeyword &user_def_item; // user-defined keyword
403  static const ReservedFitsKeyword &error_item; // error in keyword
408  static const ReservedFitsKeyword resword[]; // table of reserved words
409  static const int resalpha[26]; // alphabetic index to table
410  const ReservedFitsKeyword &match(int, const char *, int, Bool,
411  FITS::ValueType, const void *, int, const char *&) const;
412 
413 };
414 
416  operator [] (int i) const { return resword[i]; }
417 inline int ReservedFitsKeywordCollection::no() const { return no_items; }
419  return (Bool)(resword[i + 1].name() != resword[i].name()); }
421  const { return user_def_item; }
423  const { return error_item; }
425  const { return end__item; }
427  const { return spaces_item; }
429  const { return comment_item; }
431  const { return history_item; }
432 
433 //<summary> analyse the name of a header card </summary>
434 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
435 // </reviewed>
436 //<synopsis>
437 // Analyse the name of a header card
438 //</synopsis>
439 
441  public:
442  Bool isaname; // 1 if there is a name present, otherwise 0
443  int begpos; // beginning position of name
444  int endpos; // ending position of name
445  Bool isaindex; // whether an index is present or not
446  int index; // index if present
447  int len; // length of name without index
448  enum ErrMsg { OK = 0, NO_0_NDX };
450 };
451 
452 //<summary> analyse the value of a header card </summary>
453 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
454 // </reviewed>
455 //<synopsis>
456 // Analyse the value of a header card
457 //</synopsis>
458 
460  public:
462  union {
464  int s[2]; // for strings, s[0] is offset, s[1] length
466  float f;
467  double d;
468  };
472  int begpos; // beginning position of value
473  int endpos; // ending position of value
474  Bool isa_point; // 1 if a point, otherwise 0
475  int pointpos; // position of point, if any
476  int no_sig; // number of significant digits
477  const char *errmsg; // error message, if any
478 };
479 
480 //<summary> parse a header card </summary>
481 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
482 // </reviewed>
483 //<synopsis>
484 // parse a header card
485 //</synopsis>
486 
487 class FitsParse {
488  friend class FitsKeywordList;
489  public:
490  FitsKeyword &parse(const char *, int); // Parsing one string
491  int no_errs() const;
492  const char *err(int) const;
493  private:
494  FitsParse(int = 10);
495  ~FitsParse();
496  int no_errs_;
497  const int max_errs;
498  const char **err_;
499  int seterr(const char *);
500  FitsKeyword &mkerr(const char *s, int len);
501 };
502 
503 inline FitsParse::~FitsParse() { delete [] err_; }
504 inline int FitsParse::no_errs() const { return no_errs_; }
505 inline const char *FitsParse::err(int i) const { return err_[i]; }
506 inline int FitsParse::seterr(const char *s) {
507  return no_errs_ < max_errs ? ( err_[no_errs_++] = s, 0) : -1; }
508 
509 //<summary> FITS keyword </summary>
510 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
511 // </reviewed>
512 //<synopsis>
513 // A FITS keyword contains a name, a value and a comment.
514 //</synopsis>
515 class FitsKeyword {
516  friend class FitsKeywordList;
517  friend class FitsParse;
518  // A word about friends: FitsKeywordList accesses the next and prev
519  // pointers and the FitsKeyword constructors.
520  // FitsParse only accesses the FitsKeyword constructors.
521 
522  public:
523 
524  FitsKeyword(const FitsKeyword &);
526  ~FitsKeyword();
527 
528  //<group>
529  // get info about the name
530  const char *name() const;
531  int namelen() const;
532  Bool isreserved() const;
533  Bool isindexed() const;
534  const ReservedFitsKeyword &kw() const;
535  int index() const;
536  //</group>
537 
538  //<group>
539  // access the keyword comment
540  const char *comm() const;
541  int commlen() const;
542  //</group>
543 
544  // access the error status
545  int err() const;
546 
547  // the datatype of the keyword
548  FITS::ValueType type() const;
549 
550  // access the value of the keyword
551  //<group>
552  Bool asBool() const;
553  const char *asString() const;
554  int valStrlen() const;
555  Int asInt() const;
556  float asFloat() const;
557  double asDouble() const;
558  IComplex asIComplex() const;
559  Complex asComplex() const;
560  DComplex asDComplex() const;
561  const void *value() const;
562  //</group>
563 
564  // change the value of the keyword
565  //<group>
567  FitsKeyword & operator = (const char *);
569  FitsKeyword & operator = (float);
570  FitsKeyword & operator = (double);
574  //</group>
575 
576  // change the comment of the keyword
577  void comm(const char *);
578 
579  // change the name of the keyword
580  void name(const char *);
581 
582  private:
585 
586  //<group>
587  // the keyword name
588  // if name_ is 0, keyword is not a user defined name
589  // if ndx is 0, there is no index
590  char *name_;
592  int ndx;
593  short namelen_;
594  //</group>
595 
596  //<group>
597  // the keyword comment
598  // if comm_ is 0, there is no comment
599  char *comm_;
600  short commlen_;
601  //</group>
602 
603 
604  //<group>
605  // the keyword value
607  union {
610  float fval;
611  double dval;
612  };
613  void *val; // pointer to allocated value, if any
614  short vallen; // only used for string data
615  void del_val(); // does an appropriate delete based on type
616  //</group>
617 
618  void init(const FitsKeyword &);
619  void setval(const FITS::ValueType &, const void *, int);
620  void setcomm(const char *, int);
621  static void err(const char *, const FITS::ValueType &, const void *,
622  const char *);
623  static void memchk(void *);
624 
625  //<group>
626  // private constructors for use by friends
627 
628  // constructs user-defined keywords
629  // parms: name, namelen, type, val, vallen, comm, commlen
630  FitsKeyword(const char *, int ,
631  FITS::ValueType, const void *, int, const char *, int);
632  // constructs reserved keywords
633  // parms: resword, index, val, vallen, comm, commlen
635  FITS::ValueType, const void *, int, const char *, int);
636  //</group>
637 
638 
639 };
640 
641 ostream & operator << (ostream &, const FitsKeyword &);
642 
643 inline FitsKeyword::FitsKeyword(const FitsKeyword &k) : next_(0), prev_(0),
644  name_(0), kw_(0), comm_(0), val(0) { init(k); }
646  delete [] name_; delete [] comm_; del_val(); init(k); return *this; }
648  delete [] name_;
649  delete [] comm_;
650  del_val();
651 }
652 
653 inline const ReservedFitsKeyword &FitsKeyword::kw() const { return *kw_; }
654 inline Bool FitsKeyword::isreserved() const { return
655  (kw().name() != FITS::ERRWORD && kw().name() != FITS::USER_DEF)
656  ? True : False; }
657 inline const char *FitsKeyword::name() const {
658  return isreserved() ? kw().aname() : (namelen_ ? name_ : ""); }
659 inline int FitsKeyword::namelen() const { return namelen_; }
660 inline Bool FitsKeyword::isindexed() const {return ndx > 0 ? True : False;}
661 inline int FitsKeyword::index() const { return ndx; }
662 
663 inline const char *FitsKeyword::comm() const {
664  return comm_ ? comm_ : ""; }
665 inline int FitsKeyword::commlen() const { return commlen_; }
666 inline int FitsKeyword::err() const { return (kw().name() == FITS::ERRWORD); }
667 inline FITS::ValueType FitsKeyword::type() const { return type_; }
668 
669 inline Bool FitsKeyword::asBool() const { return bval; }
670 inline const char *FitsKeyword::asString() const {
671  return vallen ? (const char *)val : ""; }
672 inline int FitsKeyword::valStrlen() const { return vallen; }
673 inline Int FitsKeyword::asInt() const {
674  if( type() != FITS::LONG ) {
675  cerr << "Unexpected keyword type in FitsKeyword::asInt()\n";
676  exit(1);
677  }
678  return ival;
679 }
680 inline float FitsKeyword::asFloat() const {
681  switch( type() ) {
682  case FITS::BYTE:
683  case FITS::SHORT:
684  case FITS::LONG: return (float)ival;
685  case FITS::FLOAT: return fval;
686  case FITS::DOUBLE: return (float)dval;
687  default:
688  cerr << "Unexpected keyword type in asFloat()\n";
689  exit(1);
690  }
691  return 0.0;
692 }
693 inline double FitsKeyword::asDouble() const {
694  switch( type() ) {
695  case FITS::BYTE:
696  case FITS::SHORT:
697  case FITS::LONG: return (double)ival;
698  case FITS::FLOAT: return (double)fval;
699  case FITS::DOUBLE: return dval;
700  default:
701  cerr << "Unexpected keyword type in asDouble()\n";
702  exit(1);
703  }
704  return 0.0;
705 }
707  return *((IComplex *)val); }
709  return *((Complex *)val); }
711  return *((DComplex *)val); }
712 
714  bval = x; type_ = FITS::LOGICAL; return *this; }
716  ival = x; type_ = FITS::LONG; return *this; }
718  fval = x; type_ = FITS::FLOAT; return *this; }
720  dval = x; type_ = FITS::DOUBLE; return *this; }
722  *((IComplex *)val) = x; type_ = FITS::ICOMPLEX; return *this; }
724  *((Complex *)val) = x; type_ = FITS::COMPLEX; return *this; }
726  *((DComplex *)val) = x; type_ = FITS::DCOMPLEX; return *this; }
727 
728 class ConstFitsKeywordList; // forward declaration
729 
730 //<summary> linked list of FITS keywords </summary>
731 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
732 // </reviewed>
733 //<synopsis>
734 // A linked list of FITS keywords.
735 //</synopsis>
736 
738  public:
739  FitsKeywordList();
744 
745  // Convert the list to a string containing the 80-byte FITS headers.
746  std::string toString() const;
747 
748  // delete the current keyword (the thing returned by curr()) from the list
749  void del();
750 
751  // Add (make) a reserved keyword with the given value and optional comment
752  // The comment will be truncated if necessary to fit the available space.
753  // String values must be less than 69 characters. String values longer than
754  // that will result in an ERROR keyword instead of the desired keyword.
755  // <group>
756  void mk(FITS::ReservedName k, Bool v, const char *c = 0);
757  void mk(FITS::ReservedName k, const char *v = 0, const char *c = 0);
758  void mk(FITS::ReservedName k, Int v, const char *c = 0);
759  void mk(FITS::ReservedName k, long v, const char *c = 0);
760  void mk(FITS::ReservedName k, double v, const char *c = 0);
761  // </group>
762 
763  // Add (make) an indexed reserved keyword with the given value and optional comment
764  // The comment will be truncated if necessary to fit the available space.
765  // String values must be less than 69 characters. String values longer than
766  // that will result in an ERROR keyword instead of the desired keyword.
767  // <group>
768  void mk(int n, FITS::ReservedName k, Bool v, const char *c = 0);
769  void mk(int n, FITS::ReservedName k, const char *v, const char *c = 0);
770  void mk(int n, FITS::ReservedName k, Int v, const char *c = 0);
771  void mk(int n, FITS::ReservedName k, long v, const char *c = 0);
772  void mk(int n, FITS::ReservedName k, double v, const char *c = 0);
773  // </group>
774 
775  // Add (make) a user defined keyword with the given name, value and optional comment.
776  // The comment will be truncated if necessary to fit the available space.
777  // The name must be no longer than 8 characters. Names longer than that will
778  // result in an ERROR keyword instead of the desired keyword.
779  // String values must no longer than 69 characters. String values longer than
780  // that will result in an ERROR keyword instead of the desired keyword.
781  // <group>
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);
791  // </group>
792 
793  // add a spaces line
794  void spaces(const char *n = 0, const char *c = 0);
795 
796  // add a comment card
797  void comment(const char *n = 0, const char *c = 0);
798 
799  // add a history card
800  void history(const char *c = 0);
801 
802  // add the end card. This must be at the end of the list.
803  void end();
804 
805  // Retrieve specific keywords -- these also set the current mark
806  //<group>
807  // return the i-th keyword -- keyword numbering starts with 0
809  // return first and next non-indexed reserved keyword
812  // return first and next indexed reserved keyword
815  // return first and next user-defined keyword
816  FitsKeyword * operator () (const char *);
817  FitsKeyword * next(const char *);
818  //</group>
819 
820  //<group>
821  Bool isempty() const;
822  void first();
823  void last();
826  FitsKeyword *curr();
827  //</group>
828 
829  //<group>
830  void delete_all();
835  //</group>
836 
837  //<group>
838  // For parsing a single string
839  void parse(const char *, int);
840  int no_parse_errs() const;
841  const char *parse_err(int) const;
842  //</group>
843 
845  private:
849  int total;
850  int cursor;
851  FitsKeyword &make(const char *nm,
852  FITS::ValueType t, const void *v, const char *c);
854  FITS::ValueType t, const void *v, const char *c);
856  FITS::ValueType t, const void *v, const char *c);
857  // construct an error keyword - this happens when a name is invalid (NULL
858  // or more than 8 characters) or a string value is too long (more than
859  // 69 characters). It is the responsibility of the caller to the
860  // several mk functions to ensure that that doesn't happen. By the time
861  // it gets here, it is assumed that such problems are true errors.
862  // This is used by the private make functions.
863  FitsKeyword &makeErrKeyword(const char *name, FITS::ValueType type,
864  const void *val, const char *errmsg);
866 };
867 
868 ostream & operator << (ostream &o, FitsKeywordList &); // print the entire list
869 
870 inline FitsKeywordList::FitsKeywordList() : beg_(0), end_(0), pos(0),
871  total(0), cursor(0) { }
873 inline Bool FitsKeywordList::isempty() const { return total == 0 ? True : False; }
874 inline void FitsKeywordList::first() { cursor = 0; pos = beg_; }
875 inline void FitsKeywordList::last() { cursor = total; pos = end_; }
876 inline FitsKeyword *FitsKeywordList::curr() { return pos; }
878  first(); return next(n); }
880  int ndx) { first(); return next(n,ndx); }
882  first(); return next(w); }
883 inline void FitsKeywordList::parse(const char *s, int l) {
884  insert(card.parse(s,l)); }
885 inline int FitsKeywordList::no_parse_errs() const { return card.no_errs();}
886 inline const char *FitsKeywordList::parse_err(int n) const {
887  return card.err(n); }
888 
889 // FitsKeyword constructors for non-indexed Reserved keywords
890 inline void FitsKeywordList::mk(FITS::ReservedName k, Bool v, const char *c) {
891  insert(make(k,FITS::LOGICAL,&v,c)); }
892 inline void FitsKeywordList::mk(FITS::ReservedName k, const char *v,
893  const char *c) { insert(make(k,FITS::STRING,v,c)); }
894 inline void FitsKeywordList::mk(FITS::ReservedName k, Int v, const char *c) {
895  insert(make(k,FITS::LONG,&v,c)); }
896 inline void FitsKeywordList::mk(FITS::ReservedName k, long v, const char *c) {
897  insert(make(k,FITS::LONG,&v,c)); }
898 inline void FitsKeywordList::mk(FITS::ReservedName k, double v, const char *c) {
899  insert(make(k,FITS::DOUBLE,&v,c)); }
900 // FitsKeyword constructors for indexed Reserved keywords
901 inline void FitsKeywordList::mk(int n, FITS::ReservedName k, Bool v,
902  const char *c) {
903  Bool tmp; tmp = v; insert(make(n,k,FITS::LOGICAL,&tmp,c)); }
904 inline void FitsKeywordList::mk(int n, FITS::ReservedName k, const char *v,
905  const char *c) { insert(make(n,k,FITS::STRING,v,c)); }
906 inline void FitsKeywordList::mk(int n, FITS::ReservedName k, Int v,
907  const char *c) { insert(make(n,k,FITS::LONG,&v,c)); }
908 inline void FitsKeywordList::mk(int n, FITS::ReservedName k, long v,
909  const char *c) { insert(make(n,k,FITS::LONG,&v,c)); }
910 inline void FitsKeywordList::mk(int n, FITS::ReservedName k, double v,
911  const char *c) { insert(make(n,k,FITS::DOUBLE,&v,c)); }
912 // FitsKeyword constructors for User-Defined keywords
913 inline void FitsKeywordList::mk(const char *n, Bool v, const char *c) {
914  Bool tmp; tmp = v; insert(make(n,FITS::LOGICAL,&tmp,c)); }
915 inline void FitsKeywordList::mk(const char *n, const char *v, const char *c) {
916  insert(make(n,FITS::STRING,v,c)); }
917 inline void FitsKeywordList::mk(const char *n, Int v, const char *c) {
918  insert(make(n,FITS::LONG,&v,c)); }
919 inline void FitsKeywordList::mk(const char *n, long v, const char *c) {
920  insert(make(n,FITS::LONG,&v,c)); }
921 inline void FitsKeywordList::mk(const char *n, float v, const char *c) {
922  insert(make(n,FITS::FLOAT,&v,c)); }
923 inline void FitsKeywordList::mk(const char *n, double v, const char *c) {
924  insert(make(n,FITS::DOUBLE,&v,c)); }
925 inline void FitsKeywordList::mk(const char *n, Int r, Int i, const char *c) {
926  IComplex v(r,i);
927  insert(make(n,FITS::ICOMPLEX,&v,c)); }
928 inline void FitsKeywordList::mk(const char *n, float r, float i, const char *c)
929  { Complex v(r,i); insert(make(n,FITS::COMPLEX,&v,c)); }
930 inline void FitsKeywordList::mk(const char *n, double r, double i,
931  const char *c) { DComplex v(r,i);
932  insert(make(n,FITS::DCOMPLEX,&v,c)); }
933 // Additional keyword constructors for commentary, etc.
934 inline void FitsKeywordList::spaces(const char *n, const char *c) {
935  insert((n == 0 ? make(FITS::SPACES,FITS::NOVALUE,0,c) :
936  (c == 0 ? make(FITS::SPACES,FITS::NOVALUE,0,n) :
937  make(n,FITS::NOVALUE,0,c)))); }
938 inline void FitsKeywordList::comment(const char *n, const char *c) {
939  insert((n == 0 ? make(FITS::COMMENT,FITS::NOVALUE,0,c) :
940  (c == 0 ? make(FITS::COMMENT,FITS::NOVALUE,0,n) :
941  make(n,FITS::NOVALUE,0,c)))); }
942 inline void FitsKeywordList::history(const char *c) {
944 inline void FitsKeywordList::end() {
946 
947 //<summary> list of read-only FITS keywords </summary>
948 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
949 // </reviewed>
950 
952  public:
954 
955  const FitsKeyword * operator () (int n) { return kw(n); }
957  return kw(x); }
958  const FitsKeyword * next(const FITS::ReservedName &x) {
959  return kw.next(x); }
960  const FitsKeyword * operator () (const FITS::ReservedName &x, int n) {
961  return kw(x,n); }
962  const FitsKeyword * next(const FITS::ReservedName &x, int n) {
963  return kw.next(x,n); }
964  const FitsKeyword * operator () (const char *x) { return kw(x); }
965  const FitsKeyword * next(const char *x) { return kw.next(x); }
966 
967  Bool isempty() const { return kw.isempty(); }
968  void first() { kw.first(); }
969  void last() { kw.last(); }
970  const FitsKeyword *next() { return kw.next(); }
971  const FitsKeyword *prev() { return kw.prev(); }
972  const FitsKeyword *curr() { return kw.curr(); }
973 
974  private:
976 };
977 
978 //<summary> translator between Keyword lists and fixed FITS cars </summary>
979 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
980 // </reviewed>
981 //<synopsis>
982 // also contains the parser ???
983 //</synopsis>
984 
986  public:
989  FitsKeywordList & parse(const char *,
991  int build(char *, FitsKeywordList &);
992  int no_errs() const;
993  const char *err(int) const;
994  int err_cardno(int) const;
995  static void fmtcard(char *, const FitsKeyword &);
996  private:
997  int cardno; // the current card number within record
998  const int FitsCardSize;
999  const int FitsMaxCard;
1000  const int FitsRecSize;
1003  const char **err_;
1005  char *blanks;
1006 };
1007 
1009  delete [] err_; delete [] err_cardno_; delete [] blanks; }
1010 inline int FitsKeyCardTranslator::no_errs() const { return no_errs_; }
1011 inline const char *FitsKeyCardTranslator::err(int i) const { return err_[i]; }
1012 inline int FitsKeyCardTranslator::err_cardno(int i) const {
1013  return err_cardno_[i]; }
1014 
1015 // <summary>Utility functions for floating point values</summary>
1016 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos="">
1017 // </reviewed>
1019 {
1020 public:
1021  // These functions are useful to tell if some type is a floating point type.
1022  // This is useful in a templated function, where the processing can vary
1023  // depending on whether the type is FP or not (e.g. blank handling).
1024  // <group>
1025  static Bool isFP(const float *);
1026  static Bool isFP(const double *);
1027  static Bool isFP(const void *);
1028  // </group>
1029 
1030  // For blanking purposes, we need to be able to get a NaN. The NaN we set
1031  // is all bits on.
1032  // <group>
1033  static void setNaN(double &val);
1034  static void setNaN(float &val);
1035  // </group>
1036 };
1037 
1038 
1039 } //# NAMESPACE CASACORE - END
1040 
1041 # endif
list of read-only FITS keywords
Definition: fits.h:951
ConstFitsKeywordList(FitsKeywordList &x)
Definition: fits.h:953
const FitsKeyword * next(const FITS::ReservedName &x, int n)
Definition: fits.h:962
const FitsKeyword * next()
Definition: fits.h:970
const FitsKeyword * next(const FITS::ReservedName &x)
Definition: fits.h:958
const FitsKeyword * next(const char *x)
Definition: fits.h:965
const FitsKeyword * prev()
Definition: fits.h:971
const FitsKeyword * operator()(int n)
Definition: fits.h:955
FitsKeywordList & kw
Definition: fits.h:975
const FitsKeyword * curr()
Definition: fits.h:972
static void defaultHandler(const char *errMessage, ErrorLevel severity)
The default error handler.
static functions and enumerations
Definition: fits.h:161
static void l2f(void *, FitsLogical *, int)
static float tenpowerF[39]
Definition: fits.h:307
static const int maxsigdigits
Definition: fits.h:312
static FITS::ValueType getfitstype(NoConvert< double > x)
Definition: fits.h:191
static int get_comment(const char *s, int len, int &begpos)
static FITS::ValueType getfitstype(NoConvert< IComplex > x)
Definition: fits.h:195
static const int mindblexp
Definition: fits.h:310
static void f2l(short *, void *, int)
static void f2l(DComplex *, void *, int)
static int trim_comment(const char *s, int len)
static void get_numeric(const char *s, int len, FitsValueResult &result)
static const int maxexpdig
Definition: fits.h:314
ReservedName
FITS Reserved Names.
Definition: fits.h:238
@ PZERO_FITS
Definition: fits.h:245
static void l2f(void *, float *, int)
static FITS::ValueType getfitstype(NoConvert< float > x)
Definition: fits.h:189
static void f2l(FitsBit *, void *, int)
static void l2f(void *, char *, int)
static Bool isa_text(char c)
Definition: fits.h:324
static void swap2(void *, void *, int)
static int str2fstr(char *, const char *, int)
static void l2f(void *, FitsBit *, int)
static void f2l(unsigned char *, void *, int)
static void l2f(void *, IComplex *, int)
static void f2l(FitsVADesc *, void *, int)
static void f2l(Int *, void *, int)
static FITS::ValueType getfitstype(NoConvert< short > x)
Definition: fits.h:183
static const double mindouble
Definition: fits.h:301
static const int maxdblexp
Definition: fits.h:311
static ReservedFitsKeywordCollection & ResWord
Definition: fits.h:272
static void f2l(long *, void *, int)
static int fitssize(FITS::ValueType t)
static FITS::ValueType getfitstype(NoConvert< DComplex > x)
Definition: fits.h:197
static void swap4(void *, void *, int)
static void l2f(void *, FitsVADesc *, int)
static void l2f(void *, Int *, int)
static void l2f(void *, Complex *, int)
static double tenD(Int, int)
Definition: fits.h:330
static int ckaccum(float &, Int, int)
static void f2l(Complex *, void *, int)
FitsRecType
Types of FITS Records.
Definition: fits.h:252
@ UnrecognizableRecord
Definition: fits.h:254
@ BadBeginningRecord
Definition: fits.h:253
@ SpecialRecord
Definition: fits.h:254
@ InitialState
Definition: fits.h:253
static FITS::ValueType getfitstype(NoConvert< unsigned char > x)
Definition: fits.h:181
static double tenpowerD[309]
Definition: fits.h:306
ValueType
FITS I/O Error message types.
Definition: fits.h:167
static FITS::ValueType getfitstype(NoConvert< FitsVADesc > x)
Definition: fits.h:199
static Bool isa_letter(char)
Definition: fits.h:325
static void fstr2str(char *, const char *, int)
static FITS::ValueType getfitstype(NoConvert< FitsBit > x)
Definition: fits.h:177
static const float minfloat
Definition: fits.h:299
static void l2f(void *, long *, int)
static FITS::ValueType getfitstype(NoConvert< Complex > x)
Definition: fits.h:193
static void l2f(void *, double *, int)
static const int minfltexp
Definition: fits.h:308
static FITS::ValueType getfitstype(NoConvert< FitsLogical > x)
STRING and FSTRING are used internally in parsing keywords.
Definition: fits.h:175
static float tenF(Int, int)
Definition: fits.h:334
static FITS::ValueType getfitstype(NoConvert< Int > x)
Definition: fits.h:185
static void valstr(ostream &o, const ValueType &ty, const void *val)
static void f2l(IComplex *, void *, int)
static void l2f(void *, DComplex *, int)
static void f2l(char *, void *, int)
static const Int maxInt
Definition: fits.h:298
static int ckaccum(double &, Int, int)
static int get_value_id(const char *s, int l, int &pos)
FitsArrayOption
Options on FITS array manipulations.
Definition: fits.h:270
static Bool isa_digit(char c)
Definition: fits.h:322
static const double maxdouble
Definition: fits.h:302
static const int maxfltexp
Definition: fits.h:309
static void l2f(void *, short *, int)
static FITS::ValueType getfitstype(NoConvert< long > x)
Definition: fits.h:187
static const float maxfloat
Definition: fits.h:300
static void get_value(const char *s, int len, FitsValueResult &result)
static int chk_comment(const char *s, int len)
static const int maxdigl
Definition: fits.h:313
static void parse_vatform(const char *s, FITS::ValueType &valType, int &maxelem)
utility function to parse the binary table variable array column (i.e.
static void l2f(void *, unsigned char *, int)
HDUType
Types of FITS Header-Data Units.
Definition: fits.h:263
@ ImageExtensionHDU
Definition: fits.h:265
@ PrimaryGroupHDU
Definition: fits.h:264
@ AsciiTableHDU
Definition: fits.h:264
@ BinaryTableHDU
Definition: fits.h:265
@ PrimaryTableHDU
Definition: fits.h:266
@ PrimaryArrayHDU
Definition: fits.h:264
@ UnknownExtensionHDU
Definition: fits.h:265
static void get_name(const char *s, int len, FitsNameResult &result)
static void f2l(FitsLogical *, void *, int)
data conversion routines: FITS - local
FitsDevice
Supported FITS Physical Devices.
Definition: fits.h:258
static void swap8(void *, void *, int)
static int digit2bin(char c)
Definition: fits.h:323
static int localsize(FITS::ValueType t)
static void f2l(float *, void *, int)
static void f2l(double *, void *, int)
static int letter2bin(char)
Definition: fits.h:326
static const Int minInt
Definition: fits.h:297
static FITS::ValueType getfitstype(NoConvert< char > x)
Definition: fits.h:179
helper class for FITS Binary Tables
Definition: fits.h:116
FitsBit(unsigned char x)
Definition: fits.h:119
FitsBit & operator=(unsigned char x)
Definition: fits.h:120
unsigned char bit_array
Definition: fits.h:123
Utility functions for floating point values.
Definition: fits.h:1019
static void setNaN(float &val)
static Bool isFP(const double *)
static Bool isFP(const float *)
These functions are useful to tell if some type is a floating point type.
static Bool isFP(const void *)
static void setNaN(double &val)
For blanking purposes, we need to be able to get a NaN.
translator between Keyword lists and fixed FITS cars
Definition: fits.h:985
static void fmtcard(char *, const FitsKeyword &)
int err_cardno(int) const
Definition: fits.h:1012
int build(char *, FitsKeywordList &)
const char * err(int) const
Definition: fits.h:1011
FitsKeywordList & parse(const char *, FitsKeywordList &, int, FITSErrorHandler, Bool)
linked list of FITS keywords
Definition: fits.h:737
void end()
add the end card.
Definition: fits.h:944
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...
Definition: fits.h:890
int rules(FitsKeyword &, FITSErrorHandler errhandler=FITSError::defaultHandler)
FitsKeyword * pos
Definition: fits.h:848
FitsKeyword * beg_
Definition: fits.h:846
int rules(FITSErrorHandler errhandler=FITSError::defaultHandler)
FitsKeyword * operator()(int)
Retrieve specific keywords – these also set the current mark.
FitsKeyword * next(const FITS::ReservedName &, int)
FitsKeyword * next(const FITS::ReservedName &)
void parse(const char *, int)
For parsing a single string.
Definition: fits.h:883
std::string toString() const
Convert the list to a string containing the 80-byte FITS headers.
FitsKeyword * curr()
Definition: fits.h:876
int no_parse_errs() const
Definition: fits.h:885
Bool isempty() const
Definition: fits.h:873
FitsKeyword & make(int ind, FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
void spaces(const char *n=0, const char *c=0)
add a spaces line
Definition: fits.h:934
FitsKeyword * next(const char *)
void del()
delete the current keyword (the thing returned by curr()) from the list
const char * parse_err(int) const
Definition: fits.h:886
void insert(FitsKeyword &)
void comment(const char *n=0, const char *c=0)
add a comment card
Definition: fits.h:938
FitsKeyword & make(FITS::ReservedName nm, FITS::ValueType t, const void *v, const char *c)
FitsKeywordList(const FitsKeywordList &)
void history(const char *c=0)
add a history card
Definition: fits.h:942
FitsKeyword & make(const char *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 ...
FitsKeywordList(ConstFitsKeywordList &)
FitsKeyword * end_
Definition: fits.h:847
FitsKeywordList & operator=(const FitsKeywordList &)
FITS keyword.
Definition: fits.h:515
FitsKeyword(const FitsKeyword &)
A word about friends: FitsKeywordList accesses the next and prev pointers and the FitsKeyword constru...
Definition: fits.h:643
Bool asBool() const
access the value of the keyword
Definition: fits.h:669
char * name_
the keyword name if name_ is 0, keyword is not a user defined name if ndx is 0, there is no index
Definition: fits.h:590
const char * comm() const
access the keyword comment
Definition: fits.h:663
const ReservedFitsKeyword * kw_
Definition: fits.h:591
FitsKeyword(const char *, int, FITS::ValueType, const void *, int, const char *, int)
private constructors for use by friends
const ReservedFitsKeyword & kw() const
Definition: fits.h:653
char * comm_
the keyword comment if comm_ is 0, there is no comment
Definition: fits.h:599
void init(const FitsKeyword &)
FitsKeyword & operator=(const FitsKeyword &)
Definition: fits.h:645
double asDouble() const
Definition: fits.h:693
FitsKeyword * prev_
Definition: fits.h:584
void setval(const FITS::ValueType &, const void *, int)
Int asInt() const
Definition: fits.h:673
Bool isindexed() const
Definition: fits.h:660
int namelen() const
Definition: fits.h:659
static void err(const char *, const FITS::ValueType &, const void *, const char *)
void name(const char *)
change the name of the keyword
FITS::ValueType type() const
the datatype of the keyword
Definition: fits.h:667
const char * asString() const
Definition: fits.h:670
FITS::ValueType type_
the keyword value
Definition: fits.h:606
int commlen() const
Definition: fits.h:665
const void * value() const
float asFloat() const
Definition: fits.h:680
void setcomm(const char *, int)
static void memchk(void *)
Bool isreserved() const
Definition: fits.h:654
int valStrlen() const
Definition: fits.h:672
int err() const
access the error status
Definition: fits.h:666
const char * name() const
get info about the name
Definition: fits.h:657
DComplex asDComplex() const
Definition: fits.h:710
void comm(const char *)
change the comment of the keyword
FitsKeyword * next_
Definition: fits.h:583
int index() const
Definition: fits.h:661
IComplex asIComplex() const
Definition: fits.h:706
FitsKeyword(const ReservedFitsKeyword *, int, FITS::ValueType, const void *, int, const char *, int)
constructs reserved keywords parms: resword, index, val, vallen, comm, commlen
Complex asComplex() const
Definition: fits.h:708
FITS helper class.
Definition: fits.h:90
void undefine()
ARO 2021-02-20: Removed the following function, because it seems incorrectly implemented and isn't us...
Definition: fits.h:100
friend ostream & operator<<(ostream &o, const FitsLogical &)
FitsLogical(Bool x)
Definition: fits.h:94
FitsLogical & operator=(Bool x)
Definition: fits.h:95
analyse the name of a header card
Definition: fits.h:440
parse a header card
Definition: fits.h:487
const char * err(int) const
Definition: fits.h:505
int no_errs() const
Definition: fits.h:504
int seterr(const char *)
Definition: fits.h:506
FitsKeyword & parse(const char *, int)
const char ** err_
Definition: fits.h:498
FitsKeyword & mkerr(const char *s, int len)
const int max_errs
Definition: fits.h:497
Variable Length Array Descriptor.
Definition: fits.h:130
int num() const
Definition: fits.h:141
FitsVADesc & operator=(const FitsVADesc &x)
Definition: fits.h:136
friend ostream & operator<<(ostream &o, const FitsVADesc &)
FitsVADesc(int n, int o)
Definition: fits.h:139
FitsVADesc(const FitsVADesc &x)
Definition: fits.h:134
int offset() const
Definition: fits.h:142
void set(int n, int o)
Definition: fits.h:140
analyse the value of a header card
Definition: fits.h:459
const char * errmsg
Definition: fits.h:477
FITS::ValueType type
Definition: fits.h:461
void operator=(int)
Definition: fits.h:66
collection of reserved FITS keywords
Definition: fits.h:377
static const ReservedFitsKeyword & user_def_item
Definition: fits.h:402
const ReservedFitsKeyword & get_essential(int, Bool, FITS::ValueType, const void *, int, const char *&) const
const ReservedFitsKeyword & history() const
Definition: fits.h:430
int essential_name(const char *, int) const
const ReservedFitsKeyword & operator[](int i) const
Definition: fits.h:416
const ReservedFitsKeyword & get(const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
const ReservedFitsKeyword & comment() const
Definition: fits.h:428
static const ReservedFitsKeyword & error_item
Definition: fits.h:403
const ReservedFitsKeyword & end_item() const
Definition: fits.h:424
const ReservedFitsKeyword & get(FITS::ReservedName, Bool, FITS::ValueType, const void *, int, const char *&) const
static const ReservedFitsKeyword & history_item
Definition: fits.h:407
const ReservedFitsKeyword & match(int, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
static const int resalpha[26]
Definition: fits.h:409
static const ReservedFitsKeyword & comment_item
Definition: fits.h:406
int rules(const ReservedFitsKeyword &, const char *, int, Bool, FITS::ValueType, const void *, int, const char *&) const
const ReservedFitsKeyword & err_item() const
Definition: fits.h:422
int isreserved(const char *, int) const
const ReservedFitsKeyword & userdef_item() const
Definition: fits.h:420
const ReservedFitsKeyword & spaces() const
Definition: fits.h:426
static const ReservedFitsKeyword resword[]
Definition: fits.h:408
static const ReservedFitsKeyword & end__item
Definition: fits.h:404
const char * aname(FITS::ReservedName) const
static const ReservedFitsKeyword & spaces_item
Definition: fits.h:405
reserved FITS keyword
Definition: fits.h:343
Bool isindexed() const
Definition: fits.h:369
FITS::ValueType type() const
Definition: fits.h:368
FITS::ReservedName name_
Definition: fits.h:358
Bool isessential() const
Definition: fits.h:370
FITS::ValueType type_
Definition: fits.h:361
const char * aname() const
Definition: fits.h:366
FITS::ReservedName name() const
void(* FITSErrorHandler)(const char *errMessage, FITSError::ErrorLevel severity)
Define a typedef for the handler function signature for convenience.
Definition: FITSError.h:111
const Double c
Fundamental physical constants (SI units):
this file contains all the compiler specific defines
Definition: mainpage.dox:28
const Bool False
Definition: aipstype.h:44
LatticeExprNode pow(const LatticeExprNode &left, const LatticeExprNode &right)
int FitsLong
All FITS code seems to assume longs are 4 bytes.
Definition: aipsxtype.h:43
int Int
Definition: aipstype.h:50
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
const Bool True
Definition: aipstype.h:43