Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hdf5 url does not seems to work #170

Open
picca opened this issue Oct 4, 2017 · 13 comments
Open

hdf5 url does not seems to work #170

picca opened this issue Oct 4, 2017 · 13 comments

Comments

@picca
Copy link

picca commented Oct 4, 2017

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 ?

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

AFAIK we do not support URI

Is the one with hdf5:FILENAME?PATH normalized somewhere?

@picca
Copy link
Author

picca commented Oct 5, 2017

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.

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

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.

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

If some kind or generic URI exists it can be very useful.

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

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.

@picca
Copy link
Author

picca commented Oct 5, 2017

I am wondering if the guyes from taurus did not already implemented something like this ?

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

My bad, that's a mixed syntax...

@picca
Copy link
Author

picca commented Oct 5, 2017

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

I don't think it provides any URL format with a slicing.

@picca
Copy link
Author

picca commented Oct 5, 2017

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

@picca
Copy link
Author

picca commented Oct 5, 2017

@picca
Copy link
Author

picca commented Oct 5, 2017

Here the h5file-scheme whcih was discussed with armando a time ago :)

https://github.com/taurus-org/h5file-scheme

@vallsv
Copy link
Contributor

vallsv commented Oct 5, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants