Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
(#1517) Make output pulse width equal to exposure time to ensure pcap…
Browse files Browse the repository at this point in the history
… capture correctly triggered
  • Loading branch information
rtuck99 committed Aug 12, 2024
1 parent aa7f8da commit 2ae1967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/hyperion/device_setup_plans/setup_panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

MM_TO_ENCODER_COUNTS = 200000
GENERAL_TIMEOUT = 60
DETECTOR_TRIGGER_WIDTH = 1e-4
TICKS_PER_MS = 1000 # Panda sequencer prescaler will be set to us


Expand Down Expand Up @@ -165,9 +164,7 @@ def setup_panda_for_flyscan(
wait=True,
)

yield from bps.abs_set(
panda.pulse[1].width, DETECTOR_TRIGGER_WIDTH, group="panda-config"
)
yield from bps.abs_set(panda.pulse[1].width, exposure_time_s, group="panda-config")

exposure_distance_mm = sample_velocity_mm_per_s * exposure_time_s

Expand Down
9 changes: 8 additions & 1 deletion tests/unit_tests/device_setup_plans/test_setup_panda.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import pytest
from bluesky.plan_stubs import null
from bluesky.run_engine import RunEngine
from bluesky.simulators import RunEngineSimulator
from bluesky.simulators import RunEngineSimulator, assert_message_and_return_remaining
from dodal.common.types import UpdatingDirectoryProvider
from dodal.devices.fast_grid_scan import PandAGridScanParams
from ophyd_async.panda import SeqTrigger
Expand Down Expand Up @@ -125,6 +125,13 @@ def test_setup_panda_correctly_configures_table(
msg for msg in msgs if not msg.kwargs.get("group", "").startswith("load-phase")
]

assert_message_and_return_remaining(
msgs,
lambda msg: msg.command == "set"
and msg.obj.name == "panda-pulse-1-width"
and msg.args[0] == exposure_time_s,
)

table_msg = [
msg
for msg in msgs
Expand Down

0 comments on commit 2ae1967

Please sign in to comment.