ltl::FitsExtensionOut Class Reference
[MArray FITS file I/O]

Create a FITS extension object. Look into test/testfitsextensionio.cpp for examples. More...

Inherits ltl::FitsOut, and ltl::FitsExtension.

List of all members.

Public Member Functions

Adding new Cards



Shortcuts

Get (and set) values of mandatories and array keys via shortcuts.



Read Cards

Search the lists for card matching keyword and return requested instance.





Protected Member Functions

Parse Record string

The next 4 methods parse a complete 2880 char record into lists of ltl::FitsCards.



Parse Card String

These 2 functions parse a 80 char line card into an ltl::FitsCard.



Protected Attributes

Static Protected Attributes

Related Functions

(Note that these are not member functions.)

Card Lists

Lists representing the FITS header structure.


Detailed Description

Create a FITS extension object. Look into test/testfitsextensionio.cpp for examples.


Member Typedef Documentation

typedef std::list<FitsCard *> ltl::FitsHeader::MandatoryList [protected, inherited]
typedef MandatoryList::iterator ltl::FitsHeader::MandatoryIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::NaxisList [protected, inherited]
typedef NaxisList::iterator ltl::FitsHeader::NaxisIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::ExtensionList [protected, inherited]
typedef ExtensionList::iterator ltl::FitsHeader::ExtensionIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::ObserveList [protected, inherited]
typedef ObserveList::iterator ltl::FitsHeader::ObserveIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::CommentList [protected, inherited]
typedef CommentList::iterator ltl::FitsHeader::CommentIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::HistoryList [protected, inherited]
typedef HistoryList::iterator ltl::FitsHeader::HistoryIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::BlankList [protected, inherited]
typedef BlankList::iterator ltl::FitsHeader::BlankIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::ArrayList [protected, inherited]
typedef ArrayList::iterator ltl::FitsHeader::ArrayIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::OtherList [protected, inherited]
typedef OtherList::iterator ltl::FitsHeader::OtherIter [protected, inherited]
typedef std::list<FitsCard *> ltl::FitsHeader::JunkList [protected, inherited]
typedef JunkList::iterator ltl::FitsHeader::JunkIter [protected, inherited]

Constructor & Destructor Documentation

ltl::FitsExtensionOut::FitsExtensionOut ( const string &  path  ) 
ltl::FitsExtensionOut::FitsExtensionOut ( const char *  path  ) 
ltl::FitsExtensionOut::FitsExtensionOut ( const string &  path,
const FitsHeader header,
const bool  quiet_please = false,
const bool  ign_junk = false 
)
ltl::FitsExtensionOut::FitsExtensionOut ( const char *  path,
const FitsHeader header,
const bool  quiet_please = false,
const bool  ign_junk = false 
)
virtual ltl::FitsExtensionOut::~FitsExtensionOut (  )  [virtual]

Member Function Documentation

void ltl::FitsExtensionOut::flushHeader (  ) 

dump header to file, i.e. either primary or of next extension

int* ltl::FitsOut::region2Naxis ( const util::Region region,
int newnaxis 
) const [protected, inherited]

Convert Region to Naxis array discarding dims with length == 1.

int ltl::FitsOut::setGeometry ( const int  newbitpix,
const int  newnaxis,
const int newnaxis_i,
const bool  append = false 
) [protected, inherited]

Create "empty" FITS file, i.e. header + zero data segment. Returns file descriptor.

void ltl::FitsOut::setGeometry ( const int  newbitpix,
const util::Region region,
const bool  append = false 
) [inherited]

Create "empty" FITS file, i.e. header + zero data segment.

void ltl::FitsOut::checkinmemalloc ( const off_t  write_offset,
const int  bytestobewritten 
) [protected, inherited]
virtual void ltl::FitsOut::describeSelf ( std::ostream &  os  )  [virtual, inherited]

Write FITS file geometry and class interna to out stream.

Reimplemented from ltl::FitsHeader.

void ltl::FitsOut::openData ( const int  newbitpix,
const int  newnaxis,
const int newnaxis_i,
const bool  append = false 
) throw (FitsException) [inherited]

Write FITS file header and create suitable data segment map.

Referenced by ltl::FitsIO::operator<<().

void ltl::FitsOut::openData ( const int  newbitpix,
const util::Region region,
const bool  append = false 
) throw (FitsException) [inherited]

Write FITS file header and create region sized data segment map.

void ltl::FitsOut::setRegion ( const util::Region region  )  throw (FitsException) [inherited]

Set Region for selective access to parts of data segment .

void ltl::FitsOut::resetRegion (  )  [inline, inherited]

