Closed prjemian closed 7 years ago
This attribute is not reported by the validate code at this time.
Data file:
Here is code to reproduce that error:
import h5py
root = h5py.File('52_0003_Nika.hdf', 'r')
nxentry = root[root.attrs['default']]
nxdata = nxentry[nxentry.attrs['default']]
data = nxdata[nxdata.attrs['signal']]
wave_note = data.attrs.get('IGORWaveNote')
the last line triggers the error
changing it to this produces the same error:
wave_note = data.attrs['IGORWaveNote']
part of h5dump that describes this attribute (and another nearby one):
ATTRIBUTE "IGORWaveNote" {
DATATYPE H5T_STRING {
STRSIZE 23352;
STRPAD H5T_STR_NULLPAD;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): --lots of text--
}
}
ATTRIBUTE "uncertainities" {
DATATYPE H5T_STRING {
STRSIZE H5T_VARIABLE;
STRPAD H5T_STR_NULLTERM;
CSET H5T_CSET_UTF8;
CTYPE H5T_C_S1;
}
DATASPACE SCALAR
DATA {
(0): "Idev"
}
}
The STRSIZE
value looks wrong. Looking through the entire h5dump shows this is the problem:
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE 23352;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE 23332;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE 23198;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
STRSIZE H5T_VARIABLE;
Both h5dump and HDFview can read this data so it must be valid HDF5. IgorPro writes it. The problem is that h5py cannot read it. Might be a limitation with the htype
variable at this line:
File "...../lib/python2.7/site-packages/h5py/_hl/attrs.py", line 79, in __getitem__
no fix for this problem in punx project except to wrap in try:except clause That is working within the structure module. The validate module has not hit that problem yet.
part of structure report:
HDFview says this is: Type =
String, length = 5674
with Array Size =Scalar
and Value =