|
musrfit 1.10.0
|
NeXus HDF5 file reader with case-insensitive path lookup. More...
#include <PNeXus.h>
Public Member Functions | |
| PNeXus () | |
| PNeXus (const std::string fln, const bool printDebug=false) | |
| std::string | GetFileName () const |
| Get the filename of the NeXus file. | |
| std::string | GetHdf5LibVersion () const |
| Get the HDF5 library version string. | |
| std::string | GetHdf5Version () const |
| Get the HDF5 version string from the file. | |
| std::string | GetNeXusVersion () const |
| Get the NeXus version of the file. | |
| int | GetIdfVersion () const |
| Get the Idf version of the file. | |
| int | ReadNexusFile () |
| Read and parse the NeXus HDF5 file. | |
| const std::map< std::string, std::any > & | GetDataMap () const |
| Get the data map containing all datasets. | |
| std::map< std::string, std::any > & | GetDataMap () |
| Get mutable reference to the data map. | |
| bool | HasDataset (const std::string &path) const |
| Check if a dataset path exists in the data map. | |
| template<typename T> | |
| void | SetDataset (const std::string &path, const PNXdata< T > &data) |
| Add or update a dataset in the data map. | |
| template<typename T> | |
| PNXdata< T > | GetDataset (const std::string &path) const |
| Get a dataset from the data map. | |
| template<typename T> | |
| PNXdata< T > & | GetDatasetRef (const std::string &path) |
| Get a mutable reference to a dataset in the data map. | |
| bool | RemoveDataset (const std::string &path) |
| Remove a dataset from the data map. | |
| void | ClearDataMap () |
| Clear all datasets from the data map. | |
| size_t | GetNumDatasets () const |
| Get the number of datasets in the data map. | |
| template<typename T> | |
| bool | UpdateDatasetData (const std::string &path, const std::vector< T > &newData) |
| Update the data of an existing dataset. | |
| template<typename T> | |
| bool | UpdateDatasetDimensions (const std::string &path, const std::vector< hsize_t > &newDimensions) |
| Update the dimensions of an existing dataset. | |
| template<typename T> | |
| bool | AddDatasetAttribute (const std::string &path, const std::string &attrName, const std::any &attrValue) |
| Add or update an attribute for a dataset. | |
| template<typename T> | |
| bool | RemoveDatasetAttribute (const std::string &path, const std::string &attrName) |
| Remove an attribute from a dataset. | |
| template<typename T> | |
| bool | AddDataset (const std::string &path, const std::vector< T > &data, const std::vector< hsize_t > &dimensions, const H5::DataType &dataType=H5::PredType::NATIVE_INT) |
| Create and add a new dataset with data, dimensions, and optional attributes. | |
| template<typename T> | |
| bool | ModifyDataset (const std::string &path, const std::vector< T > &newData, const std::vector< hsize_t > &newDimensions) |
| Modify an existing dataset's data and dimensions. | |
| void | Dump () |
| int | WriteNexusFile (const std::string &filename, int idfVersion=2) |
| bool | AddGroupAttribute (const std::string &groupPath, const std::string &attrName, const std::any &attrValue) |
| bool | RemoveGroupAttribute (const std::string &groupPath, const std::string &attrName) |
| Remove an attribute from a group. | |
| bool | HasGroupAttribute (const std::string &groupPath, const std::string &attrName) const |
| Check if a group has a specific attribute. | |
| std::any | GetGroupAttribute (const std::string &groupPath, const std::string &attrName) const |
| Get an attribute value from a group. | |
| const std::map< std::string, std::any > & | GetGroupAttributes (const std::string &groupPath) const |
| Get all attributes for a group. | |
| bool | ClearGroupAttributes (const std::string &groupPath) |
| Clear all attributes from a group. | |
| bool | AddRootAttribute (const std::string &attrName, const std::any &attrValue) |
Private Member Functions | |
| void | HandleIdfV1 (H5::H5File &file) |
| Read datasets for IDF version 1 file structure. | |
| void | HandleIdfV2 (H5::H5File &file) |
| Read datasets for IDF version 2 file structure. | |
| H5::Group | CreateGroupHierarchy (H5::H5File &file, const std::string &path) |
| Create nested group hierarchy for a given path. | |
| template<typename T> | |
| void | WriteDatasetAttributes (H5::DataSet &dataset, const PNXdata< T > &data) |
| Write dataset attributes from PNXdata object. | |
| void | WriteGroupAttributes (H5::Group &group, const std::map< std::string, std::any > &attributes) |
| Write attributes to a group. | |
| void | WriteIntDataset (H5::H5File &file, const std::string &path, const PNXdata< int > &data) |
| Write an integer dataset with attributes. | |
| void | WriteFloatDataset (H5::H5File &file, const std::string &path, const PNXdata< float > &data) |
| Write a float dataset with attributes. | |
| void | WriteStringDataset (H5::H5File &file, const std::string &path, const PNXdata< std::string > &data) |
| Write a string dataset with attributes. | |
| void | WriteFileAttributes (H5::H5File &file) |
| Write root-level file attributes. | |
| std::string | FindAttributeName (H5::H5File &obj, const std::string &requestedName) |
| std::string | FindGroupPath (H5::H5File &parent, const std::string &requestedPath) |
| std::string | FindGroupPath (H5::Group &parent, const std::string &requestedPath) |
| Find group path with case-insensitive matching (Group version) | |
| std::string | FindDatasetPath (H5::H5File &parent, const std::string &requestedPath) |
| std::string | FindDatasetPath (H5::Group &parent, const std::string &requestedPath) |
| Find dataset path with case-insensitive matching (Group version) | |
| void | ReadIntDataset (H5::H5File &file, const std::string &path) |
| Read an integer dataset and store in data map. | |
| void | ReadFloatDataset (H5::H5File &file, const std::string &path) |
| Read a float dataset and store in data map. | |
| void | ReadStringDataset (H5::H5File &file, const std::string &path) |
| Read a string dataset and store in data map. | |
| template<typename T> | |
| void | ReadDatasetAttributes (H5::DataSet &dataset, PNXdata< T > &data) |
| Read dataset attributes and add to PNXdata object. | |
Static Private Member Functions | |
| static bool | CaseInsensitiveEquals (const std::string &a, const std::string &b) |
| Compare two strings case-insensitively. | |
| static std::vector< std::string > | SplitPath (const std::string &path) |
Private Attributes | |
| bool | fPrintDebug {false} |
| if true print additional debug information | |
| std::string | fFileName {""} |
| NeXus HDF5 filename. | |
| int | fIdfVersion {-1} |
| IDF version of the NeXus file. | |
| std::string | fHdf5LibVersion {"n/a"} |
| HDF5 library version used when calling PNeXus. | |
| std::string | fHdf5Version {""} |
| HDF5 version of the file. | |
| std::string | fNeXusVersion {""} |
| NeXus version of the file. | |
| std::string | fFileNameNxs {""} |
| std::string | fFileTimeNxs {""} |
| std::string | fCreatorNxs {""} |
| std::string | fUserV1 {""} |
| std::map< std::string, std::any > | fDataMap |
| Map of HDF5 paths to PNXdata objects. | |
| std::map< std::string, std::map< std::string, std::any > > | fGroupAttributes |
| Map of group paths to their attributes. | |
NeXus HDF5 file reader with case-insensitive path lookup.
The PNeXus class provides functionality for reading ISIS muon NeXus HDF5 files using the HDF5 C++ API. It implements case-insensitive path lookup for datasets, groups, and attributes to handle files with varying path casings.
Key features:
| nxH5::PNeXus::PNeXus | ( | ) |
Definition at line 3451 of file PNeXus.cpp.
References fHdf5LibVersion, and status.
| nxH5::PNeXus::PNeXus | ( | const std::string | fln, |
| const bool | printDebug = false ) |
Definition at line 3490 of file PNeXus.cpp.
References fFileName, fHdf5LibVersion, fPrintDebug, ReadNexusFile(), and status.
|
inline |
Create and add a new dataset with data, dimensions, and optional attributes.
| T | Data type of the PNXdata object |
| path | HDF5 path for the new dataset |
| data | Data vector |
| dimensions | Dimensions vector |
| dataType | HDF5 DataType (optional, uses default if not provided) |
Definition at line 1723 of file PNeXus.h.
References fDataMap, HasDataset(), nxH5::PNXdata< T >::SetData(), and nxH5::PNXdata< T >::SetDimensions().
|
inline |
Add or update an attribute for a dataset.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| attrName | Attribute name |
| attrValue | Attribute value (stored as std::any) |
Definition at line 1677 of file PNeXus.h.
References fDataMap, and HasDataset().
| bool nxH5::PNeXus::AddGroupAttribute | ( | const std::string & | groupPath, |
| const std::string & | attrName, | ||
| const std::any & | attrValue ) |
Add or update an attribute for a group.
| groupPath | HDF5 path of the group (e.g., "/raw_data_1") |
| attrName | Attribute name |
| attrValue | Attribute value (stored as std::any) |
Definition at line 5605 of file PNeXus.cpp.
References fGroupAttributes.
Referenced by AddRootAttribute().
| bool nxH5::PNeXus::AddRootAttribute | ( | const std::string & | attrName, |
| const std::any & | attrValue ) |
Add or update an attribute at the root level "/". This is a convenience method that calls AddGroupAttribute("/", attrName, attrValue).
| attrName | Attribute name |
| attrValue | Attribute value (stored as std::any) |
Definition at line 5712 of file PNeXus.cpp.
References AddGroupAttribute().
|
staticprivate |
Compare two strings case-insensitively.
| a | First string to compare |
| b | Second string to compare |
Definition at line 3015 of file PNeXus.cpp.
Referenced by FindAttributeName(), FindDatasetPath(), FindDatasetPath(), FindGroupPath(), and FindGroupPath().
|
inline |
| bool nxH5::PNeXus::ClearGroupAttributes | ( | const std::string & | groupPath | ) |
Clear all attributes from a group.
| groupPath | HDF5 path of the group |
Clear all attributes from a group.
| groupPath | HDF5 path of the group |
Definition at line 5693 of file PNeXus.cpp.
References fGroupAttributes.
|
private |
Create nested group hierarchy for a given path.
| file | HDF5 file object |
| path | Full path (e.g., "/raw_data_1/detector_1") |
| H5::GroupIException | if group creation fails |
Create nested group hierarchy for a given path. Groups are created recursively if they don't exist. If a group already exists, it is opened and returned.
| file | HDF5 file object |
| path | Full path (e.g., "/raw_data_1/detector_1") |
| H5::GroupIException | if group creation fails |
Definition at line 5027 of file PNeXus.cpp.
References fGroupAttributes, fPrintDebug, SplitPath(), and WriteGroupAttributes().
Referenced by WriteFloatDataset(), WriteIntDataset(), and WriteStringDataset().
| void nxH5::PNeXus::Dump | ( | ) |
Definition at line 3761 of file PNeXus.cpp.
References fDataMap, fFileName, fFileNameNxs, fFileTimeNxs, fHdf5Version, fIdfVersion, fNeXusVersion, and fUserV1.
|
private |
Definition at line 3090 of file PNeXus.cpp.
References CaseInsensitiveEquals().
Referenced by HandleIdfV1(), HandleIdfV2(), and ReadNexusFile().
|
private |
Find dataset path with case-insensitive matching (Group version)
| parent | HDF5 Group object to start search from |
| requestedPath | Requested dataset path (any case) |
| H5::DataSetIException | if dataset not found or path invalid |
Definition at line 3372 of file PNeXus.cpp.
References CaseInsensitiveEquals(), and SplitPath().
|
private |
Definition at line 3292 of file PNeXus.cpp.
References CaseInsensitiveEquals(), and SplitPath().
Referenced by ReadFloatDataset(), ReadIntDataset(), ReadNexusFile(), and ReadStringDataset().
|
private |
Find group path with case-insensitive matching (Group version)
| parent | HDF5 Group object to start search from |
| requestedPath | Requested group path (any case) |
| H5::GroupIException | if group not found or path invalid |
Definition at line 3200 of file PNeXus.cpp.
References CaseInsensitiveEquals(), and SplitPath().
|
private |
Definition at line 3131 of file PNeXus.cpp.
References CaseInsensitiveEquals(), and SplitPath().
|
inline |
|
inline |
|
inline |
Get a dataset from the data map.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| std::out_of_range | if path doesn't exist |
| std::bad_any_cast | if type T doesn't match stored type |
Definition at line 1588 of file PNeXus.h.
References fDataMap.
|
inline |
Get a mutable reference to a dataset in the data map.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| std::out_of_range | if path doesn't exist |
| std::bad_any_cast | if type T doesn't match stored type |
Definition at line 1601 of file PNeXus.h.
References fDataMap.
|
inline |
| std::any nxH5::PNeXus::GetGroupAttribute | ( | const std::string & | groupPath, |
| const std::string & | attrName ) const |
Get an attribute value from a group.
| groupPath | HDF5 path of the group |
| attrName | Attribute name |
| std::out_of_range | if group or attribute doesn't exist |
Get an attribute value from a group.
| groupPath | HDF5 path of the group |
| attrName | Attribute name |
| std::out_of_range | if group or attribute doesn't exist |
Definition at line 5666 of file PNeXus.cpp.
References fGroupAttributes.
| const std::map< std::string, std::any > & nxH5::PNeXus::GetGroupAttributes | ( | const std::string & | groupPath | ) | const |
Get all attributes for a group.
| groupPath | HDF5 path of the group |
Get all attributes for a group.
| groupPath | HDF5 path of the group |
Definition at line 5677 of file PNeXus.cpp.
References fGroupAttributes.
|
inline |
Get the HDF5 library version string.
Definition at line 1520 of file PNeXus.h.
References fHdf5LibVersion.
|
inline |
Get the HDF5 version string from the file.
Definition at line 1526 of file PNeXus.h.
References fHdf5Version.
|
inline |
Get the Idf version of the file.
Definition at line 1538 of file PNeXus.h.
References fIdfVersion.
|
inline |
Get the NeXus version of the file.
Definition at line 1532 of file PNeXus.h.
References fNeXusVersion.
|
inline |
|
private |
Read datasets for IDF version 1 file structure.
Reads datasets specific to the IDF version 1 NeXus format, which uses a "/run/" group hierarchy. Datasets are organized under paths like:
| file | HDF5 file object to read from |
Definition at line 3631 of file PNeXus.cpp.
References FindAttributeName(), fPrintDebug, fUserV1, ReadFloatDataset(), ReadIntDataset(), and ReadStringDataset().
Referenced by ReadNexusFile().
|
private |
Read datasets for IDF version 2 file structure.
Reads datasets specific to the IDF version 2 NeXus format, which uses a "/raw_data_1/" group hierarchy. Datasets are organized under paths like:
| file | HDF5 file object to read from |
Definition at line 3693 of file PNeXus.cpp.
References fFileNameNxs, fFileTimeNxs, FindAttributeName(), fPrintDebug, ReadFloatDataset(), ReadIntDataset(), and ReadStringDataset().
Referenced by ReadNexusFile().
|
inline |
Check if a dataset path exists in the data map.
| path | HDF5 path to check |
Definition at line 1566 of file PNeXus.h.
References fDataMap.
Referenced by AddDataset(), AddDatasetAttribute(), ModifyDataset(), RemoveDatasetAttribute(), UpdateDatasetData(), and UpdateDatasetDimensions().
| bool nxH5::PNeXus::HasGroupAttribute | ( | const std::string & | groupPath, |
| const std::string & | attrName ) const |
Check if a group has a specific attribute.
| groupPath | HDF5 path of the group |
| attrName | Attribute name to check |
Check if a group has a specific attribute.
| groupPath | HDF5 path of the group |
| attrName | Attribute name to check |
Definition at line 5648 of file PNeXus.cpp.
References fGroupAttributes.
|
inline |
Modify an existing dataset's data and dimensions.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| newData | New data vector |
| newDimensions | New dimensions vector |
Definition at line 1743 of file PNeXus.h.
References fDataMap, and HasDataset().
|
private |
Read dataset attributes and add to PNXdata object.
| T | The data type of the PNXdata object |
| dataset | HDF5 dataset object |
| data | PNXdata object to add attributes to |
Reads all attributes from an HDF5 dataset and adds them to a PNXdata object. Attributes can be integers, floats, or strings.
| T | The data type of the PNXdata object |
| dataset | HDF5 dataset object |
| data | PNXdata object to add attributes to |
Definition at line 4971 of file PNeXus.cpp.
References nxH5::PNXdata< T >::AddAttribute(), and fPrintDebug.
Referenced by ReadFloatDataset(), ReadIntDataset(), and ReadStringDataset().
|
private |
Read a float dataset and store in data map.
| file | HDF5 file object |
| path | Path to the dataset |
| H5::Exception | if reading fails |
Reads a float dataset from the HDF5 file and stores it in the data map. Handles multi-dimensional datasets by flattening them into a vector.
| file | HDF5 file object |
| path | Path to the dataset |
| H5::Exception | if reading fails |
Definition at line 4835 of file PNeXus.cpp.
References fDataMap, FindDatasetPath(), fPrintDebug, ReadDatasetAttributes(), nxH5::PNXdata< T >::SetData(), and nxH5::PNXdata< T >::SetDimensions().
Referenced by HandleIdfV1(), and HandleIdfV2().
|
private |
Read an integer dataset and store in data map.
| file | HDF5 file object |
| path | Path to the dataset |
| H5::Exception | if reading fails |
Reads an integer dataset from the HDF5 file and stores it in the data map. Handles multi-dimensional datasets by flattening them into a vector.
| file | HDF5 file object |
| path | Path to the dataset |
| H5::Exception | if reading fails |
Definition at line 4769 of file PNeXus.cpp.
References fDataMap, FindDatasetPath(), fPrintDebug, ReadDatasetAttributes(), nxH5::PNXdata< T >::SetData(), and nxH5::PNXdata< T >::SetDimensions().
Referenced by HandleIdfV1(), and HandleIdfV2().
| int nxH5::PNeXus::ReadNexusFile | ( | ) |
Read and parse the NeXus HDF5 file.
| H5::FileIException | if file cannot be opened |
| H5::AttributeIException | if required attributes are missing |
| H5::DataSetIException | if required datasets are missing |
Reads and parses the NeXus HDF5 file. Opens the file in read-only mode, loads the NeXus version attribute, and reads the IDF version dataset. Uses case-insensitive path lookup to handle varying path casings.
| H5::FileIException | if file cannot be opened |
| H5::AttributeIException | if NeXus_version attribute is missing |
| H5::DataSetIException | if IDF_version dataset is missing |
Definition at line 3531 of file PNeXus.cpp.
References fFileName, fHdf5Version, fIdfVersion, FindAttributeName(), FindDatasetPath(), fNeXusVersion, fPrintDebug, HandleIdfV1(), and HandleIdfV2().
Referenced by PNeXus().
|
private |
Read a string dataset and store in data map.
| file | HDF5 file object |
| path | Path to the dataset |
| H5::Exception | if reading fails |
Reads a string dataset from the HDF5 file and stores it in the data map.
| file | HDF5 file object |
| path | Path to the dataset |
| H5::Exception | if reading fails |
Definition at line 4900 of file PNeXus.cpp.
References fDataMap, FindDatasetPath(), fPrintDebug, ReadDatasetAttributes(), nxH5::PNXdata< T >::SetData(), and nxH5::PNXdata< T >::SetDimensions().
Referenced by HandleIdfV1(), and HandleIdfV2().
|
inline |
|
inline |
Remove an attribute from a dataset.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| attrName | Attribute name to remove |
Definition at line 1697 of file PNeXus.h.
References fDataMap, and HasDataset().
| bool nxH5::PNeXus::RemoveGroupAttribute | ( | const std::string & | groupPath, |
| const std::string & | attrName ) |
Remove an attribute from a group.
| groupPath | HDF5 path of the group |
| attrName | Attribute name to remove |
Remove an attribute from a group.
| groupPath | HDF5 path of the group |
| attrName | Attribute name to remove |
Definition at line 5619 of file PNeXus.cpp.
References fGroupAttributes.
|
inline |
|
staticprivate |
Definition at line 3052 of file PNeXus.cpp.
Referenced by CreateGroupHierarchy(), FindDatasetPath(), FindDatasetPath(), FindGroupPath(), and FindGroupPath().
|
inline |
Update the data of an existing dataset.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| newData | New data vector to set |
Definition at line 1638 of file PNeXus.h.
References fDataMap, and HasDataset().
|
inline |
Update the dimensions of an existing dataset.
| T | Data type of the PNXdata object |
| path | HDF5 path of the dataset |
| newDimensions | New dimensions vector to set |
Definition at line 1657 of file PNeXus.h.
References fDataMap, and HasDataset().
|
private |
Write dataset attributes from PNXdata object.
| T | The data type of the PNXdata object |
| dataset | HDF5 dataset object to write attributes to |
| data | PNXdata object containing attributes |
Writes all attributes from a PNXdata object to an HDF5 dataset. Supports int, float, and string attribute types.
| T | The data type of the PNXdata object |
| dataset | HDF5 dataset object to write attributes to |
| data | PNXdata object containing attributes |
Definition at line 5089 of file PNeXus.cpp.
References fPrintDebug, and nxH5::PNXdata< T >::GetAttributes().
Referenced by WriteFloatDataset(), WriteIntDataset(), and WriteStringDataset().
|
private |
Write root-level file attributes.
| file | HDF5 file object |
| H5::Exception | if writing fails |
Writes root-level file attributes such as NeXus_version, HDF5_version, file_name, and file_time to the HDF5 file.
| file | HDF5 file object |
| H5::Exception | if writing fails |
Definition at line 5479 of file PNeXus.cpp.
References fFileNameNxs, fFileTimeNxs, fGroupAttributes, fHdf5Version, fNeXusVersion, and fPrintDebug.
Referenced by WriteNexusFile().
|
private |
Write a float dataset with attributes.
| file | HDF5 file object |
| path | Dataset path (groups created automatically) |
| data | PNXdata object containing data, dimensions, and attributes |
| H5::Exception | if writing fails |
Writes a float dataset to the HDF5 file with all its attributes. The parent group hierarchy is created automatically if it doesn't exist.
| file | HDF5 file object |
| path | Dataset path (groups created automatically) |
| data | PNXdata object containing data, dimensions, and attributes |
| H5::Exception | if writing fails |
Definition at line 5248 of file PNeXus.cpp.
References CreateGroupHierarchy(), fPrintDebug, nxH5::PNXdata< T >::GetData(), nxH5::PNXdata< T >::GetDimensions(), nxH5::PNXdata< T >::GetNumElements(), and WriteDatasetAttributes().
Referenced by WriteNexusFile().
|
private |
Write attributes to a group.
| group | HDF5 group object to write attributes to |
| attributes | Map of attribute names to values |
Writes attributes to an HDF5 group object. Supports int, float, and string attribute types.
| group | HDF5 group object to write attributes to |
| attributes | Map of attribute names to values (stored as std::any) |
Definition at line 5396 of file PNeXus.cpp.
References fPrintDebug.
Referenced by CreateGroupHierarchy().
|
private |
Write an integer dataset with attributes.
| file | HDF5 file object |
| path | Dataset path (groups created automatically) |
| data | PNXdata object containing data, dimensions, and attributes |
| H5::Exception | if writing fails |
Writes an integer dataset to the HDF5 file with all its attributes. The parent group hierarchy is created automatically if it doesn't exist.
| file | HDF5 file object |
| path | Dataset path (groups created automatically) |
| data | PNXdata object containing data, dimensions, and attributes |
| H5::Exception | if writing fails |
Definition at line 5176 of file PNeXus.cpp.
References CreateGroupHierarchy(), fPrintDebug, nxH5::PNXdata< T >::GetData(), nxH5::PNXdata< T >::GetDimensions(), nxH5::PNXdata< T >::GetNumElements(), and WriteDatasetAttributes().
Referenced by WriteNexusFile().
| int nxH5::PNeXus::WriteNexusFile | ( | const std::string & | filename, |
| int | idfVersion = 2 ) |
Writes the data map contents to a new NeXus HDF5 file. This is the main public API for writing NeXus files.
| filename | Path to the output NeXus HDF5 file |
| idfVersion | IDF version to write (default: 2) |
| H5::FileIException | if file cannot be created |
| H5::GroupIException | if group creation fails |
| H5::DataSetIException | if dataset writing fails |
Definition at line 5731 of file PNeXus.cpp.
References fDataMap, fPrintDebug, WriteFileAttributes(), WriteFloatDataset(), WriteIntDataset(), and WriteStringDataset().
|
private |
Write a string dataset with attributes.
| file | HDF5 file object |
| path | Dataset path (groups created automatically) |
| data | PNXdata object containing data, dimensions, and attributes |
| H5::Exception | if writing fails |
Writes a string dataset to the HDF5 file with all its attributes. The parent group hierarchy is created automatically if it doesn't exist. Handles both scalar strings and arrays of strings.
| file | HDF5 file object |
| path | Dataset path (groups created automatically) |
| data | PNXdata object containing data, dimensions, and attributes |
| H5::Exception | if writing fails |
Definition at line 5321 of file PNeXus.cpp.
References CreateGroupHierarchy(), fPrintDebug, nxH5::PNXdata< T >::GetData(), nxH5::PNXdata< T >::GetDimensions(), and WriteDatasetAttributes().
Referenced by WriteNexusFile().
|
private |
Map of HDF5 paths to PNXdata objects.
Definition at line 1884 of file PNeXus.h.
Referenced by AddDataset(), AddDatasetAttribute(), ClearDataMap(), Dump(), GetDataMap(), GetDataMap(), GetDataset(), GetDatasetRef(), GetNumDatasets(), HasDataset(), ModifyDataset(), ReadFloatDataset(), ReadIntDataset(), ReadStringDataset(), RemoveDataset(), RemoveDatasetAttribute(), SetDataset(), UpdateDatasetData(), UpdateDatasetDimensions(), and WriteNexusFile().
|
private |
NeXus HDF5 filename.
Definition at line 1875 of file PNeXus.h.
Referenced by Dump(), GetFileName(), PNeXus(), and ReadNexusFile().
|
private |
Definition at line 1880 of file PNeXus.h.
Referenced by Dump(), HandleIdfV2(), and WriteFileAttributes().
|
private |
Definition at line 1881 of file PNeXus.h.
Referenced by Dump(), HandleIdfV2(), and WriteFileAttributes().
|
private |
Map of group paths to their attributes.
Definition at line 1885 of file PNeXus.h.
Referenced by AddGroupAttribute(), ClearGroupAttributes(), CreateGroupHierarchy(), GetGroupAttribute(), GetGroupAttributes(), HasGroupAttribute(), RemoveGroupAttribute(), and WriteFileAttributes().
|
private |
|
private |
HDF5 version of the file.
Definition at line 1878 of file PNeXus.h.
Referenced by Dump(), GetHdf5Version(), ReadNexusFile(), and WriteFileAttributes().
|
private |
IDF version of the NeXus file.
Definition at line 1876 of file PNeXus.h.
Referenced by Dump(), GetIdfVersion(), and ReadNexusFile().
|
private |
NeXus version of the file.
Definition at line 1879 of file PNeXus.h.
Referenced by Dump(), GetNeXusVersion(), ReadNexusFile(), and WriteFileAttributes().
|
private |
if true print additional debug information
Definition at line 1874 of file PNeXus.h.
Referenced by CreateGroupHierarchy(), HandleIdfV1(), HandleIdfV2(), PNeXus(), ReadDatasetAttributes(), ReadFloatDataset(), ReadIntDataset(), ReadNexusFile(), ReadStringDataset(), WriteDatasetAttributes(), WriteFileAttributes(), WriteFloatDataset(), WriteGroupAttributes(), WriteIntDataset(), WriteNexusFile(), and WriteStringDataset().
|
private |
Definition at line 1883 of file PNeXus.h.
Referenced by Dump(), and HandleIdfV1().