[Nexus-developers] Missing attribute?

freddie.akeroyd at stfc.ac.uk freddie.akeroyd at stfc.ac.uk
Fri Jun 11 12:36:29 BST 2010


Hi,

It's a little confusing, but NXroot is currently only a "real object" in the XML representation. A NeXus HDF4 file consisted of top level global attributes plus various groups - only groups could have a class in HDF4. The class "NXroot" was created to describe what these top level attributes were (NeXus_version etc). With XML files you cannot have a global attributes so in this case NXroot was explicitly written into the file as a "real group".

If you wanted to know if an HDF5 files was a NeXus file, you could currently check for the "NeXus_version" attribute. For HDF5 it would be easy for the API to write an additional global attribute "nx_class" at the top level with the value "NXroot" - does anybody think this could cause any problems?
 
Regards,

Freddie     

-----Original Message-----
From: nexus-developers-bounces at nexusformat.org [mailto:nexus-developers-bounces at nexusformat.org] On Behalf Of Tobias Richter
Sent: 11 June 2010 11:45
To: "V. Armando" Solé"
Cc: nexus-developers at nexusformat.org
Subject: Re: [Nexus-developers] Missing attribute?

The standard NeXus API does do that or even allow it in a
straightforward way. That is why many files will fail your test at the
moment. But it could set the class attribute for HDF5. In HDF4 you could
not have attributes to the root node (I might be wrong though), that is
probably why it is not there. But adding that would be relatively simple
(for HDF5 and XML) and useful, I guess.

Regards,
Tobias


On Fri, 2010-06-11 at 11:47 +0200, "V. Armando Solé" wrote:
> Hello,
> 
> I've got surprised by the fact the NeXus files I've got from different 
> sources do not have an attribute NX_class set to NXroot at the root level.
> 
> The web description does not endorse that, but one would really expect it.
> 
> It would be the simplest way to test if a just opened HDF5 file is 
> supposed to be following NeXus rules.
> 
> Best regards,
> 
> Armando
> 
> _______________________________________________
> NeXus-developers mailing list
> NeXus-developers at nexusformat.org
> http://lists.nexusformat.org/mailman/listinfo/nexus-developers


-- 
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd. 
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom
 



_______________________________________________
NeXus-developers mailing list
NeXus-developers at nexusformat.org
http://lists.nexusformat.org/mailman/listinfo/nexus-developers


More information about the NeXus-developers mailing list