ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Namespaces | Classes | Typedefs | Enumerations | Functions
daq::fits Namespace Reference

Namespaces

 constants
 
 v1
 Versioned namespace of sorting functions in case standard evolves but instruments want to freeze.
 

Classes

class  MemoryFitsFile
 In-memory FITS file. More...
 
class  CfitsioError
 Represents errors from cfitsio. More...
 
struct  KeywordNameView
 
class  LiteralKeyword
 Represents the literal 80-character FITS keyword record. More...
 
struct  BasicKeywordBase
 Non template base class that is purely used to avoid type-deduction issues of ValueType. More...
 
struct  BasicKeyword
 A type safe version of LiteralKeyword that consist of the three basic components of a FITS keyword keyword record: name, value and optional comment. More...
 
struct  ValueKeywordTraits
 
struct  EsoKeywordTraits
 

Typedefs

using UniqueFitsFile = std::unique_ptr< fitsfile, void(*)(fitsfile *) noexcept >
 Defines unique ownership type to cfitsio fitsfile. More...
 
using ValueKeyword = BasicKeyword< ValueKeywordTraits >
 Standard FITS value keyword. More...
 
using EsoKeyword = BasicKeyword< EsoKeywordTraits >
 ESO hiearchical keyword. More...
 
using KeywordVariant = std::variant< ValueKeyword, EsoKeyword, LiteralKeyword >
 The different variants of keywords that are supported. More...
 
using TypedKeywordVariant = std::variant< ValueKeyword, EsoKeyword >
 Subset of value-typed keywords. More...
 
using KeywordVector = std::vector< KeywordVariant >
 Vector of keywords. More...
 

Enumerations

enum class  HduType : int { Image = IMAGE_HDU , Ascii = ASCII_TBL , Binary = BINARY_TBL }
 
enum class  OpenMode : uint8_t { ReadOnly , ReadWrite }
 
enum  KeywordType : uint8_t { Value , Eso , Commentary }
 Type of FITS keyword. More...
 
enum class  KeywordClass : int {
  Structure = TYP_STRUC_KEY , Compression = TYP_CMPRS_KEY , Scale = TYP_SCAL_KEY , Null = TYP_NULL_KEY ,
  Dim = TYP_DIM_KEY , Range = TYP_RANG_KEY , Unit = TYP_UNIT_KEY , Disp = TYP_DISP_KEY ,
  HduId = TYP_HDUID_KEY , Checksum = TYP_CKSUM_KEY , Wcs = TYP_WCS_KEY , RefSys = TYP_REFSYS_KEY ,
  Comment = TYP_COMM_KEY , Continue = TYP_CONT_KEY , User = TYP_USER_KEY
}
 Fits keyword type. More...
 
enum class  ConflictPolicy { Replace , Skip }
 

Functions

void SelectHduNum (fitsfile *ptr, int hdu_num)
 Select current HDU number. More...
 
void DefaultClose (fitsfile *ptr) noexcept
 Default close function that is used by UniqueFitsFile as a deleter. More...
 
void InitPrimaryHduEmpty (fitsfile *ptr)
 Initializes an empty FITS file with an empty primary HDU (no keywords) More...
 
void InitPrimaryHduNoImage (fitsfile *ptr)
 Initializes an empty FITS file with a primary HDU. More...
 
UniqueFitsFile CreateEmpty (char const *filename)
 Creates empty FITS file using fits_create_file and returns a pointer with a deleter that will close the file. More...
 
UniqueFitsFile Open (char const *filename, OpenMode mode)
 Open file. More...
 
std::vector< LiteralKeywordReadKeywords (fitsfile *ptr, int hdu_num)
 Read keywords from HDU identifed by absolute position hdu_num. More...
 
std::vector< LiteralKeywordReadKeywords (fitsfile *ptr, HduType type, std::string_view name, std::optional< int > version)
 
void DeleteAllKeywords (fitsfile *ptr, int hdu_num)
 Delete all keywords from HDU. More...
 
void MakeHduSpace (fitsfile *ptr, int hdu_num, size_t additional_keys)
 
void WriteKeywords (fitsfile *ptr, int hdu_num, std::vector< LiteralKeyword > const &keywords, std::optional< ssize_t > *remaining_size=nullptr)
 Write keywords to HDU identified by number hdu_num. More...
 
void WriteChecksum (fitsfile *ptr, int hdu_num)
 Write or update checksum keywords DATASUM and CHECKSUM to HDU specified by hdu_num. More...
 
