casacore
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
casacore::FitsIO Class Referenceabstract

sequential FITS I/O More...

#include <fitsio.h>

Public Types

enum  FitsErrs {
  OK,
  IOERR,
  MISSKEY,
  BADBEGIN,
  EMPTYFILE,
  NOPRIMARY,
  BADOPER,
  BADEOF,
  MEMERR,
  BADBITPIX,
  NOAXISN,
  NOPCOUNT,
  NOGCOUNT,
  BADPCOUNT,
  BADGCOUNT,
  NOGROUPS,
  BADNAXIS,
  BADPRIMARY,
  BADSIZE,
  HDUERR
}
 error return code. More...
 

Public Member Functions

virtual ~FitsIO ()
 
int err () const
 
int fitsrecsize () const
 record size, in bytes, of a FITS block. More...
 
Bool isafits () const
 is it a valid fits file (SIMPLE==T). More...
 
Bool isextend () const
 see if there may be FITS extensions present (EXTENT==T) More...
 
Bool eof () const
 test if end of file has been reached More...
 
FITS::FitsRecType rectype () const
 the FITS record type More...
 
FITS::HDUType hdutype () const
 Header Data Unit type (e.g. More...
 
FITS::ValueType datatype () const
 
OFF_T datasize () const
 return the datasize of the current HDU. More...
 
Int itemsize () const
 data characteristics More...
 
OFF_T currsize () const
 for input, size of remaining data for output, size of data written More...
 
FitsKeyCardTranslatorgetkc ()
 get FitsKeyCardTranslator More...
 
fitsfile * getfptr () const
 get the fitsfile pointer More...
 
OFF_T getskipsize () const
 get the size of the last skipped HDU More...
 

Protected Member Functions

 FitsIO (FITSErrorHandler)
 
virtual void errmsg (FitsErrs, const char *)=0
 set error message that belongs to one of the enumerated types More...
 

Protected Attributes

fitsfile * m_fptr
 
const int m_recsize
 
Bool m_valid_fits
 
Bool m_extend
 
Bool m_isaprimary
 
Bool m_header_done
 
FITS::FitsRecType m_rec_type
 
FITS::HDUType m_hdu_type
 
FITSErrorHandler m_errfn
 
FitsErrs m_err_status
 
FitsKeyCardTranslator m_kc
 
FitsKeywordList m_kw
 
char * m_curr
 
int m_bytepos
 
Int m_item_size
 
FITS::ValueType m_data_type
 
OFF_T m_data_size
 uInt m_data_size; More...
 
OFF_T m_curr_size
 for input, size of remaining data for output, size of data written uInt m_curr_size; More...
 
OFF_T m_skipHDU_size
 for size of the last HDU skipped More...
 

Detailed Description

sequential FITS I/O

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

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) {
}

Definition at line 62 of file fitsio.h.

Member Enumeration Documentation

◆ FitsErrs

error return code.

Should be one of an enumerated type:

Enumerator
OK 
IOERR 
MISSKEY 
BADBEGIN 
EMPTYFILE 
NOPRIMARY 
BADOPER 
BADEOF 
MEMERR 
BADBITPIX 
NOAXISN 
NOPCOUNT 
NOGCOUNT 
BADPCOUNT 
BADGCOUNT 
NOGROUPS 
BADNAXIS 
BADPRIMARY 
BADSIZE 
HDUERR 

Definition at line 78 of file fitsio.h.

Constructor & Destructor Documentation

◆ ~FitsIO()

virtual casacore::FitsIO::~FitsIO ( )
virtual

◆ FitsIO()

casacore::FitsIO::FitsIO ( FITSErrorHandler  )
protected

Member Function Documentation

◆ currsize()

OFF_T casacore::FitsIO::currsize ( ) const
inline

for input, size of remaining data for output, size of data written

Definition at line 108 of file fitsio.h.

References m_curr_size.

◆ datasize()

OFF_T casacore::FitsIO::datasize ( ) const
inline

return the datasize of the current HDU.

This excludes the trailing end of the blocked data portion.

Definition at line 103 of file fitsio.h.

References m_data_size.

