ifw-ccf  3.0.0-pre2
Functions
ccf::common::fits Namespace Reference

Functions

int BitpixToCfitsioDataType (const int8_t bitpix)
 Extract category name from PAF key. More...
 
void GetKeys (std::shared_ptr< CCfits::FITS > &fits_handle, const int16_t hdu_nb, const std::vector< std::string > &keys, std::map< std::string, std::pair< std::string, std::string >> &key_values, const bool ignore_missing_keys)
 
int8_t BitpixToBytesPerPixel (const int8_t bitpix)
 Convert the value of BITPIX into the corresponding bytes per pixel. More...
 
void LoadImageData (const std::string &filename, const int16_t hdu_nb, const int8_t output_bitpix, void **image_buffer, uint32_t &image_size, std::map< std::string, std::pair< std::string, std::string >> &key_values, const std::list< std::string > &req_keys)
 
int DataTypeToBzero (const int fits_data_type)
 Convert the data type into the corresponding BZERO value. More...
 
void AppendImageExtension (std::shared_ptr< CCfits::FITS > &fits_handle, const core::dit::did::Did &dictionary, std::string &ext_name, const int8_t bitpix, const std::vector< int32_t > &naxes, const uint32_t image_size, const void *image_buffer, const uint16_t nb_of_hdr_blocks=1)
 Append an image extension to the existing FITS file. More...
 
uint16_t GetNbOfHdus (std::shared_ptr< CCfits::FITS > &fits_handle)
 Return number of HDUs in the FITS file referenced to by the handle. More...
 

Detailed Description

Function Documentation

◆ AppendImageExtension()

void ccf::common::fits::AppendImageExtension ( std::shared_ptr< CCfits::FITS > &  fits_handle,
const core::dit::did::Did &  dictionary,
std::string &  ext_name,
const int8_t  bitpix,
const std::vector< int32_t > &  naxes,
const uint32_t  image_size,
const void *  image_buffer,
const uint16_t  nb_of_hdr_blocks 
)

Append an image extension to the existing FITS file.

◆ BitpixToBytesPerPixel()

int8_t ccf::common::fits::BitpixToBytesPerPixel ( const int8_t  bitpix)

Convert the value of BITPIX into the corresponding bytes per pixel.

◆ BitpixToCfitsioDataType()

int ccf::common::fits::BitpixToCfitsioDataType ( const int8_t  bitpix)

Extract category name from PAF key.

◆ DataTypeToBzero()

int ccf::common::fits::DataTypeToBzero ( const int  fits_data_type)

Convert the data type into the corresponding BZERO value.

◆ GetKeys()

void ccf::common::fits::GetKeys ( std::shared_ptr< CCfits::FITS > &  fits_handle,
const int16_t  hdu_nb,
const std::vector< std::string > &  keys,
std::map< std::string, std::pair< std::string, std::string >> &  key_values,
const bool  ignore_missing_keys = false 
)

Get the listed keys from the FITS file, referenced by the handle. If "ignore_missing_keys" is true, keys requested bu not found will be silently ignored. The values are returned as strings independently of the actual type. Specifying "hdu_nb = dit::fits::CUR_HDU" means current HDU.

◆ GetNbOfHdus()

uint16_t ccf::common::fits::GetNbOfHdus ( std::shared_ptr< CCfits::FITS > &  fits_handle)

Return number of HDUs in the FITS file referenced to by the handle.

◆ LoadImageData()

void ccf::common::fits::LoadImageData ( const std::string &  filename,
const int16_t  hdu_nb,
const int8_t  output_bitpix,
void **  image_buffer,
uint32_t &  image_size,
std::map< std::string, std::pair< std::string, std::string >> &  key_values,
const std::list< std::string > &  req_keys = std::list< std::string >() 
)

Load the data of the given HDU (1st HDU = 0, dit::fits::CUR_HDU = current header). The function will allocate the buffer to hold the image data. If the HDU contains an image cube, the entire cube is loaded. The application is in charge of free'ing the image buffer when no longer needed. With the "req_keys" parameter, it is possible to specify a selected set of keys to return. Default, a set of basic keys is returned (BITPIX, NAXISi). To have all keys extracted, put the element ALL_KEYS. TODO: "output_bitpix": On-the-fly scaling not provided.