std::vector< LiteralKeywordReadKeywords (fitsfile *ptr, std::string_view name, std::optional< int > version=std::nullopt)
 Read keywords from HDU identifed by EXTNAME and EXTVER keywords. More...
 
std::vector< KeywordVariantParseJsonKeywords (char const *keywords)
 Parse and return FITS keywords. More...
 
std::vector< KeywordVariantParseJsonKeywords (nlohmann::json const &keywords, nlohmann::json_pointer< nlohmann::json > const &=nlohmann::json_pointer< nlohmann::json >())
 Parse and return FITS keywords. More...
 
nlohmann::json SerializeJsonKeywordValue (BasicKeywordBase::ValueType const &value)
 SerializeJsons the keyword value variant to JSON. More...
 
nlohmann::json SerializeJsonKeyword (KeywordVariant const &keyword)
 SerializeJsons keyword to JSON. More...
 
nlohmann::json SerializeJsonKeywords (std::vector< KeywordVariant > const &keywords)
 SerializeJsons keyword to JSON. More...
 
bool operator== (KeywordNameView lhs, KeywordNameView rhs) noexcept
 
bool operator!= (KeywordNameView lhs, KeywordNameView rhs) noexcept
 
bool operator< (LiteralKeyword const &, LiteralKeyword const &) noexcept
 Sort by logical keyword name (not DICD sort) More...
 
bool operator== (LiteralKeyword const &lhs, LiteralKeyword const &rhs) noexcept
 Compares equally if keyword record in lhs is the same as rhs (char for char). More...
 
bool operator!= (LiteralKeyword const &, LiteralKeyword const &) noexcept
 Compares inequally if keyword record in lhs is not the same as rhs (char for char). More...
 
std::ostream & operator<< (std::ostream &os, LiteralKeyword const &kw)
 
bool operator< (LiteralKeyword const &, EsoKeyword const &) noexcept
 Keyword sorting function. More...
 
bool operator< (LiteralKeyword const &, ValueKeyword const &) noexcept
 Keyword sorting function. More...
 
bool operator< (ValueKeyword const &, EsoKeyword const &) noexcept
 Keyword sorting function. More...
 
bool operator< (ValueKeyword const &, LiteralKeyword const &) noexcept
 Keyword sorting function. More...
 
bool operator< (EsoKeyword const &, ValueKeyword const &) noexcept
 Keyword sorting function. More...
 
bool operator< (EsoKeyword const &, LiteralKeyword const &) noexcept
 Keyword sorting function. More...
 
template<class Trait >
std::ostream & operator<< (std::ostream &os, BasicKeyword< Trait > const &kw)
 
template<class Trait >
std::ostream & operator<< (std::ostream &os, BasicKeywordBase::ValueType const &kw)
 
std::ostream & operator<< (std::ostream &os, KeywordVariant const &kw)
 Ostream formatting of keywords. More...
 
constexpr KeywordNameView GetKeywordName (EsoKeyword const &keyword) noexcept
 Get keyword name from keyword. More...
 
constexpr KeywordNameView GetKeywordName (ValueKeyword const &keyword) noexcept
 
constexpr KeywordNameView GetKeywordName (KeywordVariant const &keyword) noexcept
 Get keyword name from keyword variant. More...
 
KeywordClass GetKeywordClass (std::string_view name)
 Get keyword class. More...
 
bool NameEquals (KeywordVariant const &lhs, KeywordVariant const &rhs) noexcept
 Compare logical keyword names of keyword of the same type. More...
 
void UpdateKeywords (KeywordVector &to, KeywordVector const &from, ConflictPolicy policy=ConflictPolicy::Replace)
 Updates to with keywords from from. More...
 
void InsertKeywords (KeywordVector &keywords, KeywordVector::iterator position, KeywordVector::const_iterator from_first, KeywordVector::const_iterator from_last)
 Insert keywords. More...
 
std::vector< KeywordVariantParseJsonKeywords (Json const &keywords, JsonPointer const &breadcrumb)
 
bool operator< (KeywordNameView lhs, KeywordNameView rhs) noexcept
 
template std::ostream & operator<<< EsoKeywordTraits > (std::ostream &os, BasicKeyword< EsoKeywordTraits > const &kw)
 
template std::ostream & operator<<< ValueKeywordTraits > (std::ostream &os, BasicKeyword< ValueKeywordTraits > const &kw)
 
