[NeXus-committee] NeXus data file inspection tool. NeXus at ILL. We need to be more flexible.
Pete Jemian
prjemian at gmail.com
Tue Sep 2 14:32:14 BST 2014
Joachim:
On 9/2/2014 7:42 AM, Joachim Wuttke wrote:
> Dear colleagues,
>
> enclosed I submit a short piece of software to your kind consideration:
> A script that reads a NeXus data file and writes a complete tree
> representation of the structure, plus contents, except for arrays
> (which are abbreviated to fit in one line) and repeating structures
> (which are replaced by links).
Your new tool joins two other Python tools that provide a tree view.
Are you aware of these?
* the tree API in NeXpy (http://nexpy.github.io/nexpy/)
* h5toText (part of http://spec2nexus.readthedocs.org)
Both are available on PyPI. That means they can be installed in a
Python distribution using either of these commands:
easy_install spec2nexus
easy_install nexpy
pip install spec2nexus
pip install nexpy
NeXpy's implementation of the tree API was designed for use on NeXus
files. It is likely to complain about structure in an HDF5 file that is
not compliant with the NeXus standard (for example: the appearance of an
HDF group with attribute NX_class="NXpete" since there is no such NeXus
NXDL).
The h5toText tool is more relaxed in its aim - to show the structure of
any HDF5 file. If the file satisfies the minimum requirement (it has
the class path: /NXentry/NXdata/{datafield}/@signal=1), then it is
identified as a NeXus data file. Try it on the ILL data file. Read the
documentation for the features available (such as displaying array data).
Pete
More information about the NeXus-committee
mailing list