dls-dodal 1.68.0__py3-none-any.whl → 2.0.0__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.
- {dls_dodal-1.68.0.dist-info → dls_dodal-2.0.0.dist-info}/METADATA +1 -31
- dls_dodal-2.0.0.dist-info/RECORD +354 -0
- {dls_dodal-1.68.0.dist-info → dls_dodal-2.0.0.dist-info}/WHEEL +1 -1
- dodal/_version.py +2 -2
- dodal/beamlines/__init__.py +10 -17
- dodal/beamlines/adsim.py +40 -33
- dodal/beamlines/b01_1.py +11 -0
- dodal/beamlines/b07.py +17 -21
- dodal/beamlines/b07_1.py +20 -22
- dodal/beamlines/b07_shared.py +12 -0
- dodal/beamlines/b16.py +1 -1
- dodal/beamlines/b21.py +15 -6
- dodal/beamlines/i02_1.py +17 -45
- dodal/beamlines/i02_2.py +6 -12
- dodal/beamlines/i03.py +8 -5
- dodal/beamlines/i03_supervisor.py +19 -0
- dodal/beamlines/i04.py +87 -184
- dodal/beamlines/i05.py +9 -39
- dodal/beamlines/i05_1.py +4 -13
- dodal/beamlines/i05_shared.py +51 -0
- dodal/beamlines/i06_1.py +26 -0
- dodal/beamlines/{i06.py → i06_shared.py} +25 -14
- dodal/beamlines/i07.py +14 -16
- dodal/beamlines/i09.py +76 -29
- dodal/beamlines/i09_1.py +25 -56
- dodal/beamlines/i09_1_shared.py +61 -0
- dodal/beamlines/i09_2.py +6 -100
- dodal/beamlines/i09_2_shared.py +110 -0
- dodal/beamlines/i10.py +60 -54
- dodal/beamlines/i10_1.py +99 -10
- dodal/beamlines/{i10_optics.py → i10_shared.py} +80 -66
- dodal/beamlines/i11.py +31 -18
- dodal/beamlines/i13_1.py +1 -1
- dodal/beamlines/i15.py +6 -6
- dodal/beamlines/i15_1.py +6 -6
- dodal/beamlines/i16.py +11 -0
- dodal/beamlines/i17.py +37 -28
- dodal/beamlines/i18.py +3 -4
- dodal/beamlines/i19_1.py +95 -34
- dodal/beamlines/i19_2.py +68 -52
- dodal/beamlines/i19_optics.py +26 -13
- dodal/beamlines/i20_1.py +17 -11
- dodal/beamlines/i21.py +44 -29
- dodal/beamlines/i22.py +19 -4
- dodal/beamlines/i23.py +20 -27
- dodal/beamlines/i24.py +64 -113
- dodal/beamlines/k07.py +99 -5
- dodal/beamlines/p38.py +3 -3
- dodal/beamlines/p60.py +35 -14
- dodal/beamlines/p99.py +16 -15
- dodal/beamlines/training_rig.py +20 -12
- dodal/cli.py +36 -2
- dodal/common/__init__.py +2 -1
- dodal/common/beamlines/beamline_parameters.py +2 -1
- dodal/common/beamlines/beamline_utils.py +11 -9
- dodal/common/beamlines/commissioning_mode.py +6 -3
- dodal/common/coordination.py +12 -14
- dodal/common/crystal_metadata.py +5 -8
- dodal/common/device_utils.py +4 -3
- dodal/common/maths.py +87 -19
- dodal/common/udc_directory_provider.py +13 -8
- dodal/common/visit.py +18 -21
- dodal/common/watcher_utils.py +13 -12
- dodal/device_manager.py +94 -54
- dodal/devices/aperturescatterguard.py +26 -27
- dodal/devices/areadetector/plugins/cam.py +1 -3
- dodal/devices/areadetector/plugins/mjpg.py +6 -5
- dodal/devices/attenuator/attenuator.py +12 -11
- dodal/devices/beamlines/b07/__init__.py +3 -0
- dodal/devices/{b07_1 → beamlines/b07_1}/__init__.py +2 -2
- dodal/devices/{b07_1 → beamlines/b07_1}/ccmc.py +5 -10
- dodal/devices/{b16 → beamlines/b16}/detector.py +2 -3
- dodal/devices/{i02_1 → beamlines/i02_1}/fast_grid_scan.py +2 -3
- dodal/devices/{i02_1 → beamlines/i02_1}/sample_motors.py +1 -1
- dodal/devices/{i03 → beamlines/i03}/beamsize.py +11 -7
- dodal/devices/{i03 → beamlines/i03}/dcm.py +1 -2
- dodal/devices/{i03 → beamlines/i03}/undulator_dcm.py +4 -5
- dodal/devices/beamlines/i04/beam_centre.py +151 -0
- dodal/devices/{i04 → beamlines/i04}/beamsize.py +11 -7
- dodal/devices/beamlines/i04/max_pixel.py +25 -0
- dodal/devices/{i04 → beamlines/i04}/murko_results.py +23 -8
- dodal/devices/{i04 → beamlines/i04}/transfocator.py +10 -15
- dodal/devices/beamlines/i05/__init__.py +3 -0
- dodal/devices/beamlines/i06_shared/__init__.py +3 -0
- dodal/devices/beamlines/i06_shared/i06_enum.py +7 -0
- dodal/devices/{i07 → beamlines/i07}/dcm.py +2 -3
- dodal/devices/{i07 → beamlines/i07}/id.py +8 -9
- dodal/devices/beamlines/i09/__init__.py +3 -0
- dodal/devices/{i09_1_shared → beamlines/i09_1_shared}/hard_energy.py +5 -6
- dodal/devices/{i09_1_shared → beamlines/i09_1_shared}/hard_undulator_functions.py +19 -16
- dodal/devices/{i10 → beamlines/i10}/diagnostics.py +4 -3
- dodal/devices/{i10 → beamlines/i10}/i10_apple2.py +37 -51
- dodal/devices/{i10 → beamlines/i10}/rasor/rasor_current_amp.py +1 -24
- dodal/devices/{i10 → beamlines/i10}/rasor/rasor_motors.py +2 -2
- dodal/devices/{i10 → beamlines/i10}/slits.py +5 -3
- dodal/devices/beamlines/i10_1/__init__.py +9 -0
- dodal/devices/beamlines/i10_1/electromagnet/magnet.py +16 -0
- dodal/devices/beamlines/i10_1/electromagnet/stages.py +14 -0
- dodal/devices/beamlines/i10_1/scaler_cards.py +13 -0
- dodal/devices/{i11 → beamlines/i11}/cyberstar_blower.py +1 -1
- dodal/devices/{i11 → beamlines/i11}/diff_stages.py +4 -6
- dodal/devices/{i11 → beamlines/i11}/mythen.py +3 -4
- dodal/devices/{i11 → beamlines/i11}/nx100robot.py +6 -6
- dodal/devices/{i11 → beamlines/i11}/spinner.py +1 -1
- dodal/devices/{i13_1 → beamlines/i13_1}/merlin.py +1 -1
- dodal/devices/{i15 → beamlines/i15}/dcm.py +1 -2
- dodal/devices/{i15 → beamlines/i15}/focussing_mirror.py +5 -5
- dodal/devices/{i15 → beamlines/i15}/jack.py +2 -2
- dodal/devices/{i15 → beamlines/i15}/multilayer_mirror.py +1 -1
- dodal/devices/{i17 → beamlines/i17}/i17_apple2.py +16 -22
- dodal/devices/{i18 → beamlines/i18}/diode.py +1 -1
- dodal/devices/{i19 → beamlines/i19}/access_controlled/attenuator_motor_squad.py +12 -8
- dodal/devices/{i19 → beamlines/i19}/access_controlled/blueapi_device.py +16 -15
- dodal/devices/beamlines/i19/access_controlled/piezo_control.py +72 -0
- dodal/devices/{i19 → beamlines/i19}/access_controlled/shutter.py +11 -9
- dodal/devices/{i19 → beamlines/i19}/backlight.py +3 -1
- dodal/devices/{i19 → beamlines/i19}/mapt_configuration.py +2 -1
- dodal/devices/{i19 → beamlines/i19}/pin_col_stages.py +11 -8
- dodal/devices/beamlines/i19/pin_tip.py +32 -0
- dodal/devices/beamlines/i21/__init__.py +3 -0
- dodal/devices/{i22 → beamlines/i22}/dcm.py +1 -2
- dodal/devices/{i22 → beamlines/i22}/fswitch.py +1 -3
- dodal/devices/{i22 → beamlines/i22}/nxsas.py +5 -4
- dodal/devices/{i24 → beamlines/i24}/beam_center.py +1 -1
- dodal/devices/{i24 → beamlines/i24}/beamstop.py +2 -2
- dodal/devices/{i24 → beamlines/i24}/commissioning_jungfrau.py +12 -12
- dodal/devices/{i24 → beamlines/i24}/dcm.py +1 -3
- dodal/devices/{i24 → beamlines/i24}/dual_backlight.py +3 -3
- dodal/devices/{i24 → beamlines/i24}/pmac.py +9 -7
- dodal/devices/{p60 → beamlines/p60}/lab_xray_source.py +1 -1
- dodal/devices/beamlines/p99/__init__.py +0 -0
- dodal/devices/{p99 → beamlines/p99}/andor2_point.py +11 -15
- dodal/devices/bimorph_mirror.py +22 -20
- dodal/devices/collimation_table.py +3 -2
- dodal/devices/common_dcm.py +30 -20
- dodal/devices/controllers.py +2 -2
- dodal/devices/cryostream.py +8 -0
- dodal/devices/current_amplifiers/current_amplifier.py +16 -18
- dodal/devices/current_amplifiers/current_amplifier_detector.py +9 -10
- dodal/devices/current_amplifiers/femto.py +8 -9
- dodal/devices/current_amplifiers/sr570.py +16 -16
- dodal/devices/current_amplifiers/struck_scaler_counter.py +5 -5
- dodal/devices/detector/det_resolution.py +9 -8
- dodal/devices/detector/detector.py +4 -2
- dodal/devices/diamond_filter.py +3 -4
- dodal/devices/eiger.py +32 -17
- dodal/devices/eiger_odin.py +1 -1
- dodal/devices/electron_analyser/base/__init__.py +3 -3
- dodal/devices/electron_analyser/base/base_controller.py +32 -21
- dodal/devices/electron_analyser/base/base_detector.py +15 -20
- dodal/devices/electron_analyser/base/base_driver_io.py +39 -46
- dodal/devices/electron_analyser/base/base_enums.py +0 -5
- dodal/devices/electron_analyser/base/base_region.py +29 -31
- dodal/devices/electron_analyser/base/base_util.py +18 -16
- dodal/devices/electron_analyser/base/energy_sources.py +35 -40
- dodal/devices/electron_analyser/specs/specs_detector.py +7 -6
- dodal/devices/electron_analyser/vgscienta/vgscienta_detector.py +7 -6
- dodal/devices/eurotherm.py +3 -2
- dodal/devices/fast_grid_scan.py +31 -34
- dodal/devices/fast_shutter.py +125 -39
- dodal/devices/flux.py +1 -1
- dodal/devices/focusing_mirror.py +29 -11
- dodal/devices/hutch_shutter.py +6 -6
- dodal/devices/insertion_device/__init__.py +20 -8
- dodal/devices/insertion_device/apple2_controller.py +371 -0
- dodal/devices/insertion_device/apple2_undulator.py +184 -587
- dodal/devices/insertion_device/apple_knot_controller.py +222 -0
- dodal/devices/insertion_device/energy.py +161 -0
- dodal/devices/insertion_device/energy_motor_lookup.py +21 -28
- dodal/devices/insertion_device/lookup_table_models.py +47 -52
- dodal/devices/insertion_device/polarisation.py +36 -0
- dodal/devices/ipin.py +1 -1
- dodal/devices/linkam3.py +7 -5
- dodal/devices/motors.py +107 -19
- dodal/devices/mx_phase1/beamstop.py +2 -4
- dodal/devices/oav/oav_calculations.py +20 -13
- dodal/devices/oav/oav_detector.py +92 -22
- dodal/devices/oav/oav_parameters.py +4 -9
- dodal/devices/oav/oav_to_redis_forwarder.py +22 -18
- dodal/devices/oav/pin_image_recognition/__init__.py +4 -6
- dodal/devices/oav/pin_image_recognition/manual_test.py +1 -2
- dodal/devices/oav/pin_image_recognition/utils.py +30 -32
- dodal/devices/oav/snapshots/grid_overlay.py +10 -9
- dodal/devices/oav/snapshots/snapshot_image_processing.py +15 -13
- dodal/devices/oav/utils.py +20 -6
- dodal/devices/p45.py +3 -9
- dodal/devices/pgm.py +8 -14
- dodal/devices/pressure_jump_cell.py +93 -32
- dodal/devices/qbpm.py +1 -3
- dodal/devices/robot.py +45 -20
- dodal/devices/s4_slit_gaps.py +1 -1
- dodal/devices/selectable_source.py +41 -0
- dodal/devices/slits.py +2 -5
- dodal/devices/smargon.py +2 -3
- dodal/devices/temperture_controller/lakeshore/lakeshore.py +38 -64
- dodal/devices/temperture_controller/lakeshore/lakeshore_io.py +21 -35
- dodal/devices/tetramm.py +7 -7
- dodal/devices/turbo_slit.py +8 -7
- dodal/devices/undulator.py +42 -56
- dodal/devices/util/adjuster_plans.py +2 -3
- dodal/devices/util/epics_util.py +10 -10
- dodal/devices/util/lookup_tables.py +17 -18
- dodal/devices/v2f.py +2 -3
- dodal/devices/watsonmarlow323_pump.py +1 -1
- dodal/devices/xbpm_feedback.py +3 -2
- dodal/devices/xspress3/xspress3.py +8 -11
- dodal/devices/xspress3/xspress3_channel.py +3 -6
- dodal/devices/zebra/zebra.py +21 -7
- dodal/devices/zebra/zebra_constants_mapping.py +12 -7
- dodal/devices/zebra/zebra_controlled_shutter.py +2 -1
- dodal/devices/zocalo/zocalo_interaction.py +14 -14
- dodal/devices/zocalo/zocalo_results.py +33 -33
- dodal/log.py +23 -20
- dodal/plan_stubs/check_topup.py +15 -15
- dodal/plan_stubs/data_session.py +6 -6
- dodal/plan_stubs/motor_utils.py +22 -18
- dodal/plan_stubs/pressure_jump_cell.py +18 -0
- dodal/plan_stubs/wrapped.py +40 -55
- dodal/plans/bimorph.py +63 -52
- dodal/plans/configure_arm_trigger_and_disarm_detector.py +0 -1
- dodal/plans/device_setup_plans/__init__.py +5 -0
- dodal/plans/device_setup_plans/setup_pin_tip_params.py +63 -0
- dodal/plans/preprocessors/verify_undulator_gap.py +10 -8
- dodal/plans/spec_path.py +3 -5
- dodal/plans/verify_undulator_gap.py +1 -2
- dodal/plans/wrapped.py +4 -3
- dodal/testing/__init__.py +0 -0
- dodal/testing/electron_analyser/device_factory.py +5 -7
- dodal/testing/fixtures/devices/apple2.py +38 -0
- dodal/testing/fixtures/run_engine.py +3 -7
- dodal/testing/fixtures/utils.py +1 -2
- dodal/utils.py +60 -58
- dls_dodal-1.68.0.dist-info/RECORD +0 -330
- dodal/beamline_specific_utils/i05_shared.py +0 -14
- dodal/devices/b07/__init__.py +0 -3
- dodal/devices/i04/max_pixel.py +0 -38
- dodal/devices/i05/__init__.py +0 -3
- dodal/devices/i09/__init__.py +0 -3
- dodal/devices/i21/__init__.py +0 -5
- {dls_dodal-1.68.0.dist-info → dls_dodal-2.0.0.dist-info}/entry_points.txt +0 -0
- {dls_dodal-1.68.0.dist-info → dls_dodal-2.0.0.dist-info}/licenses/LICENSE +0 -0
- {dls_dodal-1.68.0.dist-info → dls_dodal-2.0.0.dist-info}/top_level.txt +0 -0
- /dodal/{beamline_specific_utils → devices/beamlines}/__init__.py +0 -0
- /dodal/devices/{b07 → beamlines/b07}/enums.py +0 -0
- /dodal/devices/{b07_1 → beamlines/b07_1}/enums.py +0 -0
- /dodal/devices/{b16 → beamlines/b16}/__init__.py +0 -0
- /dodal/devices/{i02_1 → beamlines/i02_1}/__init__.py +0 -0
- /dodal/devices/{i02_2 → beamlines/i02_2}/__init__.py +0 -0
- /dodal/devices/{i03 → beamlines/i03}/__init__.py +0 -0
- /dodal/devices/{i03 → beamlines/i03}/constants.py +0 -0
- /dodal/devices/{i04 → beamlines/i04}/__init__.py +0 -0
- /dodal/devices/{i04 → beamlines/i04}/constants.py +0 -0
- /dodal/devices/{i05 → beamlines/i05}/enums.py +0 -0
- /dodal/devices/{i07 → beamlines/i07}/__init__.py +0 -0
- /dodal/devices/{i09 → beamlines/i09}/enums.py +0 -0
- /dodal/devices/{i09_1 → beamlines/i09_1}/__init__.py +0 -0
- /dodal/devices/{i09_1 → beamlines/i09_1}/enums.py +0 -0
- /dodal/devices/{i09_1_shared → beamlines/i09_1_shared}/__init__.py +0 -0
- /dodal/devices/{i09_2_shared → beamlines/i09_2_shared}/__init__.py +0 -0
- /dodal/devices/{i09_2_shared → beamlines/i09_2_shared}/i09_apple2.py +0 -0
- /dodal/devices/{i10 → beamlines/i10}/__init__.py +0 -0
- /dodal/devices/{i10 → beamlines/i10}/i10_setting_data.py +0 -0
- /dodal/devices/{i10 → beamlines/i10}/mirrors.py +0 -0
- /dodal/devices/{i10 → beamlines/i10}/rasor/__init__.py +0 -0
- /dodal/devices/{i10 → beamlines/i10}/rasor/rasor_scaler_cards.py +0 -0
- /dodal/devices/{i11 → beamlines/i10_1/electromagnet}/__init__.py +0 -0
- /dodal/devices/{i13_1 → beamlines/i11}/__init__.py +0 -0
- /dodal/devices/{i15 → beamlines/i13_1}/__init__.py +0 -0
- /dodal/devices/{i13_1 → beamlines/i13_1}/merlin_controller.py +0 -0
- /dodal/devices/{i17 → beamlines/i15}/__init__.py +0 -0
- /dodal/devices/{i15 → beamlines/i15}/laue.py +0 -0
- /dodal/devices/{i15 → beamlines/i15}/motors.py +0 -0
- /dodal/devices/{i15 → beamlines/i15}/rail.py +0 -0
- /dodal/devices/{i18 → beamlines/i17}/__init__.py +0 -0
- /dodal/devices/{i19 → beamlines/i18}/__init__.py +0 -0
- /dodal/devices/{i18 → beamlines/i18}/kb_mirror.py +0 -0
- /dodal/devices/{i19/access_controlled → beamlines/i19}/__init__.py +0 -0
- /dodal/devices/{i20_1 → beamlines/i19/access_controlled}/__init__.py +0 -0
- /dodal/devices/{i19 → beamlines/i19}/access_controlled/hutch_access.py +0 -0
- /dodal/devices/{i19 → beamlines/i19}/beamstop.py +0 -0
- /dodal/devices/{i19 → beamlines/i19}/diffractometer.py +0 -0
- /dodal/devices/{i22 → beamlines/i20_1}/__init__.py +0 -0
- /dodal/devices/{i21 → beamlines/i21}/enums.py +0 -0
- /dodal/devices/{i24 → beamlines/i22}/__init__.py +0 -0
- /dodal/devices/{p99 → beamlines/i24}/__init__.py +0 -0
- /dodal/devices/{i24 → beamlines/i24}/aperture.py +0 -0
- /dodal/devices/{i24 → beamlines/i24}/focus_mirrors.py +0 -0
- /dodal/devices/{i24 → beamlines/i24}/vgonio.py +0 -0
- /dodal/devices/{p60 → beamlines/p60}/__init__.py +0 -0
- /dodal/devices/{p60 → beamlines/p60}/enums.py +0 -0
- /dodal/devices/{p99 → beamlines/p99}/sample_stage.py +0 -0
- /dodal/devices/insertion_device/{id_enum.py → enum.py} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
from dodal.common.beamlines.beamline_utils import (
|
|
2
|
-
device_factory,
|
|
3
|
-
)
|
|
4
1
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
2
|
+
from dodal.device_manager import DeviceManager
|
|
3
|
+
from dodal.devices.beamlines.i06_shared import I06Grating
|
|
5
4
|
from dodal.devices.insertion_device import (
|
|
6
5
|
Apple2,
|
|
7
6
|
UndulatorGap,
|
|
8
7
|
UndulatorLockedPhaseAxes,
|
|
9
8
|
)
|
|
9
|
+
from dodal.devices.pgm import PlaneGratingMonochromator
|
|
10
10
|
from dodal.devices.synchrotron import Synchrotron
|
|
11
11
|
from dodal.log import set_beamline as set_log_beamline
|
|
12
12
|
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
@@ -16,18 +16,20 @@ PREFIX = BeamlinePrefix(BL)
|
|
|
16
16
|
set_log_beamline(BL)
|
|
17
17
|
set_utils_beamline(BL)
|
|
18
18
|
|
|
19
|
+
devices = DeviceManager()
|
|
20
|
+
|
|
19
21
|
|
|
20
|
-
@
|
|
22
|
+
@devices.factory()
|
|
21
23
|
def synchrotron() -> Synchrotron:
|
|
22
24
|
return Synchrotron()
|
|
23
25
|
|
|
24
26
|
|
|
25
|
-
@
|
|
27
|
+
@devices.factory()
|
|
26
28
|
def idd_gap() -> UndulatorGap:
|
|
27
29
|
return UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:")
|
|
28
30
|
|
|
29
31
|
|
|
30
|
-
@
|
|
32
|
+
@devices.factory()
|
|
31
33
|
def idd_phase() -> UndulatorLockedPhaseAxes:
|
|
32
34
|
return UndulatorLockedPhaseAxes(
|
|
33
35
|
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
|
|
@@ -36,18 +38,18 @@ def idd_phase() -> UndulatorLockedPhaseAxes:
|
|
|
36
38
|
)
|
|
37
39
|
|
|
38
40
|
|
|
39
|
-
@
|
|
40
|
-
def idd() -> Apple2:
|
|
41
|
+
@devices.factory()
|
|
42
|
+
def idd(idd_gap: UndulatorGap, idd_phase: UndulatorLockedPhaseAxes) -> Apple2:
|
|
41
43
|
"""i06 downstream insertion device."""
|
|
42
|
-
return Apple2(id_gap=idd_gap
|
|
44
|
+
return Apple2(id_gap=idd_gap, id_phase=idd_phase)
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-
@
|
|
47
|
+
@devices.factory()
|
|
46
48
|
def idu_gap() -> UndulatorGap:
|
|
47
49
|
return UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:")
|
|
48
50
|
|
|
49
51
|
|
|
50
|
-
@
|
|
52
|
+
@devices.factory()
|
|
51
53
|
def idu_phase() -> UndulatorLockedPhaseAxes:
|
|
52
54
|
return UndulatorLockedPhaseAxes(
|
|
53
55
|
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-21:",
|
|
@@ -56,7 +58,16 @@ def idu_phase() -> UndulatorLockedPhaseAxes:
|
|
|
56
58
|
)
|
|
57
59
|
|
|
58
60
|
|
|
59
|
-
@
|
|
60
|
-
def idu() -> Apple2:
|
|
61
|
+
@devices.factory()
|
|
62
|
+
def idu(idu_gap: UndulatorGap, idu_phase: UndulatorLockedPhaseAxes) -> Apple2:
|
|
61
63
|
"""i06 upstream insertion device."""
|
|
62
|
-
return Apple2(id_gap=
|
|
64
|
+
return Apple2(id_gap=idu_gap, id_phase=idu_phase)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@devices.factory()
|
|
68
|
+
def pgm() -> PlaneGratingMonochromator:
|
|
69
|
+
return PlaneGratingMonochromator(
|
|
70
|
+
prefix=f"{PREFIX.beamline_prefix}-OP-PGM-01:",
|
|
71
|
+
grating=I06Grating,
|
|
72
|
+
grating_pv="NLINES2",
|
|
73
|
+
)
|
dodal/beamlines/i07.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from dodal.common.beamlines.beamline_utils import device_factory
|
|
2
1
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
3
|
-
from dodal.
|
|
4
|
-
from dodal.devices.i07.
|
|
2
|
+
from dodal.device_manager import DeviceManager
|
|
3
|
+
from dodal.devices.beamlines.i07.dcm import DCM
|
|
4
|
+
from dodal.devices.beamlines.i07.id import InsertionDevice
|
|
5
5
|
from dodal.devices.undulator import UndulatorOrder
|
|
6
6
|
from dodal.log import set_beamline as set_log_beamline
|
|
7
7
|
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
@@ -11,31 +11,29 @@ set_log_beamline(BL)
|
|
|
11
11
|
set_utils_beamline(BL)
|
|
12
12
|
PREFIX = BeamlinePrefix(BL)
|
|
13
13
|
|
|
14
|
+
devices = DeviceManager()
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
@devices.factory()
|
|
16
18
|
def dcm() -> DCM:
|
|
17
|
-
"""Instantiate DCM using two PV bases"""
|
|
18
|
-
|
|
19
|
-
f"{PREFIX.beamline_prefix}-MO-DCM-01:",
|
|
20
|
-
f"{PREFIX.beamline_prefix}-DI-DCM-01:",
|
|
21
|
-
"dcm",
|
|
19
|
+
"""Instantiate DCM using two PV bases."""
|
|
20
|
+
return DCM(
|
|
21
|
+
f"{PREFIX.beamline_prefix}-MO-DCM-01:", f"{PREFIX.beamline_prefix}-DI-DCM-01:"
|
|
22
22
|
)
|
|
23
|
-
return dcm
|
|
24
23
|
|
|
25
24
|
|
|
26
|
-
@
|
|
25
|
+
@devices.factory()
|
|
27
26
|
def harmonic() -> UndulatorOrder:
|
|
28
|
-
return UndulatorOrder(
|
|
27
|
+
return UndulatorOrder()
|
|
29
28
|
|
|
30
29
|
|
|
31
|
-
@
|
|
32
|
-
def id() -> InsertionDevice:
|
|
30
|
+
@devices.factory()
|
|
31
|
+
def id(harmonic: UndulatorOrder) -> InsertionDevice:
|
|
33
32
|
"""Get the i07 undulator device, instantiate it if it hasn't already been.
|
|
34
33
|
If this is called when already instantiated it will return the existing object.
|
|
35
34
|
"""
|
|
36
35
|
return InsertionDevice(
|
|
37
|
-
"id",
|
|
38
36
|
f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
|
|
39
|
-
harmonic
|
|
37
|
+
harmonic,
|
|
40
38
|
id_gap_lookup_table_path="/dls_sw/i07/software/gda/config/lookupTables/IIDCalibrationTable.txt",
|
|
41
39
|
)
|
dodal/beamlines/i09.py
CHANGED
|
@@ -1,59 +1,106 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
from ophyd_async.core import InOut
|
|
2
|
+
|
|
3
|
+
from dodal.beamlines.i09_1_shared import devices as i09_1_shared_devices
|
|
4
|
+
from dodal.beamlines.i09_2_shared import devices as i09_2_shared_devices
|
|
4
5
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
5
|
-
from dodal.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
StationaryCrystal,
|
|
9
|
-
)
|
|
6
|
+
from dodal.device_manager import DeviceManager
|
|
7
|
+
from dodal.devices.beamlines.i09.enums import LensMode, PassEnergy, PsuMode
|
|
8
|
+
from dodal.devices.common_dcm import DoubleCrystalMonochromatorWithDSpacing
|
|
10
9
|
from dodal.devices.electron_analyser.base import DualEnergySource
|
|
11
10
|
from dodal.devices.electron_analyser.vgscienta import VGScientaDetector
|
|
12
|
-
from dodal.devices.
|
|
11
|
+
from dodal.devices.fast_shutter import DualFastShutter, GenericFastShutter
|
|
12
|
+
from dodal.devices.motors import XYZPolarAzimuthStage
|
|
13
13
|
from dodal.devices.pgm import PlaneGratingMonochromator
|
|
14
|
+
from dodal.devices.selectable_source import SourceSelector
|
|
14
15
|
from dodal.devices.synchrotron import Synchrotron
|
|
16
|
+
from dodal.devices.temperture_controller import Lakeshore336
|
|
15
17
|
from dodal.log import set_beamline as set_log_beamline
|
|
16
18
|
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
17
19
|
|
|
18
20
|
BL = get_beamline_name("i09")
|
|
19
|
-
|
|
21
|
+
I_PREFIX = BeamlinePrefix(BL, suffix="I")
|
|
22
|
+
J_PREFIX = BeamlinePrefix(BL, suffix="J")
|
|
20
23
|
set_log_beamline(BL)
|
|
21
24
|
set_utils_beamline(BL)
|
|
22
25
|
|
|
26
|
+
devices = DeviceManager()
|
|
27
|
+
devices.include(i09_1_shared_devices)
|
|
28
|
+
devices.include(i09_2_shared_devices)
|
|
29
|
+
|
|
23
30
|
|
|
24
|
-
@
|
|
31
|
+
@devices.factory()
|
|
25
32
|
def synchrotron() -> Synchrotron:
|
|
26
33
|
return Synchrotron()
|
|
27
34
|
|
|
28
35
|
|
|
29
|
-
@
|
|
30
|
-
def
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
@devices.factory()
|
|
37
|
+
def source_selector() -> SourceSelector:
|
|
38
|
+
return SourceSelector()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@devices.factory()
|
|
42
|
+
def dual_energy_source(
|
|
43
|
+
dcm: DoubleCrystalMonochromatorWithDSpacing,
|
|
44
|
+
pgm: PlaneGratingMonochromator,
|
|
45
|
+
source_selector: SourceSelector,
|
|
46
|
+
) -> DualEnergySource:
|
|
47
|
+
return DualEnergySource(
|
|
48
|
+
dcm.energy_in_eV,
|
|
49
|
+
pgm.energy.user_readback,
|
|
50
|
+
source_selector.selected_source,
|
|
34
51
|
)
|
|
35
52
|
|
|
36
53
|
|
|
37
|
-
@
|
|
38
|
-
def
|
|
39
|
-
return
|
|
40
|
-
f"{
|
|
54
|
+
@devices.factory()
|
|
55
|
+
def fsi1() -> GenericFastShutter[InOut]:
|
|
56
|
+
return GenericFastShutter[InOut](
|
|
57
|
+
f"{I_PREFIX.beamline_prefix}-EA-FSHTR-01:CTRL",
|
|
58
|
+
open_state=InOut.OUT,
|
|
59
|
+
close_state=InOut.IN,
|
|
41
60
|
)
|
|
42
61
|
|
|
43
62
|
|
|
44
|
-
@
|
|
45
|
-
def
|
|
46
|
-
return
|
|
63
|
+
@devices.factory()
|
|
64
|
+
def fsj1() -> GenericFastShutter[InOut]:
|
|
65
|
+
return GenericFastShutter[InOut](
|
|
66
|
+
f"{J_PREFIX.beamline_prefix}-EA-FSHTR-01:CTRL",
|
|
67
|
+
open_state=InOut.OUT,
|
|
68
|
+
close_state=InOut.IN,
|
|
69
|
+
)
|
|
70
|
+
|
|
47
71
|
|
|
72
|
+
@devices.factory()
|
|
73
|
+
def dual_fast_shutter(
|
|
74
|
+
fsi1: GenericFastShutter, fsj1: GenericFastShutter, source_selector: SourceSelector
|
|
75
|
+
) -> DualFastShutter[InOut]:
|
|
76
|
+
return DualFastShutter[InOut](fsi1, fsj1, source_selector.selected_source)
|
|
48
77
|
|
|
49
|
-
|
|
50
|
-
#
|
|
51
|
-
|
|
52
|
-
|
|
78
|
+
|
|
79
|
+
# CAM:IMAGE will fail to connect outside the beamline network,
|
|
80
|
+
# see https://github.com/DiamondLightSource/dodal/issues/1852
|
|
81
|
+
@devices.factory()
|
|
82
|
+
def ew4000(
|
|
83
|
+
dual_fast_shutter: DualFastShutter,
|
|
84
|
+
dual_energy_source: DualEnergySource,
|
|
85
|
+
source_selector: SourceSelector,
|
|
86
|
+
) -> VGScientaDetector[LensMode, PsuMode, PassEnergy]:
|
|
53
87
|
return VGScientaDetector[LensMode, PsuMode, PassEnergy](
|
|
54
|
-
prefix=f"{
|
|
88
|
+
prefix=f"{I_PREFIX.beamline_prefix}-EA-DET-01:CAM:",
|
|
55
89
|
lens_mode_type=LensMode,
|
|
56
90
|
psu_mode_type=PsuMode,
|
|
57
91
|
pass_energy_type=PassEnergy,
|
|
58
|
-
energy_source=
|
|
92
|
+
energy_source=dual_energy_source,
|
|
93
|
+
shutter=dual_fast_shutter,
|
|
94
|
+
source_selector=source_selector,
|
|
59
95
|
)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@devices.factory()
|
|
99
|
+
def lakeshore() -> Lakeshore336:
|
|
100
|
+
return Lakeshore336(prefix="BL09L-VA-LAKE-01:")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
@devices.factory()
|
|
104
|
+
def smpm() -> XYZPolarAzimuthStage:
|
|
105
|
+
"""Sample Manipulator."""
|
|
106
|
+
return XYZPolarAzimuthStage(prefix=f"{I_PREFIX.beamline_prefix}-MO-SMPM-01:")
|
dodal/beamlines/i09_1.py
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
from dodal.
|
|
2
|
-
device_factory,
|
|
3
|
-
)
|
|
1
|
+
from dodal.beamlines.i09_1_shared import devices as i09_1_shared_devices
|
|
4
2
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
5
|
-
from dodal.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
StationaryCrystal,
|
|
9
|
-
)
|
|
3
|
+
from dodal.device_manager import DeviceManager
|
|
4
|
+
from dodal.devices.beamlines.i09_1 import LensMode, PsuMode
|
|
5
|
+
from dodal.devices.common_dcm import DoubleCrystalMonochromatorWithDSpacing
|
|
10
6
|
from dodal.devices.electron_analyser.base import EnergySource
|
|
11
7
|
from dodal.devices.electron_analyser.specs import SpecsDetector
|
|
12
|
-
from dodal.devices.
|
|
13
|
-
from dodal.devices.i09_1_shared.hard_energy import HardEnergy, HardInsertionDeviceEnergy
|
|
14
|
-
from dodal.devices.i09_1_shared.hard_undulator_functions import (
|
|
15
|
-
calculate_energy_i09_hu,
|
|
16
|
-
calculate_gap_i09_hu,
|
|
17
|
-
)
|
|
8
|
+
from dodal.devices.motors import XYZPolarAzimuthTiltStage
|
|
18
9
|
from dodal.devices.synchrotron import Synchrotron
|
|
19
|
-
from dodal.devices.
|
|
10
|
+
from dodal.devices.temperture_controller import Lakeshore336
|
|
20
11
|
from dodal.log import set_beamline as set_log_beamline
|
|
21
12
|
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
22
13
|
|
|
@@ -25,60 +16,38 @@ PREFIX = BeamlinePrefix(BL, suffix="I")
|
|
|
25
16
|
set_log_beamline(BL)
|
|
26
17
|
set_utils_beamline(BL)
|
|
27
18
|
|
|
19
|
+
devices = DeviceManager()
|
|
20
|
+
devices.include(i09_1_shared_devices)
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
|
|
23
|
+
@devices.factory()
|
|
30
24
|
def synchrotron() -> Synchrotron:
|
|
31
25
|
return Synchrotron()
|
|
32
26
|
|
|
33
27
|
|
|
34
|
-
@
|
|
35
|
-
def dcm
|
|
36
|
-
return
|
|
37
|
-
f"{PREFIX.beamline_prefix}-MO-DCM-01:", PitchAndRollCrystal, StationaryCrystal
|
|
38
|
-
)
|
|
39
|
-
|
|
28
|
+
@devices.factory()
|
|
29
|
+
def energy_source(dcm: DoubleCrystalMonochromatorWithDSpacing) -> EnergySource:
|
|
30
|
+
return EnergySource(dcm.energy_in_eV)
|
|
40
31
|
|
|
41
|
-
@device_factory()
|
|
42
|
-
def energy_source() -> EnergySource:
|
|
43
|
-
return EnergySource(dcm().energy_in_eV)
|
|
44
32
|
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
def analyser() -> SpecsDetector[LensMode, PsuMode]:
|
|
33
|
+
# CAM:IMAGE will fail to connect outside the beamline network,
|
|
34
|
+
# see https://github.com/DiamondLightSource/dodal/issues/1852
|
|
35
|
+
@devices.factory()
|
|
36
|
+
def analyser(energy_source: EnergySource) -> SpecsDetector[LensMode, PsuMode]:
|
|
50
37
|
return SpecsDetector[LensMode, PsuMode](
|
|
51
38
|
prefix=f"{PREFIX.beamline_prefix}-EA-DET-02:CAM:",
|
|
52
39
|
lens_mode_type=LensMode,
|
|
53
40
|
psu_mode_type=PsuMode,
|
|
54
|
-
energy_source=energy_source
|
|
41
|
+
energy_source=energy_source,
|
|
55
42
|
)
|
|
56
43
|
|
|
57
44
|
|
|
58
|
-
@
|
|
59
|
-
def
|
|
60
|
-
return
|
|
61
|
-
|
|
45
|
+
@devices.factory()
|
|
46
|
+
def lakeshore() -> Lakeshore336:
|
|
47
|
+
return Lakeshore336(prefix=f"{PREFIX.beamline_prefix}-EA-TCTRL-01:")
|
|
62
48
|
|
|
63
|
-
@device_factory()
|
|
64
|
-
def harmonics() -> UndulatorOrder:
|
|
65
|
-
return UndulatorOrder()
|
|
66
49
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return
|
|
71
|
-
undulator_order=harmonics(),
|
|
72
|
-
undulator=undulator(),
|
|
73
|
-
lut={}, # ToDo https://github.com/DiamondLightSource/sm-bluesky/issues/239
|
|
74
|
-
gap_to_energy_func=calculate_energy_i09_hu,
|
|
75
|
-
energy_to_gap_func=calculate_gap_i09_hu,
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
@device_factory()
|
|
80
|
-
def hu_energy() -> HardEnergy:
|
|
81
|
-
return HardEnergy(
|
|
82
|
-
dcm=dcm(),
|
|
83
|
-
undulator_energy=hu_id_energy(),
|
|
84
|
-
)
|
|
50
|
+
@devices.factory()
|
|
51
|
+
def hsmpm() -> XYZPolarAzimuthTiltStage:
|
|
52
|
+
"""Sample Manipulator."""
|
|
53
|
+
return XYZPolarAzimuthTiltStage(prefix=f"{PREFIX.beamline_prefix}-MO-HSMPM-01:")
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
from dodal.device_manager import DeviceManager
|
|
2
|
+
from dodal.devices.beamlines.i09_1_shared import (
|
|
3
|
+
HardEnergy,
|
|
4
|
+
HardInsertionDeviceEnergy,
|
|
5
|
+
calculate_energy_i09_hu,
|
|
6
|
+
calculate_gap_i09_hu,
|
|
7
|
+
)
|
|
8
|
+
from dodal.devices.common_dcm import (
|
|
9
|
+
DoubleCrystalMonochromatorWithDSpacing,
|
|
10
|
+
PitchAndRollCrystal,
|
|
11
|
+
StationaryCrystal,
|
|
12
|
+
)
|
|
13
|
+
from dodal.devices.undulator import UndulatorInMm, UndulatorOrder
|
|
14
|
+
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
15
|
+
|
|
16
|
+
BL = get_beamline_name("i09-1-shared")
|
|
17
|
+
I_PREFIX = BeamlinePrefix(BL, suffix="I")
|
|
18
|
+
|
|
19
|
+
devices = DeviceManager()
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@devices.factory()
|
|
23
|
+
def dcm() -> DoubleCrystalMonochromatorWithDSpacing[
|
|
24
|
+
PitchAndRollCrystal, StationaryCrystal
|
|
25
|
+
]:
|
|
26
|
+
return DoubleCrystalMonochromatorWithDSpacing[
|
|
27
|
+
PitchAndRollCrystal, StationaryCrystal
|
|
28
|
+
](f"{I_PREFIX.beamline_prefix}-MO-DCM-01:", PitchAndRollCrystal, StationaryCrystal)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
@devices.factory()
|
|
32
|
+
def undulator() -> UndulatorInMm:
|
|
33
|
+
return UndulatorInMm(prefix=f"{I_PREFIX.insertion_prefix}-MO-SERVC-01:")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@devices.factory()
|
|
37
|
+
def harmonics() -> UndulatorOrder:
|
|
38
|
+
return UndulatorOrder()
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@devices.factory()
|
|
42
|
+
def hu_id_energy(
|
|
43
|
+
harmonics: UndulatorOrder, undulator: UndulatorInMm
|
|
44
|
+
) -> HardInsertionDeviceEnergy:
|
|
45
|
+
return HardInsertionDeviceEnergy(
|
|
46
|
+
undulator_order=harmonics,
|
|
47
|
+
undulator=undulator,
|
|
48
|
+
lut={}, # ToDo https://github.com/DiamondLightSource/sm-bluesky/issues/239
|
|
49
|
+
gap_to_energy_func=calculate_energy_i09_hu,
|
|
50
|
+
energy_to_gap_func=calculate_gap_i09_hu,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@devices.factory()
|
|
55
|
+
def hu_energy(
|
|
56
|
+
dcm: DoubleCrystalMonochromatorWithDSpacing, hu_id_energy: HardInsertionDeviceEnergy
|
|
57
|
+
) -> HardEnergy:
|
|
58
|
+
return HardEnergy(
|
|
59
|
+
dcm=dcm,
|
|
60
|
+
undulator_energy=hu_id_energy,
|
|
61
|
+
)
|
dodal/beamlines/i09_2.py
CHANGED
|
@@ -1,113 +1,19 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
from daq_config_server.client import ConfigServer
|
|
4
|
-
|
|
5
|
-
from dodal.common.beamlines.beamline_utils import (
|
|
6
|
-
device_factory,
|
|
7
|
-
)
|
|
1
|
+
from dodal.beamlines.i09_2_shared import devices as i09_2_shared_devices
|
|
8
2
|
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
|
|
9
|
-
from dodal.
|
|
10
|
-
from dodal.devices.i09_2_shared.i09_apple2 import (
|
|
11
|
-
J09_GAP_POLY_DEG_COLUMNS,
|
|
12
|
-
J09_PHASE_POLY_DEG_COLUMNS,
|
|
13
|
-
)
|
|
14
|
-
from dodal.devices.insertion_device import (
|
|
15
|
-
Apple2,
|
|
16
|
-
Apple2EnforceLHMoveController,
|
|
17
|
-
BeamEnergy,
|
|
18
|
-
InsertionDeviceEnergy,
|
|
19
|
-
InsertionDevicePolarisation,
|
|
20
|
-
UndulatorGap,
|
|
21
|
-
UndulatorPhaseAxes,
|
|
22
|
-
)
|
|
23
|
-
from dodal.devices.insertion_device.energy_motor_lookup import (
|
|
24
|
-
ConfigServerEnergyMotorLookup,
|
|
25
|
-
)
|
|
26
|
-
from dodal.devices.insertion_device.lookup_table_models import LookupTableColumnConfig
|
|
27
|
-
from dodal.devices.pgm import PlaneGratingMonochromator
|
|
3
|
+
from dodal.device_manager import DeviceManager
|
|
28
4
|
from dodal.devices.synchrotron import Synchrotron
|
|
29
5
|
from dodal.log import set_beamline as set_log_beamline
|
|
30
6
|
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
31
7
|
|
|
32
|
-
J09_CONF_CLIENT = ConfigServer(url="https://daq-config.diamond.ac.uk")
|
|
33
|
-
LOOK_UPTABLE_DIR = "/dls_sw/i09-2/software/gda/workspace_git/gda-diamond.git/configurations/i09-2-shared/lookupTables/"
|
|
34
|
-
GAP_LOOKUP_FILE_NAME = "JIDEnergy2GapCalibrations.csv"
|
|
35
|
-
PHASE_LOOKUP_FILE_NAME = "JIDEnergy2PhaseCalibrations.csv"
|
|
36
|
-
|
|
37
8
|
BL = get_beamline_name("i09-2")
|
|
38
9
|
PREFIX = BeamlinePrefix(BL, suffix="J")
|
|
39
10
|
set_log_beamline(BL)
|
|
40
11
|
set_utils_beamline(BL)
|
|
41
12
|
|
|
13
|
+
devices = DeviceManager()
|
|
14
|
+
devices.include(i09_2_shared_devices)
|
|
42
15
|
|
|
43
|
-
|
|
16
|
+
|
|
17
|
+
@devices.factory()
|
|
44
18
|
def synchrotron() -> Synchrotron:
|
|
45
19
|
return Synchrotron()
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
@device_factory()
|
|
49
|
-
def pgm() -> PlaneGratingMonochromator:
|
|
50
|
-
return PlaneGratingMonochromator(
|
|
51
|
-
prefix=f"{PREFIX.beamline_prefix}-MO-PGM-01:",
|
|
52
|
-
grating=Grating,
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
@device_factory()
|
|
57
|
-
def jid_gap() -> UndulatorGap:
|
|
58
|
-
return UndulatorGap(prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:")
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@device_factory()
|
|
62
|
-
def jid_phase() -> UndulatorPhaseAxes:
|
|
63
|
-
return UndulatorPhaseAxes(
|
|
64
|
-
prefix=f"{PREFIX.insertion_prefix}-MO-SERVC-01:",
|
|
65
|
-
top_outer="PUO",
|
|
66
|
-
top_inner="PUI",
|
|
67
|
-
btm_inner="PLI",
|
|
68
|
-
btm_outer="PLO",
|
|
69
|
-
)
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
@device_factory()
|
|
73
|
-
def jid() -> Apple2:
|
|
74
|
-
"""I09 soft x-ray insertion device."""
|
|
75
|
-
return Apple2(
|
|
76
|
-
id_gap=jid_gap(),
|
|
77
|
-
id_phase=jid_phase(),
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
@device_factory()
|
|
82
|
-
def jid_controller() -> Apple2EnforceLHMoveController:
|
|
83
|
-
"""J09 insertion device controller."""
|
|
84
|
-
return Apple2EnforceLHMoveController(
|
|
85
|
-
apple2=jid(),
|
|
86
|
-
gap_energy_motor_lut=ConfigServerEnergyMotorLookup(
|
|
87
|
-
lut_config=LookupTableColumnConfig(poly_deg=J09_GAP_POLY_DEG_COLUMNS),
|
|
88
|
-
config_client=J09_CONF_CLIENT,
|
|
89
|
-
path=Path(LOOK_UPTABLE_DIR, GAP_LOOKUP_FILE_NAME),
|
|
90
|
-
),
|
|
91
|
-
phase_energy_motor_lut=ConfigServerEnergyMotorLookup(
|
|
92
|
-
lut_config=LookupTableColumnConfig(poly_deg=J09_PHASE_POLY_DEG_COLUMNS),
|
|
93
|
-
config_client=J09_CONF_CLIENT,
|
|
94
|
-
path=Path(LOOK_UPTABLE_DIR, PHASE_LOOKUP_FILE_NAME),
|
|
95
|
-
),
|
|
96
|
-
units="keV",
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
@device_factory()
|
|
101
|
-
def jid_energy() -> InsertionDeviceEnergy:
|
|
102
|
-
return InsertionDeviceEnergy(id_controller=jid_controller())
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
@device_factory()
|
|
106
|
-
def jid_polarisation() -> InsertionDevicePolarisation:
|
|
107
|
-
return InsertionDevicePolarisation(id_controller=jid_controller())
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
@device_factory()
|
|
111
|
-
def energy_jid() -> BeamEnergy:
|
|
112
|
-
"""Beam energy."""
|
|
113
|
-
return BeamEnergy(id_energy=jid_energy(), mono=pgm().energy)
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
from pathlib import Path
|
|
2
|
+
|
|
3
|
+
from daq_config_server.client import ConfigServer
|
|
4
|
+
|
|
5
|
+
from dodal.device_manager import DeviceManager
|
|
6
|
+
from dodal.devices.beamlines.i09.enums import Grating
|
|
7
|
+
from dodal.devices.beamlines.i09_2_shared.i09_apple2 import (
|
|
8
|
+
J09_GAP_POLY_DEG_COLUMNS,
|
|
9
|
+
J09_PHASE_POLY_DEG_COLUMNS,
|
|
10
|
+
)
|
|
11
|
+
from dodal.devices.insertion_device import (
|
|
12
|
+
Apple2,
|
|
13
|
+
Apple2EnforceLHMoveController,
|
|
14
|
+
BeamEnergy,
|
|
15
|
+
InsertionDeviceEnergy,
|
|
16
|
+
InsertionDevicePolarisation,
|
|
17
|
+
UndulatorGap,
|
|
18
|
+
UndulatorPhaseAxes,
|
|
19
|
+
)
|
|
20
|
+
from dodal.devices.insertion_device.energy_motor_lookup import (
|
|
21
|
+
ConfigServerEnergyMotorLookup,
|
|
22
|
+
)
|
|
23
|
+
from dodal.devices.insertion_device.lookup_table_models import LookupTableColumnConfig
|
|
24
|
+
from dodal.devices.pgm import PlaneGratingMonochromator
|
|
25
|
+
from dodal.utils import BeamlinePrefix, get_beamline_name
|
|
26
|
+
|
|
27
|
+
J09_CONF_CLIENT = ConfigServer(url="https://daq-config.diamond.ac.uk")
|
|
28
|
+
LOOK_UPTABLE_DIR = "/dls_sw/i09-2/software/gda/workspace_git/gda-diamond.git/configurations/i09-2-shared/lookupTables/"
|
|
29
|
+
GAP_LOOKUP_FILE_NAME = "JIDEnergy2GapCalibrations.csv"
|
|
30
|
+
PHASE_LOOKUP_FILE_NAME = "JIDEnergy2PhaseCalibrations.csv"
|
|
31
|
+
|
|
32
|
+
BL = get_beamline_name("i09-2-shared")
|
|
33
|
+
J_PREFIX = BeamlinePrefix(BL, suffix="J")
|
|
34
|
+
|
|
35
|
+
devices = DeviceManager()
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
@devices.factory()
|
|
39
|
+
def pgm() -> PlaneGratingMonochromator:
|
|
40
|
+
return PlaneGratingMonochromator(
|
|
41
|
+
prefix=f"{J_PREFIX.beamline_prefix}-MO-PGM-01:",
|
|
42
|
+
grating=Grating,
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@devices.factory()
|
|
47
|
+
def jid_gap() -> UndulatorGap:
|
|
48
|
+
return UndulatorGap(prefix=f"{J_PREFIX.insertion_prefix}-MO-SERVC-01:")
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
@devices.factory()
|
|
52
|
+
def jid_phase() -> UndulatorPhaseAxes:
|
|
53
|
+
return UndulatorPhaseAxes(
|
|
54
|
+
prefix=f"{J_PREFIX.insertion_prefix}-MO-SERVC-01:",
|
|
55
|
+
top_outer="PUO",
|
|
56
|
+
top_inner="PUI",
|
|
57
|
+
btm_inner="PLI",
|
|
58
|
+
btm_outer="PLO",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@devices.factory()
|
|
63
|
+
def jid(
|
|
64
|
+
jid_gap: UndulatorGap, jid_phase: UndulatorPhaseAxes
|
|
65
|
+
) -> Apple2[UndulatorPhaseAxes]:
|
|
66
|
+
"""I09 soft x-ray insertion device."""
|
|
67
|
+
return Apple2[UndulatorPhaseAxes](id_gap=jid_gap, id_phase=jid_phase)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@devices.factory()
|
|
71
|
+
def jid_controller(
|
|
72
|
+
jid: Apple2[UndulatorPhaseAxes],
|
|
73
|
+
) -> Apple2EnforceLHMoveController[UndulatorPhaseAxes]:
|
|
74
|
+
"""J09 insertion device controller."""
|
|
75
|
+
return Apple2EnforceLHMoveController[UndulatorPhaseAxes](
|
|
76
|
+
apple2=jid,
|
|
77
|
+
gap_energy_motor_lut=ConfigServerEnergyMotorLookup(
|
|
78
|
+
lut_config=LookupTableColumnConfig(poly_deg=J09_GAP_POLY_DEG_COLUMNS),
|
|
79
|
+
config_client=J09_CONF_CLIENT,
|
|
80
|
+
path=Path(LOOK_UPTABLE_DIR, GAP_LOOKUP_FILE_NAME),
|
|
81
|
+
),
|
|
82
|
+
phase_energy_motor_lut=ConfigServerEnergyMotorLookup(
|
|
83
|
+
lut_config=LookupTableColumnConfig(poly_deg=J09_PHASE_POLY_DEG_COLUMNS),
|
|
84
|
+
config_client=J09_CONF_CLIENT,
|
|
85
|
+
path=Path(LOOK_UPTABLE_DIR, PHASE_LOOKUP_FILE_NAME),
|
|
86
|
+
),
|
|
87
|
+
units="keV",
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
@devices.factory()
|
|
92
|
+
def jid_energy(
|
|
93
|
+
jid_controller: Apple2EnforceLHMoveController[UndulatorPhaseAxes],
|
|
94
|
+
) -> InsertionDeviceEnergy:
|
|
95
|
+
return InsertionDeviceEnergy(id_controller=jid_controller)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@devices.factory()
|
|
99
|
+
def jid_polarisation(
|
|
100
|
+
jid_controller: Apple2EnforceLHMoveController[UndulatorPhaseAxes],
|
|
101
|
+
) -> InsertionDevicePolarisation:
|
|
102
|
+
return InsertionDevicePolarisation(id_controller=jid_controller)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
@devices.factory()
|
|
106
|
+
def energy_jid(
|
|
107
|
+
jid_energy: InsertionDeviceEnergy, pgm: PlaneGratingMonochromator
|
|
108
|
+
) -> BeamEnergy:
|
|
109
|
+
"""Beam energy."""
|
|
110
|
+
return BeamEnergy(id_energy=jid_energy, mono=pgm.energy)
|