#include <fitshandle.h>
Public Types | |
enum | openmethod { CREATE, OPEN } |
Public Member Functions | |
File-level access and manipulation. | |
fitshandle () | |
fitshandle (const std::string &fname, openmethod mode=OPEN, int rwmode=READONLY) | |
fitshandle (const std::string &fname, int hdunum, int rwmode=READONLY) | |
~fitshandle () | |
void | open (const std::string &fname, int rwmode=READONLY) |
void | create (const std::string &fname) |
void | close () |
void | goto_hdu (int hdu) |
void | assert_pdmtype (const std::string &pdmtype) |
void | insert_bintab (const std::vector< fitscolumn > &cols) |
void | insert_asctab (const std::vector< fitscolumn > &cols) |
void | insert_image (int btpx, const std::vector< long > &Axes) |
template<typename T> | |
void | insert_image (int btpx, const arr2< T > &data) |
Information about the current HDU | |
int | bitpix () const |
int | hdutype () const |
const std::vector< long > & | axes () const |
const std::string & | colname (int i) const |
const std::string & | colunit (int i) const |
long | repcount (int i) const |
int | coltype (int i) const |
int | ncols () const |
int | nrows () const |
long | nelems (int i) const |
Keyword-handling methods | |
void | copy_header (const fitshandle &orig) |
void | copy_historified_header (const fitshandle &orig) |
template<typename T> | |
void | add_key (const std::string &name, const T &value, const std::string &comment="") |
template<typename T> | |
void | update_key (const std::string &name, const T &value, const std::string &comment="") |
void | delete_key (const std::string &name) |
void | add_comment (const std::string &comment) |
template<typename T> | |
void | get_key (const std::string &name, T &value) |
template<typename T> | |
T | get_key (const std::string &name) |
bool | key_present (const std::string &name) |
Methods for table data I/O | |
template<typename T> | |
void | read_column_raw (int colnum, T *data, long num, long offset=0) |
template<typename T> | |
void | read_column (int colnum, arr< T > &data, long offset=0) |
template<typename T> | |
void | read_column (int colnum, T &data, long offset=0) |
template<typename T> | |
void | write_column_raw (int colnum, const T *data, long num, long offset=0) |
template<typename T> | |
void | write_column (int colnum, const arr< T > &data, long offset=0) |
template<typename T> | |
void | write_column (int colnum, const T &data, long offset=0) |
Methods for image data I/O | |
template<typename T> | |
void | read_image (arr2< T > &data) |
template<typename T> | |
void | read_subimage (arr2< T > &data, int xl, int yl) |
template<typename T> | |
void | read_subimage (arr< T > &data, long offset=0) |
template<typename T> | |
void | write_image (const arr2< T > &data) |
template<typename T> | |
void | write_subimage (const arr< T > &data, long offset=0) |
Definition at line 82 of file fitshandle.h.
|
the list of modes in which a fitshandle can be opened. Definition at line 130 of file fitshandle.h. |
|
Creates an unconnected fitshandle. Definition at line 138 of file fitshandle.h. |
|
Creates a fitshandle connected to file fname. If rwmode == READONLY, no writing access is permitted; if it is READWRITE, reading and writing can be performed. Definition at line 143 of file fitshandle.h. |
|
Creates a fitshandle connected to file fname and jumps directly to the HDU with the number hdunum. If rwmode == READONLY, no writing access is permitted; if it is READWRITE, reading and writing can be performed. Definition at line 156 of file fitshandle.h. |
|
Performs all necessary cleanups. Definition at line 164 of file fitshandle.h. |
|
Connects to the file fname. If rwmode == READONLY, no writing access is permitted; if it is READWRITE, reading and writing can be performed. Definition at line 185 of file fitshandle.cc. |
|
Creates the file fname and connects to it. Definition at line 192 of file fitshandle.cc. |
|
Closes the current file. Definition at line 173 of file fitshandle.h. |
|
Jumps to the HDU with the absolute number hdu. Definition at line 201 of file fitshandle.cc. |
|
Asserts that the PDMTYPE of the current HDU is pdmtype. Definition at line 510 of file fitshandle.cc. |
|
Inserts a binary table described by cols. Definition at line 209 of file fitshandle.cc. |
|
Inserts an ASCII table described by cols. The width of the columns is chosen automatically, in a way that avoids truncation. Definition at line 230 of file fitshandle.cc. |
|
Inserts a FITS image with the type given by btpx and dimensions given by Axes. Definition at line 259 of file fitshandle.cc. |
|
Inserts a 2D FITS image with the type given by btpx, whose contents are given in data. Definition at line 272 of file fitshandle.cc. |
|
If the current HDU is an image, returns the BITPIX parameter of that image, else throws an exception. Definition at line 198 of file fitshandle.h. |
|
Returns the FITS type code for the current HDU. Definition at line 204 of file fitshandle.h. |
|
Returns the dimensions of the current image. Definition at line 206 of file fitshandle.h. |
|
Returns the name of column #i. Definition at line 212 of file fitshandle.h. |
|
Returns the unit of column #i. Definition at line 218 of file fitshandle.h. |
|
Returns repetition count of column #i. Definition at line 224 of file fitshandle.h. |
|
Returns the FITS type code for column #i. Definition at line 230 of file fitshandle.h. |
|
Returns the number of columns in the current table. Definition at line 236 of file fitshandle.h. |
|
Returns the number of rows in the current table. Definition at line 242 of file fitshandle.h. |
|
Returns the total number of elements (nrows*repcount) in column #i. Definition at line 249 of file fitshandle.h. |
|
Copies all header keywords from the current HDU of orig to the current HDU of *this. Definition at line 334 of file fitshandle.cc. |
|
Copies all header keywords from the current HDU of orig to the current HDU of *this, prepending a HISTORY keyword to every line. Definition at line 292 of file fitshandle.cc. |
|
Adds a new header line consisting of key, value and comment. Definition at line 373 of file fitshandle.cc. |
|
Updates key with value and comment. Definition at line 413 of file fitshandle.cc. |
|
Deletes key from the header. Definition at line 450 of file fitshandle.cc. |
|
Adds comment as a comment line. Definition at line 457 of file fitshandle.cc. |
|
Reads the value belonging to key and returns it in value. Definition at line 464 of file fitshandle.cc. |
|
Returms the value belonging to key. Definition at line 283 of file fitshandle.h. |
|
Returns true if key is present, else false. Definition at line 500 of file fitshandle.cc. |
|
Copies num elements from column colnum to the memory pointed to by data, starting at offset offset in the column. Definition at line 298 of file fitshandle.h. |
|
Fills data with elements from column colnum, starting at offset offset in the column. Definition at line 303 of file fitshandle.h. |
|
Reads the element #offset from column colnum into data. Definition at line 307 of file fitshandle.h. |
|
Copies num elements from the memory pointed to by data to the column colnum, starting at offset offset in the column. Definition at line 320 of file fitshandle.h. |
|
Copies all elements from data to the column colnum, starting at offset offset in the column. Definition at line 325 of file fitshandle.h. |
|
Copies data to the column colnum, at the position offset. Definition at line 329 of file fitshandle.h. |
|
Reads the current image into data, which is resized accordingly. Definition at line 610 of file fitshandle.cc. |
|
Reads a partial image, whose dimensions are given by the dimensions of data, into data. The starting pixel indices are given by xl and yl. Definition at line 625 of file fitshandle.cc. |
|
Fills data with values from the image, starting at the offset offset in the image. The image is treated as a one-dimensional array. Definition at line 639 of file fitshandle.cc. |
|
Writes data into the current image. data must have the same dimensions as specified in the HDU. Definition at line 580 of file fitshandle.cc. |
|
Copies data to the image, starting at the offset offset in the image. The image is treated as a one-dimensional array. Definition at line 597 of file fitshandle.cc. |