diff --git a/xrf_hdf5_exporter.py b/xrf_hdf5_exporter.py index 7705c38..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" @@ -35,6 +36,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 @@ -52,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