Reset Region, if set.

References ltl::FitsOut::closeData().

bool ltl::FitsOut::isRegion (  )  const [inline, inherited]

Return true if region is set.

References ltl::FitsIO::regionptr_.

void ltl::FitsOut::closeData (  )  [inherited]

Finish FITS file, unmap data segment.

Referenced by ltl::FitsOut::resetRegion().

void ltl::FitsOut::copyData ( FitsIn infile,
const bool  append = false 
) [inherited]

Copy data (and BSCALE and BZERO) from infile.

Referenced by ltl::FitsIO::operator<<(), and ltl::FitsIO::operator>>().

unsigned char* ltl::FitsOut::begin (  )  const [inherited]
unsigned char* ltl::FitsOut::end (  )  const [inherited]
void ltl::FitsOut::resetPosition (  )  [inherited]
void ltl::FitsOut::setPosition ( off_t  offset  )  [inherited]
ptrdiff_t ltl::FitsOut::getPosition (  )  const [inherited]
void ltl::FitsOut::setFilename ( const string &  path  )  [inherited]

Set output filename according to argument.

void ltl::FitsOut::setBitpixOut ( const int  bpo  )  throw (FitsException) [inherited]

Override automatic BITPIX setting with argument.

void ltl::FitsOut::setOrigin ( const string &  orig  )  [inherited]

Set FITS key ORIGIN according to argument.

int ltl::FitsOut::getBitpixOut (  )  const [inherited]

Public method to read ltl::FitsOut::bitpixout_.

string ltl::FitsOut::getOrigin (  )  const [inherited]

Public method to read ltl::FitsOut::origin_.

template<class T >
void ltl::FitsOut::writeDataArray ( T &  i  )  [inline, inherited]

Fill data segment with container via iterator i.

References ltl::FitsOut::begin(), ltl::FitsHeader::bitpix_, and ltl::FitsHeader::getDataLength().

template<class T >
void ltl::FitsOut::writeRegionArray ( T &  i  )  [inline, inherited]

Fill region of data segment with container via iterator i.

References ltl::FitsOut::begin(), ltl::FitsHeader::bitpix_, ltl::FitsHeader::getFullRegion(), and ltl::FitsIO::regionptr_.

template<class T >
void ltl::FitsOut::setNextPixel ( const T  value  )  [inline, inherited]
void ltl::FitsOut::eraseObsolete (  )  [protected, inherited]

Erase BSCALE, BZERO, BLOCKED, EPOCH and ORIGIN.

void ltl::FitsOut::resetMandatories ( const int  newbitpix,
const int  newnaxis,
const int newnaxis_i 
) throw (FitsException) [protected, inherited]

Set mandatory FITS keywords according to arguments.

void ltl::FitsOut::resetArrayKeys (  )  [protected, inherited]

Erase potentially missleading FITS array keywords.

std::string ltl::FitsHeader::adjustKeyword ( std::string  keyword  )  const [inherited]

Return keyword trimmed (or expanded) to a width of 8 chars.

Trailing blanks are significant for FITS keywords. If you want to add missing trailing blanks or simply trim too long keywords you may want to use this method.

void ltl::FitsHeader::addCommentCard ( const std::string &  keyword,
const std::string &  comment 
) [inherited]

Add a commentary card.

void ltl::FitsHeader::addCommentCard ( FitsCard *  cardptr  )  throw (FitsException) [protected, inherited]

Add a commentary card to the correct list.

void ltl::FitsHeader::addHistory ( const std::string &  history  )  [inherited]

Add a history of arbitrary length.

void ltl::FitsHeader::addComment ( const std::string &  comment  )  [inherited]

Add a history of arbitrary length.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const std::string &  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add a string value card.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const char *  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add a char value card.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const bool  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add a boolean value card.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const int  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add an integer value card.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const long  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add an integer value card.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const float  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add a floating point value card.

void ltl::FitsHeader::addValueCard ( const std::string &  keyword,
const double  value,
const std::string  comment = "",
const bool  fixed = true 
) [inherited]

Add a floating point value card.

void ltl::FitsHeader::addValueCard ( FitsCard *  cardptr  )  throw (FitsException) [protected, inherited]

Add a value holding card to its proper list.

If the card has a bad syntax it's put on the ltl::FitsHeader::junk_ list.

Exceptions:
ltl::FitsException on error.
int ltl::FitsHeader::eraseCard ( const std::string &  keyword  )  throw (FitsException) [inherited]

Erase FITS card keyword.

Returns 0 on success, -1 on keyword not found.