Format keyword using default formatting rules.
Parameters
keywordKeyword to format.
Exceptions
std::invalid_argumenton failure.
LiteralKeyword Format (KeywordVariant const &keyword)
 
LiteralKeyword Format (ValueKeyword const &keyword)
 
LiteralKeyword Format (EsoKeyword const &keyword)
 
LiteralKeyword Format (LiteralKeyword::Components const &keyword)
 

Typedef Documentation

◆ EsoKeyword

ESO hiearchical keyword.

Definition at line 337 of file keyword.hpp.

◆ KeywordVariant

The different variants of keywords that are supported.

Definition at line 400 of file keyword.hpp.

◆ KeywordVector

using daq::fits::KeywordVector = typedef std::vector<KeywordVariant>

Vector of keywords.

Definition at line 414 of file keyword.hpp.

◆ TypedKeywordVariant

using daq::fits::TypedKeywordVariant = typedef std::variant<ValueKeyword, EsoKeyword>

Subset of value-typed keywords.

Definition at line 407 of file keyword.hpp.

◆ UniqueFitsFile

using daq::fits::UniqueFitsFile = typedef std::unique_ptr<fitsfile, void (*)(fitsfile*) noexcept>

Defines unique ownership type to cfitsio fitsfile.

Definition at line 33 of file cfitsio.hpp.

◆ ValueKeyword

Standard FITS value keyword.

Definition at line 330 of file keyword.hpp.

Enumeration Type Documentation

◆ ConflictPolicy

Enumerator
Replace 

Replace keyword that conflicts.

Skip 

Skip keyword that conflicts.

Definition at line 463 of file keyword.hpp.

◆ HduType

enum daq::fits::HduType : int
strong
Enumerator
Image 
Ascii 
Binary 

Definition at line 19 of file cfitsio.hpp.

◆ KeywordClass

enum daq::fits::KeywordClass : int
strong

Fits keyword type.

See https://heasarc.gsfc.nasa.gov/docs/software/fitsio/c/c_user/node52.html#ffdtyp

Enumerator
Structure 
Compression 
Scale 
Null 
Dim 
Range 
Unit 
Disp 
HduId 
Checksum 
Wcs 
RefSys 
Comment 
Continue 
User 

Definition at line 89 of file keyword.hpp.

◆ KeywordType

enum daq::fits::KeywordType : uint8_t

Type of FITS keyword.

FITS standard define two types: Value keywords and Commentary keywords.

ESO conventions adds a third "ESO hiearchical keyword" which is strictly speaking a Commentary keyword with keyword name "HIERARCH".

Enumerator
Value 

A value keyword.

Eso 

An ESO hiearchical keyword.

Commentary 

A commentary keyword, which are keywords that do not fall into the previous categories.

Definition at line 64 of file keyword.hpp.

◆ OpenMode

enum daq::fits::OpenMode : uint8_t
strong
Enumerator
ReadOnly 
ReadWrite 

Definition at line 26 of file cfitsio.hpp.

Function Documentation

◆ CreateEmpty()

UniqueFitsFile daq::fits::CreateEmpty ( char const *  filename)

Creates empty FITS file using fits_create_file and returns a pointer with a deleter that will close the file.

Definition at line 158 of file cfitsio.cpp.

◆ DefaultClose()

void daq::fits::DefaultClose ( fitsfile *  ptr)
noexcept

Default close function that is used by UniqueFitsFile as a deleter.

Definition at line 100 of file cfitsio.cpp.

◆ DeleteAllKeywords()

void daq::fits::DeleteAllKeywords ( fitsfile *  ptr,
int  hdu_num 
)

Delete all keywords from HDU.

Parameters
ptrFITS file to delete keywords from.
hdu_numHDU number. HDU numbers are 1-indexed, so primary HDU is 1.
Exceptions
CfitsioErroron error.

Definition at line 209 of file cfitsio.cpp.

◆ Format() [1/4]

LiteralKeyword daq::fits::Format ( EsoKeyword const &  keyword)

Definition at line 592 of file keyword.cpp.

◆ Format() [2/4]

LiteralKeyword daq::fits::Format ( KeywordVariant const &  keyword)

Definition at line 626 of file keyword.cpp.

◆ Format() [3/4]

LiteralKeyword daq::fits::Format ( LiteralKeyword::Components const &  keyword)

Definition at line 609 of file keyword.cpp.

◆ Format() [4/4]

