Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions xrf_hdf5_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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

Expand Down
Loading