mx-bluesky 1.5.9__py3-none-any.whl → 1.5.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mx_bluesky/_version.py +2 -2
- mx_bluesky/beamlines/aithre_lasershaping/goniometer_controls.py +2 -2
- mx_bluesky/beamlines/i02_1/parameters/gridscan.py +1 -1
- mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +9 -9
- mx_bluesky/beamlines/i04/thawing_plan.py +9 -9
- mx_bluesky/beamlines/i24/jungfrau_commissioning/experiment_plans/do_darks.py +123 -0
- mx_bluesky/beamlines/i24/jungfrau_commissioning/plan_stubs/__init__.py +1 -0
- mx_bluesky/beamlines/i24/jungfrau_commissioning/{do_external_acquisition.py → plan_stubs/do_external_acquisition.py} +8 -7
- mx_bluesky/beamlines/i24/jungfrau_commissioning/{do_internal_acquisition.py → plan_stubs/do_internal_acquisition.py} +4 -3
- mx_bluesky/beamlines/i24/jungfrau_commissioning/{plan_utils.py → plan_stubs/plan_utils.py} +21 -28
- mx_bluesky/beamlines/i24/serial/__init__.py +7 -5
- mx_bluesky/beamlines/i24/serial/dcid.py +3 -3
- mx_bluesky/beamlines/i24/serial/extruder/{i24ssx_Extruder_Collect_py3v2.py → i24ssx_extruder_collect_py3v2.py} +65 -35
- mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_Collect_py3v1.py → i24ssx_chip_collect_py3v1.py} +5 -5
- mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_Manager_py3v1.py → i24ssx_chip_manager_py3v1.py} +46 -46
- mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_StartUp_py3v1.py → i24ssx_chip_startup_py3v1.py} +3 -3
- mx_bluesky/beamlines/i24/serial/fixed_target/i24ssx_moveonclick.py +33 -33
- mx_bluesky/beamlines/i24/serial/log.py +11 -11
- mx_bluesky/beamlines/i24/serial/parameters/fixed_target/cs/cs_maker.json +3 -3
- mx_bluesky/beamlines/i24/serial/setup_beamline/ca.py +0 -12
- mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +13 -32
- mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +5 -5
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +22 -249
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +2 -2
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +4 -4
- mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +102 -15
- mx_bluesky/beamlines/i24/serial/write_nexus.py +4 -4
- mx_bluesky/common/device_setup_plans/robot_load_unload.py +2 -2
- mx_bluesky/common/device_setup_plans/setup_oav.py +1 -1
- mx_bluesky/common/device_setup_plans/xbpm_feedback.py +4 -4
- mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py +9 -9
- mx_bluesky/common/experiment_plans/common_grid_detect_then_xray_centre_plan.py +2 -2
- mx_bluesky/common/experiment_plans/inner_plans/do_fgs.py +2 -2
- mx_bluesky/common/experiment_plans/inner_plans/read_hardware.py +5 -5
- mx_bluesky/common/experiment_plans/inner_plans/udc_default_state.py +22 -1
- mx_bluesky/common/experiment_plans/inner_plans/write_sample_status.py +2 -2
- mx_bluesky/common/experiment_plans/oav_grid_detection_plan.py +2 -2
- mx_bluesky/common/experiment_plans/oav_snapshot_plan.py +1 -1
- mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +3 -3
- mx_bluesky/common/external_interaction/callbacks/common/plan_reactive_callback.py +1 -1
- mx_bluesky/common/external_interaction/callbacks/common/zocalo_callback.py +2 -2
- mx_bluesky/common/external_interaction/callbacks/sample_handling/sample_handling_callback.py +3 -3
- mx_bluesky/common/external_interaction/callbacks/xray_centre/ispyb_callback.py +7 -5
- mx_bluesky/common/external_interaction/callbacks/xray_centre/nexus_callback.py +2 -2
- mx_bluesky/common/external_interaction/config_server.py +2 -2
- mx_bluesky/common/external_interaction/ispyb/exp_eye_store.py +4 -2
- mx_bluesky/common/external_interaction/ispyb/ispyb_store.py +0 -1
- mx_bluesky/common/external_interaction/nexus/nexus_utils.py +2 -2
- mx_bluesky/common/external_interaction/nexus/write_nexus.py +3 -3
- mx_bluesky/common/parameters/constants.py +1 -1
- mx_bluesky/common/parameters/device_composites.py +2 -2
- mx_bluesky/common/parameters/gridscan.py +2 -2
- mx_bluesky/common/utils/exceptions.py +9 -7
- mx_bluesky/common/utils/log.py +4 -4
- mx_bluesky/common/utils/tracing.py +5 -5
- mx_bluesky/common/utils/utils.py +8 -8
- mx_bluesky/hyperion/__main__.py +5 -5
- mx_bluesky/hyperion/baton_handler.py +15 -8
- mx_bluesky/hyperion/device_setup_plans/smargon.py +5 -5
- mx_bluesky/hyperion/device_setup_plans/utils.py +1 -1
- mx_bluesky/hyperion/experiment_plans/experiment_registry.py +1 -1
- mx_bluesky/hyperion/experiment_plans/hyperion_flyscan_xray_centre_plan.py +19 -18
- mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +54 -40
- mx_bluesky/hyperion/experiment_plans/optimise_attenuation_plan.py +9 -9
- mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py +2 -2
- mx_bluesky/hyperion/experiment_plans/pin_tip_centring_plan.py +5 -5
- mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +3 -3
- mx_bluesky/hyperion/external_interaction/agamemnon.py +2 -2
- mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +2 -2
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +1 -1
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +2 -2
- mx_bluesky/hyperion/external_interaction/config_server.py +2 -2
- mx_bluesky/hyperion/parameters/constants.py +2 -2
- mx_bluesky/hyperion/parameters/device_composites.py +2 -2
- mx_bluesky/hyperion/parameters/gridscan.py +4 -4
- mx_bluesky/hyperion/parameters/rotation.py +4 -6
- mx_bluesky/hyperion/plan_runner.py +6 -6
- mx_bluesky/hyperion/runner.py +10 -8
- mx_bluesky/hyperion/utils/context.py +6 -1
- mx_bluesky/jupyter_example.ipynb +3 -3
- {mx_bluesky-1.5.9.dist-info → mx_bluesky-1.5.11.dist-info}/METADATA +7 -6
- {mx_bluesky-1.5.9.dist-info → mx_bluesky-1.5.11.dist-info}/RECORD +87 -85
- /mx_bluesky/beamlines/i24/jungfrau_commissioning/{__init__.py → experiment_plans/__init__.py} +0 -0
- {mx_bluesky-1.5.9.dist-info → mx_bluesky-1.5.11.dist-info}/WHEEL +0 -0
- {mx_bluesky-1.5.9.dist-info → mx_bluesky-1.5.11.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.5.9.dist-info → mx_bluesky-1.5.11.dist-info}/licenses/LICENSE +0 -0
- {mx_bluesky-1.5.9.dist-info → mx_bluesky-1.5.11.dist-info}/top_level.txt +0 -0
|
@@ -4,36 +4,17 @@ PVs
|
|
|
4
4
|
# Now with Eiger goodness
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
import os
|
|
8
|
-
import sys
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def __show__(name):
|
|
12
|
-
"""Checks available variables given a string, uses first two letters"""
|
|
13
|
-
for things in globals():
|
|
14
|
-
if name[:2].lower() in things.lower():
|
|
15
|
-
print("Available:", things)
|
|
16
|
-
print()
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
def __which__():
|
|
20
|
-
"""Return script directory, used for finding which pv.py you are running"""
|
|
21
|
-
pathname, scriptname = os.path.split(sys.argv[0])
|
|
22
|
-
print("Current dir: " + os.path.abspath(pathname))
|
|
23
|
-
print("path to pv.py: ")
|
|
24
|
-
|
|
25
|
-
|
|
26
7
|
requested_transmission = "BL24I-OP-ATTN-01:T2A:SETVAL1"
|
|
27
8
|
|
|
28
9
|
|
|
29
10
|
# Eiger
|
|
30
11
|
eiger_filepath = "BL24I-EA-EIGER-01:CAM:FilePath"
|
|
31
12
|
eiger_filename = "BL24I-EA-EIGER-01:CAM:FileName"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
13
|
+
eiger_od_filepath = "BL24I-EA-EIGER-01:OD:FilePath"
|
|
14
|
+
eiger_od_filename = "BL24I-EA-EIGER-01:OD:FileName"
|
|
15
|
+
eiger_seq_id = "BL24I-EA-EIGER-01:CAM:SequenceId"
|
|
35
16
|
eiger_numimages = "BL24I-EA-EIGER-01:CAM:NumImages"
|
|
36
|
-
|
|
17
|
+
eiger_od_num_capture = "BL24I-EA-EIGER-01:OD:NumCapture"
|
|
37
18
|
eiger_numexpimage = "BL24I-EA-EIGER-01:CAM:NumExposures"
|
|
38
19
|
eiger_acquiretime = "BL24I-EA-EIGER-01:CAM:AcquireTime"
|
|
39
20
|
eiger_acquireperiod = "BL24I-EA-EIGER-01:CAM:AcquirePeriod"
|
|
@@ -47,37 +28,37 @@ eiger_stream = "BL24I-EA-EIGER-01:CAM:StreamEnable"
|
|
|
47
28
|
eiger_monitor = "BL24I-EA-EIGER-01:CAM:MonitorEnable"
|
|
48
29
|
eiger_datasource = "BL24I-EA-EIGER-01:CAM:DataSource"
|
|
49
30
|
eiger_statuspoll = "BL24I-EA-EIGER-01:CAM:ReadStatus.SCAN"
|
|
50
|
-
|
|
31
|
+
eiger_roi_mode = "BL24I-EA-EIGER-01:CAM:ROIMode"
|
|
51
32
|
eiger_ff = "BL24I-EA-EIGER-01:CAM:FlatfieldApplied"
|
|
52
33
|
eiger_compress = "BL24I-EA-EIGER-01:CAM:FWCompression"
|
|
53
34
|
eiger_compresstype = "BL24I-EA-EIGER-01:CAM:CompressionAlgo"
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
eiger_od_compress = "BL24I-EA-EIGER-01:OD:Compression"
|
|
36
|
+
eiger_od_datatype = "BL24I-EA-EIGER-01:OD:DataType"
|
|
56
37
|
eiger_bitdepthrbv = "BL24I-EA-EIGER-01:CAM:BitDepthImage_RBV"
|
|
57
38
|
eiger_countmode = "BL24I-EA-EIGER-01:CAM:CountingMode"
|
|
58
39
|
eiger_autosum = "BL24I-EA-EIGER-01:CAM:AutoSummation"
|
|
59
40
|
eiger_hdrdetail = "BL24I-EA-EIGER-01:CAM:StreamHdrDetail"
|
|
60
41
|
eiger_hdrappen = "BL24I-EA-EIGER-01:CAM:StreamHdrAppendix"
|
|
61
|
-
|
|
42
|
+
eiger_od_capture = "BL24I-EA-EIGER-01:OD:Capture"
|
|
62
43
|
eiger_acquire = "BL24I-EA-EIGER-01:CAM:Acquire"
|
|
63
44
|
eiger_wavelength = "BL24I-EA-EIGER-01:CAM:Wavelength"
|
|
64
45
|
eiger_detdist = "BL24I-EA-EIGER-01:CAM:DetDist"
|
|
65
46
|
eiger_beamx = "BL24I-EA-EIGER-01:CAM:BeamX"
|
|
66
47
|
eiger_beamy = "BL24I-EA-EIGER-01:CAM:BeamY"
|
|
67
48
|
eiger_omegaincr = "BL24I-EA-EIGER-01:CAM:OmegaIncr"
|
|
68
|
-
|
|
49
|
+
eiger_od_filename_rbv = "BL24I-EA-EIGER-01:OD:FP:FileName_RBV"
|
|
69
50
|
|
|
70
51
|
# BPMs
|
|
71
52
|
qbpm1_inten = "BL24I-DI-QBPM-01:INTEN"
|
|
72
|
-
|
|
53
|
+
qbpm1_inten_n = "BL24I-DI-QBPM-01:INTEN_N"
|
|
73
54
|
qbpm2_inten = "BL24I-DI-QBPM-02:INTEN"
|
|
74
|
-
|
|
55
|
+
qbpm2_inten_n = "BL24I-DI-QBPM-02:INTEN_N"
|
|
75
56
|
qbpm3_inten = "BL24I-DI-QBPM-03:INTEN"
|
|
76
|
-
|
|
57
|
+
qbpm3_inten_n = "BL24I-DI-QBPM-03:INTEN_N"
|
|
77
58
|
# Cividec
|
|
78
59
|
cividec_x = "BL24I-AL-XBPM-01:XS"
|
|
79
60
|
cividec_y = "BL24I-AL-XBPM-01:YS"
|
|
80
|
-
|
|
61
|
+
cividec_sum_i = "BL24I-EA-XBPM-01:SumAll:Sigma_RBV"
|
|
81
62
|
cividec_beamx = "BL24I-EA-XBPM-01:PosX:MeanValue_RBV"
|
|
82
63
|
cividec_beamy = "BL24I-EA-XBPM-01:PosY:MeanValue_RBV"
|
|
83
64
|
# Lancelot
|
|
@@ -22,15 +22,15 @@ class Eiger:
|
|
|
22
22
|
det_y_threshold = 70.0
|
|
23
23
|
det_y_target = 59.0
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class PV:
|
|
26
26
|
detector_distance = pv.eiger_detdist
|
|
27
27
|
wavelength = pv.eiger_wavelength
|
|
28
28
|
transmission = "BL24I-EA-PILAT-01:cam1:FilterTransm"
|
|
29
|
-
|
|
30
|
-
file_name = pv.
|
|
31
|
-
file_path = pv.
|
|
29
|
+
filename_rbv = pv.eiger_od_filename_rbv
|
|
30
|
+
file_name = pv.eiger_od_filename
|
|
31
|
+
file_path = pv.eiger_od_filepath
|
|
32
32
|
file_template = None
|
|
33
|
-
sequence_id = pv.
|
|
33
|
+
sequence_id = pv.eiger_seq_id
|
|
34
34
|
beamx = pv.eiger_beamx
|
|
35
35
|
beamy = pv.eiger_beamy
|
|
36
36
|
bit_depth = pv.eiger_bitdepthrbv
|
|
@@ -96,185 +96,6 @@ def set_detector_beam_center_plan(
|
|
|
96
96
|
yield from bps.wait(group=group)
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
def modechange(action):
|
|
100
|
-
"""Mode Change"""
|
|
101
|
-
# Pin Hand Mount
|
|
102
|
-
if action == "Pin_hand_mount":
|
|
103
|
-
caput(pv.bl_mp_select, "Out")
|
|
104
|
-
caput(pv.aptr1_mp_select, "Manual Mounting")
|
|
105
|
-
caput(pv.bs_mp_select, "Robot")
|
|
106
|
-
caput(pv.vgon_omega, 0)
|
|
107
|
-
caput(pv.vgon_kappa, 0)
|
|
108
|
-
caput(pv.vgon_phi, 0)
|
|
109
|
-
caput(pv.vgon_pinxs, 0)
|
|
110
|
-
caput(pv.vgon_pinzs, 0)
|
|
111
|
-
caput(pv.fluo_trans, "OUT")
|
|
112
|
-
caput(pv.cstrm_p1701, 0)
|
|
113
|
-
caput(pv.cstrm_mp_select, "Out")
|
|
114
|
-
SSX_LOGGER.debug("Pin Hand Mount Done")
|
|
115
|
-
|
|
116
|
-
# Pin Room Tempreature Hand Mount
|
|
117
|
-
elif action == "Pin_rt_hand_mount":
|
|
118
|
-
caput(pv.cstrm_p1701, 0)
|
|
119
|
-
caput(pv.cstrm_mp_select, "Away")
|
|
120
|
-
caput(pv.bl_mp_select, "Out")
|
|
121
|
-
caput(pv.aptr1_mp_select, "Manual Mounting")
|
|
122
|
-
caput(pv.bs_mp_select, "Robot")
|
|
123
|
-
caput(pv.vgon_omega, 0)
|
|
124
|
-
caput(pv.vgon_kappa, 0)
|
|
125
|
-
caput(pv.vgon_phi, 0)
|
|
126
|
-
caput(pv.vgon_pinxs, 0)
|
|
127
|
-
caput(pv.vgon_pinzs, 0)
|
|
128
|
-
caput(pv.fluo_trans, "OUT")
|
|
129
|
-
SSX_LOGGER.debug("RT Pin Hand Mount Done")
|
|
130
|
-
|
|
131
|
-
# Pin Data Collection
|
|
132
|
-
elif action == "Pin_data_collection":
|
|
133
|
-
caput(pv.cstrm_p1701, 0)
|
|
134
|
-
caput(pv.cstrm_mp_select, "In")
|
|
135
|
-
caput(pv.aptr1_mp_select, "In")
|
|
136
|
-
caput(pv.vgon_omega, 0)
|
|
137
|
-
caput(pv.vgon_kappa, 0)
|
|
138
|
-
caput(pv.vgon_phi, 0)
|
|
139
|
-
caput(pv.vgon_pinxs, 0)
|
|
140
|
-
# caput(pv.vgon_pinyh, 0)
|
|
141
|
-
caput(pv.vgon_pinzs, 0)
|
|
142
|
-
caput(pv.fluo_trans, "OUT")
|
|
143
|
-
caput(pv.bs_roty, 0)
|
|
144
|
-
yield from bps.sleep(0.5)
|
|
145
|
-
caput(pv.bs_mp_select, "Data Collection")
|
|
146
|
-
yield from bps.sleep(2.3)
|
|
147
|
-
caput(pv.bl_mp_select, "In")
|
|
148
|
-
SSX_LOGGER.debug("Pin Data Collection Done")
|
|
149
|
-
|
|
150
|
-
# Pin Room Tempreature Data Collection
|
|
151
|
-
elif action == "Pin_rt_data_collection":
|
|
152
|
-
SSX_LOGGER.debug("RT Mode")
|
|
153
|
-
caput(pv.cstrm_p1701, 0)
|
|
154
|
-
caput(pv.cstrm_mp_select, "Away")
|
|
155
|
-
caput(pv.aptr1_mp_select, "In")
|
|
156
|
-
caput(pv.vgon_omega, 0)
|
|
157
|
-
caput(pv.vgon_kappa, 0)
|
|
158
|
-
caput(pv.vgon_phi, 0)
|
|
159
|
-
caput(pv.vgon_pinxs, 0)
|
|
160
|
-
caput(pv.vgon_pinyh, 0)
|
|
161
|
-
caput(pv.vgon_pinzs, 0)
|
|
162
|
-
caput(pv.fluo_trans, "OUT")
|
|
163
|
-
yield from bps.sleep(0.1)
|
|
164
|
-
caput(pv.bs_roty, 0)
|
|
165
|
-
yield from bps.sleep(2.6)
|
|
166
|
-
caput(pv.bl_mp_select, "In")
|
|
167
|
-
caput(pv.bs_mp_select, "Data Collection")
|
|
168
|
-
SSX_LOGGER.debug("RT Data Collection Done")
|
|
169
|
-
|
|
170
|
-
# Tray Hand Mount
|
|
171
|
-
elif action == "Tray_hand_mount":
|
|
172
|
-
caput(pv.ttab_x, 2.0)
|
|
173
|
-
caput(pv.hgon_trayys, 0.0)
|
|
174
|
-
caput(pv.hgon_omega, 0.0)
|
|
175
|
-
caput(pv.fluo_trans, "OUT")
|
|
176
|
-
caput(pv.bl_mp_select, "Out")
|
|
177
|
-
yield from bps.sleep(1)
|
|
178
|
-
caput(pv.aptr1_mp_select, "Manual Mounting")
|
|
179
|
-
caput(pv.bs_mp_select, "Tray Mount")
|
|
180
|
-
while float(caget(pv.ttab_x + ".RBV")) > 3:
|
|
181
|
-
yield from bps.sleep(1)
|
|
182
|
-
SSX_LOGGER.debug("Tray Hand Mount Done")
|
|
183
|
-
|
|
184
|
-
# Tray Robot Load. This action needs to be reviewed and revised
|
|
185
|
-
elif action == "Tray_robot_load":
|
|
186
|
-
# Middle of black circle
|
|
187
|
-
caput(pv.ttab_x, 79.2)
|
|
188
|
-
caput(pv.hgon_trayys, -7.00)
|
|
189
|
-
caput(pv.hgon_trayzs, -1.10)
|
|
190
|
-
caput(pv.hgon_omega, 0.0)
|
|
191
|
-
caput(pv.fluo_trans, "OUT")
|
|
192
|
-
caput(pv.aptr1_mp_select, "In")
|
|
193
|
-
caput(pv.bl_mp_select, "Out")
|
|
194
|
-
yield from bps.sleep(1)
|
|
195
|
-
caput(pv.bs_roty, 0)
|
|
196
|
-
yield from bps.sleep(1)
|
|
197
|
-
caput(pv.bs_mp_select, "Robot")
|
|
198
|
-
yield from bps.sleep(1)
|
|
199
|
-
caput(pv.bs_mp_select, "Data Collection Far")
|
|
200
|
-
yield from bps.sleep(1)
|
|
201
|
-
caput(pv.bs_roty, 0)
|
|
202
|
-
yield from bps.sleep(4)
|
|
203
|
-
caput(pv.bl_mp_select, "In")
|
|
204
|
-
SSX_LOGGER.debug("Tray Robot Mount Done")
|
|
205
|
-
|
|
206
|
-
# Tray Data Collection
|
|
207
|
-
elif action == "Tray_data_collection":
|
|
208
|
-
SSX_LOGGER.debug("This should be E11 on the test tray (CrystalQuickX)")
|
|
209
|
-
caput(pv.ttab_x, 37.4)
|
|
210
|
-
caput(pv.hgon_trayys, -8.0)
|
|
211
|
-
caput(pv.hgon_trayzs, -2.1)
|
|
212
|
-
caput(pv.aptr1_mp_select, "In")
|
|
213
|
-
caput(pv.fluo_trans, "OUT")
|
|
214
|
-
caput(pv.bl_mp_select, "Out")
|
|
215
|
-
yield from bps.sleep(1)
|
|
216
|
-
caput(pv.bs_roty, 0)
|
|
217
|
-
yield from bps.sleep(1)
|
|
218
|
-
caput(pv.bs_mp_select, "Robot")
|
|
219
|
-
yield from bps.sleep(1)
|
|
220
|
-
caput(pv.bs_mp_select, "Data Collection")
|
|
221
|
-
yield from bps.sleep(1)
|
|
222
|
-
caput(pv.bs_roty, 0)
|
|
223
|
-
yield from bps.sleep(4)
|
|
224
|
-
caput(pv.bl_mp_select, "In")
|
|
225
|
-
SSX_LOGGER.debug("Tray Data Collection Done")
|
|
226
|
-
|
|
227
|
-
# Pin Switch to Tray
|
|
228
|
-
elif action == "Pin_switch2tray":
|
|
229
|
-
caput(pv.cstrm_p1701, 0)
|
|
230
|
-
caput(pv.cstrm_mp_select, "Away")
|
|
231
|
-
caput(pv.aptr1_mp_select, "Manual Mounting")
|
|
232
|
-
caput(pv.bl_mp_select, "Out")
|
|
233
|
-
caput(pv.hgon_omega, 0.0)
|
|
234
|
-
caput(pv.ttab_x, 0)
|
|
235
|
-
caput(pv.hgon_trayys, 0.0)
|
|
236
|
-
caput(pv.hgon_trayzs, 0.0)
|
|
237
|
-
caput(pv.ptab_y, -90)
|
|
238
|
-
caput(pv.fluo_trans, "OUT")
|
|
239
|
-
caput(pv.vgon_omega, 0)
|
|
240
|
-
caput(pv.vgon_kappa, 0)
|
|
241
|
-
caput(pv.vgon_phi, 0)
|
|
242
|
-
caput(pv.vgon_pinxs, 0)
|
|
243
|
-
caput(pv.vgon_pinyh, 0)
|
|
244
|
-
caput(pv.vgon_pinzs, 0)
|
|
245
|
-
while float(caget(pv.ttab_x + ".RBV")) > 1:
|
|
246
|
-
SSX_LOGGER.debug(f"moving ttab_x {caget(pv.ttab_x)}")
|
|
247
|
-
yield from bps.sleep(0.1)
|
|
248
|
-
while caget(pv.fluo_out_limit) == "OFF":
|
|
249
|
-
SSX_LOGGER.debug("waiting on fluorescence detector")
|
|
250
|
-
yield from bps.sleep(0.1)
|
|
251
|
-
while caget(pv.bl_mp_select) != "Out":
|
|
252
|
-
SSX_LOGGER.debug("waiting on back light to move to out")
|
|
253
|
-
yield from bps.sleep(0.1)
|
|
254
|
-
caput(pv.bs_mp_select, "Robot")
|
|
255
|
-
caput(pv.bs_roty, 0)
|
|
256
|
-
while float(caget(pv.ptab_y + ".RBV")) > -89.0:
|
|
257
|
-
yield from bps.sleep(1)
|
|
258
|
-
SSX_LOGGER.debug("Switch To Tray Done")
|
|
259
|
-
|
|
260
|
-
# Tray Switch to Pin
|
|
261
|
-
elif action == "Tray_switch2pin":
|
|
262
|
-
caput(pv.ttab_x, 0.0)
|
|
263
|
-
# Supposed to absorb pin laser
|
|
264
|
-
caput(pv.hgon_trayys, 0.0)
|
|
265
|
-
caput(pv.hgon_trayzs, 0.0)
|
|
266
|
-
while float(caget(pv.ttab_x + ".RBV")) > 1.0:
|
|
267
|
-
yield from bps.sleep(1)
|
|
268
|
-
caput(pv.ptab_y, 0)
|
|
269
|
-
while float(caget(pv.ptab_y + ".RBV")) < -1.0:
|
|
270
|
-
yield from bps.sleep(1)
|
|
271
|
-
yield from modechange("Pin_data_collection")
|
|
272
|
-
SSX_LOGGER.debug("Switch To Pin Done")
|
|
273
|
-
else:
|
|
274
|
-
SSX_LOGGER.debug(f"Unknown action: {action}")
|
|
275
|
-
return 1
|
|
276
|
-
|
|
277
|
-
|
|
278
99
|
def eiger(action, args_list, dcm: DCM):
|
|
279
100
|
SSX_LOGGER.debug("***** Entering Eiger")
|
|
280
101
|
SSX_LOGGER.info(f"Setup eiger - {action}")
|
|
@@ -292,7 +113,7 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
292
113
|
caput(pv.eiger_monitor, "No")
|
|
293
114
|
# caput(pv.eiger_datasource, 'None')
|
|
294
115
|
caput(pv.eiger_statuspoll, "1 second")
|
|
295
|
-
caput(pv.
|
|
116
|
+
caput(pv.eiger_roi_mode, "Disabled")
|
|
296
117
|
caput(pv.eiger_ff, "Enabled")
|
|
297
118
|
caput(pv.eiger_compresstype, "bslz4")
|
|
298
119
|
caput(pv.eiger_countmode, "Retrigger")
|
|
@@ -304,10 +125,10 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
304
125
|
# Sends a single trigger to start data collection
|
|
305
126
|
SSX_LOGGER.debug("Eiger quickshot")
|
|
306
127
|
[filepath, filename, num_imgs, exptime] = args_list
|
|
307
|
-
filename = filename + "_" + str(caget(pv.
|
|
308
|
-
caput(pv.
|
|
128
|
+
filename = filename + "_" + str(caget(pv.eiger_seq_id))
|
|
129
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
309
130
|
yield from bps.sleep(0.1)
|
|
310
|
-
caput(pv.
|
|
131
|
+
caput(pv.eiger_od_filename, filename)
|
|
311
132
|
yield from bps.sleep(0.1)
|
|
312
133
|
acqtime = float(exptime) - 0.0000001
|
|
313
134
|
caput(pv.eiger_acquiretime, str(acqtime))
|
|
@@ -325,17 +146,17 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
325
146
|
yield from bps.sleep(1.0)
|
|
326
147
|
# ODIN setup
|
|
327
148
|
SSX_LOGGER.info("Setting up Odin")
|
|
328
|
-
caput(pv.
|
|
329
|
-
caput(pv.
|
|
330
|
-
caput(pv.
|
|
331
|
-
caput(pv.
|
|
149
|
+
caput(pv.eiger_od_filename, filename)
|
|
150
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
151
|
+
caput(pv.eiger_od_num_capture, str(num_imgs))
|
|
152
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
332
153
|
eigerbdrbv = "UInt" + str(caget(pv.eiger_bitdepthrbv))
|
|
333
|
-
caput(pv.
|
|
334
|
-
caput(pv.
|
|
154
|
+
caput(pv.eiger_od_datatype, eigerbdrbv)
|
|
155
|
+
caput(pv.eiger_od_compress, "BSL24")
|
|
335
156
|
yield from bps.sleep(1.0)
|
|
336
157
|
# All done. Now get Odin to wait for data and start Eiger
|
|
337
158
|
SSX_LOGGER.info("Done: Odin waiting for data")
|
|
338
|
-
caput(pv.
|
|
159
|
+
caput(pv.eiger_od_capture, "Capture")
|
|
339
160
|
# If detector fails to arm first time can try twice with a sleep inbetween
|
|
340
161
|
SSX_LOGGER.info("Arming Eiger")
|
|
341
162
|
caput(pv.eiger_acquire, "1")
|
|
@@ -346,10 +167,10 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
346
167
|
# Send a trigger for every image. Records while TTL is high
|
|
347
168
|
SSX_LOGGER.info("Eiger triggered")
|
|
348
169
|
[filepath, filename, num_imgs, exptime] = args_list
|
|
349
|
-
filename = filename + "_" + str(caget(pv.
|
|
350
|
-
caput(pv.
|
|
170
|
+
filename = filename + "_" + str(caget(pv.eiger_seq_id))
|
|
171
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
351
172
|
yield from bps.sleep(0.1)
|
|
352
|
-
caput(pv.
|
|
173
|
+
caput(pv.eiger_od_filename, filename)
|
|
353
174
|
yield from bps.sleep(0.1)
|
|
354
175
|
acqtime = float(exptime) - 0.0000001
|
|
355
176
|
caput(pv.eiger_acquiretime, str(acqtime))
|
|
@@ -367,17 +188,17 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
367
188
|
yield from bps.sleep(1.0)
|
|
368
189
|
# ODIN setup #
|
|
369
190
|
SSX_LOGGER.info("Setting up Odin")
|
|
370
|
-
caput(pv.
|
|
371
|
-
caput(pv.
|
|
372
|
-
caput(pv.
|
|
373
|
-
caput(pv.
|
|
191
|
+
caput(pv.eiger_od_filename, filename)
|
|
192
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
193
|
+
caput(pv.eiger_od_num_capture, str(num_imgs))
|
|
194
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
374
195
|
eigerbdrbv = "UInt" + str(caget(pv.eiger_bitdepthrbv))
|
|
375
|
-
caput(pv.
|
|
376
|
-
caput(pv.
|
|
196
|
+
caput(pv.eiger_od_datatype, eigerbdrbv)
|
|
197
|
+
caput(pv.eiger_od_compress, "BSL24")
|
|
377
198
|
yield from bps.sleep(1.0)
|
|
378
199
|
# All done. Now get Odin to wait for data and start Eiger
|
|
379
200
|
SSX_LOGGER.info("Done: Odin waiting for data")
|
|
380
|
-
caput(pv.
|
|
201
|
+
caput(pv.eiger_od_capture, "Capture")
|
|
381
202
|
# If detector fails to arm first time can try twice with a sleep inbetween
|
|
382
203
|
SSX_LOGGER.info("Arming Eiger")
|
|
383
204
|
caput(pv.eiger_acquire, "1")
|
|
@@ -387,55 +208,7 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
387
208
|
# Put it all back to GDA acceptable defaults
|
|
388
209
|
elif action == "return-to-normal":
|
|
389
210
|
caput(pv.eiger_manualtrigger, "No")
|
|
390
|
-
# caput(pv.
|
|
211
|
+
# caput(pv.eiger_seq_id, int(caget(pv.eiger_seq_id))+1)
|
|
391
212
|
SSX_LOGGER.debug("***** leaving Eiger")
|
|
392
213
|
yield from bps.sleep(0.1)
|
|
393
214
|
return 0
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
def xspress3(action, args_list):
|
|
397
|
-
SSX_LOGGER.debug("***** Entering xspress3")
|
|
398
|
-
SSX_LOGGER.info(f"xspress3 - {action}")
|
|
399
|
-
if args_list:
|
|
400
|
-
for arg in args_list:
|
|
401
|
-
SSX_LOGGER.debug(f"Argument: {arg}")
|
|
402
|
-
|
|
403
|
-
if action == "stop-and-start":
|
|
404
|
-
[exp_time, lo, hi] = args_list
|
|
405
|
-
caput(pv.xsp3_triggermode, "Internal")
|
|
406
|
-
caput(pv.xsp3_numimages, 1)
|
|
407
|
-
caput(pv.xsp3_acquiretime, exp_time)
|
|
408
|
-
caput(pv.xsp3_c1_mca_roi1_llm, lo)
|
|
409
|
-
caput(pv.xsp3_c1_mca_roi1_hlm, hi)
|
|
410
|
-
yield from bps.sleep(0.2)
|
|
411
|
-
caput(pv.xsp3_c1_mca_roi1_llm, lo)
|
|
412
|
-
caput(pv.xsp3_c1_mca_roi1_hlm, hi)
|
|
413
|
-
yield from bps.sleep(0.2)
|
|
414
|
-
caput(pv.xsp3_erase, 0)
|
|
415
|
-
|
|
416
|
-
elif action == "on-the-fly":
|
|
417
|
-
[num_frms, lo, hi] = args_list
|
|
418
|
-
caput(pv.xsp3_triggermode, "TTL Veto Only")
|
|
419
|
-
caput(pv.xsp3_numimages, num_frms)
|
|
420
|
-
caput(pv.xsp3_c1_mca_roi1_llm, lo)
|
|
421
|
-
caput(pv.xsp3_c1_mca_roi1_hlm, hi)
|
|
422
|
-
yield from bps.sleep(0.2)
|
|
423
|
-
caput(pv.xsp3_c1_mca_roi1_llm, lo)
|
|
424
|
-
caput(pv.xsp3_c1_mca_roi1_hlm, hi)
|
|
425
|
-
yield from bps.sleep(0.2)
|
|
426
|
-
caput(pv.xsp3_erase, 0)
|
|
427
|
-
|
|
428
|
-
elif action == "return-to-normal":
|
|
429
|
-
caput(pv.xsp3_triggermode, "TTL Veto Only")
|
|
430
|
-
caput(pv.xsp3_numimages, 1)
|
|
431
|
-
caput(pv.xsp3_acquiretime, 1)
|
|
432
|
-
caput(pv.xsp3_c1_mca_roi1_llm, 0)
|
|
433
|
-
caput(pv.xsp3_c1_mca_roi1_hlm, 0)
|
|
434
|
-
caput(pv.xsp3_erase, 0)
|
|
435
|
-
|
|
436
|
-
else:
|
|
437
|
-
SSX_LOGGER.error("Unknown action for xspress3 method:", action)
|
|
438
|
-
|
|
439
|
-
yield from bps.sleep(0.1)
|
|
440
|
-
SSX_LOGGER.debug("***** leaving xspress3")
|
|
441
|
-
return 1
|
|
@@ -32,7 +32,7 @@ class DetRequest(IntEnum):
|
|
|
32
32
|
return self.name
|
|
33
33
|
|
|
34
34
|
|
|
35
|
-
class
|
|
35
|
+
class UnknownDetectorTypeError(Exception):
|
|
36
36
|
pass
|
|
37
37
|
|
|
38
38
|
|
|
@@ -45,7 +45,7 @@ def get_detector_type(detector_stage: YZStage) -> Generator[Msg, None, Detector]
|
|
|
45
45
|
return Eiger()
|
|
46
46
|
else:
|
|
47
47
|
SSX_LOGGER.error("Detector not found.")
|
|
48
|
-
raise
|
|
48
|
+
raise UnknownDetectorTypeError("Detector not found.")
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
def _move_detector_stage(detector_stage: YZStage, target: float) -> MsgGenerator:
|
|
@@ -209,13 +209,13 @@ def setup_zebra_for_extruder_with_pump_probe_plan(
|
|
|
209
209
|
yield from set_logic_gates_for_porto_triggering(zebra)
|
|
210
210
|
|
|
211
211
|
# Set TTL out depending on detector type
|
|
212
|
-
|
|
213
|
-
|
|
212
|
+
det_ttl = TTL_EIGER
|
|
213
|
+
laser_ttl = TTL_LASER # may change with additional detectors
|
|
214
214
|
yield from bps.abs_set(
|
|
215
|
-
zebra.output.out_pvs[
|
|
215
|
+
zebra.output.out_pvs[det_ttl], zebra.mapping.sources.AND4, group=group
|
|
216
216
|
)
|
|
217
217
|
yield from bps.abs_set(
|
|
218
|
-
zebra.output.out_pvs[
|
|
218
|
+
zebra.output.out_pvs[laser_ttl], zebra.mapping.sources.AND3, group=group
|
|
219
219
|
)
|
|
220
220
|
|
|
221
221
|
yield from bps.abs_set(
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# from collections.abc import Sequence
|
|
2
|
+
from datetime import datetime
|
|
2
3
|
from typing import Literal
|
|
3
4
|
|
|
4
5
|
import bluesky.plan_stubs as bps
|
|
@@ -6,6 +7,7 @@ import bluesky.preprocessors as bpp
|
|
|
6
7
|
from bluesky.utils import MsgGenerator
|
|
7
8
|
from dodal.beamlines import i24
|
|
8
9
|
from dodal.common import inject
|
|
10
|
+
from dodal.devices.attenuator.attenuator import EnumFilterAttenuator
|
|
9
11
|
from dodal.devices.hutch_shutter import HutchShutter
|
|
10
12
|
from dodal.devices.i24.aperture import Aperture
|
|
11
13
|
from dodal.devices.i24.beam_center import DetectorBeamCenter
|
|
@@ -19,15 +21,18 @@ from dodal.devices.oav.oav_detector import OAVBeamCentreFile
|
|
|
19
21
|
from dodal.devices.zebra.zebra import Zebra
|
|
20
22
|
|
|
21
23
|
from mx_bluesky.beamlines.i24.serial.dcid import DCID
|
|
24
|
+
from mx_bluesky.beamlines.i24.serial.extruder.i24ssx_extruder_collect_py3v2 import (
|
|
25
|
+
run_plan_in_wrapper as run_ex_collection_plan,
|
|
26
|
+
)
|
|
22
27
|
from mx_bluesky.beamlines.i24.serial.fixed_target.ft_utils import (
|
|
23
28
|
ChipType,
|
|
24
29
|
MappingType,
|
|
25
30
|
PumpProbeSetting,
|
|
26
31
|
)
|
|
27
|
-
from mx_bluesky.beamlines.i24.serial.fixed_target.
|
|
28
|
-
run_plan_in_wrapper,
|
|
32
|
+
from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_chip_collect_py3v1 import (
|
|
33
|
+
run_plan_in_wrapper as run_ft_collection_plan,
|
|
29
34
|
)
|
|
30
|
-
from mx_bluesky.beamlines.i24.serial.fixed_target.
|
|
35
|
+
from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_chip_manager_py3v1 import (
|
|
31
36
|
upload_chip_map_to_geobrick,
|
|
32
37
|
)
|
|
33
38
|
from mx_bluesky.beamlines.i24.serial.fixed_target.i24ssx_moveonclick import (
|
|
@@ -41,13 +46,15 @@ from mx_bluesky.beamlines.i24.serial.parameters import (
|
|
|
41
46
|
FixedTargetParameters,
|
|
42
47
|
get_chip_format,
|
|
43
48
|
)
|
|
49
|
+
from mx_bluesky.beamlines.i24.serial.parameters.experiment_parameters import (
|
|
50
|
+
ExtruderParameters,
|
|
51
|
+
)
|
|
44
52
|
from mx_bluesky.beamlines.i24.serial.parameters.utils import EmptyMapError
|
|
45
53
|
from mx_bluesky.beamlines.i24.serial.setup_beamline import pv
|
|
46
54
|
from mx_bluesky.beamlines.i24.serial.setup_beamline.ca import caput
|
|
47
55
|
from mx_bluesky.beamlines.i24.serial.setup_beamline.pv_abstract import Eiger
|
|
48
56
|
from mx_bluesky.beamlines.i24.serial.setup_beamline.setup_detector import (
|
|
49
57
|
_move_detector_stage,
|
|
50
|
-
get_detector_type,
|
|
51
58
|
)
|
|
52
59
|
|
|
53
60
|
|
|
@@ -92,13 +99,6 @@ def gui_gonio_move_on_click(position_px: tuple[int, int]) -> MsgGenerator:
|
|
|
92
99
|
yield from bps.mv(gonio.x, x_um / 1000, gonio.yh, y_um / 1000) # type: ignore
|
|
93
100
|
|
|
94
101
|
|
|
95
|
-
# See https://github.com/DiamondLightSource/mx-bluesky/issues/853
|
|
96
|
-
@bpp.run_decorator()
|
|
97
|
-
def gui_sleep(sec: int) -> MsgGenerator:
|
|
98
|
-
for _ in range(sec):
|
|
99
|
-
yield from bps.sleep(1)
|
|
100
|
-
|
|
101
|
-
|
|
102
102
|
@bpp.run_decorator()
|
|
103
103
|
def gui_move_detector(
|
|
104
104
|
det: Literal["eiger"],
|
|
@@ -111,6 +111,12 @@ def gui_move_detector(
|
|
|
111
111
|
caput(pv.me14e_gp101, det)
|
|
112
112
|
|
|
113
113
|
|
|
114
|
+
@bpp.run_decorator()
|
|
115
|
+
def gui_set_fiducial_0(pmac: PMAC = inject("PMAC")) -> MsgGenerator:
|
|
116
|
+
SSX_LOGGER.debug("Set fiducial 0 to home string")
|
|
117
|
+
yield from bps.trigger(pmac.home, wait=True)
|
|
118
|
+
|
|
119
|
+
|
|
114
120
|
@bpp.run_decorator()
|
|
115
121
|
def gui_run_chip_collection(
|
|
116
122
|
sub_dir: str,
|
|
@@ -137,8 +143,9 @@ def gui_run_chip_collection(
|
|
|
137
143
|
dcm: DCM = inject("dcm"),
|
|
138
144
|
mirrors: FocusMirrorsMode = inject("focus_mirrors"),
|
|
139
145
|
beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
|
|
146
|
+
attenuator: EnumFilterAttenuator = inject("attenuator"),
|
|
140
147
|
) -> MsgGenerator:
|
|
141
|
-
"""Set the parameter model
|
|
148
|
+
"""Set the parameter model and run the data collection.
|
|
142
149
|
|
|
143
150
|
Args:
|
|
144
151
|
sub_dir (str): subdirectory of the visit to write data in.
|
|
@@ -166,7 +173,9 @@ def gui_run_chip_collection(
|
|
|
166
173
|
"""
|
|
167
174
|
# NOTE still a work in progress, adding to it as the ui grows
|
|
168
175
|
# See progression of https://github.com/DiamondLightSource/mx-daq-ui/issues/3
|
|
169
|
-
|
|
176
|
+
# get_detector_type temporarily disabled as pilatus went away, and for now only eiger in use
|
|
177
|
+
# for this.
|
|
178
|
+
# det_type = yield from get_detector_type(detector_stage)
|
|
170
179
|
_format = chip_format if ChipType[chip_type] is ChipType.Custom else None
|
|
171
180
|
chip_params = get_chip_format(ChipType[chip_type], _format)
|
|
172
181
|
if ChipType[chip_type] in [ChipType.Oxford, ChipType.OxfordInner]:
|
|
@@ -179,13 +188,16 @@ def gui_run_chip_collection(
|
|
|
179
188
|
mapping = MappingType.NoMap
|
|
180
189
|
chip_map = []
|
|
181
190
|
|
|
191
|
+
# NOTE. For now setting attenuation here in place of the edms doing a caput
|
|
192
|
+
yield from bps.abs_set(attenuator, transmission, wait=True)
|
|
193
|
+
|
|
182
194
|
params = {
|
|
183
195
|
"visit": _read_visit_directory_from_file().as_posix(), # noqa
|
|
184
196
|
"directory": sub_dir,
|
|
185
197
|
"filename": chip_name,
|
|
186
198
|
"exposure_time_s": exp_time,
|
|
187
199
|
"detector_distance_mm": det_dist,
|
|
188
|
-
"detector_name":
|
|
200
|
+
"detector_name": "eiger",
|
|
189
201
|
"num_exposures": n_shots,
|
|
190
202
|
"transmission": transmission,
|
|
191
203
|
"chip": chip_params,
|
|
@@ -213,7 +225,7 @@ def gui_run_chip_collection(
|
|
|
213
225
|
dcid = DCID(emit_errors=False, expt_params=parameters) # noqa
|
|
214
226
|
SSX_LOGGER.info("DCID created")
|
|
215
227
|
|
|
216
|
-
yield from
|
|
228
|
+
yield from run_ft_collection_plan(
|
|
217
229
|
zebra,
|
|
218
230
|
pmac,
|
|
219
231
|
aperture,
|
|
@@ -227,3 +239,78 @@ def gui_run_chip_collection(
|
|
|
227
239
|
parameters,
|
|
228
240
|
dcid,
|
|
229
241
|
)
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
@bpp.run_decorator()
|
|
245
|
+
def gui_run_extruder_collection(
|
|
246
|
+
sub_dir: str,
|
|
247
|
+
file_name: str,
|
|
248
|
+
exp_time: float,
|
|
249
|
+
det_dist: float,
|
|
250
|
+
transmission: float,
|
|
251
|
+
num_images: int,
|
|
252
|
+
pump_probe: bool,
|
|
253
|
+
laser_dwell: float,
|
|
254
|
+
laser_delay: float,
|
|
255
|
+
zebra: Zebra = inject("zebra"),
|
|
256
|
+
aperture: Aperture = inject("aperture"),
|
|
257
|
+
backlight: DualBacklight = inject("backlight"),
|
|
258
|
+
beamstop: Beamstop = inject("beamstop"),
|
|
259
|
+
detector_stage: YZStage = inject("detector_motion"),
|
|
260
|
+
shutter: HutchShutter = inject("shutter"),
|
|
261
|
+
dcm: DCM = inject("dcm"),
|
|
262
|
+
mirrors: FocusMirrorsMode = inject("focus_mirrors"),
|
|
263
|
+
attenuator: EnumFilterAttenuator = inject("attenuator"),
|
|
264
|
+
beam_center_eiger: DetectorBeamCenter = inject("eiger_bc"),
|
|
265
|
+
):
|
|
266
|
+
"""Set parameter model for extruder and run the data collection.
|
|
267
|
+
Args:
|
|
268
|
+
sub_dir (str): subdirectory of the visit to write data in.
|
|
269
|
+
file_name (str): filename to be used for the collection.
|
|
270
|
+
exp_time (float): exposure time of each image, in s.
|
|
271
|
+
det_dist (float): sample-detector distance, in mm.
|
|
272
|
+
transmission (float): requested beam intensity transmission, expressed as
|
|
273
|
+
a fraction, e.g. 0.3.
|
|
274
|
+
num_images (int): number of images be collected.
|
|
275
|
+
pump_probe (bool): pump probe setting.
|
|
276
|
+
laser_dwell (float): laser exposure time for pump probe collections, in s.
|
|
277
|
+
laser_delay (float): delay between laser exposure and collection, in s.
|
|
278
|
+
"""
|
|
279
|
+
# NOTE. For now setting attenuation here in place of the edms doing a caput
|
|
280
|
+
yield from bps.abs_set(attenuator, transmission, wait=True)
|
|
281
|
+
start_time = datetime.now()
|
|
282
|
+
SSX_LOGGER.info(f"Collection start time: {start_time.ctime()}")
|
|
283
|
+
|
|
284
|
+
params = {
|
|
285
|
+
"visit": _read_visit_directory_from_file().as_posix(), # noqa
|
|
286
|
+
"directory": sub_dir,
|
|
287
|
+
"filename": file_name,
|
|
288
|
+
"exposure_time_s": exp_time,
|
|
289
|
+
"detector_distance_mm": det_dist,
|
|
290
|
+
"detector_name": "eiger",
|
|
291
|
+
"transmission": transmission,
|
|
292
|
+
"num_images": num_images,
|
|
293
|
+
"pump_status": pump_probe,
|
|
294
|
+
"laser_dwell_s": laser_dwell,
|
|
295
|
+
"laser_delay_s": laser_delay,
|
|
296
|
+
}
|
|
297
|
+
parameters = ExtruderParameters(**params)
|
|
298
|
+
# Create collection directory
|
|
299
|
+
parameters.collection_directory.mkdir(parents=True, exist_ok=True)
|
|
300
|
+
# DCID - not generated yet
|
|
301
|
+
dcid = DCID(emit_errors=False, expt_params=parameters)
|
|
302
|
+
|
|
303
|
+
yield from run_ex_collection_plan(
|
|
304
|
+
zebra,
|
|
305
|
+
aperture,
|
|
306
|
+
backlight,
|
|
307
|
+
beamstop,
|
|
308
|
+
detector_stage,
|
|
309
|
+
shutter,
|
|
310
|
+
dcm,
|
|
311
|
+
mirrors,
|
|
312
|
+
beam_center_eiger,
|
|
313
|
+
parameters,
|
|
314
|
+
dcid,
|
|
315
|
+
start_time,
|
|
316
|
+
)
|