LiteralKeyword daq::fits::Format ( ValueKeyword const &  keyword)

Definition at line 600 of file keyword.cpp.

◆ GetKeywordClass()

KeywordClass daq::fits::GetKeywordClass ( std::string_view  name)

Get keyword class.

Parameters
nameKeyword name.
Returns
keyword class.

Definition at line 490 of file keyword.cpp.

◆ GetKeywordName() [1/3]

constexpr KeywordNameView daq::fits::GetKeywordName ( EsoKeyword const &  keyword)
constexprnoexcept

Get keyword name from keyword.

Parameters
keywordKeyword to query.

Definition at line 427 of file keyword.hpp.

◆ GetKeywordName() [2/3]

constexpr KeywordNameView daq::fits::GetKeywordName ( KeywordVariant const &  keyword)
constexprnoexcept

Get keyword name from keyword variant.

Parameters
keywordKeyword to query.

Definition at line 439 of file keyword.hpp.

◆ GetKeywordName() [3/3]

constexpr KeywordNameView daq::fits::GetKeywordName ( ValueKeyword const &  keyword)
constexprnoexcept

Definition at line 431 of file keyword.hpp.

◆ InitPrimaryHduEmpty()

void daq::fits::InitPrimaryHduEmpty ( fitsfile *  ptr)

Initializes an empty FITS file with an empty primary HDU (no keywords)

Precondition
ptr != nullptr
Parameters
ptrValid FITS file.
Exceptions
CfitsioErroron error.

Definition at line 112 of file cfitsio.cpp.

◆ InitPrimaryHduNoImage()

void daq::fits::InitPrimaryHduNoImage ( fitsfile *  ptr)

Initializes an empty FITS file with a primary HDU.

Mandatory keywords are set and primary HDU added if necessary.

Mandatory keywords are initialized as:

  • SIMPLE = T
  • BITPIX = 8
  • NAXIS = 0
Precondition
ptr != nullptr
Parameters
ptrValid FITS file.
Exceptions
CfitsioErroron error.

Definition at line 125 of file cfitsio.cpp.

◆ InsertKeywords()

void daq::fits::InsertKeywords ( KeywordVector keywords,
KeywordVector::iterator  position,
KeywordVector::const_iterator  from_first,
KeywordVector::const_iterator  from_last 
)

Insert keywords.

Conflicting keywords are deleted from the current position.

Parameters
positionInsert position that must lie within range (to_first, to_last]
to_firstStart of range to consider when deleting duplicate keywords.
to_lastEnd of range to consider when deleting duplicate keywords.
from_firstRange to insert from.
from_lastRange to insert from.
fromKeywords to update from.

Definition at line 570 of file keyword.cpp.

◆ MakeHduSpace()

void daq::fits::MakeHduSpace ( fitsfile *  ptr,
int  hdu_num,
size_t  additional_keys 
)

Definition at line 229 of file cfitsio.cpp.

◆ NameEquals()

bool daq::fits::NameEquals ( KeywordVariant const &  lhs,
KeywordVariant const &  rhs 
)
noexcept

Compare logical keyword names of keyword of the same type.

Comparing names only is useful to e.g. look up keyword by name, to modify it.

Parameters
lhsvalue to compare
rhsvalue to compare
Returns
true iff lhs and rhs are the same type and their name property compares equal.

Definition at line 478 of file keyword.cpp.

◆ Open()

UniqueFitsFile daq::fits::Open ( char const *  filename,
OpenMode  mode 
)

Open file.

Parameters
filenamePath to file to open.
modeFile open mode.
Exceptions
CfitsioErroron errors.

Definition at line 168 of file cfitsio.cpp.

◆ operator!=() [1/2]

bool daq::fits::operator!= ( KeywordNameView  lhs,
KeywordNameView  rhs 
)
noexcept
Returns
true if keyword type and names are not equal.

Definition at line 359 of file keyword.cpp.

◆ operator!=() [2/2]

bool daq::fits::operator!= ( LiteralKeyword const &  lhs,
LiteralKeyword const &  rhs 
)
noexcept

Compares inequally if keyword record in lhs is not the same as rhs (char for char).

Definition at line 428 of file keyword.cpp.

◆ operator<() [1/8]

bool daq::fits::operator< ( EsoKeyword const &  lhs,
LiteralKeyword const &  rhs 
)
noexcept

Keyword sorting function.

Definition at line 518 of file keyword.cpp.

◆ operator<() [2/8]

bool daq::fits::operator< ( EsoKeyword const &  lhs,
ValueKeyword const &  rhs 
)
noexcept

Keyword sorting function.

Definition at line 515 of file keyword.cpp.

◆ operator<() [3/8]

bool daq::fits::operator< ( KeywordNameView  lhs,
KeywordNameView  rhs 
)
noexcept

Definition at line 351 of file keyword.cpp.

◆ operator<() [4/8]

bool daq::fits::operator< ( LiteralKeyword const &  lhs,
EsoKeyword const &  rhs 
)
noexcept

Keyword sorting function.

Definition at line 500 of file keyword.cpp.

◆ operator<() [5/8]

bool daq::fits::operator< ( LiteralKeyword const &  lhs,
LiteralKeyword const &  rhs 
)
noexcept

Sort by logical keyword name (not DICD sort)

Definition at line 420 of file keyword.cpp.

◆ operator<() [6/8]

bool daq::fits::operator< ( LiteralKeyword const &  lhs,
ValueKeyword const &  rhs 
)
noexcept

Keyword sorting function.

Definition at line 504 of file keyword.cpp.

◆ operator<() [7/8]

bool daq::fits::operator< ( ValueKeyword const &  lhs,
EsoKeyword const &  rhs 
)
noexcept

Keyword sorting function.

Definition at line 507 of file keyword.cpp.

◆ operator<() [8/8]

bool daq::fits::operator< ( ValueKeyword const &  lhs,
LiteralKeyword const &  rhs 
)
noexcept

Keyword sorting function.

Definition at line 511 of file keyword.cpp.

◆ operator<<() [1/4]

template<class Trait >
std::ostream & daq::fits::operator<< ( std::ostream &  os,
BasicKeyword< Trait > const &  kw 
)

Definition at line 539 of file keyword.cpp.

◆ operator<<() [2/4]

template<class Trait >
std::ostream & daq::fits::operator<< ( std::ostream &  os,
BasicKeywordBase::ValueType const &  kw 
)

Definition at line 522 of file keyword.cpp.

◆ operator<<() [3/4]

std::ostream & daq::fits::operator<< ( std::ostream &  os,
KeywordVariant const &  kw 
)

Ostream formatting of keywords.

Definition at line 549 of file keyword.cpp.

◆ operator<<() [4/4]

std::ostream & daq::fits::operator<< ( std::ostream &  os,
LiteralKeyword const &  kw 
)

Definition at line 432 of file keyword.cpp.

◆ operator<<< EsoKeywordTraits >()

template std::ostream& daq::fits::operator<<< EsoKeywordTraits > ( std::ostream &  os,
BasicKeyword< EsoKeywordTraits > const &  kw 
)

◆ operator<<< ValueKeywordTraits >()

template std::ostream& daq::fits::operator<<< ValueKeywordTraits > ( std::ostream &  os,
BasicKeyword< ValueKeywordTraits > const &  kw 
)

◆ operator==() [1/2]

bool daq::fits::operator== ( KeywordNameView  lhs,
KeywordNameView  rhs 
)
noexcept
Returns
true if keyword type and names are equal.

Definition at line 355 of file keyword.cpp.

◆ operator==() [2/2]

bool daq::fits::operator== ( LiteralKeyword const &  lhs,
LiteralKeyword const &  rhs 
)
noexcept

Compares equally if keyword record in lhs is the same as rhs (char for char).

Definition at line 424 of file keyword.cpp.

◆ ParseJsonKeywords() [1/3]

std::vector< KeywordVariant > daq::fits::ParseJsonKeywords ( char const *  keywords)

Parse and return FITS keywords.

Example string:

auto keywords = R"([
{
"type":"valueKeyword",
"name":"OBJECT",
"value":"OBJECT,SKY"
},
...
]");
auto res = ParseJsonKeywords(keywords);
Parameters
keywordsJSON encoded string of keywords
Exceptions
std::invalid_argumenton schema validation error.
nlohmann::json::exceptionon JSON parsing error.

Definition at line 124 of file json.cpp.

◆ ParseJsonKeywords() [2/3]

std::vector<KeywordVariant> daq::fits::ParseJsonKeywords ( Json const &  keywords,
JsonPointer const &  breadcrumb 
)

Definition at line 130 of file json.cpp.

◆ ParseJsonKeywords() [3/3]