Exceptions:
ltl::FitsException on forbidden erasures.
off_t ltl::FitsHeader::getDataOffset (  )  const [inherited]

Return the byte offset within the file to the data segment.

int ltl::FitsHeader::getBitpix (  )  const [inherited]

Return BITPIX setting.

int ltl::FitsHeader::getBytpix (  )  const [inherited]

Return bytes per pixel, i.e. abs( bitpix_ ) / 8.

int ltl::FitsHeader::getNaxis (  )  const [inherited]

Return NAXIS setting.

Referenced by ltl::getFitsMArray(), and ltl::insertFitsMArray().

int ltl::FitsHeader::getNaxis ( const int  i  )  const [inherited]

Return width of i NAXIS.

double ltl::FitsHeader::getBscale (  )  const [inherited]
double ltl::FitsHeader::getBzero (  )  const [inherited]
void ltl::FitsHeader::setBscale ( const double  value  )  [inherited]

Set the BSCALE key to value.

void ltl::FitsHeader::setBzero ( const double  value  )  [inherited]

Set the BZERO key to value.

util::Region ltl::FitsHeader::getFullRegion (  )  const [inherited]

Return a util::Region according to the NAXIS geometry.

Referenced by ltl::FitsIn::getDataArray(), ltl::FitsIn::readRegionArray(), and ltl::FitsOut::writeRegionArray().

off_t ltl::FitsHeader::getDataLength (  )  const [inherited]

Return the size of the data segment in bytes.

Referenced by ltl::FitsIn::getDataArray(), ltl::FitsIn::readDataArray(), and ltl::FitsOut::writeDataArray().

std::string ltl::FitsHeader::getString ( const std::string &  keyword  )  const [inherited]

Return string value of FITS key keyword.

bool ltl::FitsHeader::getBool ( const std::string &  keyword  )  const [inherited]

Return boolean value of FITS key keyword.

long ltl::FitsHeader::getInt ( const std::string &  keyword  )  const [inherited]

Return integer value of FITS key keyword.

double ltl::FitsHeader::getFloat ( const std::string &  keyword  )  const [inherited]

Return floating point value of FITS key keyword.

bool ltl::FitsHeader::isFixed ( const std::string &  keyword  )  const [inherited]

Indicate if value of FITS key keyword is of fixed type.

std::string ltl::FitsHeader::getComment ( const std::string &  keyword  )  const [inherited]

Return comment of FITS key keyword.

std::string ltl::FitsHeader::getComment (  )  const [inherited]

Return complete COMMENT.

std::string ltl::FitsHeader::getHistory (  )  const [inherited]

Return complete HISTORY.

std::string ltl::FitsHeader::getValueAsString ( const std::string &  keyword  )  const [inherited]

Return value of FITS key keyword as a string irrespective of its type.

std::string ltl::FitsHeader::writeHeader ( const bool  with_junk = false  )  [inherited]

Return a new valid FITS file format header.

void ltl::FitsHeader::readHeader ( const std::string &  filename,
const bool  alljunk = false,
unsigned char *  inmemptr = NULL,
size_t  inmemlen = 0 
) throw (FitsException) [protected, inherited]

Read and parse a FITS header from file.

std::string::size_type ltl::FitsHeader::parseRecord ( const std::string &  record,
const bool  alljunk = false 
) throw (FitsException) [protected, inherited]

Parse a FITS record and assign the cards to their proper lists.

Returns the length of the record or 0 if "END" was found.

Exceptions:
ltl::FitsException on error.
std::string::size_type ltl::FitsHeader::parseMandatory ( const std::string &  record  )  throw (FitsException) [protected, inherited]

Parse the mandatory keys of record.

Return offset to next non-mandatory card within record.

Exceptions:
ltl::FitsException on error.
std::string::size_type ltl::FitsHeader::parseNaxis ( const std::string &  record,
std::string::size_type  card_of_record = 0 
) [protected, inherited]

Parse cards until Naxis parameter is matched, returns card offset in record.

void ltl::FitsHeader::checkNaxis (  )  throw (FitsException) [protected, inherited]

Check the Naxis list, ltl::FitsException on error.

FitsCard* ltl::FitsHeader::parseCard ( const std::string &  card  )  const throw (FitsException) [protected, inherited]

Parse 80 char line into an ltl::FitsCard object.

std::string ltl::FitsHeader::getCardComment ( const std::string &  teststring  )  const throw (FitsException) [protected, inherited]

Return the comment of a 80 char line card remainder.

void ltl::FitsHeader::parseCommentToCardList ( const std::string &  keyword,
const std::string &  comment 
) [protected, inherited]

Parse and add a commentstring to its list.

