EleFits  4.0.0
A modern C++ API on top of CFitsIO

◆ writeSeqIn() [2/2]

template<RecordMode Mode = RecordMode::CreateOrUpdate, typename TSeq >
void Euclid::Fits::Header::writeSeqIn ( const std::vector< std::string > &  keywords,
TSeq &&  records 
) const

Write a subset of a homogeneous or heterogeneous sequence of records.

Template Parameters
ModeThe write mode
TThe record value type for homogeneous sequences (automatically deduced)
Ts...The record value types for heterogeneous sequences (automatically deduced)
TSeqThe sequence type (automatically deduced)
Parameters
recordsThe sequence of records
keywordsThe selection to be written

Several methods allow write a sequence of records or subset of sequence of records. Analogously to write(), template parameter Mode controls the writing behavior, depending on wether the keyword to be written already exists or not.

If parameter keywords is provided, then only the records for which the keyword belongs to keywords are written. This is especially handy when a unique sequence of records should be written in different HDUs.

Example usage:

h0.writeSeq(records);
h1.writeSeqIn<RecordMode::CreateNew>({"A", "B"}, records);
h2.writeSeqIn<RecordMode::CreateNew>({"B", "C"}, records);

where h0, h1, h2 are headers of different HDUs and records is a sequence of records, like a RecordSeq.

See also
RecordMode