Skip to content

Add: Data from diodes, readback/setpoint, plot tools, scan update - #235

Merged
tomkane-dls merged 12 commits into
mainfrom
enz-locum
Nov 9, 2026
Merged

tomkane-dls merged 12 commits into
mainfrom
enz-locum

Conversation

@tomkane-dls

Copy link
Copy Markdown
Contributor

No description provided.

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

@hyperrealist hyperrealist left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should work as is, and it is interoperable with the now deployed dls-tiled 0.4.0. But please review #238 and merge it to this branch first before you merge this.

claude:

What was checked, and small notes (most addressed in #238)

Checked

  • Merged with current main (incl. the tomography threshold change), it merges cleanly and type-checks, tests, lints and builds.
  • Against dls-tiled 0.4.0 (deployed on b01-1), /binned returns DiodesRed/DiodesGreen/DiodesBlue for runs with diodes and null for runs without, which this handles.

Notes

  • The coverage check fails: ViSR coverage drops 1.08% → 1.03% because the new code has no tests. #238 adds tests for it.
  • DiodesRed/DiodesGreen/DiodesBlue are typed number[][], but are null for a run without diodes. It works at runtime (toRgbNdt falls back to the placeholder), but the type should allow null. Fixed in #238.
  • With Diodes selected, a run without diodes shows the small black placeholder, which reads as dark data. #238 draws it as empty cells instead.
  • The MSW mocks have no Diodes* data, so the Diodes view is empty in mock mode.
  • SliceViewer now keeps its own copy of enum Plane, which has to stay in the same order as plane.tsx.

ViSR: plot types, final poll and scan status on top of the Enz Locum UI
@tomkane-dls tomkane-dls changed the title Fetch Enz locum data and allow switching between datasets Add: Data from diodes, readback/setpoint, plot tools, scan update Oct 20, 2026
@tomkane-dls
tomkane-dls marked this pull request as ready for review October 20, 2026 09:11
ViSR: create shared state hook, apply to all controls
@tomkane-dls

Copy link
Copy Markdown
Contributor Author

I've merged in a PR that repurposes abigail's code allowing sliceviewer's controls to persist across tabs, and applying it to the new controls here, as it was tightly coupled with whats on this one

Make the Positions and Plot Type help text user-facing (no "spec" or
"setpoint grid" jargon), add tooltips to the Data Source options, and
say "beam footprint" rather than "beamline footprint" in the beam size
warning.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@hyperrealist

Copy link
Copy Markdown
Collaborator

@EmsArnold could you take another look at the tooltips?

@EmsArnold

Copy link
Copy Markdown
Contributor

Tooltip changes look great, thanks!

The only other thing I noticed was that you can make the dividing line cut through buttons (on both the spectroscopy page and the tomography page) if you make the width of your browser sufficiently small. I'm not sure this is an issue given we always aim to have the same size window, but may be something which needs to be looked at in the future.

Screenshot from 2026-11-05 07-51-59

@tomkane-dls

Copy link
Copy Markdown
Contributor Author

Tooltip changes look great, thanks!

The only other thing I noticed was that you can make the dividing line cut through buttons (on both the spectroscopy page and the tomography page) if you make the width of your browser sufficiently small. I'm not sure this is an issue given we always aim to have the same size window, but may be something which needs to be looked at in the future.
Screenshot from 2026-11-05 07-51-59

Yes Abigail and I noticed this, it's now visible on this PR because we added controls for spectroscopy, but it was already introduced for tomography on a previous branch. Once things have settled I will try and come up with a good solution for this

@tomkane-dls
tomkane-dls merged commit f473fa0 into main Nov 9, 2026
2 checks passed
@tomkane-dls
tomkane-dls deleted the enz-locum branch November 9, 2026 11:13
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.

3 participants