A simple struct that combines the two arguments that must be passed to most cfitsio routines and contains thin and/or templated wrappers around common cfitsio routines.
More...
|
std::string | getFileName () const |
| Return the file name associated with the FITS object or "<unknown>" if there is none.
|
|
int | getHdu () |
| Return the current HDU (0-indexed; 0 is the Primary HDU).
|
|
void | setHdu (int hdu, bool relative=false) |
| Set the current HDU.
|
|
void | setHdu (std::string const &name, HduType hdutype=HduType::ANY, int hduver=0) |
| Set the current HDU using its name, version and type.
|
|
int | countHdus () |
| Return the number of HDUs in the file.
|
|
template<typename T > |
void | updateKey (std::string const &key, T const &value, std::string const &comment) |
| Set a FITS header key, editing if it already exists and appending it if not.
|
|
void | updateKey (std::string const &key, char const *value, std::string const &comment) |
|
template<typename T > |
void | updateKey (std::string const &key, T const &value) |
|
void | updateKey (std::string const &key, char const *value) |
|
template<typename T > |
void | writeKey (std::string const &key, T const &value, std::string const &comment) |
| Add a FITS header key to the bottom of the header.
|
|
void | writeKey (std::string const &key, char const *value, std::string const &comment) |
|
template<typename T > |
void | writeKey (std::string const &key, T const &value) |
|
void | writeKey (std::string const &key, char const *value) |
|
template<typename T > |
void | updateColumnKey (std::string const &prefix, int n, T const &value, std::string const &comment) |
| Update a key of the form XXXXXnnn, where XXXXX is the prefix and nnn is a column number.
|
|
void | updateColumnKey (std::string const &prefix, int n, char const *value, std::string const &comment) |
|
template<typename T > |
void | updateColumnKey (std::string const &prefix, int n, T const &value) |
|
void | updateColumnKey (std::string const &prefix, int n, char const *value) |
|
template<typename T > |
void | writeColumnKey (std::string const &prefix, int n, T const &value, std::string const &comment) |
| Write a key of the form XXXXXnnn, where XXXXX is the prefix and nnn is a column number.
|
|
void | writeColumnKey (std::string const &prefix, int n, char const *value, std::string const &comment) |
|
template<typename T > |
void | writeColumnKey (std::string const &prefix, int n, T const &value) |
|
void | writeColumnKey (std::string const &prefix, int n, char const *value) |
|
void | writeMetadata (daf::base::PropertySet const &metadata) |
| Read a FITS header into a PropertySet or PropertyList.
|
|
void | readMetadata (daf::base::PropertySet &metadata, bool strip=false) |
| Read a FITS header into a PropertySet or PropertyList.
|
|
template<typename T > |
void | readKey (std::string const &key, T &value) |
| Read a FITS header key into the given reference.
|
|
void | forEachKey (HeaderIterationFunctor &functor) |
| Call a polymorphic functor for every key in the header.
|
|
void | createEmpty () |
| Create an empty image HDU with NAXIS=0 at the end of the file.
|
|
template<typename PixelT , int N> |
void | createImage (ndarray::Vector< ndarray::Size, N > const &shape) |
| Create an image with pixel type provided by the given explicit PixelT template parameter and shape defined by an ndarray index.
|
|
template<int N> |
void | createImage (int bitpix, ndarray::Vector< ndarray::Size, N > const &shape) |
|
template<typename PixelT > |
void | createImage (long x, long y) |
| Create a 2-d image with pixel type provided by the given explicit PixelT template parameter.
|
|
template<typename T , int N, int C> |
void | writeImage (ndarray::Array< T const, N, C > const &array) |
| Write an ndarray::Array to a FITS image HDU.
|
|
template<typename T > |
void | writeImage (image::ImageBase< T > const &image, ImageWriteOptions const &options, daf::base::PropertySet const *header=nullptr, image::Mask< image::MaskPixel > const *mask=nullptr) |
| Write an image to FITS.
|
|
int | getImageDim () |
| Return the number of dimensions in the current HDU.
|
|
template<int N> |
ndarray::Vector< ndarray::Size, N > | getImageShape () |
| Return the shape of the current (image) HDU.
|
|
template<typename T > |
bool | checkImageType () |
| Return true if the current HDU is compatible with the given pixel type.
|
|
std::string | getImageDType () |
| Return the numpy dtype equivalent of the image pixel type (e.g.
|
|
template<typename T , int N> |
void | readImage (ndarray::Array< T, N, N > const &array, ndarray::Vector< int, N > const &offset) |
| Read an array from a FITS image.
|
|
void | createTable () |
| Create a new binary table extension.
|
|
template<typename T > |
int | addColumn (std::string const &ttype, int size, std::string const &comment) |
| Add a column to a table.
|
|
template<typename T > |
int | addColumn (std::string const &ttype, int size) |
| Add a column to a table.
|
|
std::size_t | addRows (std::size_t nRows) |
| Append rows to a table, and return the index of the first new row.
|
|
std::size_t | countRows () |
| Return the number of row in a table.
|
|
template<typename T > |
void | writeTableArray (std::size_t row, int col, int nElements, T const *value) |
| Write an array value to a binary table.
|
|
template<typename T > |
void | writeTableScalar (std::size_t row, int col, T value) |
| Write a scalar value to a binary table.
|
|
void | writeTableScalar (std::size_t row, int col, std::string const &value) |
| Write a string to a binary table.
|
|
template<typename T > |
void | readTableArray (std::size_t row, int col, int nElements, T *value) |
| Read an array value from a binary table.
|
|
template<typename T > |
void | readTableScalar (std::size_t row, int col, T &value) |
| Read an array scalar from a binary table.
|
|
void | readTableScalar (std::size_t row, int col, std::string &value, bool isVariableLength) |
| Read a string from a binary table.
|
|
long | getTableArraySize (int col) |
| Return the size of an array column.
|
|
long | getTableArraySize (std::size_t row, int col) |
| Return the size of an variable-length array field.
|
|
| Fits () |
| Default constructor; set all data members to 0.
|
|
| Fits (std::string const &filename, std::string const &mode, int behavior) |
| Open or create a FITS file from disk.
|
|
| Fits (MemFileManager &manager, std::string const &mode, int behavior) |
| Open or create a FITS file from an in-memory file.
|
|
void | closeFile () |
| Close a FITS file.
|
|
void | setImageCompression (ImageCompressionOptions const &options) |
| Set compression options for writing FITS images.
|
|
ImageCompressionOptions | getImageCompression () |
| Return the current image compression settings.
|
|
bool | checkCompressedImagePhu () |
| Go to the first image header in the FITS file.
|
|
| ~Fits () |
|
| Fits (const Fits &)=delete |
|
Fits & | operator= (const Fits &)=delete |
|
| Fits (Fits &&)=delete |
|
Fits & | operator= (Fits &&)=delete |
|
A simple struct that combines the two arguments that must be passed to most cfitsio routines and contains thin and/or templated wrappers around common cfitsio routines.
This is NOT intended to be an object-oriented C++ wrapper around cfitsio; it's simply a thin layer that saves a lot of repetition, const/reinterpret casts, and replaces void pointer args and type codes with templates and overloads.
Like a cfitsio pointer, a Fits object always considers one HDU the "active" one, and most operations will be applied to that HDU.
All member functions are non-const because they may modify the 'status' data member.
- Note
- All functions that take a row or column number below are 0-indexed; the internal cfitsio calls are all 1-indexed.
Definition at line 308 of file fits.h.