ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Go to the documentation of this file.
8 #ifndef DAQ_OCM_DAQ_FITS_CFITSIO_HPP_
9 #define DAQ_OCM_DAQ_FITS_CFITSIO_HPP_
13 #include <cfitsio/fitsio.h>
32 using UniqueFitsFile = std::unique_ptr<fitsfile, void (*)(fitsfile*) noexcept>;
68 return std::move(m_file);
74 FitsMemory(
size_t initial_size);
75 ~FitsMemory() noexcept;
80 std::unique_ptr<FitsMemory> m_memory;
97 int GetStatus()
const noexcept;
167 std::vector<LiteralKeyword>
ReadKeywords(fitsfile* ptr,
int hdu_num);
187 std::vector<LiteralKeyword>
204 std::vector<LiteralKeyword>
const& keywords,
205 std::optional<ssize_t>* remaining_size =
nullptr);
217 #endif // #define DAQ_OCM_DAQ_FITS_CFITSIO_HPP_
std::vector< LiteralKeyword > ReadKeywords(fitsfile *ptr, int hdu_num)
Read keywords from HDU identifed by absolute position hdu_num.
void WriteKeywords(fitsfile *ptr, int hdu_num, std::vector< LiteralKeyword > const &keywords, std::optional< ssize_t > *remaining_size)
Write keywords to HDU identified by number hdu_num.
UniqueFitsFile CreateEmpty(char const *filename)
Creates empty FITS file using fits_create_file and returns a pointer with a deleter that will close t...
Represents errors from cfitsio.
Contains data structure for FITS keywords.
void InitPrimaryHduEmpty(fitsfile *ptr)
Initializes an empty FITS file with an empty primary HDU (no keywords)
void SelectHduNum(fitsfile *ptr, int hdu_num)
Select current HDU number.
UniqueFitsFile Open(char const *filename, OpenMode mode)
Open file.
std::unique_ptr< fitsfile, void(*)(fitsfile *) noexcept > UniqueFitsFile
Defines unique ownership type to cfitsio fitsfile.
MemoryFitsFile(MemoryFitsFile &&other) noexcept=default
void DeleteAllKeywords(fitsfile *ptr, int hdu_num)
Delete all keywords from HDU.
fitsfile * GetFile() const noexcept
Get fits pointer.
MemoryFitsFile & operator=(MemoryFitsFile &&other) noexcept=default
UniqueFitsFile GetOwnedFile() &&
Move out ptr.
void InitPrimaryHduNoImage(fitsfile *ptr)
Initializes an empty FITS file with a primary HDU.
void WriteChecksum(fitsfile *ptr, int hdu_num)
Write or update checksum keywords DATASUM and CHECKSUM to HDU specified by hdu_num.
MemoryFitsFile() noexcept
Creates empty file.
void DefaultClose(fitsfile *ptr) noexcept
Default close function that is used by UniqueFitsFile as a deleter.