Skip to content

uipsf M2 pairs: scripts for the tilt, the focus drift and the score per height - #167

Merged
jries merged 6 commits into
mainfrom
claude/vigilant-johnson-ns061k
Nov 15, 2026
Merged

jries merged 6 commits into
mainfrom
claude/vigilant-johnson-ns061k

Conversation

@jries

@jries jries commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

These scripts test the open hypotheses of "In situ against molecule stacks on M2" (docs/uipsf/architecture.md) from the molecules' heights alone, without a tilt in the pupil. All are in benchmarks/uipsf/real/m2_pairs/, and each docstring says how to call it and how to read the result.

  • heights.py: localises every molecule of the nucleus movie (used, held out, not drawn) once per model, from five starting heights as cross_score.py does, and saves heights_<model>.npz: height, CRLB, ½ Σ deviance, chip position and frame.
  • tilt_from_edge.py: fits the coverslip's edge per tile of the field and a weighted plane through the tiles. A real tilt of 1.6° would be about 28 nm per µm, about 700 nm across the field. With --stack it prints the molecule stack's own focal-plane slope beside it.
  • edge_vs_time.py: fits the edge per block of the 72 000 frames with one model held, to show focus drift.
  • score_by_height.py: scores two models on the same unseen molecules per height bin, to show where each pupil fits better.
  • The architecture doc gets a short paragraph listing them as the next step.

Checked here

  • On synthetic files: a planted 1.6° tilt reads as 1.63°, a file without tilt as 0.01°. A planted drift of 5.6 nm per 10 000 frames reads as 4.9 ± 0.5, and a height-dependent score difference is recovered per bin.
  • heights.py on a small simulated movie (uipsf.movie): 71 units, heights 0–1050 nm, the edge 21 ± 16 nm from 0.
  • ruff check benchmarks/uipsf/real/m2_pairs is clean.

Tests

--slow was not run. This PR adds only benchmark scripts and documentation, and no test covers benchmark scripts. The scripts have not been run on M2's data, which are not in git ($M2_DATA); they are meant to be run on the studio.


Generated by Claude Code

…eplaces it

The plugin (Localize/Bead calibration), its window (calibrate/qt_gui.py), its
assistant actions and its pages are removed.  The bead average is the PSF
calibration window's, which already had every page, the bead table and the
assistant's actions; its method's explanation moves to a widgetless help page,
Panels/Bead average.  smappy-calibrate opens the PSF calibration window
(headless --out unchanged).  The tests of the use_calibration hand-over and of
the bead settings' forms are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JegwAEzHHExiXkwvXgA2j
…est tested on the minimal pupil

From round 2, once the coverslip edge has set the focus, a unit localised more than
3 errors below the coverslip (its CRLB times the edge's scatter factor, with the
edge's own error) is not chosen (`insitu_rounds.below_coverslip`,
`RoundSettings.below_coverslip_sd`): the z bins below 0 had filled with molecules
the model placed badly.  The twin test already mirrored held modes; a test now pins
it for the minimal pupil, in situ's default.  The roadmap's in situ line and the
architecture's known flaws brought up to date.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JegwAEzHHExiXkwvXgA2j
…U-only PyTorch beside an NVIDIA card

The line Detect writes now ends with where learning runs (uipsf.device.describe: the
graphics card by name, Apple's GPU or the CPU).  A torch built for the CPU only on a
machine with an NVIDIA card (torch_install.cpu_build_on_nvidia, from its version's local
label: a plain pip install on Windows brings it) learnt on the CPU without a word; the
window now says so and offers Install PyTorch, whose command then reinstalls the card's
build from the CUDA index (command(replace=True)), and asks for a restart where the old
build is already loaded.  Neither blocks a run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JegwAEzHHExiXkwvXgA2j
…er height, from the molecules' heights

heights.py localises every molecule of the nucleus movie once per model and saves height, CRLB,
½ Σ deviance, chip position and frame; tilt_from_edge.py fits the coverslip's edge per tile and a
plane through it (a real 1.6° tilt is ~28 nm per µm), edge_vs_time.py the edge per block of frames,
score_by_height.py two models' scores per height bin on the unseen molecules.  Smoke-tested here on
synthetic files (a planted 1.6° tilt read as 1.63°, a planted drift and a height-dependent score
recovered) and heights.py on a small simulated movie; not yet run on M2's data, which are not in git.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014JegwAEzHHExiXkwvXgA2j
@jries
jries merged commit dfa3166 into main Nov 15, 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.

2 participants