Skip to content

Commit

Permalink
Try to account for no units in sparse files
Browse files Browse the repository at this point in the history
  • Loading branch information
jadball committed Jan 16, 2025
1 parent 638b8e6 commit 2f72955
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ImageD11/sinograms/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,11 @@ def import_motors_from_master(self):
# read from h5:
dty = hin[scan]["instrument/positioners"][self.dtymotor]
# get the unit for dty:
dty_unit = hin[scan]["instrument/positioners"][self.dtymotor].attrs['units']
# will fail if we import from sparse unfortunately
try:
dty_unit = hin[scan]["instrument/positioners"][self.dtymotor].attrs['units']
except KeyError:
logging.warning('No units for dty, assuming microns!')
if dty_unit == 'mm':
dty_is_mm = True
if len(dty.shape) == 0:
Expand Down

0 comments on commit 2f72955

Please sign in to comment.