Repository navigation
Add XRD count, dark and scan plans - #10
Merged
Anthony Sligar (sligara7) merged 1 commit intoOct 23, 2026
Merged
Anthony Sligar (sligara7) merged 1 commit into
Anthony Sligar (sligara7) merged 1 commit into
Conversation
pdftools.xrd ports hextools#110 (986fd54): xrd_count, xrd_dark and xrd_scan, with PDF's fast shutter fs instead of HEX's front-end/photon shutters, internal triggering only, and the detectors passed explicitly. pdftools.utils gains ensure_available. The Perkin Elmer test mock moves to conftest and now passes PostCount/NumFilter frames per circular-buffer trigger, as the IOC does; the one-frame-per-trigger mock could not model more than one image per event. Assisted-by: copilot:claude-opus-5-5
Anthony Sligar (sligara7)
merged commit Oct 23, 2026
bb4b79b
into
NSLS2:pdf-profile-conversion
4 checks passed
There was a problem hiding this comment.
🟡 Changes recommended
Continuous-acquisition startup handling and averaging timeouts can abort otherwise valid acquisitions.
2 open issues
What changed in this PR
Adds XRD count, dark, and motor-scan plans to PDF’s collection session, adapting the hextools plans for explicit detector selection and PDF’s fast shutter.
Changes:
- Adds acquisition plans with frame averaging, repeated runs, and shutter cleanup.
- Adds session-object lookup for the default shutter.
- Introduces a shared Perkin Elmer mock and tests acquisition documents, shapes, and failure cleanup.
| File | Description |
|---|---|
tests/test_xrd.py |
Tests XRD acquisition and cleanup behavior. |
tests/conftest.py |
Adds a shared mock supporting multiple frames per trigger. |
src/pdftools/xrd.py |
Implements XRD plans and continuous-acquisition exposure setup. |
src/pdftools/utils/__init__.py |
Adds typed session-object lookup helpers. |
src/pdftools/profiles/collection.py |
Exposes XRD plans in the collection session. |
Review effort: Balanced
Comment on lines
+53
to
+54
| # A busy record: waiting on it would block until acquisition stops. | ||
| yield from bps.abs_set(detector.driver.acquire, True, wait=False) |
| trigger_info = TriggerInfo( | ||
| trigger=DetectorTrigger.INTERNAL, | ||
| livetime=exposure_time, | ||
| exposures_per_collection=images_to_average, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Ports hextools#110 (
986fd54, still open there) aspdftools.xrd:xrd_count,xrd_dark,xrd_scan,ensure_cont_acq_exposure. Loaded into the profile session.PDF changes from the hextools version:
xrd_count([pe1c], 0.2, ...)); PDF has four.fs(session's if not given): opened for count/scan, closed after (also on failure); darks close it first and never open it. No front-end/photon shutter check.pdftools.utils.ensure_availableported from hextools.Test mock: the Perkin Elmer mock moves to
conftest.py(pe) and passesPostCount // NumFilterframes per circular-buffer trigger, as the IOC does; the old one-frame mock could not model more than one image per event.Verified: mock tests (count/dark/scan documents and shapes, frame averaging, shutter commands, motor reset and shutter close on failure). Not run on the beamline.