[Nexus] HDF compatibility issues

Ray Osborn ROsborn at anl.gov
Mon Sep 2 10:09:49 BST 2002

On 8/28/02 9:29 PM, "Frédéric OTT" <fott at cea.fr> wrote:

> Dear Nexus users,
> I have recently implemented Nexus I/O for my programs (in order to have
> a flexible data storage).
> However, I am experiencing a limited compatibility with General Purpose
> HDF plotters (such as Compaq Array Visualisator or Transform)
> The main problem is related to the way the X, Y lambda scales are stored.
> In the Nexus format, the axis have "axis" and "primary" attributes.
> However, this convention is Nexus Specific.
> In general HDF files, the data sets containing the scales are stored in
> the 2D sets as a reference to the sets containing the scales..
> This means that when reading Nexus files in a HDF plotter, the axis
> values are lost (and have to be reconstructed, tedious).
> I am correct? (I might perhaps  have missed some point) but no function
> to do that seems available in the Nexus API.

I agree that the situation is frustrating.  You will find a note about it at
the end of the NeXus Data section in
<http://www.neutron.anl.gov/nexus/NeXus_structure.html#Data>.  The problem
arises because the HDF4 implementation of dimension scales is not consistent
with a hierarchical file structure.  This was the reason that Jon Tischler
proposed the axis attribute solution.  Much third-party software seem to
assume that there is only one SDS in the HDF file so they have problems with
all but the simplest of NeXus files.

I don't know how commercial software will cope with HDF5, which has no
default way of defining dimension scales at all.  Perhaps we can persuade
them to adopt the NeXus solution (this might one day be realistic, but
probably not for a little while).

> Could it be possible to add some function in the Nexus API in order to
> put a reference to the axis sets in the data sets themselves so as to
> have a better HDF compatibility?
> What is your opinion?

It's a long time since I thought about this.  I don't know if Mark wants to
comment on this.  If we knew that the named data item was only going to be
used in one NXdata group, then I suppose a fudge is possible.  However, it
would probably have to involve a new subroutine call, and would have to be
considered a deprecated fudge.  As I wrote above, it would have no use once
most of us shift to HDF5.

Best regards,
Dr Ray Osborn                Tel: +1 (630) 252-9011
Materials Science Division   Fax: +1 (630) 252-7777
Argonne National Laboratory  E-mail: ROsborn at anl.gov
Argonne, IL 60439-4845

More information about the NeXus mailing list