Classes | |
| struct | FormatSpec |
Typedefs | |
| using | CfitsioType = int32_t |
Functions | |
| log4cplus::Logger & | Logger () |
| void | HandleCfitsioError (const std::string &operation, const int cfitsio_status) |
| Throw an exception, extracting the relevant info from cfitsio, if status != 0. | |
| int | DidToCfitsioType (const ifw::core::dit::did::DataType did_type) |
| Convert an ELT ICS data type to the corresponding cfitsio data type. | |
| std::string | GenerateKey (const std::string &key, const std::string &hierarch_prefix=FITS_KEY_ESO_HIERARCH) |
| Generates an ESO hierarchical keyword. | |
| void | CreateFile (std::shared_ptr< CCfits::FITS > &fits_handle, const std::string &filename, const ifw::core::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. | |
| void | MoveToHdu (std::shared_ptr< CCfits::FITS > &fits_handle, const int16_t hdu_nb) |
| Move to the given HDU. | |
| bool | 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). | |
| int | ReadIntKey (std::shared_ptr< CCfits::FITS > &fits_handle, const std::string &key) |
| void | AddDoubleKey (std::shared_ptr< CCfits::FITS > &fits_handle, const ifw::core::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. | |
| void | PrepForAddingKey (std::shared_ptr< CCfits::FITS > &fits_handle, const ifw::core::dit::did::Did &dictionary, const std::string &key, const int16_t hdu_nb, ifw::core::dit::did::Record &did_record, std::string &target_key, bool &key_in_hdu) |
| Used to prepare for adding a keyword card in a FITS file (mostly internal usage). | |
| void | 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). | |
| void | 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. | |
| void | 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. | |
| void | StoreImage (std::shared_ptr< CCfits::FITS > &fits_handle, const ifw::fnd::fits::BitPix bitpix, const uint32_t image_size, const void *image_buffer, const int16_t hdu_nb, const int16_t naxis3) |
| void | addHdu (std::shared_ptr< CCfits::FITS > &fits_handle, const std::string extension_name, const ifw::fnd::fits::BitPix bitpix, const std::vector< int32_t > &naxes) |
| template<class TYPE> | |
| void | AddKey (std::shared_ptr< CCfits::FITS > &fits_handle, const ifw::core::dit::did::Did &dictionary, const std::string &key, const TYPE &value, const int16_t hdu_nb=CUR_HDU) |
| Template function to add a keyword card in an existing FITS file. | |
| template<class TYPE> | |
| void | UpdateKey (std::shared_ptr< CCfits::FITS > &fits_handle, const ifw::core::dit::did::Did &dictionary, const std::string &key, const TYPE &value, const int16_t hdu_nb=CUR_HDU) |
Variables | |
| const int | CUR_HDU = -1 |
| const int | APPEND = -2 |
| const std::string | FITS_KEY_ESO_HIERARCH = "HIERARCH ESO" |
| const int16_t | ALL_HEADERS = SHRT_MAX |
| const int | BITS_PER_PIXEL = 8 |
| using ifw::core::dit::fits::CfitsioType = int32_t |
| void ifw::core::dit::fits::AddDoubleKey | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const ifw::core::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.
| fits_handle | CCfits object associated to the FITS file. |
| dictionary | Dictionary obejct containing information about keys to be added. |
| hdu_nb | HDU in which to add the key (primary header = 1). |
| value | Double value to be added. |
| key | Key to be added. |
| void ifw::core::dit::fits::addHdu | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const std::string | extension_name, | ||
| const ifw::fnd::fits::BitPix | bitpix, | ||
| const std::vector< int32_t > & | naxes ) |
Add a HDU to an existing file
| fits_handle | CCfits handle object associated with existing FITS file. |
| bitpix | bitpix of the image pixels. |
| naxes | dimension of each axis. |
| void ifw::core::dit::fits::AddKey | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const ifw::core::dit::did::Did & | dictionary, | ||
| const std::string & | key, | ||
| const TYPE & | value, | ||
| const int16_t | hdu_nb = CUR_HDU ) |
Template function to add a keyword card in an existing FITS file.
| fits_handle | CCfits object associated to a FITS file. |
| dictionary | Dictionary obejct containing information about keys to be added. |
| key | Key to be added, e.g. "INS OPTI1 ID". |
| value | Value to be added. |
| hdu_nb | Target HDU number (primary header = 1). |
Note: For Double type keys, use "ifw::core::dit::fits::AddDoubleKey()".
| void ifw::core::dit::fits::CreateFile | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const std::string & | filename, | ||
| const ifw::core::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.
| fits_handle | The CCfits handle for the new file. Will be allocated by the function. |
| filename | Basename for target file. |
| dictionary | Dictionary containing the definition of the keys to be created. |
| bitpix | Number of bits per pixel |
| naxes | dimension of each axis |
| target_filename | The resulting final target filename. |
| remove_if_exists | If true, remove a file if already exsting with the target filename. |
| nb_of_hdr_blocks | Number of header blocks to reserve ( |
| data_size | Size in bytes to allocate for the data ( |
FITS files should normally be created in "$DATAROOT/<subsystem>/<instance id>". If a filename is given without the path, the default target path will be "$DATAROOT/<filename>". It will be checked if the filename given has extension ".fits". If not, it will be added i the target name. If a filename with path is given, which contains environment variables or "~", the name will be resolved.
| int ifw::core::dit::fits::DidToCfitsioType | ( | const ifw::core::dit::did::DataType | did_type | ) |
Convert an ELT ICS data type to the corresponding cfitsio data type.
| did_type |
| void ifw::core::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.
| filename | Basename of the file. |
| target_filename | Complete name of target file. |
| hdr_buf | Buffer with the newline terminated FITS keyword cards from the requested HDU's. |
| hdr_ref | HDU to extract, or all (primary HDU = 1). |
| void ifw::core::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).
| fits_handle | CCfits handle object associated with existing FITS file. |
| hdr_buf | Buffer which will contain the ASCII dump of the requested headers. |
| hdr_ref | Single HDU or all for which to extract the keyword cards. |
| std::string ifw::core::dit::fits::GenerateKey | ( | const std::string & | key, |
| const std::string & | hierarch_prefix = FITS_KEY_ESO_HIERARCH ) |
Generates an ESO hierarchical keyword.
| key | Input key to be checked and possibly converted. |
For hierarchical keys, these shall be given as follows: "<cat> [<subsystem>] <parameter>".
A primary key is returned unmodified.
| void ifw::core::dit::fits::HandleCfitsioError | ( | const std::string & | operation, |
| const int | cfitsio_status ) |
Throw an exception, extracting the relevant info from cfitsio, if status != 0.
| bool ifw::core::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).
| fits_handle | The CCfits object. |
| hdu_nb | HDU to check. |
| key | Name of the key, e.g. "INS FILT1 NAME". |
| log4cplus::Logger & ifw::core::dit::fits::Logger | ( | ) |
| void ifw::core::dit::fits::MoveToHdu | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const int16_t | hdu_nb ) |
Move to the given HDU.
| fits_handle | CCfits fits handle. |
| hdu_nb | HDU number requested (primary header = 1). |
| void ifw::core::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.
| fits_handle | CCfits fits handle object. Will be allocated by the function. |
| filename | Basename of FITS file to open. |
| target_filename | Complete name of file opened. |
| mode | CCfits::Read or CCfits::Write. |
| void ifw::core::dit::fits::PrepForAddingKey | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const ifw::core::dit::did::Did & | dictionary, | ||
| const std::string & | key, | ||
| const int16_t | hdu_nb, | ||
| ifw::core::dit::did::Record & | did_record, | ||
| std::string & | target_key, | ||
| bool & | key_in_hdu ) |
Used to prepare for adding a keyword card in a FITS file (mostly internal usage).
| dictionary | Dictionary object defining the keys in the FITS file. |
| fits_handle | The CCfits object. |
| key | Key to be added. |
| hdu_nb | HDU number where the shall be added (primary header = 1, CUR_HDU = current HDU). |
| did_record | Copy of the dictionary record for the key. |
| target_key | The final target keyname, e.g. "HIERARCH ESO INS1 FILT2 NAME". |
| key_in_hdu | True if key already defined in the given HDU. |
Note, the function does actually not add the key in the file.
| int ifw::core::dit::fits::ReadIntKey | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const std::string & | key ) |
| void ifw::core::dit::fits::StoreImage | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const ifw::fnd::fits::BitPix | bitpix, | ||
| const uint32_t | image_size, | ||
| const void * | image_buffer, | ||
| const int16_t | hdu_nb = ifw::core::dit::fits::CUR_HDU, | ||
| const int16_t | naxis3 = 0 ) |
Store the image pixels provided into a specific HDU. Cubes are supported.
| fits_handle | CCfits handle object associated with existing FITS file. |
| bitpix | FITS std BITPIX data type of the image pixels. |
| image_size | size in bytes of an image. |
| image_buffer | image content. |
| hdu_nb | index (starting from one) of the hdu where to store the data. |
| naxis3 | frame index in case of a cube. |
| void ifw::core::dit::fits::UpdateKey | ( | std::shared_ptr< CCfits::FITS > & | fits_handle, |
| const ifw::core::dit::did::Did & | dictionary, | ||
| const std::string & | key, | ||
| const TYPE & | value, | ||
| const int16_t | hdu_nb = CUR_HDU ) |
Update an existing key. See also AddKey().
| const int16_t ifw::core::dit::fits::ALL_HEADERS = SHRT_MAX |
| const int ifw::core::dit::fits::APPEND = -2 |
| const int ifw::core::dit::fits::BITS_PER_PIXEL = 8 |
| const int ifw::core::dit::fits::CUR_HDU = -1 |
| const std::string ifw::core::dit::fits::FITS_KEY_ESO_HIERARCH = "HIERARCH ESO" |