Cannot load my hdf5

26 views
Skip to first unread message

O Ruk

unread,
Apr 20, 2020, 5:16:41 PM4/20/20
to hyperspy-users
Hi
I cannot load the attached hdf5 file
containing a hyperspectral image (cube 490x2x2048).
I however tried to mimic the stem_abf_data.hspy when creating it.
It looks like it does not "see" the metadata group...
I don't see why. Or it is smth else?
Thanks

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-1-7e3913bd378d> in <module>
      8 #hs.load?
      9 
---> 10 s = hs.load(datafile, lazy=True)
     11 print ('coucou')
     12 

~/venvs/HS/lib/python3.6/site-packages/hyperspy/io.py in load(filenames, signal_type, stack, stack_axis, new_axis_name, lazy, convert_units, **kwds)
    279             objects = [load_single_file(filename, lazy=lazy,
    280                                         **kwds)
--> 281                        for filename in filenames]
    282 
    283         if len(objects) == 1:

~/venvs/HS/lib/python3.6/site-packages/hyperspy/io.py in <listcomp>(.0)
    279             objects = [load_single_file(filename, lazy=lazy,
    280                                         **kwds)
--> 281                        for filename in filenames]
    282 
    283         if len(objects) == 1:

~/venvs/HS/lib/python3.6/site-packages/hyperspy/io.py in load_single_file(filename, **kwds)
    316     else:
    317         reader = io_plugins[i]
--> 318         return load_with_reader(filename=filename, reader=reader, **kwds)
    319 
    320 

~/venvs/HS/lib/python3.6/site-packages/hyperspy/io.py in load_with_reader(filename, reader, signal_type, convert_units, **kwds)
    323     lazy = kwds.get('lazy', False)
    324     file_data_list = reader.file_reader(filename,
--> 325                                         **kwds)
    326     objects = []
    327 

~/venvs/HS/lib/python3.6/site-packages/hyperspy/io_plugins/hspy.py in file_reader(filename, backing_store, lazy, **kwds)
    163         for experiment in experiments:
    164             exg = f['Experiments'][experiment]
--> 165             exp = hdfgroup2signaldict(exg, lazy)
    166             # assign correct models, if found:
    167             _tmp = {}

~/venvs/HS/lib/python3.6/site-packages/hyperspy/io_plugins/hspy.py in hdfgroup2signaldict(group, lazy)
    199 
    200     exp = {'metadata': hdfgroup2dict(
--> 201         group[metadata], lazy=lazy),
    202         'original_metadata': hdfgroup2dict(
    203             group[original_metadata], lazy=lazy),

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

~/venvs/HS/lib/python3.6/site-packages/h5py/_hl/group.py in __getitem__(self, name)
    262                 raise ValueError("Invalid HDF5 object reference")
    263         else:
--> 264             oid = h5o.open(self.id, self._e(name), lapl=self._lapl)
    265 
    266         otype = h5i.get_type(oid)

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/_objects.pyx in h5py._objects.with_phil.wrapper()

h5py/h5o.pyx in h5py.h5o.open()

KeyError: "Unable to open object (object 'mapped_parameters' doesn't exist)"


m3_charge_ROI0-160-2048-2_noav_00001.hdf5
Reply all
Reply to author
Forward
0 new messages