You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ports the old xrd_map (71-map_scans.py) to pdftools.xrd, loaded into the profile session. Same arguments and terms as before (dwell_time, backoff, snake, fly_*/step_*).
One run; each row steps step_motor, then flies fly_motor across at the speed that spends dwell_time per pixel, one event per pixel with start_<fly>/stop_<fly> positions (same field names, dimensions hint and sp_* metadata as before). As configure_area_det did, a continuous-acquisition detector sums ceil(dwell_time / frame time) frames per pixel, and a dwell shorter than one frame is refused. The shutter is closed while the motors reposition; the fly velocity is restored afterwards, also on failure.
Changed from the old plan:
Optional frame_time sets the frame time (the old plan used whatever glbl['frame_acq_time'] had set).
Repositions at the motor's own velocity, not a hard-coded 10.
No 2 s sleep after opening (fs has its own settle time).
Detectors and shutter are passed in (shutter defaults to fs).
In-map darks (dark_plan, off by default, via bluesky_darkframes) are not ported; run xrd_dark before the map.
Verified: mock tests (tests/test_xrd_map.py: snake and typewriter paths, frames per dwell and fly speed, frame-time override, too-short dwell refused before anything moves, shutter closed for every reposition, restore on a detector fault). Not run on the beamline.
Port of pdf-profile-collection xrd_map (71-map_scans.py) onto the ophyd-async detectors: one run, one event per pixel with the fly motor's start/stop positions, snake or typewriter rows, the shutter closed while the motors reposition, and the fly velocity restored afterwards. In-map darks are not ported.
Assisted-by: copilot:claude-opus-5-5
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Backoff handling can misplace acquisition, while shutter timing and cleanup failures can cause unnecessary exposure or leave the fly velocity unrestored.
dwell_time is again the total time per pixel; continuous-acquisition detectors sum ceil(dwell_time / frame time) frames, a dwell shorter than one frame is refused, and an optional frame_time sets the frame time, as configure_area_det did.
Assisted-by: copilot:claude-opus-5-5
…ection, close before the overshoot
Images now start once the fly motor crosses the row start, so the backoff no longer eats pixels; the first backoff takes its sign from the fly direction; the shutter closes after each row's last image. Cleanup in xrd_map, xrd_jog and xrd_scan restores velocity/position even if closing the shutter fails. Found by Copilot review on NSLS2#14; the first two were in the old plan too.
Assisted-by: copilot:claude-opus-5-5
Validate detector frame-time agreement before applying dwell time
src/pdftools/xrd.py:613
With frame_time=None, only the first continuous-acquisition detector's frame time is read, but _body() applies it to every detector. Panels initially at 0.1 s and 0.2 s therefore both become 0.1 s, accepting a 0.15 s dwell that is shorter than the second panel's existing frame time. Validate that their current frame times agree, and require an explicit frame_time override before changing mismatched panels.
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
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 the old
xrd_map(71-map_scans.py) topdftools.xrd, loaded into the profile session. Same arguments and terms as before (dwell_time,backoff,snake,fly_*/step_*).One run; each row steps
step_motor, then fliesfly_motoracross at the speed that spendsdwell_timeper pixel, one event per pixel withstart_<fly>/stop_<fly>positions (same field names,dimensionshint andsp_*metadata as before). Asconfigure_area_detdid, a continuous-acquisition detector sumsceil(dwell_time / frame time)frames per pixel, and a dwell shorter than one frame is refused. The shutter is closed while the motors reposition; the fly velocity is restored afterwards, also on failure.Changed from the old plan:
frame_timesets the frame time (the old plan used whateverglbl['frame_acq_time']had set).fshas its own settle time).shutterdefaults tofs).dark_plan, off by default, viabluesky_darkframes) are not ported; runxrd_darkbefore the map.Verified: mock tests (
tests/test_xrd_map.py: snake and typewriter paths, frames per dwell and fly speed, frame-time override, too-short dwell refused before anything moves, shutter closed for every reposition, restore on a detector fault). Not run on the beamline.