ifw-core  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs | Functions | Variables
fits.hpp File Reference

Utilities to handle FITS files. More...

#include <string>
#include <fitsio.h>
#include <CCfits/CCfits.h>
#include <CCfits/FITS.h>
#include <CCfits/PHDU.h>
#include "ctd/defines/defines.hpp"
#include "dit/did/Did.hpp"

Go to the source code of this file.

Classes

class  dit::fits::FitsReport
 

Namespaces

 dit
 
 dit::fits
 

Typedefs

using dit::fits::CfitsioType = int32_t
 

Functions

CfitsioType dit::fits::DidToCfitsioType (ctd::defines::DataType did_type)
 Convert an ELT ICS data type to the corresponding cfitsio data type. More...
 
void dit::fits::HandleCfitsioError (const std::string &operation, const int cfitsio_status)
 Throw an exception, extracting the relevant info from cfitsio, if status != 0. More...
 
std::string dit::fits::GenerateKey (const std::string &key, const std::string &hierarch_prefix=FITS_KEY_ESO_HIERARCH)
 Generates an ESO hierarchical keyword. More...
 
void dit::fits::CreateFile (std::shared_ptr< CCfits::FITS > &fits_handle, const std::string &filename, const dit::did::Did &dictionary, const int32_t bitpix, const std::vector< int32_t > &naxes, std::string &target_filename, const bool remove_if_exists=false, const uint16_t nb_of_hdr_blocks=1)
 Create a new FITS file. More...
 
void dit::fits::OpenFitsFile (std::shared_ptr< CCfits::FITS > &fits_handle, const std::string &filename, std::string &target_filename, CCfits::RWmode mode=CCfits::Read)
 Open an existing FITS file. More...
 
bool dit::fits::KeyInHdu (std::shared_ptr< CCfits::FITS > &fits_handle, const int16_t hdu_nb, const std::string &key)
 Check if a given key is contained in the referenced HDU (primary HDU = 1). More...
 
void dit::fits::MoveToHdu (std::shared_ptr< CCfits::FITS > &fits_handle, const int16_t hdu_nb)
 Move to the given HDU. More...
 
void dit::fits::PrepForAddingKey (std::shared_ptr< CCfits::FITS > &fits_handle, const dit::did::Did &dictionary, const std::string &key, const int16_t hdu_nb, dit::did::Record &did_record, std::string &target_key, bool &key_in_hdu, CfitsioType &cfitsio_type, dit::did::FormatSpecifier &format_specifier)
 Used to prepare for adding a keyword card in a FITS file (mostly internal usage). More...
 
template<class TYPE >
void dit::fits::AddKey (std::shared_ptr< CCfits::FITS > &fits_handle, const dit::did::Did &dictionary, const std::string &key, const TYPE &value, const int16_t hdu_nb)
 Template function to add a keyword card in an existing FITS file. More...
 
void dit::fits::AddDoubleKey (std::shared_ptr< CCfits::FITS > &fits_handle, const dit::did::Did &dictionary, const std::string &key, const double value, const uint16_t hdu_nb)
 Add a double type key in an existing FITS file. More...
 
void dit::fits::Verify (const std::string &filename, std::string &target_filename, dit::fits::FitsReport &report)
 Function to carry out a verification check on a FITS file. More...
 
void dit::fits::Verify (const std::string &filename, std::string &target_filename, const dit::did::Did &dictionary, dit::fits::FitsReport &report)
 Function to carry out a verification check on a FITS file. Dictionary taken into account. More...
 
void dit::fits::ExtractHeaders (const std::string &filename, std::string &target_filename, std::string &hdr_buf, const int16_t hdr_ref=ALL_HEADERS)
 Extract all or a specific header from a FITS file. More...
 
void dit::fits::ExtractHeaders (std::shared_ptr< CCfits::FITS > &fits_handle, std::string &hdr_buf, const int16_t hdr_ref=ALL_HEADERS)
 Extract the keyword cards in one or more HDU's in an ASCII format (newline terminated). More...
 

Variables

const std::string dit::fits::FITS_KEY_ESO_HIERARCH = "HIERARCH ESO"
 
const int16_t dit::fits::ALL_HEADERS = SHRT_MAX
 

Detailed Description

Utilities to handle FITS files.