31 # include <casacore/casa/aips.h>
32 # include <casacore/fits/FITS/fits.h>
33 # include <casacore/fits/FITS/blockio.h>
34 # include <casacore/casa/BasicSL/String.h>
35 # include <casacore/casa/Arrays/Vector.h>
149 void mk(
const char *n,
Bool v,
const char *
c = 0);
150 void mk(
const char *n,
const char *v = 0,
const char *
c = 0);
151 void mk(
const char *n,
Int v,
const char *
c = 0);
152 void mk(
const char *n,
float v,
const char *
c = 0);
153 void mk(
const char *n,
double v,
const char *
c = 0);
154 void mk(
const char *n,
Int r,
Int i,
const char *
c = 0);
155 void mk(
const char *n,
float r,
float i,
const char *
c = 0);
156 void mk(
const char *n,
double r,
double i,
const char *
c = 0);
157 void spaces(
const char *n = 0,
const char *
c = 0);
158 void comment(
const char *n = 0,
const char *
c = 0);
339 template <
class TYPE>
388 TYPE &
data(
int,
int,
int,
int,
int);
389 TYPE &
data(
int,
int,
int,
int);
418 int store(
const TYPE *source,
int npixels);
419 void copy(
double *target,
int npixels)
const;
420 void copy(
float *target,
int npixels)
const;
421 void move(TYPE *target,
int npixels)
const;
426 int naxis,
long naxes[],
int extend );
487 int offset(
int,
int,
int,
int,
int)
const;
514 template <
class TYPE>
535 int bitpix,
int naxis,
long *naxes);
593 template <
class TYPE>
705 template <
class TYPE>
720 int bitpix,
int naxis,
long *naxes);
812 int read(
char *addr,
int nbytes) {
853 virtual int dim(
int n)
const;
862 virtual void show(std::ostream &) = 0;
881 template <
class TYPE>
891 (*field)[0] = x;
return *
this; }
934 byte_offset = i / 8;
mask = 0200 >> (i % 8);
return *
this; }
937 (*field)[byte_offset] =
938 (i == 0 ? ((*field)[byte_offset] & ~
mask) :
939 ((*
field)[byte_offset] |
mask));
return *
this; }
944 operator int() {
return (((*
field)[byte_offset] &
mask) != 0); }
971 template <
class TYPE>
1092 const char**,
const char**,
const char*,
long );
1177 long,
int,
const char **,
long *,
1178 const char **,
const char **,
const char *
e);
1199 #ifndef CASACORE_NO_AUTO_TEMPLATES
1200 #include <casacore/fits/FITS/hdu.tcc>
AsciiTableExtension(FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler)
int readrow()
read and write the next FITS data row
Int tbcol(int n)
position in which column starts
int writerow(FitsOutput &)
int write_ascTbl_hdr(FitsOutput &, long, long, int, const char **, long *, const char **, const char **, const char *e)
write the required keywords for ASCIITableExtension
AsciiTableExtension(FITSErrorHandler errhandler=FITSError::defaultHandler)
char * tnull(int n)
ascii string that represents the NULL value
AsciiTableExtension(FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler)
Int nrows() const
return basic elements of a table
const char * ttype(int n) const
const char * referenc() const
Bool isatnull(int n) const
double tscal(int n) const
BinaryTableExtension & operator()(int)
BinaryTableExtension(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
int bind(int, FitsBase &)
binds a FitsField to a column
const char * author() const
double crval(int n) const
FitsBase & field(int i) const
select a field
BinaryTableExtension(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
sets field addresses in the current row void set_fitsrow(Int);
virtual int writerow(FitsOutput &)
Int currrow() const
get current row
BinaryTableExtension(FITSErrorHandler errhandler=FITSError::defaultHandler)
constructor to match write_bintbl_hdr()
virtual ~BinaryTableExtension()
BinaryTableExtension(FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
BinaryTableExtension(FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler)
int write(FitsOutput &)
write current rows
const char * tunit(int n) const
int read()
read entire table into memory
double crota(int n) const
BinaryTableExtension & operator--()
const char * tdim(int n) const
int set_next(int)
prepare to write the next N rows
int write_binTbl_hdr(FitsOutput &, long, int, const char **, const char **, const char **, const char *, long)
create a binary table header without using FitsKeywordList objet.
void ** data_addr
data addresses of fields of current row
double cdelt(int n) const
int read(int)
read next N rows into memory
double crpix(int n) const
void set_fitsrow(Int)
sets field addresses in the current row
const char * tdisp(int n) const
const char * tform(int n) const
BinaryTableExtension & operator++()
row selector functions
const char * ctype(int n) const
virtual int readrow()
read and write the next FITS data row
BinaryTableExtension(FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler)
double tzero(int n) const
list of read-only FITS keywords
static void defaultHandler(const char *errMessage, ErrorLevel severity)
The default error handler.
static functions and enumerations
ReservedName
FITS Reserved Names.
ValueType
FITS I/O Error message types.
FitsArrayOption
Options on FITS array manipulations.
HDUType
Types of FITS Header-Data Units.
FITS array of FitsBit type Note: We must specify a FitsArray<FitsBit> as a specialization;
FitsArray(int, const int *)
FitsArray(int, const int *)
static FitsBase * make(const FITS::ValueType &, int, int *)
virtual void setaddr(void **)=0
FitsBase(const FITS::ValueType &t, int n)
unsigned int nelements() const
virtual void show(std::ostream &)=0
FITS::ValueType data_type
static FitsBase * make(const FITS::ValueType &, int=1)
FitsBase & operator=(FitsBase &)=delete
virtual int fitsfieldsize() const =0
virtual int localfieldsize() const =0
virtual int dim(int n) const
static FitsBase * make(FitsBase &)
FITS::ValueType fieldtype() const
helper class for FITS Binary Tables
void show(std::ostream &)
int fitsfieldsize() const
int localfieldsize() const
void setaddr(void **addr)
helper class Note: Note that FitsField does not allocate space for the data; Space is external to Fi...
FitsField< TYPE > & operator=(const TYPE &x)
int fitsfieldsize() const
void show(std::ostream &)
int localfieldsize() const
void setaddr(void **addr)
linked list of FITS keywords
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...
FitsKeyword * next(const FITS::ReservedName &)
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
fixed-length sequential blocked FITS output
IMAGE extension of given type.
ImageExtension(FITSErrorHandler errhandler=FITSError::defaultHandler)
constructor for header consisted required keywords only
ImageExtension(FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler)
int write_imgExt_hdr(FitsOutput &fout, int bitpix, int naxis, long *naxes)
write required keywords for ImageExtension
ImageExtension(FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler)
templated primary array base class of given type
double bscale() const
General access routines for a primary array.
void move(TYPE *target, FITS::FitsArrayOption=FITS::NoOpt) const
PrimaryArray(FitsInput &, FITSErrorHandler=FITSError::defaultHandler)
constructor from a FitsInput
int offset(int, int) const
compute a linear offset from array indicies
void copy(double *target, FITS::FitsArrayOption=FITS::NoOpt) const
TYPE & data(int, int, int, int)
char * ctype(int n) const
int store(const TYPE *source, FITS::FitsArrayOption=FITS::NoOpt)
The ‘store()’, ‘move()’ and ‘copy()’ functions allow bulk data transfer between the internal FITS arr...
double cdelt(int n) const
PrimaryArray(FitsKeywordList &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
construct from a FitsKeywordList with given HDU type
virtual int write(FitsOutput &)
PrimaryArray(FitsKeywordList &, FITSErrorHandler=FITSError::defaultHandler)
constructor from a FitsKeywordList
double crota(int n) const
void copy(float *target, FITS::FitsArrayOption=FITS::NoOpt) const
virtual int read()
The ‘read()’ and ‘write()’ functions control reading and writing data from the external FITS I/O medi...
TYPE * array
the allocated array
int offset(int, int, int) const
double crpix(int n) const
int store(const TYPE *source, int npixels)
Use these versions if you are reading/writing "chunk by chunk.
double operator()(int, int, int, int, int) const
The overloaded operator functions ‘()’ all return physical data, i.
double crval(int n) const
int offset(int, int, int, int, int) const
PrimaryArray(FitsInput &, FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
construct from a FitsInput with given HDU type
int offset(int, int, int, int) const
virtual OFF_T set_next(OFF_T)
PrimaryArray(FITSErrorHandler=FITSError::defaultHandler)
constructor does not require a FitsKeywordList.
void copy(float *target, int npixels) const
PrimaryArray(FITS::HDUType, FITSErrorHandler errhandler=FITSError::defaultHandler)
construct witout FitsKeywordList for given HDU type(for ImageExtension and PrimaryGroup)
void copy(double *target, int npixels) const
void move(TYPE *target, int npixels) const
int write_priArr_hdr(FitsOutput &fout, int simple, int bitpix, int naxis, long naxes[], int extend)
TYPE & data(int, int, int)
virtual ~PrimaryArray()
destructor
TYPE & data(int, int, int, int, int)
The various ‘data()’ functions allow one to access and set the raw data itself.
Random Group datastructure.
int write_priGrp_hdr(FitsOutput &fout, int simple, int bitpix, int naxis, long naxes[], long pcount, long gcount)
write the required keywords for PrimaryGroup
double pscal(int n) const
int read()
read, or write the next group
Int gcount() const
Return basic parameters of a random group.
PrimaryGroup(FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler)
void moveparm(TYPE *target) const
PrimaryGroup(FITSErrorHandler errhandler=FITSError::defaultHandler)
constructor for header consisted required keywords only
double pzero(int n) const
char * ptype(int n) const
void copyparm(double *target) const
OFF_T set_next(OFF_T)
disable these functions, since they are inherited from PrimaryArray
PrimaryGroup(FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler)
void copyparm(float *target) const
void storeparm(const TYPE *source)
int write_priTable_hdr(FitsOutput &fout, int bitpix, int naxis, long *naxes)
write required keywords for PrimaryTable
int read()
The ‘read()’ and ‘write()’ functions control reading and writing data from the external FITS I/O medi...
PrimaryTable(FITSErrorHandler errhandler=FITSError::defaultHandler)
constructor for header consisted required keywords only
PrimaryTable(FitsKeywordList &, FITSErrorHandler errhandler=FITSError::defaultHandler)
PrimaryTable(FitsInput &, FITSErrorHandler errhandler=FITSError::defaultHandler)
void(* FITSErrorHandler)(const char *errMessage, FITSError::ErrorLevel severity)
Define a typedef for the handler function signature for convenience.
const Double c
Fundamental physical constants (SI units):
const Double e
e and functions thereof:
this file contains all the compiler specific defines
FitsArray< FitsLong > LongFitsArray
FitsArray< DComplex > DComplexFitsArray
PrimaryGroup< short > ShortPrimaryGroup
FitsArray< short > ShortFitsArray
FitsField< FitsVADesc > VADescFitsField
FitsField< FitsBit > BitFitsField
FitsField< Complex > ComplexFitsField
FitsArray< float > FloatFitsArray
PrimaryArray< unsigned char > BytePrimaryArray
PrimaryArray< float > FloatPrimaryArray
PrimaryTable< FitsLong > LongPrimaryTable
FitsField< short > ShortFitsField
ImageExtension< unsigned char > ByteImageExtension
PrimaryTable< double > DoublePrimaryTable
PrimaryArray< FitsLong > LongPrimaryArray
FitsField< float > FloatFitsField
LatticeExprNode mask(const LatticeExprNode &expr)
This function returns the mask of the given expression.
ImageExtension< float > FloatImageExtension
FitsField< unsigned char > ByteFitsField
FitsField< FitsLong > LongFitsField
PrimaryGroup< double > DoublePrimaryGroup
FitsField< char > CharFitsField
FitsArray< Complex > ComplexFitsArray
FitsArray< unsigned char > ByteFitsArray
ImageExtension< short > ShortImageExtension
PrimaryTable< float > FloatPrimaryTable
FitsArray< FitsVADesc > VADescFitsArray
FitsArray< char > CharFitsArray
PrimaryArray< double > DoublePrimaryArray
bool Bool
Define the standard types used by Casacore.
ImageExtension< FitsLong > LongImageExtension
ostream & operator<<(ostream &os, const IComplex &)
Show on ostream.
FitsArray< FitsLogical > LogicalFitsArray
PrimaryTable< short > ShortPrimaryTable
FitsField< double > DoubleFitsField
FitsArray< IComplex > IComplexFitsArray
PrimaryGroup< unsigned char > BytePrimaryGroup
FitsField< DComplex > DComplexFitsField
PrimaryGroup< FitsLong > LongPrimaryGroup
FitsField< FitsLogical > LogicalFitsField
PrimaryArray< short > ShortPrimaryArray
FitsField< IComplex > IComplexFitsField
PrimaryTable< unsigned char > BytePrimaryTable
FitsArray< double > DoubleFitsArray
PrimaryGroup< float > FloatPrimaryGroup
FitsArray< FitsBit > BitFitsArray
ImageExtension< double > DoubleImageExtension