pyNSID.io.hdf_utils.validate_h5_dimension

pyNSID.io.hdf_utils.validate_h5_dimension(h5_dim, dim_length)[source]

Validates a dimension already present in an HDF5 file.

Parameters
  • h5_dim (h5py.Dataset) – HDF5 dataset which represents a scientific dimension. The dimension should have non empty attributes ‘name’, quantity’, ‘units’, and ‘dimension_type’

  • dim_length (int) – Expected length of dataset

Returns

error_message

Return type

string, empty if ok.

Notes

A valid dataset to be used as dimension must be 1D not a compound data type but ‘simple’. Such a dataset must have ancillary attributes ‘name’, quantity’, ‘units’, and ‘dimension_type’, which have to be of types str, str, str, and bool respectively and not empty If it is not valid of dataset, Exceptions are raised.