casacore
Loading...
Searching...
No Matches
casacore::FitsInput Class Reference

fixed-length sequential blocked FITS input More...

#include <fitsio.h>

Public Member Functions

 FitsInput (const char *, const FITS::FitsDevice &, int=10, FITSErrorHandler errhandler=FITSError::defaultHandler)
 FitsInput (FITSErrorHandler errhandler=FITSError::defaultHandler)
 ~FitsInput ()
int skip_hdu ()
void skip_all (FITS::HDUType)
 skip all remaining data
char * read_sp ()
 int skip_hdu2(); read special or unrecognizable records
Vector< Stringkwlist_str (Bool length80=False)
 get hdu header image cards as strings.
int blockno () const
 number of physical blocks read/written
int recno () const
 number of logical records read/written
BlockInputgetfin ()
int getnumhdu () const
 the number of hdu in this fits file
Public Member Functions inherited from casacore::FitsIO
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

Private Member Functions

BlockInputmake_input (const char *, const FITS::FitsDevice &, int, FITSErrorHandler errhandler=FITSError::defaultHandler)
virtual void errmsg (FitsErrs, const char *)
 set error message that belongs to one of the enumerated types
void init ()
void read_header_rec ()
bool current_hdu_type (FITS::HDUType &)
bool get_data_type (FITS::ValueType &)
int process_header (FITS::HDUType, FitsKeywordList &)
 Special interface to class HeaderDataUnit.
OFF_T read_all (FITS::HDUType, char *)
 read all data into a given address - all responsibility is given to the user
int read (FITS::HDUType, char *, int)
 read N bytes into address
int skip (FITS::HDUType, OFF_T)
 skip N bytes

Private Attributes

BlockInputm_fin
Bool m_got_rec
 flag used for read control in errors
int m_thdunum
 total number of hdu in this fits file

Friends

int HeaderDataUnit::get_hdr (FITS::HDUType, FitsKeywordList &)
OFF_T HeaderDataUnit::read_all_data (char *)
int HeaderDataUnit::read_data (char *, Int)
int HeaderDataUnit::skip (uInt)
int HeaderDataUnit::skip ()

Additional Inherited Members

Public Types inherited from casacore::FitsIO
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...
Protected Member Functions inherited from casacore::FitsIO
 FitsIO (FITSErrorHandler)
Protected Attributes inherited from casacore::FitsIO
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

fixed-length sequential blocked FITS input

Definition at line 154 of file fitsio.h.

Constructor & Destructor Documentation

◆ FitsInput() [1/2]

casacore::FitsInput::FitsInput ( const char * ,
const FITS::FitsDevice & ,
int = 10,
FITSErrorHandler errhandler = FITSError::defaultHandler )

◆ FitsInput() [2/2]

casacore::FitsInput::FitsInput ( FITSErrorHandler errhandler = FITSError::defaultHandler)

◆ ~FitsInput()

casacore::FitsInput::~FitsInput ( )

Member Function Documentation

◆ blockno()

int casacore::FitsInput::blockno ( ) const
inline

number of physical blocks read/written

Definition at line 184 of file fitsio.h.

References m_fin.

◆ current_hdu_type()

bool casacore::FitsInput::current_hdu_type ( FITS::HDUType & )
private

◆ errmsg()

virtual void casacore::FitsInput::errmsg ( FitsErrs ,
const char *  )
privatevirtual

set error message that belongs to one of the enumerated types

Implements casacore::FitsIO.

◆ get_data_type()

bool casacore::FitsInput::get_data_type ( FITS::ValueType & )
private

◆ getfin()

BlockInput & casacore::FitsInput::getfin ( )
inline

Definition at line 188 of file fitsio.h.

References m_fin.

◆ getnumhdu()

int casacore::FitsInput::getnumhdu ( ) const
inline

the number of hdu in this fits file

Definition at line 191 of file fitsio.h.

References m_thdunum.

◆ init()

void casacore::FitsInput::init ( )
private

◆ kwlist_str()

Vector< String > casacore::FitsInput::kwlist_str ( Bool length80 = False)

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).

References casacore::False.

◆ make_input()

BlockInput & casacore::FitsInput::make_input ( const char * ,
const FITS::FitsDevice & ,
int ,
FITSErrorHandler errhandler = FITSError::defaultHandler )
private

◆ process_header()

int casacore::FitsInput::process_header ( FITS::HDUType ,
FitsKeywordList &  )
private

Special interface to class HeaderDataUnit.

special way to process header

◆ read()

int casacore::FitsInput::read ( FITS::HDUType ,
char * ,
int  )
private

read N bytes into address

◆ read_all()

OFF_T casacore::FitsInput::read_all ( FITS::HDUType ,
char *  )
private

read all data into a given address - all responsibility is given to the user

◆ read_header_rec()

void casacore::FitsInput::read_header_rec ( )
private

◆ read_sp()

char * casacore::FitsInput::read_sp ( )

int skip_hdu2(); read special or unrecognizable records

◆ recno()

int casacore::FitsInput::recno ( ) const
inline

number of logical records read/written

Definition at line 187 of file fitsio.h.

References m_fin.

◆ skip()

int casacore::FitsInput::skip ( FITS::HDUType ,
OFF_T  )
private

skip N bytes

◆ skip_all()

void casacore::FitsInput::skip_all ( FITS::HDUType )

skip all remaining data

◆ skip_hdu()

int casacore::FitsInput::skip_hdu ( )

◆ HeaderDataUnit::get_hdr

◆ HeaderDataUnit::read_all_data

OFF_T HeaderDataUnit::read_all_data ( char * )
friend

◆ HeaderDataUnit::read_data

int HeaderDataUnit::read_data ( char * ,
Int  )
friend

◆ HeaderDataUnit::skip [1/2]

int HeaderDataUnit::skip ( )
friend

◆ HeaderDataUnit::skip [2/2]

int HeaderDataUnit::skip ( uInt )
friend

Member Data Documentation

◆ m_fin

BlockInput& casacore::FitsInput::m_fin
private

Definition at line 194 of file fitsio.h.

Referenced by blockno(), getfin(), and recno().

◆ m_got_rec

Bool casacore::FitsInput::m_got_rec
private

flag used for read control in errors

Definition at line 199 of file fitsio.h.

◆ m_thdunum

int casacore::FitsInput::m_thdunum
private

total number of hdu in this fits file

Definition at line 201 of file fitsio.h.

Referenced by getnumhdu().


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