NeXus and 2-D data

Ray Osborn ROsborn at anl.gov
Tue Aug 4 21:11:31 BST 1998


>Dear folks,
>
>We're getting serious about NeXus files, and have run into a problem for which
>we don't know the best solution.
>
>Most of our two-dimensional scans are actually sequences of one-dimensional scans,
>and each one-dimensional scan has its own X axis (X is the independent variable).
>In some cases, all X axes ideally would be identical, but in practice might contain
>different positioning errors.  In other cases, users will actively modify 
>the X-axis
>range as the scan progresses, for example to track a peak whose location is 
>a function
>of the Y-axis positioners.  In still other cases, users will do 2-D scans 
>simply as a
>way of programming a series of unrelated 1-D scans, so they can get dinner 
>or some sleep.
>We'd like to allow for all possibilities.
>
>Our idea has been to store the Y-axis data in 1-D arrays (one per Y-axis 
>positioner),
>to store the X-axis data in 2-D arrays (again, one per X-axis positioner), 
>and to store the 
>dependent variables (i.e., the payload data) in 2-D arrays somehow 
>associated with the axes.
>
>Now, how does one use NeXus to tell a data-plotting tool that a 2-D array's Y-axis
>information is in any of several 1-D arrays, and it's X-axis information is 
>in any of
>several 2-D arrays?
>
>Presumably, we'll need a custom tool to display and analyze this kind of 
>2-D data correctly,
>because standard tools will likely expect 2-D data to have 1-D X- and 
>Y-axis data.  However,
>we'd like to write our 2-D data in such a way that standard NeXus and HDF 
>tools at least can
>display it as an image, because in many cases it will be an image, apart 
>from any small
>irregularities in the behavior of X-axis positioners.
>
>Any advice?  Is there a preferred way to do this?
>
>Tim Mooney
>Beamline Controls & Data Acquisition
>Advanced Photon Source
>Argonne National Laboratory
>
>

Hi Tim,
It's taken me a little while to understand the details of this problem.  Am
I right in thinking that the scenario is for the instrument to set a
particular Y-value, scan in X, and then set a new Y-value etc?  If so, that
would give just one 1-d array containing the Y-axis settings.  This would
then be given the attribute axis=2 and would present no further problems. 
It seems to me that there are two possibilities for storing the X-axis
settings.

1) Construct a default 1-d array containing the "nominal" X-values and give
this the axis=1 attribute.  The actual X-values could be stored in a
2d-array as subsidiary data (given "signal=2" or higher ) and would be
ignored by standard plotting packages.

2) Construct a set of 1-d arrays containing the actual X-values, each with
axis=1, but with the "primary" attribute set to 1, 2, etc.  Standard
plotting packages would choose the axis with "primary=1". 

I'm not sure how to deal with the case where there is a different number of
X-values in each scan.  One of the rules of NXdata groups is that the data
themselves are stored as a multi-dimensional data set with defined sizes for
each dimension.  I guess that the writing program could work out the maximum
number of X-values, make that the dimension size, and fill the missing
values with the standard HDF fill value (which can be set to anything the
user wants).  This requires that the NeXus file is written after all the
data have been taken, which I know is not always possible.  

Let me know if any of this makes sense,
Regards,
Ray
-- 
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