◆ datatype()

FITS::ValueType casacore::FitsIO::datatype ( ) const
inline

Definition at line 100 of file fitsio.h.

References m_data_type.

◆ eof()

Bool casacore::FitsIO::eof ( ) const
inline

test if end of file has been reached

Definition at line 95 of file fitsio.h.

References casacore::FITS::EndOfFile, and m_rec_type.

Referenced by casacore::FITSTable::eof().

◆ err()

int casacore::FitsIO::err ( ) const
inline

Definition at line 82 of file fitsio.h.

References m_err_status.

◆ errmsg()

virtual void casacore::FitsIO::errmsg ( FitsErrs  ,
const char *   
)
protectedpure virtual

set error message that belongs to one of the enumerated types

Implemented in casacore::FitsOutput, and casacore::FitsInput.

◆ fitsrecsize()

int casacore::FitsIO::fitsrecsize ( ) const
inline

record size, in bytes, of a FITS block.

Normally set at 2880, unless some form of blocking was used.

Definition at line 87 of file fitsio.h.

References m_recsize.

◆ getfptr()

fitsfile* casacore::FitsIO::getfptr ( ) const
inline

get the fitsfile pointer

Definition at line 112 of file fitsio.h.

References m_fptr.

◆ getkc()

FitsKeyCardTranslator& casacore::FitsIO::getkc ( )
inline

get FitsKeyCardTranslator

Definition at line 110 of file fitsio.h.

References m_kc.

◆ getskipsize()

OFF_T casacore::FitsIO::getskipsize ( ) const
inline

get the size of the last skipped HDU

Definition at line 115 of file fitsio.h.

References m_skipHDU_size.

◆ hdutype()

FITS::HDUType casacore::FitsIO::hdutype ( ) const
inline

