[NeXus-tech] napi and attribute arrays

Tobias.Richter at diamond.ac.uk Tobias.Richter at diamond.ac.uk
Thu Nov 21 15:20:16 GMT 2013


Hi all,

So far I've been creating my example files for with the new geometry definitions with h5py (mostly). Now that I want to use Java for that I find that while we say the vector attribute consists of three values: http://download.nexusformat.org/doc/html/design.html?highlight=vector
there is no way to write that with the NAPI. Because napi.c has:

  NXstatus  NXputattr (NXhandle fid, CONSTCHAR *name, const void *data, 
                                  int datalen, int iType)
  {
    char buffer[256];
    pNexusFunction pFunc = handleToNexusFunc(fid);
    if (datalen > 1 && iType != NX_CHAR)
    {
        NXReportError("NXputattr: numeric arrays are not allowed as attributes - only character strings and single numbers");
        return NX_ERROR;
    }

Unless there are objections I'd remove that limitation (for HDF5 only for now). 

Tobias
-- 
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
 






More information about the NeXus-tech mailing list