fabio
fabio copied to clipboard
hdf5 url does not seems to work
Hello, I try to open this file, like this
fabio_viewer hdf5:///nfs/ruche-diffabs/diffabs-soleil/com-diffabs/2016/Run4/2016-09-01/IHR_30.nxs?scan_30/scan_data/data_02
fabio do not detect this as a known uri.
but
If I use
fabio_viewer /nfs/ruche-diffabs/diffabs-soleil/com-diffabs/2016/Run4/2016-09-01/IHR_30.nxs::scan_30/scan_data/data_02
it works.
So my question is whcih version is the right one ?
AFAIK we do not support URI
Is the one with hdf5:FILENAME?PATH normalized somewhere?
here the link from fabio
http://sources.debian.net/src/python-fabio/0.4.0%2Bdfsg-2/fabio/openimage.py/#L172
but it seems to me that this is not implemented.
We decide to support :: from this URI format https://github.com/blaze/odo/blob/master/docs/source/uri.rst, but it does not allow to create slicing.
I think the one from the documentation was only informative and not implemented.
If some kind or generic URI exists it can be very useful.
In [26]: fabio.open("hdf5:///workspace/valls/silx.git/alltypes_GmKvnA.h5::/")
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-26-2e123c93db8d> in <module>()
----> 1 fabio.open("hdf5:///workspace/valls/silx.git/alltypes_GmKvnA.h5::/")
/home/valls/.local/lib/python2.7/site-packages/fabio/openimage.pyc in openimage(filename, frame)
134 else:
135 logger.debug("Attempting to open %s" % (filename))
--> 136 obj = _openimage(filename)
137 logger.debug("Attempting to read frame %s from %s with reader %s" % (frame, filename, obj.classname))
138 obj = obj.read(obj.filename, frame)
/home/valls/.local/lib/python2.7/site-packages/fabio/openimage.pyc in _openimage(filename)
212
213 if url.scheme in ["nxs", "hdf5"] and filetype == "hdf5":
--> 214 obj.set_url(url)
215 obj.filename = filename
216 # skip the read for read header
AttributeError: 'Hdf5Image' object has no attribute 'set_url'
It looks to be unimplemented.
I am wondering if the guyes from taurus did not already implemented something like this ?
My bad, that's a mixed syntax...
what about this http://h5serv.readthedocs.io/en/latest/index.html
I don't think it provides any URL format with a slicing.
I just contacted carlos pascal from taurus in order to have its opinion. they have a scheme for their data sources. And I think that it could nice to share the same between silx/fabio/pyFAI and taurus. To avoid two different syntax
Here an example of url with a slice whci his in fact select :)
https://data.hdfgroup.org:7258/datasets/4af8bc72-3e8a-11e6-a48f-0242ac110003/value?host=tall.data.hdfgroup.org&select=[0:4,0:4]
Here the h5file-scheme whcih was discussed with armando a time ago :)
https://github.com/taurus-org/h5file-scheme
BTW, i don't think it is a very good idea to use fabio to open a HDF5 file.
It can be useful first, but i am afraid it will create an useless overhead on top of h5py.