CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
SaveBoostHistogram.hpp File Reference

This functions saves a boost::histogram into a numpy file. More...

#include <boost/histogram.hpp>
#include <corsika/detail/framework/utility/SaveBoostHistogram.inl>
Include dependency graph for SaveBoostHistogram.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 corsika
 `, since they are used everywhere as integral part of the framework.
 

Functions

template<class Axes , class Storage >
void corsika::save_hist (boost::histogram::histogram< Axes, Storage > const &h, std::string const &filename, bool overwrite=true)
 

Detailed Description

This functions saves a boost::histogram into a numpy file.

Only rather basic axis types are supported: regular, variable, integer, category<int>. Only "ordinary" bin counts (i.e. a double or int) are supported, nothing fancy like profiles.

Note that this function makes a temporary, dense copy of the histogram, which could be an issue for huge sizes (e.g. for high dimensions)

Parameters
overwritesilently overwrite existing files if true, otherwise throw runtime_error

Definition in file SaveBoostHistogram.hpp.