Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions src/dodal/beamlines/i19_optics.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
from functools import cache

from daq_config_server import ConfigClient
from ophyd_async.epics.motor import Motor

from dodal.common.beamlines.beamline_utils import (
set_beamline as set_utils_beamline,
)
from dodal.common.beamlines.beamline_utils import (
set_config_client,
)
from dodal.device_manager import DeviceManager
from dodal.devices.attenuator.filter import FilterWheel
from dodal.devices.attenuator.filter_selections import I19FilterOneSelections
Expand All @@ -18,6 +24,7 @@
from dodal.devices.focusing_mirror import FocusingMirrorWithPiezo
from dodal.devices.hutch_shutter import InterlockedHutchShutter
from dodal.devices.interlocks import PSSInterlock
from dodal.devices.undulator import UndulatorInKeV
from dodal.log import set_beamline as set_log_beamline
from dodal.utils import BeamlinePrefix

Expand All @@ -26,16 +33,25 @@
set_log_beamline(BL)
set_utils_beamline(BL)

# For the moment pointing to the daq_configuration path in i19-1 which has links to the
# common optics configuration, as it's already present in the daq-config-server.
# The correct path will have to wait for this PR
# https://github.com/DiamondLightSource/daq-config-server/pull/186 to be merged and
# a subsequent release
DAQ_CONFIGURATION_PATH = "/dls_sw/i19-1/software/daq_configuration"
ID_GAP_LOOKUP = (
f"{DAQ_CONFIGURATION_PATH}/lookup-shared/energy_to_id_gap_look_up_table.txt"
)

devices = DeviceManager()


@devices.factory()
def dcm() -> DoubleCrystalMonochromatorWithDSpacing:
return DoubleCrystalMonochromatorWithDSpacing(
prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:",
xtal_1=StationaryCrystal,
xtal_2=PitchAndRollCrystal,
)
@devices.fixture
@cache
def config_client() -> ConfigClient:
client = ConfigClient()
set_config_client(client)
return client


@devices.factory()
Expand Down Expand Up @@ -88,6 +104,15 @@ def attenuator_y_motor() -> Motor:
return Motor(f"{PREFIX.beamline_prefix}-OP-ATTN-05:Y", "attenuator_y")


@devices.factory()
def dcm() -> DoubleCrystalMonochromatorWithDSpacing:
return DoubleCrystalMonochromatorWithDSpacing(
prefix=f"{PREFIX.beamline_prefix}-MO-DCM-01:",
xtal_1=StationaryCrystal,
xtal_2=PitchAndRollCrystal,
)


# Temporarily skipping as the IOC is being worked on and not in use
@devices.factory(skip=True)
def filter_wheel() -> FilterWheel:
Expand Down Expand Up @@ -143,6 +168,15 @@ def shutter() -> InterlockedHutchShutter:
)


@devices.factory()
def undulator(config_client: ConfigClient) -> UndulatorInKeV:
return UndulatorInKeV(
f"{BeamlinePrefix(BL).insertion_prefix}-MO-SERVC-01:",
config_client=config_client,
id_gap_lookup_table_path=ID_GAP_LOOKUP,
)


@devices.factory()
def vfm() -> FocusingMirrorWithPiezo:
"""Device factory for the I19 Vertical Focus Mirror (VFM) Piezo Device.
Expand Down
Loading