Files
karl/include/IO/hdf5_writer.h
T
csendlinger 5fc227e1b1 Implemented pitch angle resolution.
Still includes (and uses) the non-pitch angle
resolved fields as well; have to be either removed
completely or refactored s.t. one of the two options
is chosen.
Pitch angle distribution has a hardcoded number of
bins for now, and exists in 'energy_binning.h'
2024-10-28 15:00:19 +01:00

37 lines
1.4 KiB
C++
Executable File

#ifndef HDF5_WRITER_H
#define HDF5_WRITER_H
#include <string>
#include <vector>
#include "blitz/array.h"
class Hdf5Writer {
public:
Hdf5Writer(std::string directory = "./output",
std::string filename = "output");
void write(const blitz::Array<double, 1>& data, std::string path);
void write(const blitz::Array<double, 2>& data, std::string path);
void write(const blitz::Array<double, 3>& data, std::string path);
void write(const blitz::Array<double, 4>& data, std::string path);
void write(const blitz::Array<double, 5>& data, std::string path);
void write(const blitz::Array<long int, 4>& data, std::string path);
void write(const blitz::Array<long int, 5>& data, std::string path);
void write(const blitz::TinyVector<double, 3>& data, std::string path);
void write(const blitz::TinyVector<int, 3>& data, std::string path);
void write(const std::vector<double>& data, std::string path);
void write(int data, std::string path);
void write(long int data, std::string path);
void write(double data, std::string path);
void write(const std::string& data, std::string path);
void writeRNG(const std::string& data, std::string path_base);
std::string AbsoluteFileName() const;
private:
std::string absolute_filename_;
void createFolder(std::string directory);
void createFile(std::string absolute_filename);
};
#endif /* HDF5_WRITER_H */