Can be long, will be broken into lines)

void ltl::FitsHeader::addJunkCard ( const std::string &  native_card  )  [protected, inherited]

Just split 80 char card into keyword + rest and push it on the junk list.

void ltl::FitsHeader::addJunkCard ( const std::string &  keyword,
const std::string &  comment 
) [protected, inherited]

Add a suitable trimmed junk card.

void ltl::FitsHeader::addJunkCard ( FitsCard *  cardptr  )  [protected, inherited]

Add a preexisting ltl::FitsCard to junk list.

void ltl::FitsHeader::clearCardList ( std::list< FitsCard * > &  the_list  )  [protected, inherited]

Clear a whole list of cards.

int ltl::FitsHeader::eraseCardFromList ( const std::string &  keyword,
std::list< FitsCard * > &  the_list 
) [protected, inherited]

Erase first ltl::FitsCard mathcing keyword from the_list.

Return -1 if keyword not found, otherwise 0.

int ltl::FitsHeader::eraseCardsFromJunkList ( const std::string &  keyword  )  [protected, inherited]

Erase all cards matching keyword from the ltl::FitsHeader::junk_ list.

Return the number of erased cards.

FitsCard * ltl::FitsHeader::findCardInList ( const std::string &  keyword,
const std::list< FitsCard * > &  the_list 
) const [protected, inherited]

Return pointer to card matching keyword in the_list.

Return NULL if no card is found.

Referenced by ltl::FitsBinTableIn::readColumn().

FitsCard * ltl::FitsHeader::getValueCard ( const std::string &  keyword  )  const throw (FitsException) [protected, inherited]

Return pointer to first card matching keyword on any non commentary list.

Exceptions:
ltl::FitsException on error, i.e. no matching card found.
std::string ltl::FitsHeader::writeCommentsOfList ( const std::list< FitsCard * > &  the_list  )  const [protected, inherited]

Return string holding new line broken comments of a whole list.

std::string ltl::FitsHeader::writeCardsOfList ( const std::list< FitsCard * > &  the_list  )  const [protected, inherited]

Return string holding FITS formatted cards of a list.

void ltl::FitsHeader::copy ( const FitsHeader other  )  [protected, inherited]

Copy header from other.

void ltl::FitsHeader::copyCardList ( std::list< FitsCard * > &  dest_list,
const std::list< FitsCard * > &  src_list 
) [protected, inherited]

Copy list of ltl::FitsCard.

void ltl::FitsHeader::testRegion ( const util::Region testreg  )  const throw (FitsException) [protected, inherited]

Test if region complies with FITS file geometry.

void ltl::FitsIO::checkRegion ( const size_t  dim  )  const throw (FitsException) [protected, inherited]

Test if dimension dim of region is "retrievable".

string ltl::FitsIO::getFilename (  )  const [inline, inherited]
unsigned char* ltl::FitsIO::streampos (  )  const [inline, inherited]
size_t ltl::FitsIO::getRegionLength (  )  const [inherited]

Get number of pixels in selected region.

Referenced by ltl::getFitsMArray(), and ltl::insertFitsMArray().

size_t ltl::FitsIO::getRegionLength ( const size_t  dim  )  const [inherited]

Get length along dimension dim of selected region in pixels.

int ltl::FitsIO::getRegionStart ( const size_t  dim  )  const [inherited]

Get start pixel coordinate in dimension dim of selected region.

int ltl::FitsIO::getRegionEnd ( const size_t  dim  )  const [inherited]

Get end pixel coordinate in dimension dim of selected region.

Referenced by ltl::insertFitsMArray().

util::Region ltl::FitsIO::getRegion (  )  const [inherited]

Return copy of selected region.

Referenced by ltl::insertFitsMArray().

size_t ltl::FitsExtension::getExtNo (  )  const [inherited]

Return number of actual extension.

bool ltl::FitsExtension::getPrimary (  )  const [inherited]

Return status of primary flag, i.e. reading or writing primary header / data.

Referenced by ltl::FitsIO::operator<<().

void ltl::FitsExtension::resetExtNo (  )  [inherited]

Reset Extension counter and raise primary flag.

Referenced by ltl::FitsIO::operator<<().

void ltl::FitsExtension::incExtNo (  )  [inherited]

Increment Extension counter and lower primary flag.

Referenced by ltl::FitsIO::operator<<().

void ltl::FitsExtension::unsetPrimary (  )  [inherited]

Lower primary flag.

Referenced by ltl::FitsIO::operator<<().


Member Data Documentation

bool ltl::FitsOut::ignorejunk_ [protected, inherited]

