Skip to content

Profile conversion 5b: xrd_jog - #12

Merged
Anthony Sligar (sligara7) merged 1 commit into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-05b-jog
Oct 23, 2026
Merged

Anthony Sligar (sligara7) merged 1 commit into
NSLS2:pdf-profile-conversionfrom
sligara7:pdf-conv-05b-jog

Conversation

@sligara7

Copy link
Copy Markdown

Ports the old jog/rocking_ct (70-jog_scans.py) as xrd_jog in pdftools.xrd, loaded into the profile session.

Each image is taken while the motor sweeps from one end to the other at the speed that makes the sweep last one averaged image (exposure_time × images_to_average); the next image sweeps back. start == stop takes images without moving. The motor's velocity is restored and fs closed afterwards, also on failure.

Verified: mock tests (tests/test_xrd_jog.py: sweep targets and velocities, no-travel case, restore on a detector fault). Not run on the beamline.

Port of pdf-profile-collection jog/rocking_ct (70-jog_scans.py) onto the ophyd-async detectors: the sweep lasts one averaged image, alternates direction, and the motor velocity is restored afterwards.

Assisted-by: copilot:claude-opus-5-5
Copilot AI balanced review requested due to automatic review settings October 23, 2026 23:13
@sligara7
Anthony Sligar (sligara7) merged commit 377dfad into NSLS2:pdf-profile-conversion Oct 23, 2026
4 checks passed
@sligara7
Anthony Sligar (sligara7) deleted the pdf-conv-05b-jog branch October 23, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Failure cleanup can restore velocity during an active sweep or skip restoration when shutter closure fails.

2 open issues
What changed in this PR

Ports the legacy jog acquisition plan into pdftools.xrd as xrd_jog and makes it available in the collection profile.

Changes:

  • Adds alternating motor sweeps timed to averaged images, plus a no-travel mode.
  • Adds shutter handling and motor-velocity restoration.
  • Adds mock tests for sweep behavior, no-travel acquisition, and detector-failure cleanup.
File Description
tests/​test_xrd_jog.py Tests acquisition behavior and failure cleanup.
src/​pdftools/​xrd.py Implements the xrd_jog acquisition plan.
src/​pdftools/​profiles/​collection.py Exposes xrd_jog in the profile session.

Review effort: Balanced

Comment thread src/pdftools/xrd.py
Comment on lines +405 to +406
yield from bps.trigger_and_read(list(detectors))
yield from bps.wait(group=group)
Comment thread src/pdftools/xrd.py
Comment on lines +417 to +419
if use_shutter:
yield from bps.mv(shutter, "Close")
yield from bps.mv(motor.velocity, velocity)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants