<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Armando,
<div class="">I hope I didn’t give the impression that I thought your file was anomalous. It is perfectly acceptable to store the attributes as an array of fixed-length strings, as you did. The only request is that the strings are UTF-8, but fixed-length string
arrays are always (I think) returned as an array of byte strings by h5py, whatever their encoding. The problem was not with your file, but with my implementation of a fix. In fact, it has stimulated me to provide a more robust way of handling different but
valid storage options, so it’s been very useful. </div>
<div class=""><br class="">
</div>
<div class="">With best regards,</div>
<div class="">Ray</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jan 30, 2018, at 9:23 AM, V. Armando Solé <<a href="mailto:sole@esrf.fr" class="">sole@esrf.fr</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">On 30/01/2018 16:14, Osborn, Raymond wrote:<br class="">
<blockquote type="cite" class=""><br class="">
The ‘nxvalue’ property is what is returned when accessing the<br class="">
attribute dictionary, but the ‘nxdata’ property can be accessed using<br class="">
the ‘get’ method of the attribute dictionary. In the file recently<br class="">
posted by Armando Solé:<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class=""> xanes['202.1/plotselect'].attrs.get('auxiliary_signals').nxdata<br class="">
</blockquote>
</blockquote>
</blockquote>
array([b'xmap_nika00', b'xmap_nika01', b'xmap_nika02', b'xmap_nika03',<br class="">
b'xmap_nika04', b'xmap_nika07'], <br class="">
dtype='|S11')<br class="">
<br class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">
<blockquote type="cite" class="">xanes['202.1/plotselect'].attrs['auxiliary_signals']<br class="">
</blockquote>
</blockquote>
</blockquote>
['xmap_nika00',<br class="">
'xmap_nika01',<br class="">
'xmap_nika02',<br class="">
'xmap_nika03',<br class="">
'xmap_nika04',<br class="">
'xmap_nika07']<br class="">
<br class="">
</blockquote>
<br class="">
Following your indications (Thanks Ray!) we have corrected that at our<br class="">
side to make sure we respect the NX_CHAR type:<br class="">
<br class="">
NX_CHAR: any string representation<br class="">
All strings are to be encoded in UTF-8.<br class="">
Includes fixed-length strings, variable-length<br class="">
strings, and string arrays.<br class="">
Some file writers write strings as a string array of<br class="">
rank 1 and length 1. Clients should be prepared to handle such strings.<br class="">
<br class="">
Unfortunately the error is so common that readers quite often need to<br class="">
handle both.<br class="">
<br class="">
Armando<br class="">
<br class="">
_______________________________________________<br class="">
NeXus mailing list<br class="">
<a href="mailto:NeXus@nexusformat.org" class="">NeXus@nexusformat.org</a><br class="">
http://lists.nexusformat.org/mailman/listinfo/nexus<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
<br class="">
<br class="">
<div class="">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
-- <br class="">
Ray Osborn, Senior Scientist<br class="">
Materials Science Division<br class="">
Argonne National Laboratory<br class="">
Argonne, IL 60439, USA<br class="">
Phone: +1 (630) 252-9011<br class="">
Email: <a href="mailto:ROsborn@anl.gov" class="">ROsborn@anl.gov</a></div>
</div>
</div>
<br class="">
</body>
</html>