27.01.2015 Views

CCfits - HEASARC - NASA

CCfits - HEASARC - NASA

CCfits - HEASARC - NASA

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

15 What’s Present, What’s Missing, and Calling CFITSIO 29<br />

}<br />

return 0;<br />

15 What’s Present, What’s Missing, and Calling CFITSIO<br />

Most of the functionality of cfitsio described in Chapter 5 of the cfitsio manual is<br />

present, although <strong>CCfits</strong> is designed to provide atomic read/write operations rather<br />

than primitive file manipulation. For example, opening and creating FITS files are private<br />

operations which are called by reading and writing constructors. Similarly, errors<br />

are treated by C++ exception handling rather than returning status codes, and moving<br />

between HDUs within a file is a primitive rather than an atomic operation [in <strong>CCfits</strong>,<br />

operations typically call an internal HDU::makeThisCurrent() call on a specific table<br />

or image extension, and then perform the requested read/write operation].<br />

Read/Write operations for keys (in the HDU class) are provided; these implement calls<br />

to fits_read_key and fits_update_key respectively. In the case of keywords, which<br />

have one of five data types (Integer, Logical, String, Floating and Complex) <strong>CCfits</strong><br />

will handle certain type conversions between the keyword value and the data type of<br />

the user-supplied variable. This is described in detail in the Keyword class reference<br />

page. In reading image and table data, intrinsic type conversions are performed as<br />

in cfitsio with the exception that reading numeric data into character data is not supported.<br />

There is an extensive set of member functions supporting equivalents of most of<br />

cfitsio’s read/write operations: the classes PHDU [primary HDU] and ExtHDU [with<br />

subclasses template ImageExt], provide multiple overloaded versions<br />

of read and write functions. The Column class, instances of which can be held in<br />

Table instances [with subclasses AsciiTable and BinTable] has also an extensive set of<br />

read/write operations.<br />

A special constructor is provided which creates a new file with the Primary HDU of<br />

a source file. A FITS::copy(const HDU&) function copies HDUs from one file into<br />

another. Support for filtering table rows by expression is provided by a FITS::filter( ...<br />

) call which may be used to create a new filtered file or overwrite an existing HDU (see<br />

cfitsio manual section 5.6.4).<br />

Functions are provided for adding and deleting columns, and inserting and deleting<br />

rows in tables.<br />

HDU objects also have functions to implement writing of history, comment and date<br />

keys.<br />

Extended file name syntax (chapter 10 of the cfitsio manual) is supported in general,<br />

though not the feature which allows the opening of a particular image stored in the row<br />

of a table.<br />

Generated on Tue Dec 6 2011 16:12:51 for <strong>CCfits</strong> by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!