Skip to content
Snippets Groups Projects
Commit 90713ca7 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

pre-date HRIXS detector images

the HRIXS detector unfortunately gives no proper trainId when the image
is taken, but when the image is received. This pre-dates the image
to when it was actually taken.
parent 6d929c27
No related branches found
No related tags found
No related merge requests found
...@@ -169,6 +169,14 @@ def load(proposalNB=None, runNB=None, ...@@ -169,6 +169,14 @@ def load(proposalNB=None, runNB=None,
if k not in rois: if k not in rois:
# no ROIs selection, we read everything # no ROIs selection, we read everything
arr = run.get_array(*v.values(), name=k) arr = run.get_array(*v.values(), name=k)
# the HRIXS detector puts the trainId when the image arrives at the
# computer. This is much later than it is actually taken. We estimate the
# readout time and subract it from the trainId in order to pre-date the
# image. 100000 means 1 MHz readout / 10 Hz XFEL rep-rate
if f == 'hRIXS_det':
arr = arr.assign_coords(trainId=arr['trainId']
- int(arr.shape[1] * arr.shape[2] // 100000) - 1)
if len(arr) == 0: if len(arr) == 0:
log.warning(f'Empty array for {f}: {v["source"]}, {v["key"]}. ' log.warning(f'Empty array for {f}: {v["source"]}, {v["key"]}. '
'Skipping!') 'Skipping!')
......
  • Maintainer

    What if we want to use a different readout speed?

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment