EleFits  5.3.0
A modern C++ API on top of CFITSIO
Loading...
Searching...
No Matches

◆ write_n() [1/2]

void write_n ( const Record< Ts > &...  records) const

Write a homogeneous 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.write_n(records);
h1.write_n_in<RecordMode::CreateNew>({"A", "B"}, records);
h2.write_n_in<RecordMode::CreateNew>({"B", "C"}, records);
@ CreateNew
Create a new record, even if keyword already exists.

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

See also
RecordMode
Examples
EleFitsTutorial.cpp.