Skip to content

Commit

Permalink
initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Sep 18, 2024
1 parent 307ce62 commit e7c72ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/ophyd_async/epics/advimba/_vimba_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ def get_deadtime(self, exposure: float | None) -> float:
return 0.001

async def prepare(self, trigger_info: TriggerInfo):
frames: int = 0
if type(trigger_info.number) is list:
frames = sum(trigger_info.number)
elif type(trigger_info.number) is int:
frames = trigger_info.number
await asyncio.gather(
self._drv.trigger_mode.set(TRIGGER_MODE[trigger_info.trigger]),
self._drv.exposure_mode.set(EXPOSE_OUT_MODE[trigger_info.trigger]),
self._drv.num_images.set(trigger_info.number),
self._drv.num_images.set(frames),
self._drv.image_mode.set(adcore.ImageMode.multiple),
)
if trigger_info.livetime is not None and trigger_info.trigger not in [
Expand Down
7 changes: 6 additions & 1 deletion src/ophyd_async/epics/eiger/_eiger_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@ async def set_energy(self, energy: float, tolerance: float = 0.1):
await self._drv.photon_energy.set(energy)

async def prepare(self, trigger_info: TriggerInfo):
frames: int = 0
if type(trigger_info.number) is list:
frames = sum(trigger_info.number)
elif type(trigger_info.number) is int:
frames = trigger_info.number
coros = [
self._drv.trigger_mode.set(
EIGER_TRIGGER_MODE_MAP[trigger_info.trigger].value
),
self._drv.num_images.set(trigger_info.number),
self._drv.num_images.set(frames),
]
if trigger_info.livetime is not None:
coros.extend(
Expand Down
1 change: 1 addition & 0 deletions src/ophyd_async/plan_stubs/_fly.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def prepare_static_seq_table_flyer_and_detectors_with_same_trigger(
shutter_time: float,
repeats: int = 1,
period: float = 0.0,
frame_timeout: float | None = None,
):
"""Prepare a hardware triggered flyable and one or more detectors.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async def prepare(self, trigger_info: TriggerInfo):
async def arm(self):
assert self._trigger_info.livetime
assert self.period

self.task = asyncio.create_task(
self._coroutine_for_image_writing(
self._trigger_info.livetime, self.period, self._trigger_info.number
Expand Down

0 comments on commit e7c72ba

Please sign in to comment.