std::vector<KeywordVariant> daq::fits::ParseJsonKeywords ( nlohmann::json const &  keywords,
nlohmann::json_pointer< nlohmann::json > const &  = nlohmann::json_pointer< nlohmann::json >() 
)

Parse and return FITS keywords.

Parameters
keywordsJSON object containing FITS keywords.
Exceptions
std::invalid_argumenton schema validation error.

◆ ReadKeywords() [1/3]

std::vector<LiteralKeyword> daq::fits::ReadKeywords ( fitsfile *  ptr,
HduType  type,
std::string_view  name,
std::optional< int >  version 
)

Definition at line 188 of file cfitsio.cpp.

◆ ReadKeywords() [2/3]

std::vector< LiteralKeyword > daq::fits::ReadKeywords ( fitsfile *  ptr,
int  hdu_num 
)

Read keywords from HDU identifed by absolute position hdu_num.

Parameters
ptrFITS file to read from.
hdu_numHDU number. HDU numbers are 1-indexed, so primary HDU is 1.
Exceptions
CfitsioErroron error.

Definition at line 181 of file cfitsio.cpp.

◆ ReadKeywords() [3/3]

std::vector<LiteralKeyword> daq::fits::ReadKeywords ( fitsfile *  ptr,
std::string_view  name,
std::optional< int >  version = std::nullopt 
)

Read keywords from HDU identifed by EXTNAME and EXTVER keywords.

Parameters
ptrFITS file to read from.
nameHDU extension name as identified by EXTNAME keyword.
versionHDU extension version as identified by EXTVER keyword. If version is not provided the EXTVER will be ignored when looking up extension.
Exceptions
CfitsioErroron error.

◆ SelectHduNum()

void daq::fits::SelectHduNum ( fitsfile *  ptr,
int  hdu_num 
)

Select current HDU number.

Parameters
hdu_numHDU number starting with primary HDU == 1.

Definition at line 89 of file cfitsio.cpp.

◆ SerializeJsonKeyword()

nlohmann::json daq::fits::SerializeJsonKeyword ( KeywordVariant const &  keyword)

SerializeJsons keyword to JSON.

Parameters
keywordkeyword to serialize.
Returns
JSON object.

Definition at line 170 of file json.cpp.

◆ SerializeJsonKeywords()

nlohmann::json daq::fits::SerializeJsonKeywords ( std::vector< KeywordVariant > const &  keywords)

SerializeJsons keyword to JSON.

Parameters
keywordskeywords to serialize.
Returns
JSON array of keywords.

Definition at line 200 of file json.cpp.

◆ SerializeJsonKeywordValue()

nlohmann::json daq::fits::SerializeJsonKeywordValue ( BasicKeywordBase::ValueType const &  value)

SerializeJsons the keyword value variant to JSON.

Parameters
valueValue to serialize.
Returns
JSON value.

Definition at line 166 of file json.cpp.

◆ UpdateKeywords()

void daq::fits::UpdateKeywords ( KeywordVector to,
KeywordVector const &  from,
ConflictPolicy  policy = ConflictPolicy::Replace 
)

Updates to with keywords from from.

New keywords are inserted at the end. Existing keywords will be updated with new value if keyword type and name is the same.

Parameters
toKeywords to update to.
fromKeywords to update from.
policyDetermines what to do for a keyword conflict.

Definition at line 554 of file keyword.cpp.

◆ WriteChecksum()

void daq::fits::WriteChecksum ( fitsfile *  ptr,
int  hdu_num 
)

Write or update checksum keywords DATASUM and CHECKSUM to HDU specified by hdu_num.

Parameters
hdu_numHDU to calculate and update checksum keywords for if necessary.
Exceptions
CfitsioErroron error.

Definition at line 283 of file cfitsio.cpp.

◆ WriteKeywords()

void daq::fits::WriteKeywords ( fitsfile *  ptr,
int  hdu_num,
std::vector< LiteralKeyword > const &  keywords,
std::optional< ssize_t > *  remaining_size = nullptr 
)

Write keywords to HDU identified by number hdu_num.

Parameters
ptrFITS file to write to.
hdu_numHDU number. HDU numbers are 1-indexed, so primary HDU is 1.
keywordsKeywords to write.
[out]remaining_sizeoptional parameter that is updated with remaining size in HDU before any allocations. If this number is negative it means the HDU required to be allocated with an associated performance penalty.
Exceptions
CfitsioErroron error.

Definition at line 247 of file cfitsio.cpp.