Skip to content

Commit

Permalink
Fixes NXsensor_scan and axes attribute error (#237)
Browse files Browse the repository at this point in the history
* Updates definitions

* Fix reading of items over the length of the axes array

* Update nexus version file

* Updates reference files

* Updates eln schema file
  • Loading branch information
domna authored Feb 13, 2024
1 parent 62afeb7 commit ea64cbf
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pynxtools/nexus-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2020.10-1452-gd2fdad4f
v2020.10-1459-g364a77d1
10 changes: 6 additions & 4 deletions pynxtools/nexus/nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"""Read files from different format and print it in a standard NeXus format
"""

import logging
import os

import sys
import logging
import h5py

import click
import h5py

from pynxtools.nexus.nxdl_utils import * # pylint: disable=wildcard-import, unused-wildcard-import

Expand Down Expand Up @@ -560,7 +560,9 @@ def get_single_or_multiple_axes(nxdata, ax_datasets, a_item, ax_list):
if ind and isinstance(ind, int):
if ind == a_item:
ax_list.append(nxdata[aax])
if not ax_list: # positional determination of the dimension number
if not ax_list and a_item < len(
ax_datasets
): # positional determination of the dimension number
ax_list.append(nxdata[ax_datasets[a_item]])
except KeyError:
pass
Expand Down
5 changes: 4 additions & 1 deletion tests/data/dataconverter/readers/mpes/Ref_nexus_mpes.log
Original file line number Diff line number Diff line change
Expand Up @@ -2111,8 +2111,11 @@ DEBUG - ===== FIELD (//entry/instrument/electronanalyser/collectioncolumn/lens_m
DEBUG - value: b'6kV_kmodem2.0_30VTOF_MoTe2_2340VMCP.sav'
DEBUG - classpath: ['NXentry', 'NXinstrument', 'NXelectronanalyser', 'NXcollectioncolumn', 'NX_CHAR']
DEBUG - classes:
NXmpes.nxdl.xml:/ENTRY/INSTRUMENT/ELECTRONANALYSER/COLLECTIONCOLUMN/lens_mode
NXcollectioncolumn.nxdl.xml:/lens_mode
DEBUG - <<OPTIONAL>>
DEBUG - <<RECOMMENDED>>
DEBUG - documentation (NXmpes.nxdl.xml:/ENTRY/INSTRUMENT/ELECTRONANALYSER/COLLECTIONCOLUMN/lens_mode):
DEBUG -
DEBUG - documentation (NXcollectioncolumn.nxdl.xml:/lens_mode):
DEBUG -
Labelling of the lens setting in use.
Expand Down
2 changes: 1 addition & 1 deletion tests/data/eln_mapper/eln.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Instrument:
vendor: null
field_aperture: null
iris: null
mode: null
lens_mode: null
projection: null
scheme: null
spatial_acceptance: null
Expand Down
2 changes: 1 addition & 1 deletion tests/data/eln_mapper/mpes.scheme.archive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ definitions:
component: StringEditQuantity
defaultDisplayUnit: <No Default unit>
description: ' Scheme of the electron collection column. '
mode:
lens_mode:
type: str
m_annotations:
eln:
Expand Down

0 comments on commit ea64cbf

Please sign in to comment.