- OK
- IOERR
- MISSKEY
- BADBEGIN
- EMPTYFILE
- NOPRIMARY
- BADOPER
- BADEOF
- MEMERR
- BADBITPIX
- NOAXISN
- NOPCOUNT
- NOGCOUNT
- BADPCOUNT
- BADGCOUNT
- NOGROUPS
- BADNAXIS
- BADPRIMARY
- BADSIZE
- HDUERR
error return code. Should be one of an
enumerated type:
record size, in bytes, of a FITS block.
Normally set at 2880, unless some form of blocking was used.
is it a valid fits file (SIMPLE==T). If not, the only
safest operation is to skip the data portion of the
current HeaderDataUnit
see if there may be FITS extensions present (EXTENT==T)
test if end of file has been reached
the FITS record type
Header Data Unit type (e.g.
return the datasize of the current HDU. This excludes
the trailing end of the blocked data portion.
data characteristics
for input, size of remaining data
for output, size of data written
get FitsKeyCardTranslator
get the fitsfile pointer
set error message that belongs to one of the enumerated types
get hdu header image cards as strings. By default the strings will be of
variable length. You can optionally ask for them to be length 80 (padded
with spaces).
number of physical blocks read/written
number of logical records read/written
Special interface to class HeaderDataUnit
special way to process header
Special interface to class HeaderDataUnit
read all data into a given address - all responsibility is given
to the user
Special interface to class HeaderDataUnit
read N bytes into address
Special interface to class HeaderDataUnit
skip N bytes
Special interface to class HeaderDataUnit
skip all remaining data
Special interface to class HeaderDataUnit
write all data from address
Special interface to class HeaderDataUnit
write N bytes from address
Special interface to class HeaderDataUnit
Review Status
Synopsis
FitsIO is a base class that handles all the sequential blocked
FITS I/O. Special derived classes do the input and output.
No interpretation of the data is attempted here, there are
special FITS classes that handle syntax and interpretation.
Example
FitsInput fin("myfile.fits",FITS::Disk); // open disk file for FITS input
if (fin.err() == FitsIO::IOERR) { // check if open succeeded
cout << "Could not open FITS input\n";
exit(0);
}
if (fin.rectype() == FITS::HDURecord && // test for primary array
fin.hdutype() == FITS::PrimaryArrayHDU) {
}
Member Description
virtual ~FitsIO()
enum FitsErrs
int err() const
enum FitsErrs { OK, IOERR, MISSKEY, BADBEGIN, EMPTYFILE,
NOPRIMARY, BADOPER, BADEOF, MEMERR, BADBITPIX, NOAXISN,
NOPCOUNT, NOGCOUNT, BADPCOUNT, BADGCOUNT, NOGROUPS,
BADNAXIS, BADPRIMARY, BADSIZE, HDUERR };
int fitsrecsize() const
Bool isafits() const
Bool isextend() const
Bool eof() const
FITS::FitsRecType rectype() const
FITS::HDUType hdutype() const
FITS::ValueType datatype() const
OFF_T datasize() const
Int itemsize() const
OFF_T currsize() const
FitsKeyCardTranslator& getkc()
fitsfile *getfptr() const
FitsIO(FITSErrorHandler)
virtual void errmsg(FitsErrs, char *) = 0
class FitsInput : public FitsIO
Interface
Description
Member Description
friend int HeaderDataUnit::get_hdr(HeaderDataUnit::HDUType, FitsKeywordList &)
friend OFF_T OFF_T::read_all_data(char *)
friend int HeaderDataUnit::read_data(char *, Int)
friend int HeaderDataUnit::skip(uInt)
friend int HeaderDataUnit::skip()
FitsInput(const char *, const FITS::FitsDevice &, int = 10, FITSErrorHandler errhandler = FITSError::defaultHandler)
FitsInput(FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsInput()
int skip_hdu()
char *read_sp()
int skip_hdu2();
read special or unrecognizable records
Vector<String> kwlist_str(Bool length80=False)
int blockno() const
int recno() const
BlockInput & getfin()
BlockInput &make_input(const char *, const FITS::FitsDevice &, int, FITSErrorHandler errhandler = FITSError::defaultHandler)
virtual void errmsg(FitsErrs, char *)
void init()
void read_header_rec()
bool current_hdu_type( FITS::HDUType &)
bool get_data_type( FITS::ValueType &)
int process_header(FITS::HDUType, FitsKeywordList &)
OFF_T read_all(FITS::HDUType, char *)
int read(FITS::HDUType, char *, int )
int skip(FITS::HDUType, OFF_T)
void skip_all(FITS::HDUType)
class FitsOutput : public FitsIO
Interface
Description
Member Description
friend int HeaderDataUnit::write_hdr(FitsOutput &)
friend int HeaderDataUnit::write_all_data(FitsOutput &, char *)
friend int HeaderDataUnit::write_data(FitsOutput &, char *, Int)
FitsOutput(const char *, const FITS::FitsDevice &, int = 10, FITSErrorHandler errhandler = FITSError::defaultHandler)
FitsOutput(FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsOutput()
void set_data_info( FitsKeywordList &kwl, FITS::HDUType t, FITS::ValueType dt, OFF_T ds, Int is)
used by PrimaryArray, BinaryTabelExtention etc to work with the constructor without keyword list.
int write_sp(char *rec)
write a special record. For this the record type must also
be to set to FITS::SpecialRecord
int hdu_complete()
check if the current hdu is done. It was private.
BlockOutput & getfout()
void setfptr( fitsfile* ffp )
Bool required_keys_only()
BlockOutput &make_output(const char *, const FITS::FitsDevice &, int, FITSErrorHandler errhandler = FITSError::defaultHandler)
virtual void errmsg(FitsErrs, char *)
int hdu_inprogress()
int write_all(FITS::HDUType, char *, char)
int write(FITS::HDUType, char *, Int, char)
int write_hdr(FitsKeywordList &, FITS::HDUType, FITS::ValueType, OFF_T, Int)
class FitsDiskInput : public BlockInput
Interface
Description
Member Description
FitsDiskInput(const char *, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsDiskInput()
char *skip(int)
implements skip in terms of lseek
class FitsDiskOutput : public BlockOutput
Interface
Description
Member Description
FitsDiskOutput(const char *, int, int = 1, FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsDiskOutput()
class FitsStdInput : public BlockInput
Interface
Description
Member Description
FitsStdInput(int, FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsStdInput()
class FitsStdOutput : public BlockOutput
Interface
Description
Member Description
FitsStdOutput(int, FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsStdOutput()
class FitsTape9Input : public BlockInput
Interface
Description
Member Description
FitsTape9Input(const char *, int, int = 10, FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsTape9Input()
class FitsTape9Output : public BlockOutput
Interface
Description
Member Description
FitsTape9Output(const char *, int, int = 10, FITSErrorHandler errhandler = FITSError::defaultHandler)
~FitsTape9Output()