Skip to content
Draft
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions src/dodal/beamlines/i11.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
from pathlib import Path

from dodal.common.beamlines.beamline_utils import (
device_factory,
get_path_provider,
set_path_provider,
)
from dodal.common.beamlines.beamline_utils import set_beamline as set_utils_beamline
from dodal.common.beamlines.device_helpers import DET_SUFFIX
from dodal.common.visit import RemoteDirectoryServiceClient, StaticVisitPathProvider
from dodal.devices.cryostream import OxfordCryoStream
from dodal.devices.eurotherm import (
EurothermGeneral,
Expand All @@ -30,6 +34,19 @@
set_log_beamline(BL)
set_utils_beamline(BL)

# Currently we must hard-code the visit, determining the visit at runtime requires
# infrastructure that is still WIP.
# Communication with GDA is also WIP so for now we determine an arbitrary scan number
# locally and write the commissioning directory. The scan number is not guaranteed to
# be unique and the data is at risk - this configuration is for testing only.
set_path_provider(
StaticVisitPathProvider(
BL,
Path(f"/dls/{BL}/data/2025/cm40625-4/bluesky"),
client=RemoteDirectoryServiceClient(f"http://{BL}-control:8088/api"),
)
)


@device_factory()
def mythen3() -> Mythen3:
Expand Down
5 changes: 4 additions & 1 deletion src/dodal/devices/i11/mythen.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ def get_deadtime(self, exposure: float | None) -> float:

async def prepare(self, trigger_info: TriggerInfo) -> None:
if (exposure := trigger_info.livetime) is not None:
await self._driver.acquire_time.set(exposure)
await asyncio.gather(
self._driver.acquire_time.set(exposure),
self._driver.acquire_period.set(exposure + self.get_deadtime(exposure)),
)

if trigger_info.trigger is DetectorTrigger.INTERNAL:
await self._driver.trigger_mode.set(Mythen3TriggerMode.INTERNAL)
Expand Down