Dear Users,
I am trying to open a .h5 file in jupyter-notebook. Please anyone guide me about reading of HDF files.
*_Command;_*
import h5py filename = "ct_multilevel-err.h5" with h5py.File(filename, "r") as f: # List all groups print("Keys: %s" % f.keys()) a_group_key = list(f.keys())[0]
# Get the data data = list(f[a_group_key])
*_Error;_*
IOError Traceback (most recent call last) <ipython-input-12-769b4593257a> in<module>() 1 filename= "ct_multilevel-err.h5" ----> 2with h5py.File(filename, "r") as f: 3 # List all groups 4 print("Keys: %s" % f.keys()) 5 a_group_key= list(f.keys())[0]
/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.pyc in__init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds) 406 fid = make_fid(name, mode, userblock_size, 407 fapl, fcpl=make_fcpl(track_order=track_order), --> 408swmr=swmr) 409 410 if isinstance(libver, tuple):
/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.pyc inmake_fid(name, mode, userblock_size, fapl, fcpl, swmr) 171 if swmrand swmr_support: 172 flags|= h5f.ACC_SWMR_READ --> 173fid= h5f.open(name, flags, fapl=fapl) 174 elif mode== 'r+': 175 fid= h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx inh5py._objects.with_phil.wrapper()
h5py/_objects.pyx inh5py._objects.with_phil.wrapper()
h5py/h5f.pyx inh5py.h5f.open()
*IOError**: Unable to open file (unable to open file: name = 'ct_multilevel-err.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)*
Hello Bilal,
Cactus HDF5 files are quite complex to read correctly, in particular when mesh refinement is involved.
Most often they are used with VisIt for visualization.
Both Ian Hinder's SimulationTools (Mathematica) and Wolfgang Kastaun's PostCactus (Python) can read the files and provide simple visualizations.
Please see:
https://docs.einsteintoolkit.org/et-docs/Analysis_and_post-processing
and
https://simulationtools.org/documentation/english/tutorials/plotting
and
https://github.com/wokast/PyCactus/blob/master/PostCactus/doc/examples/noteb...
Yours, Roland
Dear Users,
I am trying to open a .h5 file in jupyter-notebook. Please anyone guide me about reading of HDF files.
*_Command;_*
import h5py filename = "ct_multilevel-err.h5" with h5py.File(filename, "r") as f: # List all groups print("Keys: %s" % f.keys()) a_group_key = list(f.keys())[0]
# Get the data data = list(f[a_group_key])
*_Error;_*
IOError Traceback (most recent call last) <ipython-input-12-769b4593257a> in<module>() 1 filename= "ct_multilevel-err.h5" ----> 2with h5py.File(filename, "r") as f: 3 # List all groups 4 print("Keys: %s" % f.keys()) 5 a_group_key= list(f.keys())[0]
/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.pyc in__init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds) 406 fid = make_fid(name, mode, userblock_size, 407 fapl, fcpl=make_fcpl(track_order=track_order), --> 408swmr=swmr) 409 410 if isinstance(libver, tuple):
/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.pyc inmake_fid(name, mode, userblock_size, fapl, fcpl, swmr) 171 if swmrand swmr_support: 172 flags|= h5f.ACC_SWMR_READ --> 173fid= h5f.open(name, flags, fapl=fapl) 174 elif mode== 'r+': 175 fid= h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx inh5py._objects.with_phil.wrapper()
h5py/_objects.pyx inh5py._objects.with_phil.wrapper()
h5py/h5f.pyx inh5py.h5f.open()
*IOError**: Unable to open file (unable to open file: name = 'ct_multilevel-err.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)*
Bilal
The error message is "No such file or directory". Are you sure the file name is correct? Can you "ls" the file? Can you run "h5ls" on it to display the contents?
-erik
On Tue, Sep 1, 2020 at 9:11 AM Bilal Hameed bilalhameedawan962@gmail.com wrote:
Dear Users,
I am trying to open a .h5 file in jupyter-notebook. Please anyone guide me about reading of HDF files.
Command;
import h5py filename = "ct_multilevel-err.h5" with h5py.File(filename, "r") as f: # List all groups print("Keys: %s" % f.keys()) a_group_key = list(f.keys())[0]
# Get the data data = list(f[a_group_key])Error;
IOError Traceback (most recent call last) <ipython-input-12-769b4593257a> in <module>() 1 filename = "ct_multilevel-err.h5" ----> 2 with h5py.File(filename, "r") as f: 3 # List all groups 4 print("Keys: %s" % f.keys()) 5 a_group_key = list(f.keys())[0]
/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.pyc in __init__(self, name, mode, driver, libver, userblock_size, swmr, rdcc_nslots, rdcc_nbytes, rdcc_w0, track_order, **kwds) 406 fid = make_fid(name, mode, userblock_size, 407 fapl, fcpl=make_fcpl(track_order=track_order), --> 408 swmr=swmr) 409 410 if isinstance(libver, tuple):
/usr/local/lib/python2.7/dist-packages/h5py/_hl/files.pyc in make_fid(name, mode, userblock_size, fapl, fcpl, swmr) 171 if swmr and swmr_support: 172 flags |= h5f.ACC_SWMR_READ --> 173 fid = h5f.open(name, flags, fapl=fapl) 174 elif mode == 'r+': 175 fid = h5f.open(name, h5f.ACC_RDWR, fapl=fapl)
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/_objects.pyx in h5py._objects.with_phil.wrapper()
h5py/h5f.pyx in h5py.h5f.open()
IOError: Unable to open file (unable to open file: name = 'ct_multilevel-err.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
Users mailing list Users@einsteintoolkit.org http://lists.einsteintoolkit.org/mailman/listinfo/users
users@lists.einsteintoolkit.org