mx-bluesky 1.5.10__py3-none-any.whl → 1.5.12__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/experiment_plans/__init__.py +0 -0
- mx_bluesky/beamlines/aithre_lasershaping/experiment_plans/robot_load_plan.py +198 -0
- mx_bluesky/beamlines/aithre_lasershaping/goniometer_controls.py +2 -2
- mx_bluesky/beamlines/aithre_lasershaping/parameters/__init__.py +0 -0
- mx_bluesky/beamlines/aithre_lasershaping/parameters/constants.py +17 -0
- mx_bluesky/beamlines/aithre_lasershaping/parameters/robot_load_parameters.py +13 -0
- mx_bluesky/beamlines/aithre_lasershaping/pin_tip_centring.py +31 -0
- mx_bluesky/beamlines/aithre_lasershaping/robot_load.py +80 -0
- mx_bluesky/beamlines/i02_1/parameters/gridscan.py +1 -1
- mx_bluesky/beamlines/i04/__init__.py +6 -2
- mx_bluesky/beamlines/i04/callbacks/murko_callback.py +27 -12
- mx_bluesky/beamlines/i04/experiment_plans/i04_grid_detect_then_xray_centre_plan.py +94 -20
- mx_bluesky/beamlines/i04/external_interaction/__init__.py +0 -0
- mx_bluesky/beamlines/i04/external_interaction/config_server.py +15 -0
- mx_bluesky/beamlines/i04/oav_centering_plans/__init__.py +0 -0
- mx_bluesky/beamlines/i04/oav_centering_plans/oav_imaging.py +115 -0
- mx_bluesky/beamlines/i04/parameters/__init__.py +0 -0
- mx_bluesky/beamlines/i04/parameters/constants.py +21 -0
- mx_bluesky/beamlines/i04/redis_to_murko_forwarder.py +24 -1
- mx_bluesky/beamlines/i04/thawing_plan.py +149 -154
- mx_bluesky/beamlines/i24/jungfrau_commissioning/experiment_plans/do_darks.py +55 -10
- mx_bluesky/beamlines/i24/jungfrau_commissioning/plan_stubs/do_external_acquisition.py +1 -1
- mx_bluesky/beamlines/i24/jungfrau_commissioning/plan_stubs/plan_utils.py +1 -1
- mx_bluesky/beamlines/i24/serial/__init__.py +7 -5
- mx_bluesky/beamlines/i24/serial/dcid.py +6 -7
- mx_bluesky/beamlines/i24/serial/extruder/{i24ssx_Extruder_Collect_py3v2.py → i24ssx_extruder_collect_py3v2.py} +70 -37
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/CustomChip_py3v1.edl +11 -11
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DetStage.edl +3 -3
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/DiamondChipI24-py3v1.edl +142 -142
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/MappingLite-oxford_py3v1.edl +135 -135
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/PMAC_Command.edl +8 -8
- mx_bluesky/beamlines/i24/serial/fixed_target/FT-gui-edm/pumpprobe-py3v1.edl +13 -13
- mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_Collect_py3v1.py → i24ssx_chip_collect_py3v1.py} +12 -9
- mx_bluesky/beamlines/i24/serial/fixed_target/{i24ssx_Chip_Manager_py3v1.py → i24ssx_chip_manager_py3v1.py} +81 -78
- 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/parameters/utils.py +5 -5
- mx_bluesky/beamlines/i24/serial/setup_beamline/ca.py +0 -12
- mx_bluesky/beamlines/i24/serial/setup_beamline/pv.py +122 -334
- mx_bluesky/beamlines/i24/serial/setup_beamline/pv_abstract.py +5 -5
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_beamline.py +30 -251
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_detector.py +3 -3
- mx_bluesky/beamlines/i24/serial/setup_beamline/setup_zebra_plans.py +4 -4
- mx_bluesky/beamlines/i24/serial/web_gui_plans/general_plans.py +103 -16
- mx_bluesky/beamlines/i24/serial/web_gui_plans/oav_plans.py +64 -0
- mx_bluesky/beamlines/i24/serial/write_nexus.py +4 -4
- mx_bluesky/common/device_setup_plans/gonio.py +28 -0
- mx_bluesky/common/device_setup_plans/manipulate_sample.py +8 -1
- mx_bluesky/common/device_setup_plans/robot_load_unload.py +1 -1
- mx_bluesky/common/device_setup_plans/setup_oav.py +8 -0
- mx_bluesky/common/device_setup_plans/setup_zebra_and_shutter.py +0 -5
- mx_bluesky/common/device_setup_plans/xbpm_feedback.py +8 -1
- mx_bluesky/common/experiment_plans/beamstop_check.py +229 -0
- mx_bluesky/common/experiment_plans/common_flyscan_xray_centre_plan.py +8 -6
- 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 +1 -1
- mx_bluesky/common/experiment_plans/inner_plans/read_hardware.py +7 -4
- mx_bluesky/common/experiment_plans/inner_plans/write_sample_status.py +2 -2
- mx_bluesky/common/experiment_plans/oav_snapshot_plan.py +1 -2
- mx_bluesky/{hyperion → common}/experiment_plans/pin_tip_centring_plan.py +23 -24
- mx_bluesky/common/external_interaction/callbacks/common/grid_detection_callback.py +5 -0
- mx_bluesky/common/external_interaction/callbacks/common/ispyb_callback_base.py +13 -15
- mx_bluesky/common/external_interaction/callbacks/common/ispyb_mapping.py +3 -5
- 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 +12 -10
- mx_bluesky/common/external_interaction/callbacks/xray_centre/nexus_callback.py +2 -2
- mx_bluesky/common/external_interaction/config_server.py +4 -4
- mx_bluesky/common/external_interaction/ispyb/data_model.py +11 -4
- mx_bluesky/common/external_interaction/ispyb/exp_eye_store.py +163 -4
- mx_bluesky/common/external_interaction/ispyb/ispyb_store.py +76 -167
- mx_bluesky/common/external_interaction/ispyb/ispyb_utils.py +0 -14
- 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/components.py +1 -0
- mx_bluesky/common/parameters/constants.py +4 -3
- mx_bluesky/common/parameters/device_composites.py +4 -2
- mx_bluesky/common/parameters/gridscan.py +2 -2
- mx_bluesky/common/utils/exceptions.py +24 -7
- mx_bluesky/common/utils/log.py +13 -4
- mx_bluesky/common/utils/tracing.py +5 -5
- mx_bluesky/common/utils/utils.py +56 -8
- mx_bluesky/hyperion/__main__.py +6 -16
- mx_bluesky/hyperion/baton_handler.py +38 -14
- 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 +15 -13
- mx_bluesky/hyperion/experiment_plans/load_centre_collect_full_plan.py +2 -2
- mx_bluesky/hyperion/experiment_plans/optimise_attenuation_plan.py +9 -9
- mx_bluesky/hyperion/experiment_plans/pin_centre_then_xray_centre_plan.py +7 -8
- mx_bluesky/hyperion/experiment_plans/robot_load_and_change_energy.py +3 -10
- mx_bluesky/hyperion/experiment_plans/robot_load_then_centre_plan.py +4 -2
- mx_bluesky/hyperion/experiment_plans/rotation_scan_plan.py +10 -4
- mx_bluesky/hyperion/experiment_plans/set_energy_plan.py +2 -2
- mx_bluesky/hyperion/experiment_plans/udc_default_state.py +160 -0
- mx_bluesky/hyperion/external_interaction/agamemnon.py +3 -3
- mx_bluesky/hyperion/external_interaction/callbacks/__main__.py +2 -2
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_callback.py +3 -3
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/ispyb_mapping.py +1 -0
- mx_bluesky/hyperion/external_interaction/callbacks/rotation/nexus_callback.py +3 -6
- mx_bluesky/hyperion/external_interaction/config_server.py +5 -5
- mx_bluesky/hyperion/parameters/constants.py +11 -4
- mx_bluesky/hyperion/parameters/device_composites.py +2 -2
- mx_bluesky/hyperion/parameters/gridscan.py +4 -4
- mx_bluesky/hyperion/parameters/robot_load.py +1 -9
- mx_bluesky/hyperion/plan_runner.py +6 -6
- mx_bluesky/hyperion/runner.py +10 -8
- mx_bluesky/jupyter_example.ipynb +3 -3
- {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.12.dist-info}/METADATA +9 -7
- {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.12.dist-info}/RECORD +118 -104
- mx_bluesky/common/experiment_plans/inner_plans/udc_default_state.py +0 -65
- mx_bluesky/common/external_interaction/callbacks/common/logging_callback.py +0 -29
- mx_bluesky/hyperion/device_setup_plans/smargon.py +0 -25
- {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.12.dist-info}/WHEEL +0 -0
- {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.12.dist-info}/entry_points.txt +0 -0
- {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.12.dist-info}/licenses/LICENSE +0 -0
- {mx_bluesky-1.5.10.dist-info → mx_bluesky-1.5.12.dist-info}/top_level.txt +0 -0
|
@@ -96,192 +96,19 @@ def set_detector_beam_center_plan(
|
|
|
96
96
|
yield from bps.wait(group=group)
|
|
97
97
|
|
|
98
98
|
|
|
99
|
-
def
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
def eiger(action, args_list, dcm: DCM):
|
|
99
|
+
def eiger(
|
|
100
|
+
action,
|
|
101
|
+
args_list,
|
|
102
|
+
dcm: DCM,
|
|
103
|
+
detector_stage: YZStage,
|
|
104
|
+
):
|
|
279
105
|
SSX_LOGGER.debug("***** Entering Eiger")
|
|
280
106
|
SSX_LOGGER.info(f"Setup eiger - {action}")
|
|
281
107
|
if args_list:
|
|
282
108
|
for arg in args_list:
|
|
283
109
|
SSX_LOGGER.debug(f"Argument: {arg}")
|
|
284
|
-
|
|
110
|
+
det_z = yield from bps.rd(detector_stage.z.user_readback)
|
|
111
|
+
caput(pv.eiger_detdist, str(det_z / 1000))
|
|
285
112
|
dcm_wavelength_a = yield from bps.rd(dcm.wavelength_in_a.user_readback)
|
|
286
113
|
caput(pv.eiger_wavelength, dcm_wavelength_a)
|
|
287
114
|
caput(pv.eiger_omegaincr, 0.0)
|
|
@@ -292,7 +119,7 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
292
119
|
caput(pv.eiger_monitor, "No")
|
|
293
120
|
# caput(pv.eiger_datasource, 'None')
|
|
294
121
|
caput(pv.eiger_statuspoll, "1 second")
|
|
295
|
-
caput(pv.
|
|
122
|
+
caput(pv.eiger_roi_mode, "Disabled")
|
|
296
123
|
caput(pv.eiger_ff, "Enabled")
|
|
297
124
|
caput(pv.eiger_compresstype, "bslz4")
|
|
298
125
|
caput(pv.eiger_countmode, "Retrigger")
|
|
@@ -304,10 +131,10 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
304
131
|
# Sends a single trigger to start data collection
|
|
305
132
|
SSX_LOGGER.debug("Eiger quickshot")
|
|
306
133
|
[filepath, filename, num_imgs, exptime] = args_list
|
|
307
|
-
filename = filename + "_" + str(caget(pv.
|
|
308
|
-
caput(pv.
|
|
134
|
+
filename = filename + "_" + str(caget(pv.eiger_seq_id))
|
|
135
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
309
136
|
yield from bps.sleep(0.1)
|
|
310
|
-
caput(pv.
|
|
137
|
+
caput(pv.eiger_od_filename, filename)
|
|
311
138
|
yield from bps.sleep(0.1)
|
|
312
139
|
acqtime = float(exptime) - 0.0000001
|
|
313
140
|
caput(pv.eiger_acquiretime, str(acqtime))
|
|
@@ -325,17 +152,17 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
325
152
|
yield from bps.sleep(1.0)
|
|
326
153
|
# ODIN setup
|
|
327
154
|
SSX_LOGGER.info("Setting up Odin")
|
|
328
|
-
caput(pv.
|
|
329
|
-
caput(pv.
|
|
330
|
-
caput(pv.
|
|
331
|
-
caput(pv.
|
|
155
|
+
caput(pv.eiger_od_filename, filename)
|
|
156
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
157
|
+
caput(pv.eiger_od_num_capture, str(num_imgs))
|
|
158
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
332
159
|
eigerbdrbv = "UInt" + str(caget(pv.eiger_bitdepthrbv))
|
|
333
|
-
caput(pv.
|
|
334
|
-
caput(pv.
|
|
160
|
+
caput(pv.eiger_od_datatype, eigerbdrbv)
|
|
161
|
+
caput(pv.eiger_od_compress, "BSL24")
|
|
335
162
|
yield from bps.sleep(1.0)
|
|
336
163
|
# All done. Now get Odin to wait for data and start Eiger
|
|
337
164
|
SSX_LOGGER.info("Done: Odin waiting for data")
|
|
338
|
-
caput(pv.
|
|
165
|
+
caput(pv.eiger_od_capture, "Capture")
|
|
339
166
|
# If detector fails to arm first time can try twice with a sleep inbetween
|
|
340
167
|
SSX_LOGGER.info("Arming Eiger")
|
|
341
168
|
caput(pv.eiger_acquire, "1")
|
|
@@ -346,10 +173,10 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
346
173
|
# Send a trigger for every image. Records while TTL is high
|
|
347
174
|
SSX_LOGGER.info("Eiger triggered")
|
|
348
175
|
[filepath, filename, num_imgs, exptime] = args_list
|
|
349
|
-
filename = filename + "_" + str(caget(pv.
|
|
350
|
-
caput(pv.
|
|
176
|
+
filename = filename + "_" + str(caget(pv.eiger_seq_id))
|
|
177
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
351
178
|
yield from bps.sleep(0.1)
|
|
352
|
-
caput(pv.
|
|
179
|
+
caput(pv.eiger_od_filename, filename)
|
|
353
180
|
yield from bps.sleep(0.1)
|
|
354
181
|
acqtime = float(exptime) - 0.0000001
|
|
355
182
|
caput(pv.eiger_acquiretime, str(acqtime))
|
|
@@ -367,17 +194,17 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
367
194
|
yield from bps.sleep(1.0)
|
|
368
195
|
# ODIN setup #
|
|
369
196
|
SSX_LOGGER.info("Setting up Odin")
|
|
370
|
-
caput(pv.
|
|
371
|
-
caput(pv.
|
|
372
|
-
caput(pv.
|
|
373
|
-
caput(pv.
|
|
197
|
+
caput(pv.eiger_od_filename, filename)
|
|
198
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
199
|
+
caput(pv.eiger_od_num_capture, str(num_imgs))
|
|
200
|
+
caput(pv.eiger_od_filepath, filepath)
|
|
374
201
|
eigerbdrbv = "UInt" + str(caget(pv.eiger_bitdepthrbv))
|
|
375
|
-
caput(pv.
|
|
376
|
-
caput(pv.
|
|
202
|
+
caput(pv.eiger_od_datatype, eigerbdrbv)
|
|
203
|
+
caput(pv.eiger_od_compress, "BSL24")
|
|
377
204
|
yield from bps.sleep(1.0)
|
|
378
205
|
# All done. Now get Odin to wait for data and start Eiger
|
|
379
206
|
SSX_LOGGER.info("Done: Odin waiting for data")
|
|
380
|
-
caput(pv.
|
|
207
|
+
caput(pv.eiger_od_capture, "Capture")
|
|
381
208
|
# If detector fails to arm first time can try twice with a sleep inbetween
|
|
382
209
|
SSX_LOGGER.info("Arming Eiger")
|
|
383
210
|
caput(pv.eiger_acquire, "1")
|
|
@@ -387,55 +214,7 @@ def eiger(action, args_list, dcm: DCM):
|
|
|
387
214
|
# Put it all back to GDA acceptable defaults
|
|
388
215
|
elif action == "return-to-normal":
|
|
389
216
|
caput(pv.eiger_manualtrigger, "No")
|
|
390
|
-
# caput(pv.
|
|
217
|
+
# caput(pv.eiger_seq_id, int(caget(pv.eiger_seq_id))+1)
|
|
391
218
|
SSX_LOGGER.debug("***** leaving Eiger")
|
|
392
219
|
yield from bps.sleep(0.1)
|
|
393
220
|
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
|
|
@@ -20,7 +20,7 @@ from mx_bluesky.beamlines.i24.serial.setup_beamline.pv_abstract import (
|
|
|
20
20
|
)
|
|
21
21
|
|
|
22
22
|
EXPT_TYPE_DETECTOR_PVS = {
|
|
23
|
-
SSXType.FIXED: pv.
|
|
23
|
+
SSXType.FIXED: pv.ioc13_gp101,
|
|
24
24
|
SSXType.EXTRUDER: pv.ioc13_gp15,
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -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"],
|
|
@@ -108,7 +108,13 @@ def gui_move_detector(
|
|
|
108
108
|
yield from _move_detector_stage(detector_stage, det_y_target)
|
|
109
109
|
# Make the output readable
|
|
110
110
|
SSX_LOGGER.debug(f"Detector move done, resetting general PV to {det}")
|
|
111
|
-
caput(pv.
|
|
111
|
+
caput(pv.ioc13_gp101, det)
|
|
112
|
+
|
|
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)
|
|
112
118
|
|
|
113
119
|
|
|
114
120
|
@bpp.run_decorator()
|
|
@@ -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
|
+
)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
import bluesky.plan_stubs as bps
|
|
4
|
+
from dodal.common import inject
|
|
5
|
+
from dodal.devices.i24.pmac import PMAC
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class MoveSize(Enum):
|
|
9
|
+
SMALL = "small"
|
|
10
|
+
BIG = "big"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Direction(Enum):
|
|
14
|
+
UP = "up"
|
|
15
|
+
DOWN = "down"
|
|
16
|
+
LEFT = "left"
|
|
17
|
+
RIGHT = "right"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _move_direction(magnitude: float, direction: Direction, pmac):
|
|
21
|
+
y_move = 0.0
|
|
22
|
+
x_move = 0.0
|
|
23
|
+
|
|
24
|
+
match direction:
|
|
25
|
+
case Direction.UP:
|
|
26
|
+
y_move = magnitude
|
|
27
|
+
case Direction.DOWN:
|
|
28
|
+
y_move = -magnitude
|
|
29
|
+
case Direction.LEFT:
|
|
30
|
+
x_move = -magnitude
|
|
31
|
+
case Direction.RIGHT:
|
|
32
|
+
x_move = magnitude
|
|
33
|
+
|
|
34
|
+
yield from bps.abs_set(pmac.x, x_move, wait=True)
|
|
35
|
+
yield from bps.abs_set(pmac.y, y_move, wait=True)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def move_block_on_arrow_click(direction: Direction, pmac: PMAC = inject("pmac")):
|
|
39
|
+
magnitude = 3.1750
|
|
40
|
+
yield from _move_direction(magnitude, direction, pmac)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def move_window_on_arrow_click(
|
|
44
|
+
direction: Direction, size_of_move: MoveSize, pmac: PMAC = inject("pmac")
|
|
45
|
+
):
|
|
46
|
+
match size_of_move:
|
|
47
|
+
case MoveSize.SMALL:
|
|
48
|
+
magnitude = 0.1250
|
|
49
|
+
case MoveSize.BIG:
|
|
50
|
+
magnitude = 0.3750
|
|
51
|
+
|
|
52
|
+
yield from _move_direction(magnitude, direction, pmac)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def move_nudge_on_arrow_click(
|
|
56
|
+
direction: Direction, size_of_move: MoveSize, pmac: PMAC = inject("pmac")
|
|
57
|
+
):
|
|
58
|
+
match size_of_move:
|
|
59
|
+
case MoveSize.SMALL:
|
|
60
|
+
magnitude = 0.0010
|
|
61
|
+
case MoveSize.BIG:
|
|
62
|
+
magnitude = 0.0060
|
|
63
|
+
|
|
64
|
+
yield from _move_direction(magnitude, direction, pmac)
|