Header Data Unit type (e.g.


Definition at line 99 of file fitsio.h.

References m_hdu_type.

◆ isafits()

Bool casacore::FitsIO::isafits ( ) const
inline

is it a valid fits file (SIMPLE==T).

If not, the only safest operation is to skip the data portion of the current HeaderDataUnit

Definition at line 91 of file fitsio.h.

References m_valid_fits.

◆ isextend()

Bool casacore::FitsIO::isextend ( ) const
inline

see if there may be FITS extensions present (EXTENT==T)

Definition at line 93 of file fitsio.h.

References m_extend.

◆ itemsize()

Int casacore::FitsIO::itemsize ( ) const
inline

data characteristics

Definition at line 105 of file fitsio.h.

References m_item_size.

◆ rectype()

FITS::FitsRecType casacore::FitsIO::rectype ( ) const
inline

the FITS record type

Definition at line 97 of file fitsio.h.

References m_rec_type.

Member Data Documentation

◆ m_bytepos

int casacore::FitsIO::m_bytepos
protected

Definition at line 136 of file fitsio.h.

◆ m_curr

char* casacore::FitsIO::m_curr
protected

Definition at line 135 of file fitsio.h.

◆ m_curr_size

OFF_T casacore::FitsIO::m_curr_size
protected

for input, size of remaining data for output, size of data written uInt m_curr_size;

Definition at line 144 of file fitsio.h.

Referenced by currsize(), and casacore::FitsOutput::hdu_inprogress().

◆ m_data_size

OFF_T casacore::FitsIO::m_data_size
protected

uInt m_data_size;

Definition at line 140 of file fitsio.h.

Referenced by datasize(), casacore::FitsOutput::hdu_complete(), and casacore::FitsOutput::hdu_inprogress().

◆ m_data_type

FITS::ValueType casacore::FitsIO::m_data_type
protected

Definition at line 138 of file fitsio.h.

Referenced by datatype().

◆ m_err_status

FitsErrs casacore::FitsIO::m_err_status
protected

Definition at line 131 of file fitsio.h.

Referenced by err().

◆ m_errfn

FITSErrorHandler casacore::FitsIO::m_errfn
protected

Definition at line 130 of file fitsio.h.

◆ m_extend

Bool casacore::FitsIO::m_extend
protected

Definition at line 124 of file fitsio.h.

Referenced by isextend().

◆ m_fptr

fitsfile* casacore::FitsIO::m_fptr
protected

Definition at line 121 of file fitsio.h.

Referenced by getfptr().

◆ m_hdu_type

FITS::HDUType casacore::FitsIO::m_hdu_type
protected

Definition at line 128 of file fitsio.h.

Referenced by hdutype().

◆ m_header_done

Bool casacore::FitsIO::m_header_done
protected

Definition at line 126 of file fitsio.h.

◆ m_isaprimary

Bool casacore::FitsIO::m_isaprimary
protected

Definition at line 125 of file fitsio.h.

◆ m_item_size

Int casacore::FitsIO::m_item_size
protected

Definition at line 137 of file fitsio.h.

Referenced by itemsize().

◆ m_kc

FitsKeyCardTranslator casacore::FitsIO::m_kc
protected

Definition at line 132 of file fitsio.h.

Referenced by getkc().

◆ m_kw

FitsKeywordList casacore::FitsIO::m_kw
protected

Definition at line 133 of file fitsio.h.

◆ m_rec_type

FITS::FitsRecType casacore::FitsIO::m_rec_type
protected

◆ m_recsize

const int casacore::FitsIO::m_recsize
protected

Definition at line 122 of file fitsio.h.

Referenced by fitsrecsize().

◆ m_skipHDU_size

OFF_T casacore::FitsIO::m_skipHDU_size
protected

for size of the last HDU skipped

Definition at line 147 of file fitsio.h.

Referenced by getskipsize().

◆ m_valid_fits

Bool casacore::FitsIO::m_valid_fits
protected

Definition at line 123 of file fitsio.h.

Referenced by isafits().


The documentation for this class was generated from the following file:
casacore::FitsIO::BADEOF
@ BADEOF
Definition: fitsio.h:79
casacore::FITS::PrimaryArrayHDU
@ PrimaryArrayHDU
Definition: fits.h:268
casacore::FITS::HDURecord
@ HDURecord
Definition: fits.h:257
casacore::FitsIO::NOGCOUNT
@ NOGCOUNT
Definition: fitsio.h:80
casacore::FitsIO::IOERR
@ IOERR
Definition: fitsio.h:78
casacore::FitsIO::BADBEGIN
@ BADBEGIN
Definition: fitsio.h:78
casacore::FitsIO::NOGROUPS
@ NOGROUPS
Definition: fitsio.h:80
casacore::FitsIO::BADSIZE
@ BADSIZE
Definition: fitsio.h:81
casacore::FitsIO::NOPRIMARY
@ NOPRIMARY
Definition: fitsio.h:79
casacore::FitsIO::BADGCOUNT
@ BADGCOUNT
Definition: fitsio.h:80
casacore::FitsIO::BADPRIMARY
@ BADPRIMARY
Definition: fitsio.h:81
casacore::FitsIO::HDUERR
@ HDUERR
Definition: fitsio.h:81
casacore::FitsIO::EMPTYFILE
@ EMPTYFILE
Definition: fitsio.h:78
casacore::FitsIO::NOAXISN
@ NOAXISN
Definition: fitsio.h:79
casacore::FitsIO::NOPCOUNT
@ NOPCOUNT
Definition: fitsio.h:80
casacore::FitsIO::MISSKEY
@ MISSKEY
Definition: fitsio.h:78
casacore::FITS::Disk
@ Disk
Definition: fits.h:263
casacore::FitsIO::MEMERR
@ MEMERR
Definition: fitsio.h:79
casacore::FitsIO::BADNAXIS
@ BADNAXIS
Definition: fitsio.h:81
casacore::FitsIO::FitsErrs
FitsErrs
error return code.
Definition: fitsio.h:78
casacore::FitsIO::OK
@ OK
Definition: fitsio.h:78
casacore::FitsIO::BADBITPIX
@ BADBITPIX
Definition: fitsio.h:79
casacore::FitsIO::BADPCOUNT
@ BADPCOUNT
Definition: fitsio.h:80
casacore::FitsIO::BADOPER
@ BADOPER
Definition: fitsio.h:79