Skip to content

PSF calibration: open a saved calibration again; flag a bead diameter of 0; Help pages on white - #180

Merged
jries merged 2 commits into
mainfrom
claude/psf-cal-bead-diameter
Nov 17, 2026
Merged

jries merged 2 commits into
mainfrom
claude/psf-cal-bead-diameter

Conversation

@jries

@jries jries commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

What changed

Open calibration... (PSF calibration window). A calibration and its bead stacks part ways (copied elsewhere, stacks archived), and its results could then not be seen again. A saved run of the pupil model or the bead average, one channel or two, now keeps in its file a group of its own (psf_window, calibrate/saved_run.py, a few hundred kB):

  • the settings of every section the method read;
  • each stack's path, its path relative to the calibration and its size;
  • the bead table as shown and where each bead was;
  • Model vs data's averaged data and model (not the single beads: those are the stacks');
  • the fit quality;
  • for the pupil model, uipsf's bead rows (the Beads page) and the start from model, as a uipsf model group (psf_window_start);
  • the resolved camera, versions and date.

It is written after every save, Save as... and Uncertainty from halves..., and by the plugin's headless run. Opening a file sets sample, method, mode and settings, and draws every page from the file alone. The stacks go back into the file list where they are found: where they were, at the same place relative to the calibration, or (asked) by name and size in a folder the user picks. Cancel shows the file alone; if only some are found, none are added. With the stacks, Calibrate makes the calibration again. A file from before this change, or from another method, says that only its spline can be used.

  • uipsf.load_model(..., group=): reads a model from a named group, for the start model.
  • The assistant gets PSF calibration/Open calibration (gui/window_actions.py).

Bead diameter of 0. 0 stays the default (40 and 100 nm beads are both in use), but it is rarely right. With beads, bead diameter's label is red while it is 0, the plugin's form shows a notice, and a run puts it in the warning line (pupil.bead_size_warning). Also fixed: the plugin's form notice for an unknown method was a plain string, not a Notice.

Help window. The app-wide stylesheet painted read-only text edits in the window's grey over the white base the Help window set, so pages were read at less contrast. A stylesheet on the browser itself fixes it.

For the reviewer

  • Not kept: the bead average's Overview, Bead diagnostics, Transformation and Field diagnostics (they need the whole averaging result); marks made by hand (marking needs a fresh detection). In situ, molecules, 4Pi and elliptical Gaussian files are not recorded.
  • File > Open on a calibration .h5 does not route to the window yet.
  • Docs: the PSF calibration panel page (Open calibration..., what the file keeps, bead diameter), a CLAUDE.md line.

Tests

New tests/test_saved_run.py: the tree round trip, finding moved stacks, a bead average opened from its file, the window's open with stacks, with Cancel and from a chosen folder, the bead-diameter flag. The long pupil-model test also opens its saved run and a start-model group.

--slow -n 4: 4709 passed, 84 skipped
--long: test_the_pupil_model_learns_from_the_beads_without_the_window passed (the only long test touched)

🤖 Generated with Claude Code

jries and others added 2 commits November 17, 2026 14:46
The application's stylesheet paints every read-only text edit in the window's
grey, over the white base the Help window set in its palette: the pages were
read at less contrast.  A stylesheet on the browser itself wins.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lagged

Open calibration...: a calibration and its bead stacks part ways, and its
results could not be seen again.  A saved pupil model or bead average (one
channel or two) now keeps, in a group of its own (calibrate/saved_run.py), the
settings, where each stack was, the bead table, the averaged model against the
data, the fit quality, and for the pupil model its bead map and start model.
Opened, every page draws from the file alone; the stacks come back where they
were, beside the calibration, or from a folder the user picks (Cancel: the file
alone).  uipsf's load_model reads a model from a named group, for the start.
The assistant has it as a window action.

Bead diameter: 0 stays the default (40 and 100 nm beads are both in use), but
with beads its label is red while it is 0, the plugin's form says so, and a
run warns.  The plugin's form notice for an unknown method is a Notice now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jries
jries merged commit 3dae625 into main Nov 17, 2026
6 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.

1 participant