Storing repeating structures
Ray Osborn
ROsborn at anl.gov
Tue Nov 2 15:26:41 GMT 1999
on 99/11/2 1:27 AM, Mark.Koennecke at koenneck at psi.ch wrote:
>
>
>
> On Mon, 1 Nov 1999 C.M.Moreton-Smith at rl.ac.uk wrote:
>
>>
>>
>> /* How do we now store "my_array" in a NeXus file? */
>> }
>>
>
> I did indeed hit this problem. We have an instrument which will collect
> series of PSD frames when the detector electronics becomes
> available(sigh.....). At each frame a couple of values have to be
> stored. In C you would use a struct.
>
> To my knowledge there is no way to have arrays of vGroups either in HDF4
> nor in HDF 5. I'am not so sure about HDF5 though.
>
I don't believe that you can have arrays of groups in HDF5, because that
feature is provided by compound datatypes. Groups are meant to be like unix
subdirectories which have specific paths like /entry1/foo/bar. I don't see
how this could be compatible with array concepts.
> Options available where to have F77 style arrays for each single value
> to be stored or to have a vGroup per frame.
>
> I choose the vGroup option for two reasons: Each frame represents a
> single measurement. The structure of NeXus files required some data
> to be stored in different vGroups: i.e PSD data in NXdata, NXinstrument,
> NXdetector, sample data in NXsample etc. The vGroup option allowed to
> preserve this structure. I also feel that the addition of an artifical
> dimension (frame number) is a bit dodgy especially if we consider
> automatic data analysis.
>
If I understand this correctly, you are storing a multi-dimensional data
array in each frame, and then changing some variable, such as temperature or
detector angle, from frame to frame. If so, I would have thought that it
would be better to add the frame number as an extra dimension, and included
the temperature or angle as independent one-dimensional arrays in a single
NXdata group. You are, of course, allowed one unlimited dimension in each
SDS, so you would not have to define the frame number in advance. This
would make the subsequent extraction of the data for plotting a lot easier.
Each frame could be extracted as a slab, or you could take a PSD element and
plot it versus temperature. With your design, don't you have to reconstruct
this information by a lot more i/o.
Of course, if I have misunderstood the example, this may not be relevant.
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-developers
mailing list