Class FITS_file

Class Documentation

class FITS_file

template class for FITS I/O operations using CCFits

Public Functions

inline bool iserror()
inline bool isopen()

allows outsiders access to errors that occurred in a fits writing thread

inline FITS_file()

allows outsiders access file open status

inline ~FITS_file()
inline void foo(HDUTYPE hdu)
inline long open_file(bool writekeys, Camera::Information &info)

opens a FITS file

This uses CCFits to create a FITS container, opens the file and writes primary header data to it.

Parameters:
  • writekeys[in] true to write keywords before exposure

  • info[in] reference to camera_info class

Returns:

ERROR or NO_ERROR

inline void close_file(bool writekeys, Camera::Information &info)

closes fits file

Before closing the file, DATE and CHECKSUM keywords are added. Nothing called returns anything so this doesn’t return anything.

Parameters:
  • writekeys[in] true to write keywords after exposure

  • info[in] reference to camera_info class

template<class T>
inline long write_image(T *data, Camera::Information &info, const std::string extname = "")

spawn threads to write image data to FITS file on disk

This function spawns a thread to write the image data to disk

Parameters:
  • data[in] pointer to the data using template type T

  • into[in] reference to the fits_info class

Returns:

ERROR or NO_ERROR

template<class T>
inline void write_image_thread(std::valarray<T> &data, Camera::Information &info, FITS_file *self)

This is where the data are actually written for flat fits files.

This is the worker thread, to write the data using CCFits, and must be spawned by write_image.

Parameters:
  • data[in] reference to the data

  • info[in] reference to the camera info structure

  • self[in] pointer to this-> FITS_file object

template<class T>
inline void write_mex_thread(std::valarray<T> &data, Camera::Information &info, FITS_file *self, const std::string extname)

This is where the data are actually written for multi-extensions.

This is the worker thread, to write the data using CCFits, and must be spawned by write_image.

Parameters:
  • data[in] reference to the data

  • info[in] reference to the Camera::Information camera_info structure

  • self[in] pointer to this-> FITS_file object

inline void make_camera_header(Camera::Information &info)

this writes header info from the camera_info class

Todo:

is this function obsolete?

Uses CCFits

TODO is this function obsolete?

Parameters:

info[in] reference to the camera_info class

inline void safe_add_key(HDUTYPE hdu, std::string keyword, std::string type, std::string value, std::string comment)

wrapper to write keywords to the FITS file header

This can throw an exception so it should be caught.

Uses CCFits addKey template function, this wrapper ensures the correct type is passed.

Parameters:
  • hdu[in] HDUTYPE enum specified Primary or Extension

  • keyword[in]

  • type[in]

  • value[in]

  • comment

inline void add_key(HDUTYPE hdu, std::string keyword, std::string type, std::string value, std::string comment)

Public Members

std::atomic<int> extension