#include <FITS.h>
Public Methods | |
FITS (const string &name, RWmode mode=Read, bool readDataFlag=false, const std::vector< string > &primaryKeys=std::vector< string >()) | |
FITS (const string &name, RWmode mode, const string &hduName, bool readDataFlag=false, const std::vector< string > &hduKeys=std::vector< string >(), const std::vector< string > &primaryKey=std::vector< string >(), int version=1) | |
FITS (const string &name, RWmode mode, const std::vector< string > &hduNames, bool readDataFlag=false, const std::vector< string > &primaryKey=std::vector< string >()) | |
FITS (const string &fileName, const FITS &source) | |
FITS (const string &name, RWmode mode, const std::vector< string > &hduNames, const std::vector< std::vector< string > > &hduKeys, bool readDataFlag=false, const std::vector< string > &primaryKeys=std::vector< string >(), const std::vector< int > &hduVersions=std::vector< int >()) | |
FITS (const string &name, int bitpix, int naxis, long *naxes) | |
FITS (const string &name, RWmode mode, int hduIndex, bool readDataFlag=false, const std::vector< string > &hduKeys=std::vector< string >(), const std::vector< string > &primaryKey=std::vector< string >()) | |
FITS (const string &name, RWmode mode, const std::vector< string > &searchKeys, const std::vector< string > &searchValues, bool readDataFlag=false, const std::vector< string > &hduKeys=std::vector< string >(), const std::vector< string > &primaryKey=std::vector< string >(), int version=1) | |
~FITS () | |
void | deleteExtension (const std::string &doomed, int version=1) |
void | read (const string &hduName, bool readDataFlag=false, const std::vector< string > &keys=std::vector< string >(), int version=0) |
void | read (const std::vector< string > &hduNames, bool readDataFlag=false) |
void | read (const std::vector< string > &hduNames, const std::vector< std::vector< string > > &keys, bool readDataFlag=false, const std::vector< int > &hduVersions=std::vector< int >()) |
FITS* | clone () const |
const ExtHDU& | extension (int i) const |
ExtHDU& | extension (int i) |
const ExtHDU& | extension (const string &hduName, int version=1) const |
const PHDU& | pHDU () const |
PHDU& | pHDU () |
ExtHDU& | extension (const string &hduName, int version=1) |
void | read (int hduIndex, bool readDataFlag=false, const std::vector< string > &keys=std::vector< string >()) |
Table* | addTable (string &hduName, int rows, const std::vector< string > &columnName=std::vector< string >(), const std::vector< string > &columnFmt=std::vector< string >(), const std::vector< string > &columnUnit=std::vector< string >(), HduType type=BinaryTbl, int version=1) |
ExtHDU* | addImage (const string &hduName, int bpix, std::vector< long > &naxes, int version=1) |
void | destroy () throw () |
void | flush () |
const string& | currentExtensionName () const |
void | read (const std::vector< string > &searchKeys, const std::vector< string > &searchValues, bool readDataFlag=false, const std::vector< string > &hduKeys=std::vector< string >(), int version=1) |
const std::multimap<string, ExtHDU*>& | extension () const |
void | resetPosition () |
const string& | name () const |
void | copy (const HDU &source) |
Table& | filter (const string &expression, ExtHDU &inputTable, bool overwrite=true, bool readData=false) |
ExtHDU& | currentExtension () |
void | deleteExtension (int doomed) |
Static Public Methods | |
void | clearErrors () |
bool | verboseMode () |
void | setVerboseMode (bool value) |
Constructors are provided to get FITS data from an existing file or to create new FITS data sets. Overloaded versions allow the user to
a) read from one or more specified extensions, specified by EXTNAME and VERSION or by HDU number. b either just header information or data on construction c) to specify scalar keyword values to be read on construction d) to open and read an extension that has specified keyword values e) create a new FITS object and corresponding file, including an empty primary header.
The memory fits object as constructed is always an image of a valid FITS object, i.e. a primary HDU is created on construction.
calling the destructor closes the disk file, so that FITS files are automatically deleted at the end of scope unless other arrangements are made.
|
basic constructor. This basic constructor makes a FITS object from the given filename. The filename string is passed directly to the cfitsio library: thus all of the extended filename syntax described in the cfitsio manual should work as documented. If the mode is Read [default], it will read all of the headers in the file, and all of the data if the readDataFlag is supplied as true. It will also read optional primary keys. The file name is the only required argument. If the mode is Write and the file does not already exist, a default primary HDU will be created in the file with BITPIX=8 and NAXIS=0: this mode is designed for writing FITS files with table extensions only. For files with image data the constructor that specified the data type and number of axes should be called.
|
|
Open a FITS file and read a single specified HDU. This and similar constructor variants support reading table data. Optional arguments allow the reading of primary header keys and specified data from hduName, the HDU to be read. An object representing the primary HDU is always created: if it contains an image, that image may be read by subsequent calls.
|
|
This is intended as a convenience where the file consists of single versions of HDUs and data only, not keys are to be read.
|
|
create a new FITS object and corresponding file with copy of the primary header of the source.
|
|
FITS read constructor in full generality.
|
|
Constructor for creating new FITS objects containing images. This constructor is only called for creating new files (mode is not an argument) and creates a new primary HDU with the datatype & axes specified by bitpix, naxis, and naxes. The data are added to the new fits object and file by subsequent calls to FITS::pHDU().write( <arguments> ) Valid values of bitpix are given in the fitsio.h header. If the filename corresponds to an existing file and does not start with the '!' character the construction will fail with a CantCreate exception. The arguments are:
|
|
read a single numbered HDU. Constructor analogous to the version that reads by name. This is required since HDU extensions are not required to have the EXTNAME or HDUNAME keyword by the standard. If there is no name, a dummy name based on the HDU number is created and becomes the key.
|
|
open fits file and read HDU which contains supplied keywords with [optional] specified values (sometimes one just wants to know that the keyword is present). Optional parameters allows the reading of specified primary HDU keys and specified columns and keywords in the HDU of interest.
|
|
destructor.
|
|
Add an image extension to an existing FITS object. (File with w or rw access). Does not make primary images, which are built in the constructor for the FITS file. The image data is not added here: it can be added by a second call.
|
|
Add a table extension to an existing FITS object. Add extension to FITS object for file with w or rw access.
|
|
clear the error stack and set status to zero.
|
|
clone function: to allow implementation later of reference counting.
|
|
copy the HDU source into the FITS object. This function adds a copy of an HDU from another file into *this. It does not create a duplicate of an HDU in the file associated with *this. |
|
return a non-const reference to whichever is the current extension.
|
|
return the name of the extension that the fitsfile is currently addressing. If the extension in question does not have an EXTNAME or HDUNAME keyword, then the function returns $HDU$n, where n is the sequential HDU index number (primary HDU = 0). |
|
Delete extension specified by extension number.
\overload |
|
Delete extension specified by name and version number.
Removes extension from FITS object and memory copy.
|
|
Erase FITS object and close corresponding file.
Force deallocation and erase of elements of a FITS memory object. Allows a reset of everything inside the FITS object, and closes the file. The object is inaccessible after this call. destroy is public to allow users to reuse a symbol for a new file, but it is identical in operation to the destructor. |
|
return const reference to the extension container. This is useful for such operations as extension().size() etc. |
|
return FITS extension by name and (optionally) version number.
|
|
return FITS extension by name and (optionally) version number.
|
|
return FITS extension by index number. non-const version. see const version for details.
|
|
return FITS extension by index number. N.B. The input index number is currently defined as enumerating extensions, so the extension(1) returns HDU number 2.
|
|
Filter the rows of the inputTable with the condition expression, and return a reference to the resulting Table.
This function provides an object oriented version of cfitsio's fits_select_rows call. The expression string is any boolean expression involving the names of the columns in the input table (e.g., if there were a column called "density", a valid expression might be "DENSITY > 3.5": see the cfitsio documentation for further details). [N.B. the "append" functionality described below does not work when linked with cfitsio 2.202 or prior because of a known issue with that version of the library. This causes the output to be a new extension with a correct header copy and version number but without the filtered data]. If the inputTable is an Extension HDU of this FITS object, then if overwrite is true the operation will overwrite the inputTable with the filtered version, otherwise it will append a new HDU with the same extension name but the next highest version (EXTVER) number available. |
|
flush buffer contents to disk.
Provides manual control of disk writing operation. Image data are flushed automatically to disk after the write operation is completed, but not column data. |
|
return filename of file corresponding to FITS object.
|
|
return a reference to the primary HDU.
|
|
return a const reference to the primary HDU.
|
|
read method for read header or HDU that contains specified keywords.
|
|
read an HDU specified by index number.
This is provided to allow reading of HDUs after construction. see above for parameter definitions. |
|
get data from a set of HDUs from disk file, specifying keys and version numbers. This is provided to allow reading of HDUs after construction. see above for parameter definitions. |
|
get data from a set of HDUs from disk file. This is provided to allow reading of HDUs after construction. see above for parameter definitions. |
|
get data from single HDU from disk file. This is provided to allow the adding of additional HDUs to the FITS object after construction of the FITS object. After the read() functions have been called for the FITS object, subsequent read method to the Primary, ExtHDU, and Column objects will retrieve data from the FITS object in memory (those methods can be called to read data in those HDU objects that was not read when the HDU objects were constructed. All the read functions will throw NoSuchHDU exceptions on seek errors since they involve constructing HDU objects. The parameter definitions are as documented for the corresponding constructor. |
|
explicit call to set the fits file pointer to the primary.
|
|
set verbose setting for library.
|
|
return verbose setting for library.
If true, all messages that are reported by exceptions are printed to std::cerr. |