From 65bfc3ddea8288f124fb02e5cbd9ad2e37277757 Mon Sep 17 00:00:00 2001 From: Andy Kiss Date: Mon, 23 Mar 2026 14:07:36 -0400 Subject: [PATCH 1/2] Untested commit to check for supported motors in make_hdf --- xrf_hdf5_exporter.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/xrf_hdf5_exporter.py b/xrf_hdf5_exporter.py index 7705c38..55d8252 100644 --- a/xrf_hdf5_exporter.py +++ b/xrf_hdf5_exporter.py @@ -35,6 +35,30 @@ def export_xrf_hdf5(scanid): ) return + # Check if the motors are support in make_hdf + supported_motors = [ + "nano_stage_x", + "nano_stage_y", + "nano_stage_z", + "nano_stage_sx", + "nano_stage_sy", + "nano_stage_sz", + "nano_stage_topx", + "nano_stage_topz", + ] + fast_axis = h.start["scan"]["fast_axis"]["motor_name"] + slow_axis = h.start["scan"]["slow_axis"]["motor_name"] + if fast_axis not in supported_motors: + logger.info( + f"{fast_axis} motor is not supported. Not running pyxrf.api.make_hdf on this document." + ) + return + if slow_axis not in supported_motors: + logger.info( + f"{slow_axis} motor is not supported. Not running pyxrf.api.make_hdf on this document." + ) + return + # Check if this is an alignment scan # scan_input array consists of [startx, stopx, number pts x, start y, stop y, num pts y, dwell] idx_NUM_PTS_Y = 5 From e10ffb7f15df16594bba64fa1d82a514eddd0a16 Mon Sep 17 00:00:00 2001 From: Andy Kiss Date: Mon, 23 Mar 2026 14:08:10 -0400 Subject: [PATCH 2/2] Run black --- xrf_hdf5_exporter.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xrf_hdf5_exporter.py b/xrf_hdf5_exporter.py index 55d8252..a167d5e 100644 --- a/xrf_hdf5_exporter.py +++ b/xrf_hdf5_exporter.py @@ -9,6 +9,7 @@ from pyxrf.api import make_hdf from tiled.client import from_profile + # from pyxrf.api import make_hdf CATALOG_NAME = "srx" @@ -76,9 +77,7 @@ def export_xrf_hdf5(scanid): f"/nsls2/data/srx/proposals/commissioning/{h.start['data_session']}" ) else: - working_dir = ( - f"/nsls2/data/srx/proposals/{h.start['cycle']}/{h.start['data_session']}" # noqa: E501 - ) + working_dir = f"/nsls2/data/srx/proposals/{h.start['cycle']}/{h.start['data_session']}" # noqa: E501 os.umask(0o007) # Read/write access for user and group only