ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Namespaces | Typedefs | Enumerations | Functions
keyword.hpp File Reference

Contains data structure for FITS keywords. More...

#include <cassert>
#include <array>
#include <iosfwd>
#include <optional>
#include <string>
#include <variant>
#include <vector>
#include <cfitsio/fitsio.h>

Go to the source code of this file.

Classes

struct  daq::fits::KeywordNameView
 
class  daq::fits::LiteralKeyword
 Represents the literal 80-character FITS keyword record. More...
 
struct  daq::fits::LiteralKeyword::Components
 Decomposed components a literal keyword. More...
 
struct  daq::fits::BasicKeywordBase
 Non template base class that is purely used to avoid type-deduction issues of ValueType. More...
 
struct  daq::fits::BasicKeyword< Trait >
 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  daq::fits::ValueKeywordTraits
 
struct  daq::fits::EsoKeywordTraits
 
struct  daq::fits::v1::StandardLess
 Sorting function object. More...
 

Namespaces

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

Typedefs

using daq::fits::ValueKeyword = BasicKeyword< ValueKeywordTraits >
 Standard FITS value keyword. More...
 
using daq::fits::EsoKeyword = BasicKeyword< EsoKeywordTraits >
 ESO hiearchical keyword. More...
 
using daq::fits::KeywordVariant = std::variant< ValueKeyword, EsoKeyword, LiteralKeyword >
 The different variants of keywords that are supported. More...
 
using daq::fits::TypedKeywordVariant = std::variant< ValueKeyword, EsoKeyword >
 Subset of value-typed keywords. More...
 
using daq::fits::KeywordVector = std::vector< KeywordVariant >
 Vector of keywords. More...
 

Enumerations

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

Functions

bool daq::fits::operator== (KeywordNameView lhs, KeywordNameView rhs) noexcept
 
bool daq::fits::operator!= (KeywordNameView lhs, KeywordNameView rhs) noexcept
 
bool daq::fits::operator< (LiteralKeyword const &, LiteralKeyword const &) noexcept
 Sort by logical keyword name (not DICD sort) More...
 
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). More...
 
bool daq::fits::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 & daq::fits::operator<< (std::ostream &os, LiteralKeyword const &kw)
 
bool daq::fits::operator< (LiteralKeyword const &, EsoKeyword const &) noexcept
 Keyword sorting function. More...
 
bool daq::fits::operator< (LiteralKeyword const &, ValueKeyword const &) noexcept
 Keyword sorting function. More...
 
bool daq::fits::operator< (ValueKeyword const &, EsoKeyword const &) noexcept
 Keyword sorting function. More...
 
bool daq::fits::operator< (ValueKeyword const &, LiteralKeyword const &) noexcept
 Keyword sorting function. More...
 
bool daq::fits::operator< (EsoKeyword const &, ValueKeyword const &) noexcept
 Keyword sorting function. More...
 
bool daq::fits::operator< (EsoKeyword const &, LiteralKeyword const &) noexcept
 Keyword sorting function. More...
 
template<class Trait >
std::ostream & daq::fits::operator<< (std::ostream &os, BasicKeyword< Trait > const &kw)
 
template<class Trait >
std::ostream & daq::fits::operator<< (std::ostream &os, BasicKeywordBase::ValueType const &kw)
 
std::ostream & daq::fits::operator<< (std::ostream &os, KeywordVariant const &kw)
 Ostream formatting of keywords. More...
 
constexpr KeywordNameView daq::fits::GetKeywordName (EsoKeyword const &keyword) noexcept
 Get keyword name from keyword. More...
 
constexpr KeywordNameView daq::fits::GetKeywordName (ValueKeyword const &keyword) noexcept
 
constexpr KeywordNameView daq::fits::GetKeywordName (KeywordVariant const &keyword) noexcept
 Get keyword name from keyword variant. More...
 
KeywordClass daq::fits::GetKeywordClass (std::string_view name)
 Get keyword class. More...
 
bool daq::fits::NameEquals (KeywordVariant const &lhs, KeywordVariant const &rhs) noexcept
 Compare logical keyword names of keyword of the same type. More...
 
void daq::fits::UpdateKeywords (KeywordVector &to, KeywordVector const &from, ConflictPolicy policy=ConflictPolicy::Replace)
 Updates to with keywords from from. More...
 
void daq::fits::InsertKeywords (KeywordVector &keywords, KeywordVector::iterator position, KeywordVector::const_iterator from_first, KeywordVector::const_iterator from_last)
 Insert keywords. More...
 
void daq::fits::v1::StandardSort (std::vector< LiteralKeyword > &keywords)
 Sorts keywords according to ESO DICD standards. More...
 
Format keyword using default formatting rules.
Parameters
keywordKeyword to format.
Exceptions
std::invalid_argumenton failure.
LiteralKeyword daq::fits::Format (KeywordVariant const &keyword)
 
LiteralKeyword daq::fits::Format (ValueKeyword const &keyword)
 
LiteralKeyword daq::fits::Format (EsoKeyword const &keyword)
 
LiteralKeyword daq::fits::Format (LiteralKeyword::Components const &keyword)
 

Detailed Description

Contains data structure for FITS keywords.

Definition in file keyword.hpp.


Class Documentation

◆ daq::fits::LiteralKeyword::Components

struct daq::fits::LiteralKeyword::Components

Decomposed components a literal keyword.

Definition at line 130 of file keyword.hpp.

Class Members
string_view comment Comment may be empty.
string_view name
KeywordType type
string_view value