est.io.utils.read.get_data_from_url#
- est.io.utils.read.get_data_from_url(url) ndarray [source]#
Returns a numpy data from an URL.
Examples:
>>> # 1st frame from an EDF using silx.io.open >>> data = silx.io.get_data("silx:/users/foo/image.edf::/scan_0/instrument/detector_0/data[0]")
>>> # 1st frame from an EDF using fabio >>> data = silx.io.get_data("fabio:/users/foo/image.edf::[0]")
Yet 2 schemes are supported by the function.
- If silx scheme is used, the file is opened using
silx.io.open()
and the data is reach using usually NeXus paths.
- If fabio scheme is used, the file is opened using
fabio.open()
from the FabIO library. No data path have to be specified, but each frames can be accessed using the data slicing. This shortcut of
silx.io.open()
allow to have a faster access to the data.
- If fabio scheme is used, the file is opened using
See also
silx.io.url.DataUrl
- Parameters:
Union[str,silx.io.url.DataUrl] – A data URL
- Return type:
Union[numpy.ndarray, numpy.generic]
- Raises:
ImportError – If the mandatory library to read the file is not available.
ValueError – If the URL is not valid or do not match the data
IOError – If the file is not found or in case of internal error of
fabio.open()
orsilx.io.open()
. In this last case more informations are displayed in debug mode.