Skip to content

ViSR: plot types, final poll and scan status on top of the Enz Locum UI - #238

Merged
tomkane-dls merged 6 commits into
DiamondLightSource:enz-locumfrom
hyperrealist:visr-235-features
Oct 20, 2026
Merged

tomkane-dls merged 6 commits into
DiamondLightSource:enz-locumfrom
hyperrealist:visr-235-features

Conversation

@hyperrealist

@hyperrealist hyperrealist commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Builds on #235 with the spectroscopy plot features from the ViSR sprint (#227):

  • Positions (Setpoints / Readbacks) and Plot Type (Rectangles / Gaussian / Footprints) choices under Data Source. Readbacks are drawn by Tiled's /render, for the camera and the diodes.
  • The poll after a scan ends now happens, and retries on a 503, so the final image has the scan's last points.
  • A quiet status line under the plots (scanning, complete, last points still loading or missing, failed).
  • Unmeasured cells are drawn as the page background crossed by thin lines (in either theme), a single point at full brightness, and each cell between its bin edges, with axes in scan coordinates.

Needs the next dls-tiled release, with DiamondLightSource/dls-tiled#24 (diodes in /binned), DiamondLightSource/dls-tiled#25 (diodes in /render) and DiamondLightSource/dls-tiled#27 (the final poll gets fresh data). On the deployed 0.3.0 the camera works in every plot type, but the diodes don't.

To test: pnpm test in apps/visr; then run a scan and switch Data Source, Positions and Plot Type during and after it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR

hyperrealist and others added 6 commits October 19, 2026 14:14
The poll that should fetch a scan's last points once it finished never ran:
it was conditional on the poll interval still being set, but the previous
run of the effect had already cleared it. So the final image was whatever
the last regular poll got, up to half a second before the scan ended. It now
runs whenever a scan stops running.

/binned answers 503 with Retry-After while the data file is behind the
catalog. That was logged as a polling error; it is now treated as "not ready
yet": during a scan the next poll simply tries again, and the final poll,
which nothing follows, retries after the time the server asks for (up to 10
times).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR
A quiet line at the bottom right of the plots says where the plotted scan
is: "Scanning…", then "Scan complete", which fades out after a few seconds.
While the final poll waits on a 503 it says the last points are loading,
and if they never arrive, or the scan failed, it says so in the warning or
error colour and stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR
…dges

Cells no point had landed in yet were drawn black, the same as a measured
low value, so a scan in progress looked like dark data. They are now faint
diagonal stripes, one in the colour of the page behind the plots and one a
shade darker on a light page or lighter on a dark one, so they recede in
either theme. Each cell is drawn as 4x4 pixels to carry the pattern. A run
without diodes shows its diode plots as all stripes, the camera's shape.

A flat image (a single point, or all values equal) was scaled to black,
since its range is zero; it is now drawn at full brightness.

The plots were drawn in pixel numbers, without axes. They now get /binned's
bin edges as axes, so each cell sits between its own edges in scan
coordinates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR
…n or footprints

A Plot Type choice under Data Source picks the drawing, with a tooltip on
what each shows. Setpoint grid is /binned's grid as before; the others come
from Tiled's /render, drawn over the scan's extent at 200 px on its longer
side: a step-sized rectangle at each recorded position (Readbacks), a
beam-sized Gaussian on each point, or each point's beam footprint with
overlaps split between neighbours. Both data sources work in every drawing.
Where /render drew nothing, or covered a pixel only partly, it fades into
the empty-cell stripes, so gaps the beam left stay visible.

Gaussian and footprints use the beam size the run records. No run records
one yet, so /render falls back to one scan step, and a note under the plots
says so, with the size used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR
The drawing is now two choices of one line each. Positions: Setpoints (the
scan's grid, each cell the mean of the points read back in it) or Readbacks
(each point where the motors read back). Plot Type: Rectangles, Gaussian or
Footprints. Gaussian and footprints only make sense at the readback
positions, so on the setpoint grid they are greyed out and the grid's cells
show as rectangles; the shape picked for readbacks is kept meanwhile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR
The empty cells' 2-pixel stripes were hard to tell from dark data in the
dark theme. They are now the page's background crossed by thin diagonal
lines, lighter than a dark background and darker than a light one.
For lines that thin, the setpoint grid is drawn at least 240 pixels on its
longer side (and at least 4 per cell), with the axes split to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BsMDFhupHcBFbVJPK8QAvR

@tomkane-dls tomkane-dls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice new features. I will merge this into my branch and we can continue more specific discussion on there in one location, and i think we should definitely get Emily and Douglas' input before merging this onto main. If we get the enz locum working fully today we can deploy off an alpha tag for the demo

@tomkane-dls
tomkane-dls merged commit f90a8fa into DiamondLightSource:enz-locum Oct 20, 2026
2 checks passed
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