541 void create(
const std::string& fileName,
542 unsigned int flags = H5F_ACC_TRUNC);
553 void open(
const std::string& fileName,
554 unsigned int flags = H5F_ACC_RDONLY);
568 static bool canAccess(
const std::string& fileName);
642 const size_t compressionLevel);
686 const float* matrixData);
704 const size_t indexSensorSize,
705 const size_t* indexSensorData,
707 const float* matrixData);
841 const std::string& value);
void writeStringAttribute(const hid_t parentGroup, MatrixName &datasetName, MatrixName &attributeName, const std::string &value)
Write string attribute into the dataset under the root group.
hid_t openDataset(const hid_t parentGroup, MatrixName &datasetName)
Open a dataset at a specified place in the file tree.
void create(const std::string &fileName, unsigned int flags=H5F_ACC_TRUNC)
Create the HDF5 file.
void writeScalarValue(const hid_t parentGroup, MatrixName &datasetName, const T value)
Write the scalar value under a specified group.
static const std::string kMatrixDomainTypeName
String representation of the Domain type in the HDF5 file.
hid_t getRootGroup() const
Get handle to the root group of the file.
virtual ~Hdf5File()
Destructor.
hid_t openGroup(const hid_t parentGroup, MatrixName &groupName)
Open a HDF5 group at a specified place in the file tree.
void open(const std::string &fileName, unsigned int flags=H5F_ACC_RDONLY)
Open the HDF5 file.
void writeCuboidToHyperSlab(const hid_t dataset, const DimensionSizes &hyperslabPosition, const DimensionSizes &cuboidPosition, const DimensionSizes &cuboidSize, const DimensionSizes &matrixDimensions, const float *matrixData)
Write a cuboid selected within the matrixData into a hyperslab.
size_t getDatasetNumberOfDimensions(const hid_t parentGroup, MatrixName &datasetName)
Get number of dimensions of the dataset under a specified group.
DimensionSizes getDatasetDimensionSizes(const hid_t parentGroup, MatrixName &datasetName)
Get dimension sizes of the dataset under a specified group.
std::string mFileName
File name.
hid_t mFile
HDF file handle.
static bool canAccess(const std::string &fileName)
Can I access the file.
void writeSensorByMaskToHyperSlab(const hid_t dataset, const DimensionSizes &hyperslabPosition, const size_t indexSensorSize, const size_t *indexSensorData, const DimensionSizes &matrixDimensions, const float *matrixData)
Write sensor data selected by the sensor mask - Occasionally very slow, do not use! ...
void writeMatrixDomainType(const hid_t parentGroup, MatrixName &datasetName, const MatrixDomainType &matrixDomainType)
Write matrix data type into the dataset at a specified place in the file tree.
void closeDataset(const hid_t dataset)
Close dataset.
void readScalarValue(const hid_t parentGroup, MatrixName &datasetName, T &value)
Read the scalar value under a specified group.
size_t getDatasetSize(const hid_t parentGroup, MatrixName &datasetName)
Get dataset element count at a specified place in the file tree.
void writeMatrixDataType(const hid_t parentGroup, MatrixName &datasetName, const MatrixDataType &matrixDataType)
Write matrix data type into the dataset at a specified place in the file tree.
std::string readStringAttribute(const hid_t parentGroup, MatrixName &datasetName, MatrixName &attributeName)
Read string attribute from the dataset under the root group.
hid_t createGroup(const hid_t parentGroup, MatrixName &groupName)
Create a HDF5 group at a specified place in the file tree.
Class wrapping the HDF5 routines.
Hdf5File & operator=(const Hdf5File &)=delete
Operator = is not allowed.
void writeHyperSlab(const hid_t dataset, const DimensionSizes &position, const DimensionSizes &size, const T *data)
Write a hyperslab into the dataset.
const std::string MatrixName
Datatype for matrix names.
Structure with 4D dimension sizes (3 in space and 1 in time).
The matrix is stored in floating point 32b wide format.
The header file storing names of all variables.
MatrixDataType readMatrixDataType(const hid_t parentGroup, MatrixName &datasetName)
Read matrix data type from the dataset at a specified place in the file tree.
The header file containing the structure with 3D dimension sizes.
The matrix is stored in fixed point point 64b wide format.
static const std::string kMatrixDataTypeNames[]
String representation of different data types.
void closeGroup(const hid_t group)
Close a group.
void close()
Close the HDF5 file.
MatrixDomainType
HDF5 Matrix domain type (real or complex).
void readCompleteDataset(const hid_t parentGroup, MatrixName &datasetName, const DimensionSizes &dimensionSizes, T *data)
Read data from the dataset at a specified place in the file tree.
static const std::string kMatrixDataTypeName
String representation of the Data type in the HDF5 file.
static const std::string kMatrixDomainTypeNames[]
String representation of different domain types.
MatrixDataType
HDF5 matrix data type (float or uint64).
Hdf5File()
Constructor of the class.
hid_t createDataset(const hid_t parentGroup, MatrixName &datasetName, const DimensionSizes &dimensionSizes, const DimensionSizes &chunkSizes, const MatrixDataType matrixDataType, const size_t compressionLevel)
Create a float HDF5 dataset at a specified place in the file tree (3D/4D).
bool isOpen() const
Is the file opened?
MatrixDomainType readMatrixDomainType(const hid_t parentGroup, MatrixName &datasetName)
Read matrix dataset domain type at a specified place in the file tree.