ifw-ccf 5.0.2
Loading...
Searching...
No Matches
Functions
ifw::ccf::common::fits Namespace Reference

Functions

int BitpixToCfitsioDataType (const int8_t bitpix)
 Extract category name from PAF key.
 
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.
 
void LoadImageData (const std::string &filename, const int16_t hdu_nb, ifw::fnd::datatype::DataType &pixel_data_type, 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)
 
double DataTypeToBzero (const int fits_data_type)
 Convert the data type into the corresponding BZERO value.
 
void AppendImageExtension (std::shared_ptr< CCfits::FITS > &fits_handle, const ifw::core::dit::did::Did &dictionary, const std::string &ext_name, const ifw::fnd::fits::BitPix 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.
 
uint16_t GetNbOfHdus (std::shared_ptr< CCfits::FITS > &fits_handle)
 Return number of HDUs in the FITS file referenced to by the handle.
 

Detailed Description

Function Documentation

◆ AppendImageExtension()

void ifw::ccf::common::fits::AppendImageExtension ( std::shared_ptr< CCfits::FITS > & fits_handle,
const ifw::core::dit::did::Did & dictionary,
const std::string & ext_name,
const ifw::fnd::fits::BitPix 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 ifw::ccf::common::fits::BitpixToBytesPerPixel ( const int8_t bitpix)

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

◆ BitpixToCfitsioDataType()

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

Extract category name from PAF key.

◆ DataTypeToBzero()

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

Convert the data type into the corresponding BZERO value.

◆ GetKeys()

void ifw::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 ifw::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 ifw::ccf::common::fits::LoadImageData ( const std::string & filename,
const int16_t hdu_nb,
ifw::fnd::datatype::DataType & pixel_data_type,
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.