casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
casa::FitsIO Class Reference

sequential FITS I/O More...

#include <fitsio.h>

Inheritance diagram for casa::FitsIO:
casa::FitsInput casa::FitsOutput

List of all members.

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

Protected Member Functions

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

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;
OFF_T m_curr_size
 for input, size of remaining data for output, size of data written uInt m_curr_size;
OFF_T m_skipHDU_size
 for size of the last HDU skipped

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 61 of file fitsio.h.


Member Enumeration Documentation

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 77 of file fitsio.h.


Constructor & Destructor Documentation

virtual casa::FitsIO::~FitsIO ( ) [virtual]

Member Function Documentation

OFF_T casa::FitsIO::currsize ( ) const [inline]

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

Definition at line 107 of file fitsio.h.

References m_curr_size.

OFF_T casa::FitsIO::datasize ( ) const [inline]

return the datasize of the current HDU.

This excludes the trailing end of the blocked data portion.

Definition at line 102 of file fitsio.h.

References m_data_size.

Definition at line 99 of file fitsio.h.

References m_data_type.

Bool casa::FitsIO::eof ( ) const [inline]

test if end of file has been reached

Definition at line 94 of file fitsio.h.

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

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

int casa::FitsIO::err ( ) const [inline]

Definition at line 81 of file fitsio.h.

References m_err_status.

virtual void casa::FitsIO::errmsg ( FitsErrs  ,
const char *   
) [protected, pure virtual]

set error message that belongs to one of the enumerated types

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

int casa::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 86 of file fitsio.h.

References m_recsize.

fitsfile* casa::FitsIO::getfptr ( ) const [inline]

get the fitsfile pointer

Definition at line 111 of file fitsio.h.

References m_fptr.

get FitsKeyCardTranslator

Definition at line 109 of file fitsio.h.

References m_kc.

OFF_T casa::FitsIO::getskipsize ( ) const [inline]

get the size of the last skipped HDU

Definition at line 114 of file fitsio.h.

References m_skipHDU_size.

Header Data Unit type (e.g.

Definition at line 98 of file fitsio.h.

References m_hdu_type.

Bool casa::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 90 of file fitsio.h.

References m_valid_fits.

Bool casa::FitsIO::isextend ( ) const [inline]

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

Definition at line 92 of file fitsio.h.

References m_extend.

Int casa::FitsIO::itemsize ( ) const [inline]

data characteristics

Definition at line 104 of file fitsio.h.

References m_item_size.

the FITS record type

Definition at line 96 of file fitsio.h.

References m_rec_type.


Member Data Documentation

int casa::FitsIO::m_bytepos [protected]

Definition at line 135 of file fitsio.h.

char* casa::FitsIO::m_curr [protected]

Definition at line 134 of file fitsio.h.

OFF_T casa::FitsIO::m_curr_size [protected]

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

Definition at line 143 of file fitsio.h.

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

OFF_T casa::FitsIO::m_data_size [protected]

uInt m_data_size;

Definition at line 139 of file fitsio.h.

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

Definition at line 137 of file fitsio.h.

Referenced by datatype().

Definition at line 130 of file fitsio.h.

Referenced by err().

Definition at line 129 of file fitsio.h.

Definition at line 123 of file fitsio.h.

Referenced by isextend().

fitsfile* casa::FitsIO::m_fptr [protected]

Definition at line 120 of file fitsio.h.

Referenced by getfptr().

Definition at line 127 of file fitsio.h.

Referenced by hdutype().

Definition at line 125 of file fitsio.h.

Definition at line 124 of file fitsio.h.

Definition at line 136 of file fitsio.h.

Referenced by itemsize().

Definition at line 131 of file fitsio.h.

Referenced by getkc().

Definition at line 132 of file fitsio.h.

const int casa::FitsIO::m_recsize [protected]

Definition at line 121 of file fitsio.h.

Referenced by fitsrecsize().

OFF_T casa::FitsIO::m_skipHDU_size [protected]

for size of the last HDU skipped

Definition at line 146 of file fitsio.h.

Referenced by getskipsize().

Definition at line 122 of file fitsio.h.

Referenced by isafits().


The documentation for this class was generated from the following file: