Sequence FilesΒΆ

The library defines a hdf5-based file format for storing star sequences and branches. There is no need for users to deal with those files directly since there is are C++ and Python interfaces for that.

To avoid unit confusion, the files use SI units internally. When saving a sequence, conversion happens automatically using the unit system stored within the sequence. When loading, one has to specify the unit system, which is assumed to be geometric.

For saving a sequence to a hdf5 file, use save_star_seq(), specifying the path and the sequence. For saving a branch, use save_star_branch() instead.

To load sequences or branches, use load_star_seq() or load_star_branch(), respectively. Besides the file path, one has to specify the (geometric) units in which the sequence or branch should be represented. Note the units specified while loading do not need to match those used while saving.

The following example demonstrates basic use of stable TOV branches.

#include "reprimand/unitconv.h"
#include "reprimand/star_sequence.h"
#include "reprimand/star_seq_file.h"


using namespace EOS_Toolkit;

int main() {
    auto u = units::geom_solar();

    auto seq1 = load_star_branch("example1.tovseq.h5", u);    
    save_star_branch("copy1.tovseq.h5", seq1);

    auto seq2 = load_star_seq("example2.tovseq.h5", u);    
    save_star_seq("copy2.tovseq.h5", seq2);

}