Boolean indicating if "junk" FITS cards are also written to header.

int ltl::FitsOut::bitpixout_ [protected, inherited]

BITPIX setting for FITS file.

string ltl::FitsOut::origin_ [protected, inherited]

Shortcut to ORIGIN key.

bool ltl::FitsHeader::shutup_ [protected, inherited]

Boolean indicating if no error messages shall be written to stderr.

int ltl::FitsHeader::bitpix_ [protected, inherited]
int ltl::FitsHeader::bytpix_ [protected, inherited]
int ltl::FitsHeader::naxis_ [protected, inherited]
int* ltl::FitsHeader::naxis_array_ [protected, inherited]

Pointer to array holding shortcuts to NAXIS keywords.

Referenced by ltl::FitsBinTableIn::readPColumn().

bool ltl::FitsHeader::extended_ [protected, inherited]

Shortcut indicating extension maybe present.

int ltl::FitsHeader::pcount_ [protected, inherited]

Shortcuts for calculating length of extension.

int ltl::FitsHeader::gcount_ [protected, inherited]
double ltl::FitsHeader::bscale_ [protected, inherited]

Shortcuts to FITS keywords BSCALE and BZERO.

Referenced by ltl::FitsIn::getNextPixel().

double ltl::FitsHeader::bzero_ [protected, inherited]
off_t ltl::FitsHeader::data_offset_ [protected, inherited]

Offset to first element of data segment,.

off_t ltl::FitsHeader::data_length_ [protected, inherited]

Length of data segment in bytes.

const FitsPhysical ltl::FitsHeader::PH_C [static, protected, inherited]

Structure holding physical FITS sizes.

const FitsKnownList ltl::FitsHeader::KNOWN [static, protected, inherited]

List of all known keywords and their types.

List holding all mandatory cards.

NaxisList ltl::FitsHeader::naxis_i_ [protected, inherited]

List holding all NAXIS# cards.

List holding EXTENSION cards.

Referenced by ltl::FitsBinTableIn::readColumn().

List holding reserved keywords cards which are not on other lists.

These are AUTHOR, BLOCKED, DATE, DATE-OBS, DATExxxx, EQUINOX, EPOCH, INSTRUME, OBJECT, OBSERVER, ORIGIN, REFERENC and TELESCOP. EPOCH will be copied to EQUINOX if EQUINOX not present.

CommentList ltl::FitsHeader::comment_ [protected, inherited]

List holding the COMMENT cards.

HistoryList ltl::FitsHeader::history_ [protected, inherited]

List holding the HISTORY cards.

BlankList ltl::FitsHeader::blank_ [protected, inherited]

List holding the blank cards.

List holding array keywords cards.

These are BSCALE, BZERO, BUNIT, BLANK, CTYPEn, CRPIXn, CRVALn, CRDELTn, CROTAn, DATAMIN and DATAMAX.

OtherList ltl::FitsHeader::otherkeys_ [protected, inherited]

List holding all other cards.

JunkList ltl::FitsHeader::junk_ [protected, inherited]

List holding the cards not complying with FITS standard.

string ltl::FitsIO::filename_ [protected, inherited]

Filename associated with FitsIn/Out object.

Referenced by ltl::FitsIO::getFilename().

unsigned char* ltl::FitsIO::fitsinmemptr_ [protected, inherited]

Pointer to in-memory fits file image.

size_t ltl::FitsIO::fitsinmemlength_ [protected, inherited]

Length of in-memory fits file.

unsigned char** ltl::FitsIO::ptrfitsinmemptr_ [protected, inherited]

In-memory fits file image allocation data.

size_t* ltl::FitsIO::ptrfitsinmemlength_ [protected, inherited]
unsigned char* ltl::FitsIO::fitsdataptr_ [protected, inherited]

Pointer to data segment map.

unsigned char* ltl::FitsIO::fitsstreamptr_ [protected, inherited]

Pointer to actual byte in data segment for per pixel I/O.

Referenced by ltl::FitsIn::getNextPixel(), ltl::FitsOut::setNextPixel(), and ltl::FitsIO::streampos().

size_t ltl::FitsIO::fitsmaplength_ [protected, inherited]

Length of data segment map, multiple of page size.

util::Region* ltl::FitsIO::regionptr_ [protected, inherited]
off_t ltl::FitsIO::fitsregionoffset_ [protected, inherited]

Offset to determine first pixel of selected region.

bool ltl::FitsExtension::primary_ [protected, inherited]
size_t ltl::FitsExtension::extno_ [protected, inherited]

Generated on 19 Feb 2015 for LTL by  doxygen 1.6.1