From 447d22056ca071ed018951b86793cc89de4e50b3 Mon Sep 17 00:00:00 2001 From: Jonas Ries Date: Sun, 15 Nov 2026 13:13:01 +0100 Subject: [PATCH 1/2] =?UTF-8?q?uipsf:=20the=20M2=20cross-check=20--=20in?= =?UTF-8?q?=20situ=20at=20order=206=20with=20=CE=B3=20and=20the=20modes=20?= =?UTF-8?q?above=20held=20from=20the=20molecule=20stack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit insitu_start_o6_edge_n1345_ab_n1345: Z6 61.3 (stack 56.6, order 8 71.9), Z11 29.5 (24.2, 55.1), Z12 6.2, x coma 24.7 / 14.4 (4.6 / 1.7), focus 537 nm (stack held 420, order 8 682). Held-out: +2.32 nats per molecule on the stack's (order 8 +4.51), -1.61 on the movie's held out (-1.75), +1.09 on its surplus (+0.36). Most of the low-order excess was the modes above order 6's; x coma and the gap remain. Co-Authored-By: Claude Opus 5.5 --- benchmarks/uipsf/results/m2_pairs_cross.jsonl | 1 + docs/uipsf/architecture.md | 27 +++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/benchmarks/uipsf/results/m2_pairs_cross.jsonl b/benchmarks/uipsf/results/m2_pairs_cross.jsonl index 09d1eeb4..82cf90db 100644 --- a/benchmarks/uipsf/results/m2_pairs_cross.jsonl +++ b/benchmarks/uipsf/results/m2_pairs_cross.jsonl @@ -4,3 +4,4 @@ {"model": "ab_n1345", "insitu_molecules": 4328, "insitu_per_molecule": 289.21257501344803, "insitu_vs_first_per_molecule": 0.0, "insitu_vs_first_median": 0.0, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 302.4556099245901, "insitu_held_out_vs_first_per_molecule": 0.0, "insitu_held_out_vs_first_median": 0.0, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 288.49316044945664, "insitu_not_drawn_vs_first_per_molecule": 0.0, "insitu_not_drawn_vs_first_median": 0.0, "run": "tilted, in situ set only"} {"model": "insitu_start_edge_n1345_tilt_s315_ab_n1345", "insitu_molecules": 4328, "insitu_per_molecule": 291.1579490915464, "insitu_vs_first_per_molecule": 1.9453740780983746, "insitu_vs_first_median": 1.2657928466796875, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 301.2095277384258, "insitu_held_out_vs_first_per_molecule": -1.2460821861643427, "insitu_held_out_vs_first_median": -0.9002685546875, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 290.6119071821057, "insitu_not_drawn_vs_first_per_molecule": 2.1187467326490657, "insitu_not_drawn_vs_first_median": 1.33172607421875, "run": "tilted, in situ set only"} {"model": "insitu_all_n1345_tilt_s315_ab_n1345", "insitu_molecules": 4328, "insitu_per_molecule": 290.6412511568193, "insitu_vs_first_per_molecule": 1.4286761433712436, "insitu_vs_first_median": 0.5044403076171875, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 302.2358502443596, "insitu_held_out_vs_first_per_molecule": -0.2197596802305213, "insitu_held_out_vs_first_median": -0.2793731689453125, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 290.0113862124779, "insitu_not_drawn_vs_first_per_molecule": 1.51822576302123, "insitu_not_drawn_vs_first_median": 0.51824951171875, "run": "tilted, in situ set only"} +{"model": "insitu_start_o6_edge_n1345_ab_n1345", "stack_molecules": 553, "stack_per_molecule": 231.74632991632114, "stack_vs_first_per_molecule": 2.317043449305281, "stack_vs_first_median": 0.559814453125, "insitu_molecules": 4328, "insitu_per_molecule": 290.1584505832129, "insitu_vs_first_per_molecule": 0.9458755697648759, "insitu_vs_first_median": -0.0778961181640625, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 300.8473813865217, "insitu_held_out_vs_first_per_molecule": -1.6082285380684207, "insitu_held_out_vs_first_median": -1.562835693359375, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 289.5777851583316, "insitu_not_drawn_vs_first_per_molecule": 1.084624708874943, "insitu_not_drawn_vs_first_median": 0.0195770263671875, "run": "order 6 cross-check"} diff --git a/docs/uipsf/architecture.md b/docs/uipsf/architecture.md index 892c75c5..136f483b 100644 --- a/docs/uipsf/architecture.md +++ b/docs/uipsf/architecture.md @@ -2545,6 +2545,7 @@ fits better): |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| | stack `ab_n1345` | −4.0 | 56.6 | −3.6 | 4.6 | 24.2 | 0.2 | 1.7 | 7.4 | −4.1 | 0.122 (learnt) | 31.5 | per sweep | 75 ± 4 (68 refit) | 0 | 0 / 0 (focus 420, σ 39.5) | | in situ, edge, n 1.345 | −2.2 | 71.9 | −3.5 | 41.3 | 55.1 | 17.4 | 30.6 | 34.4 | 17.5 | 0.122 (held) | 38.8 | 682 | (151 refit) | +4.51 | −1.75 / +0.36 | +| in situ, edge, order 6, n 1.345 | −6.0 | 61.3 | 0.7 | 24.7 | 29.5 | 6.2 | 14.4 | 10.0 | −4.1 (held) | 0.122 (held) | 36.1 | 537 | (200 refit, the bound) | +2.32 | −1.61 / +1.09 | | in situ free, n 1.33 | −1.7 | 86.7 | −5.8 | 49.8 | 80.8 | 30.7 | 35.0 | 50.4 | 22.7 | 0.068 (held) | 36.3 | 1052 | (200 refit, the bound) | +8.43 | −2.75 / +0.50 | | in situ, edge + tilt, σ held | −4.7 | 57.8 | −22.9 | 9.9 | 37.7 | −0.1 | 0.5 | 12.6 | 3.3 | 0.122 (held) | 31.5 (held) | 1220 | – | – | −1.25 / +2.12 | | beads | −4.1 | 57.8 | −5.5 | −3.3 | 21.4 | −0.5 | −6.5 | 3.6 | – | 0.102 (learnt) | 50.8 | – | – | – | – | @@ -2628,8 +2629,30 @@ this is not yet a clean test of linearity. - *The stack's h of 75 nm*: AF647 on the glass should sit a few nm up. Yet learnt h stays at 34-98 nm in every variant, and the in situ pupils push it higher still. The supercritical ring's brightness is how h is told, and the magnitude and γ trade with it. -- *The cross-check of item 9's next step*: in situ with γ and the phase above order 6 held from the stack model. - Running when this was written (`insitu_o6_edge_n1345_ab_n1345`). +- *The cross-check*: in situ with γ and the phase above order 6 held from the stack model. + The order-6 cross-check is `insitu_start_o6_edge_n1345_ab_n1345`. It holds the stack model's γ and + every phase mode above order 6, takes the focus from the edge, uses n 1.345, and took 70 min. It closes + most of the low-order gap: + + | Noll | order 6, held | order 8 | stack | + |---|---|---|---| + | Z6, astigmatism | 61.3 | 71.9 | 56.6 | + | Z11, primary spherical | 29.5 | 55.1 | 24.2 | + | Z12 | 6.2 | 17.4 | 0.2 | + | Z8, x coma | 24.7 | 41.3 | 4.6 | + | Z16, x coma | 14.4 | 30.6 | 1.7 | + + - Of the low orders, x coma closes the least. Z22, though it sits within order 6, is 10.0 against the + stack's 7.4. + - The focus is 537 nm, between the order-8 run's 682 and the stack-held 420. σ is 36.1 nm. + - On the held-out sets it costs +2.32 nats per molecule on the stack's, half the order-8 run's +4.51. On the + movie's held out it gains −1.61, nearly the order-8 run's −1.75. On the movie's surplus it costs +1.09, + against +0.36. + - The stack refit still pushes h to the 200 nm bound. + - The twin test prefers the mirrored pupil by 1467 nats, as the order-8 runs did (867-1258). + - So the modes above order 6 carry most of in situ's excess in the low orders: by order 8 a large part of + what it puts into Z11, Z6 and coma pays for the molecules it learnt from. It does not close the gap: x + coma and the stack's preference remain. **The scripts** (`benchmarks/uipsf/real/m2_pairs/`; each says how it is called): - `m2_new.py`: every learning run, steered by environment variables (`ORDER`, `HOLD`, `START`, `NMED`, From 7920da343bb5febc42ce6338beb830d65df71d31 Mon Sep 17 00:00:00 2001 From: Jonas Ries Date: Sun, 15 Nov 2026 14:56:30 +0100 Subject: [PATCH 2/2] uipsf: M2 follow-up run -- tilt, drift, score per height, h held at 5 nm, a slide's flatness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #167's scripts run on M2's paired data (architecture.md "Follow-up (November 2026)", roadmap item 9): - score per height: the stack's pupil fits better below ~400 nm, in situ's above (+8 ... -6 nats per molecule from 0-200 to 800-1000 nm): depth-dependent; the surplus crowds at 200-400 nm. - h held at 5 nm: the stack's phase within 0.4 nm rms, γ 0.12 -> 0.25, the same held-out score; in situ from it lands where it did; the gap +5.20 / -1.73 nats per molecule (+4.51 / -1.75). - tilt: most tiles lie under the nucleus (spike 0); the three glass tiles slope 23-29 nm per µm along y, the pupil's tilt is along x. stack_flatness.py (new): a slide on M2 is level to 0.04°, flat to 4-5 nm rms -- 30-70 times less than the movie's. - drift: glass molecules only in the first ~2200 frames, so the edge's line is not a drift; the floor holds within ±20 nm over the last ~50 000 frames. tilt_from_edge.py: the stack's plane read off the device before float64 (MPS has none). The order-6 cross-check's commit, cherry-picked, missed #166. Co-Authored-By: Claude Opus 5.5 --- .../uipsf/real/m2_pairs/stack_flatness.py | 132 ++++++++++++++++++ .../uipsf/real/m2_pairs/tilt_from_edge.py | 2 +- benchmarks/uipsf/results/m2_pairs_cross.jsonl | 2 + .../uipsf/results/m2_pairs_followup.jsonl | 10 ++ benchmarks/uipsf/results/m2_pairs_runs.jsonl | 4 + docs/uipsf/architecture.md | 92 +++++++++++- docs/uipsf/roadmap.md | 7 +- 7 files changed, 245 insertions(+), 4 deletions(-) create mode 100644 benchmarks/uipsf/real/m2_pairs/stack_flatness.py create mode 100644 benchmarks/uipsf/results/m2_pairs_followup.jsonl diff --git a/benchmarks/uipsf/real/m2_pairs/stack_flatness.py b/benchmarks/uipsf/real/m2_pairs/stack_flatness.py new file mode 100644 index 00000000..64175ebc --- /dev/null +++ b/benchmarks/uipsf/real/m2_pairs/stack_flatness.py @@ -0,0 +1,132 @@ +"""How flat and level is a glass slide on M2? The AB molecule stack's molecules, each with its own z free. + + python stack_flatness.py OUTDIR STACK_MODEL [--tiles 4] [--near 400] [--json FILE] + +A reference for `tilt_from_edge.py`: the nucleus movie's coverslip edge falls 23-29 nm per µm across the few +tiles that have molecules on the glass, and the in situ pupils learn a tilt of 1.6-2.9°. The AB sweeps were +taken on a glass slide the same evening, molecules over the whole field, so the glass's own variation can be +read without a pupil question: STACK_MODEL's learnt geometry (each sweep's focus, the focal plane's slope +``geometry.plane``) and its pupil held, each spot localised again with its own offset δz free +(`CoverslipStackGeometry.checking`, the z check's model), the z bend (the median δz per 100 nm of defocus) +taken out, then: + +- the learnt plane: the slope of the focal plane against the glass over the field (nm per µm, its angle); +- the residual δz per tile of the field and a plane through the tiles: what the learnt plane leaves; +- the rms of the tiles' residuals about that plane: the glass's unevenness over a few µm; +- each sweep's learnt focus: how much the focus moved over the 10 sweeps (~10 min). + +Only spots within ``--near`` nm of focus are used: there δz is best determined. Every spot that passes the +selection (significance 5, all of them, no draw) is used; the stack learnt from 3468 of them, which is fine +here: the question is the glass, not the pupil. +""" +import argparse +import glob +import json +import os + +import numpy as np +import torch + +ROOT = os.environ.get("M2_DATA", os.path.expanduser("~/Library/Mobile Documents/com~apple~CloudDocs/Vienna/Data/" + "smappy test/261112_new")) +STACK = "261112_MR_Intercalib2_AB_50ms_coverslip/*/*.ome.tif" +BEND_STEP_NM = 100.0 + + +def weighted_plane(u, v, z, sd): + w = 1 / np.maximum(sd, 1.0) ** 2 + A = np.c_[np.ones_like(u), u, v] + cov = np.linalg.inv(A.T @ (A * w[:, None])) + coef = cov @ (A.T @ (w * z)) + dof = max(len(z) - 3, 1) + chi2 = float(np.sum(w * (z - A @ coef) ** 2) / dof) + return coef, np.sqrt(np.diag(cov) * max(chi2, 1.0)), chi2, z - A @ coef + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("out") + ap.add_argument("stack") + ap.add_argument("--tiles", type=int, default=4) + ap.add_argument("--near", type=float, default=400.0) + ap.add_argument("--json") + a = ap.parse_args() + from smappy.calibrate.molecule_stack import MoleculeStackSettings, molecule_rois + from smappy.calibrate.pupil import load_start + + from uipsf.model import ForwardModel + from uipsf.workflows.scoring import localise + + rois = molecule_rois(sorted(glob.glob(os.path.join(ROOT, STACK))), + MoleculeStackSettings(molecules=10 ** 6, significance=5.0, height_nm=None)) + ids = rois.ids("used") + d = np.asarray(rois.defocus_nm, float)[ids] + ids = ids[np.abs(d) <= a.near] + d = np.asarray(rois.defocus_nm, float)[ids] + batch, noise = rois.batch(ids=ids) + m = load_start(os.path.join(a.out, f"{a.stack}_3dcal.h5")) + model = m.model + checking = ForwardModel(model.channels, geometry=model.geometry.checking(), intensity=model.intensity, + background=model.background) + shared = {k: torch.as_tensor(v) for k, v in m.shared.items()} + fit, _ = localise(checking, shared, batch, noise) + dz = fit.params.physical()["emitter.xyz"][:, 2].detach().cpu().double().numpy() + sd = fit.std["emitter.xyz"][:, 2].detach().cpu().double().numpy() + ok = np.isfinite(dz) & np.isfinite(sd) & (sd > 0) & (np.abs(dz) < np.maximum(3 * sd, 150.0)) + # the z bend: a function of defocus, the pupil's, not the glass's + bins = np.round(d / BEND_STEP_NM) + bend = np.zeros_like(dz) + for b in np.unique(bins): + k = ok & (bins == b) + if k.any(): + bend[bins == b] = np.median(dz[k]) + r = dz - bend + px = np.asarray(rois.pixel_size_nm, float) + xy = np.asarray(rois.units.centre, float)[ids] + cx, cy = rois.field_centre() + u, v = (xy[:, 0] - cx) * px[0] / 1000, (xy[:, 1] - cy) * px[1] / 1000 + plane = torch.as_tensor(shared["geometry.plane"]).detach().cpu().double().reshape(-1).tolist() + focus = torch.as_tensor(shared["geometry.focus"]).detach().cpu().double().reshape(-1).numpy() + ang = np.degrees(np.arctan(np.hypot(*plane) / 1000)) + print(f"{ok.sum()} of {len(ids)} spots within {a.near:g} nm of focus; δz CRLB median {np.median(sd[ok]):.1f} nm") + print(f"learnt focal plane's slope: {plane[0]:+.2f}, {plane[1]:+.2f} nm per µm (x, y), {ang:.3f}°") + print(f"sweep foci: {np.round(focus, 1).tolist()} nm; range {np.ptp(focus):.1f}, sd {focus.std():.1f}") + # tiles + x0, x1, y0, y1 = u[ok].min(), u[ok].max() + 1e-9, v[ok].min(), v[ok].max() + 1e-9 + iu = np.minimum(((u - x0) / (x1 - x0) * a.tiles).astype(int), a.tiles - 1) + iv = np.minimum(((v - y0) / (y1 - y0) * a.tiles).astype(int), a.tiles - 1) + tiles = [] + for j in range(a.tiles): + for i in range(a.tiles): + k = ok & (iu == i) & (iv == j) + if k.sum() < 20: + continue + med = float(np.median(r[k])) + err = float(1.2533 * 1.4826 * np.median(np.abs(r[k] - med)) / np.sqrt(k.sum())) + tiles.append(dict(tile=(i, j), u_um=float(u[k].mean()), v_um=float(v[k].mean()), dz_nm=med, + sd_nm=err, n=int(k.sum()))) + T = {k: np.array([t[k] for t in tiles]) for k in ("u_um", "v_um", "dz_nm", "sd_nm")} + coef, err, chi2, res = weighted_plane(T["u_um"], T["v_um"], T["dz_nm"], T["sd_nm"]) + rms = float(np.sqrt(np.mean(res ** 2))) + print(f"residual δz per tile ({len(tiles)} of {a.tiles}x{a.tiles}): plane b_x {coef[1]:+.2f} ± {err[1]:.2f}, " + f"b_y {coef[2]:+.2f} ± {err[2]:.2f} nm per µm; rms about it {rms:.1f} nm; χ²/dof {chi2:.1f}; " + f"tiles' range {np.ptp(T['dz_nm']):.1f} nm") + for t in tiles: + print(f" tile {t['tile']}: u {t['u_um']:+6.1f} v {t['v_um']:+6.1f} µm δz {t['dz_nm']:+6.1f} ± " + f"{t['sd_nm']:4.1f} nm n {t['n']}") + total = (plane[0] + coef[1], plane[1] + coef[2]) + print(f"the glass against the focal plane, learnt plane + residual: {total[0]:+.2f}, {total[1]:+.2f} nm per µm, " + f"{np.degrees(np.arctan(np.hypot(*total) / 1000)):.3f}°") + if a.json: + with open(a.json, "a") as f: + f.write(json.dumps(dict(kind="stack_flatness", model=a.stack, tiles=a.tiles, near_nm=a.near, + spots=int(ok.sum()), learnt_plane_nm_per_um=plane, learnt_plane_deg=float(ang), + sweep_focus_nm=focus.tolist(), sweep_focus_range_nm=float(np.ptp(focus)), + residual_plane_nm_per_um=[float(coef[1]), float(coef[2])], + residual_plane_err=[float(err[1]), float(err[2])], residual_rms_nm=rms, + chi2_dof=chi2, tiles_range_nm=float(np.ptp(T["dz_nm"])), + total_slope_nm_per_um=list(total), tile_rows=tiles)) + "\n") + + +if __name__ == "__main__": + main() diff --git a/benchmarks/uipsf/real/m2_pairs/tilt_from_edge.py b/benchmarks/uipsf/real/m2_pairs/tilt_from_edge.py index af2bb050..cdefaa63 100644 --- a/benchmarks/uipsf/real/m2_pairs/tilt_from_edge.py +++ b/benchmarks/uipsf/real/m2_pairs/tilt_from_edge.py @@ -93,7 +93,7 @@ def main(): import torch from smappy.calibrate.pupil import load_start m = load_start(os.path.join(a.out, f"{a.stack}_3dcal.h5")) - p = torch.as_tensor(m.shared["geometry.plane"]).double().reshape(-1).tolist() + p = torch.as_tensor(m.shared["geometry.plane"]).detach().cpu().double().reshape(-1).tolist() # MPS: no float64 print(f"stack {a.stack}: focal plane's slope {p[0]:+.1f}, {p[1]:+.1f} nm per µm (x, y), " f"{angle_deg(*p):.2f}°") for name in a.names: diff --git a/benchmarks/uipsf/results/m2_pairs_cross.jsonl b/benchmarks/uipsf/results/m2_pairs_cross.jsonl index 82cf90db..ff4a61a3 100644 --- a/benchmarks/uipsf/results/m2_pairs_cross.jsonl +++ b/benchmarks/uipsf/results/m2_pairs_cross.jsonl @@ -5,3 +5,5 @@ {"model": "insitu_start_edge_n1345_tilt_s315_ab_n1345", "insitu_molecules": 4328, "insitu_per_molecule": 291.1579490915464, "insitu_vs_first_per_molecule": 1.9453740780983746, "insitu_vs_first_median": 1.2657928466796875, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 301.2095277384258, "insitu_held_out_vs_first_per_molecule": -1.2460821861643427, "insitu_held_out_vs_first_median": -0.9002685546875, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 290.6119071821057, "insitu_not_drawn_vs_first_per_molecule": 2.1187467326490657, "insitu_not_drawn_vs_first_median": 1.33172607421875, "run": "tilted, in situ set only"} {"model": "insitu_all_n1345_tilt_s315_ab_n1345", "insitu_molecules": 4328, "insitu_per_molecule": 290.6412511568193, "insitu_vs_first_per_molecule": 1.4286761433712436, "insitu_vs_first_median": 0.5044403076171875, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 302.2358502443596, "insitu_held_out_vs_first_per_molecule": -0.2197596802305213, "insitu_held_out_vs_first_median": -0.2793731689453125, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 290.0113862124779, "insitu_not_drawn_vs_first_per_molecule": 1.51822576302123, "insitu_not_drawn_vs_first_median": 0.51824951171875, "run": "tilted, in situ set only"} {"model": "insitu_start_o6_edge_n1345_ab_n1345", "stack_molecules": 553, "stack_per_molecule": 231.74632991632114, "stack_vs_first_per_molecule": 2.317043449305281, "stack_vs_first_median": 0.559814453125, "insitu_molecules": 4328, "insitu_per_molecule": 290.1584505832129, "insitu_vs_first_per_molecule": 0.9458755697648759, "insitu_vs_first_median": -0.0778961181640625, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 300.8473813865217, "insitu_held_out_vs_first_per_molecule": -1.6082285380684207, "insitu_held_out_vs_first_median": -1.562835693359375, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 289.5777851583316, "insitu_not_drawn_vs_first_per_molecule": 1.084624708874943, "insitu_not_drawn_vs_first_median": 0.0195770263671875, "run": "order 6 cross-check"} +{"model": "ab_n1345_h5", "stack_molecules": 553, "stack_per_molecule": 229.39414161282033, "stack_vs_first_per_molecule": 0.0, "stack_vs_first_median": 0.0, "insitu_molecules": 4328, "insitu_per_molecule": 289.21257501344803, "insitu_vs_first_per_molecule": 0.0, "insitu_vs_first_median": 0.0, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 302.4556099245901, "insitu_held_out_vs_first_per_molecule": 0.0, "insitu_held_out_vs_first_median": 0.0, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 288.49316044945664, "insitu_not_drawn_vs_first_per_molecule": 0.0, "insitu_not_drawn_vs_first_median": 0.0} +{"model": "insitu_start_edge_n1345_ab_n1345_h5", "stack_molecules": 553, "stack_per_molecule": 234.59183627744264, "stack_vs_first_per_molecule": 5.1976946646223015, "stack_vs_first_median": 1.6118316650390625, "insitu_molecules": 4328, "insitu_per_molecule": 289.9312272732888, "insitu_vs_first_per_molecule": 0.7186522598407625, "insitu_vs_first_median": 0.0612945556640625, "insitu_held_out_molecules": 223, "insitu_held_out_per_molecule": 300.7262950948536, "insitu_held_out_vs_first_per_molecule": -1.729314829736547, "insitu_held_out_vs_first_median": -2.09075927734375, "insitu_not_drawn_molecules": 4105, "insitu_not_drawn_per_molecule": 289.34479606154486, "insitu_not_drawn_vs_first_per_molecule": 0.8516356120882023, "insitu_not_drawn_vs_first_median": 0.18145751953125} diff --git a/benchmarks/uipsf/results/m2_pairs_followup.jsonl b/benchmarks/uipsf/results/m2_pairs_followup.jsonl new file mode 100644 index 00000000..a4e244d8 --- /dev/null +++ b/benchmarks/uipsf/results/m2_pairs_followup.jsonl @@ -0,0 +1,10 @@ +{"kind": "tilt_from_edge", "model": "insitu_all_n1345_ab_n1345", "tiles": 3, "b_x_nm_per_um": 8.050626341016258, "b_y_nm_per_um": -11.187532106716393, "b_x_err": 6.948380762890826, "b_y_err": 5.498760184488211, "chi2_dof": 82.57675338780234, "angle_deg": 0.7896626528489888, "tile_rows": [{"tile": [0, 0], "u_um": -6.69813306999596, "v_um": -6.274662510135158, "edge_nm": -45.75134893118383, "sd_nm": 17.460209336711156, "spike": 0.0, "n": 96}, {"tile": [1, 0], "u_um": 0.3396858758831466, "v_um": -5.948799602766763, "edge_nm": 171.42719899964092, "sd_nm": 7.2635997703881525, "spike": 0.39190508849047717, "n": 362}, {"tile": [2, 0], "u_um": 7.867917290844641, "v_um": -8.247229078718476, "edge_nm": 119.69925405268825, "sd_nm": 11.668781861617443, "spike": 0.0, "n": 882}, {"tile": [0, 1], "u_um": -6.35005075774084, "v_um": 0.11075541349199586, "edge_nm": 244.08597790582144, "sd_nm": 32.5860424354792, "spike": 0.0, "n": 914}, {"tile": [1, 1], "u_um": 0.14257756388801401, "v_um": -0.07706146301346337, "edge_nm": 270.20662900246964, "sd_nm": 26.56678322257762, "spike": 0.0, "n": 1669}, {"tile": [2, 1], "u_um": 6.749405575467647, "v_um": -0.14498389546466223, "edge_nm": 227.00565651296097, "sd_nm": 7.486301957547646, "spike": 0.0, "n": 1419}, {"tile": [0, 2], "u_um": -5.940362681743381, "v_um": 5.754286894870122, "edge_nm": -6.303851989129106, "sd_nm": 14.01417958041259, "spike": 0.0, "n": 213}, {"tile": [1, 2], "u_um": -0.33931665053694327, "v_um": 5.4740520715334275, "edge_nm": 1.2240260524893432, "sd_nm": 5.5707667772605385, "spike": 0.30008147845918093, "n": 380}, {"tile": [2, 2], "u_um": 7.8417599883790885, "v_um": 7.70206510817955, "edge_nm": -44.196691059210124, "sd_nm": 12.181914100862556, "spike": 0.0, "n": 170}]} +{"kind": "tilt_from_edge", "model": "insitu_start_edge_n1345_ab_n1345", "tiles": 3, "b_x_nm_per_um": 8.11874753664701, "b_y_nm_per_um": -2.6224681928144236, "b_x_err": 10.217791238764722, "b_y_err": 9.40094176651659, "chi2_dof": 78.34632234973493, "angle_deg": 0.4888235651762575, "tile_rows": [{"tile": [0, 0], "u_um": -6.69813306999596, "v_um": -6.274662510135158, "edge_nm": -248.76814287914095, "sd_nm": 21.635510311210396, "spike": 0.0, "n": 96}, {"tile": [1, 0], "u_um": 0.3396858758831466, "v_um": -5.948799602766763, "edge_nm": 161.0721638233473, "sd_nm": 17.750905967476374, "spike": 0.0, "n": 362}, {"tile": [2, 0], "u_um": 7.867917290844641, "v_um": -8.247229078718476, "edge_nm": 183.908282097015, "sd_nm": 34.292742385039126, "spike": 0.0, "n": 882}, {"tile": [0, 1], "u_um": -6.35005075774084, "v_um": 0.11075541349199586, "edge_nm": 329.8096553909869, "sd_nm": 36.67009501137894, "spike": 0.0, "n": 914}, {"tile": [1, 1], "u_um": 0.14257756388801401, "v_um": -0.07706146301346337, "edge_nm": 652.4429962409051, "sd_nm": 164.96582049229858, "spike": 0.0, "n": 1669}, {"tile": [2, 1], "u_um": 6.749405575467647, "v_um": -0.14498389546466223, "edge_nm": 390.43329755310833, "sd_nm": 23.71979041343272, "spike": 0.0, "n": 1419}, {"tile": [0, 2], "u_um": -5.940362681743381, "v_um": 5.754286894870122, "edge_nm": 52.98063972909533, "sd_nm": 14.081395014264844, "spike": 0.0, "n": 213}, {"tile": [1, 2], "u_um": -0.33931665053694327, "v_um": 5.4740520715334275, "edge_nm": 71.90171018943067, "sd_nm": 4.27938717215625, "spike": 0.29783175543397006, "n": 380}, {"tile": [2, 2], "u_um": 7.8417599883790885, "v_um": 7.70206510817955, "edge_nm": 5.518842786047394, "sd_nm": 13.918924374402229, "spike": 0.0, "n": 170}]} +{"kind": "tilt_from_edge", "model": "insitu_all_n1345_ab_n1345", "tiles": 4, "b_x_nm_per_um": -1.8859059341727333, "b_y_nm_per_um": -18.021280353753117, "b_x_err": 3.845227104708601, "b_y_err": 3.9185654075106937, "chi2_dof": 55.525298302004245, "angle_deg": 1.0380681990801057, "tile_rows": [{"tile": [1, 0], "u_um": -2.6292706939491524, "v_um": -9.886985773872352, "edge_nm": 1531.4863605648795, "sd_nm": 5317.785970344036, "spike": 0.999999999978231, "n": 76}, {"tile": [2, 0], "u_um": 3.629949595590767, "v_um": -9.398328965630599, "edge_nm": 81.89502600595753, "sd_nm": 35.4974303266986, "spike": 0.0, "n": 94}, {"tile": [3, 0], "u_um": 8.747015741839824, "v_um": -9.278956470595636, "edge_nm": 119.94412947809913, "sd_nm": 13.621642141726365, "spike": 0.0, "n": 634}, {"tile": [0, 1], "u_um": -7.504127860222362, "v_um": -1.7499194623891359, "edge_nm": 240.2111651104783, "sd_nm": 7.356819224042917, "spike": 0.8688111561892747, "n": 330}, {"tile": [1, 1], "u_um": -2.6205371413035365, "v_um": -2.179345983611935, "edge_nm": 226.03028062667053, "sd_nm": 14.633505207897034, "spike": 0.0, "n": 666}, {"tile": [2, 1], "u_um": 2.9111818595629355, "v_um": -2.6219074274732512, "edge_nm": 230.9928739511696, "sd_nm": 9.317558433792588, "spike": 0.0, "n": 1024}, {"tile": [3, 1], "u_um": 7.736014679092576, "v_um": -2.1524115404207795, "edge_nm": 232.3376756063784, "sd_nm": 10.262227529412895, "spike": 0.0, "n": 567}, {"tile": [0, 2], "u_um": -7.022087952203218, "v_um": 2.541305415030109, "edge_nm": 229.86411932621857, "sd_nm": 33.68285543171388, "spike": 0.0, "n": 350}, {"tile": [1, 2], "u_um": -2.621283333093877, "v_um": 2.4814761370689755, "edge_nm": 195.7215328386481, "sd_nm": 11.161868152666006, "spike": 0.0, "n": 779}, {"tile": [2, 2], "u_um": 2.7844907351825308, "v_um": 2.3265089408012902, "edge_nm": 198.10664803836005, "sd_nm": 6.656536482565638, "spike": 0.0, "n": 745}, {"tile": [3, 2], "u_um": 7.697910796397764, "v_um": 1.6321932378303685, "edge_nm": 231.18462292636875, "sd_nm": 10.697673844418418, "spike": 0.0, "n": 482}, {"tile": [1, 3], "u_um": -3.2067593942929036, "v_um": 7.069157738778986, "edge_nm": 8.883301065495964, "sd_nm": 5.669023495238192, "spike": 0.7286391639243969, "n": 126}, {"tile": [2, 3], "u_um": 2.9535869389761857, "v_um": 8.737009529721826, "edge_nm": -5.080956525589515, "sd_nm": 6.178473174670957, "spike": 0.8648229362469934, "n": 63}, {"tile": [3, 3], "u_um": 9.615048291876455, "v_um": 8.924961334051305, "edge_nm": -46.86371669287861, "sd_nm": 15.58318675755409, "spike": 0.0, "n": 104}]} +{"kind": "tilt_from_edge", "model": "insitu_start_edge_n1345_ab_n1345", "tiles": 4, "b_x_nm_per_um": -5.565483564355087, "b_y_nm_per_um": -12.683086655535186, "b_x_err": 4.017523007990582, "b_y_err": 3.6406530499175838, "chi2_dof": 39.80549797209902, "angle_deg": 0.7935222710307286, "tile_rows": [{"tile": [1, 0], "u_um": -2.6292706939491524, "v_um": -9.886985773872352, "edge_nm": 28851.605638144807, "sd_nm": 7768.5437177274, "spike": 0.847441458090991, "n": 76}, {"tile": [2, 0], "u_um": 3.629949595590767, "v_um": -9.398328965630599, "edge_nm": 118.87960979337842, "sd_nm": 19.45325576947567, "spike": 0.0, "n": 94}, {"tile": [3, 0], "u_um": 8.747015741839824, "v_um": -9.278956470595636, "edge_nm": 150.06215567614035, "sd_nm": 14.809301991379574, "spike": 0.0, "n": 634}, {"tile": [0, 1], "u_um": -7.504127860222362, "v_um": -1.7499194623891359, "edge_nm": 272.4045658618538, "sd_nm": 7.216283749877517, "spike": 0.0, "n": 330}, {"tile": [1, 1], "u_um": -2.6205371413035365, "v_um": -2.179345983611935, "edge_nm": 429.2985278570146, "sd_nm": 73.0744492540568, "spike": 0.0, "n": 666}, {"tile": [2, 1], "u_um": 2.9111818595629355, "v_um": -2.6219074274732512, "edge_nm": 468.60258293308357, "sd_nm": 95.38586556028739, "spike": 0.0, "n": 1024}, {"tile": [3, 1], "u_um": 7.736014679092576, "v_um": -2.1524115404207795, "edge_nm": 386.59169410333675, "sd_nm": 26.553220241242723, "spike": 0.0, "n": 567}, {"tile": [0, 2], "u_um": -7.022087952203218, "v_um": 2.541305415030109, "edge_nm": 311.26574258616665, "sd_nm": 37.94627921230082, "spike": 0.0, "n": 350}, {"tile": [1, 2], "u_um": -2.621283333093877, "v_um": 2.4814761370689755, "edge_nm": 383.07643231807117, "sd_nm": 62.207035787593796, "spike": 0.0, "n": 779}, {"tile": [2, 2], "u_um": 2.7844907351825308, "v_um": 2.3265089408012902, "edge_nm": 492.7851326977005, "sd_nm": 122.3772587188462, "spike": 0.0, "n": 745}, {"tile": [3, 2], "u_um": 7.697910796397764, "v_um": 1.6321932378303685, "edge_nm": 381.2529158449613, "sd_nm": 22.63007047893767, "spike": 0.0, "n": 482}, {"tile": [1, 3], "u_um": -3.2067593942929036, "v_um": 7.069157738778986, "edge_nm": 79.09538979948604, "sd_nm": 4.138084528816207, "spike": 0.6767234799368376, "n": 126}, {"tile": [2, 3], "u_um": 2.9535869389761857, "v_um": 8.737009529721826, "edge_nm": 54.18243769029578, "sd_nm": 7.3148955027333935, "spike": 0.9667742045730022, "n": 63}, {"tile": [3, 3], "u_um": 9.615048291876455, "v_um": 8.924961334051305, "edge_nm": 8.068452470162907, "sd_nm": 18.16347877648437, "spike": 0.0, "n": 104}]} +{"kind": "edge_vs_time", "model": "insitu_all_n1345_ab_n1345", "blocks": 10, "slope_nm_per_10k_frames": 48.02894533086869, "slope_err": 7.261736241324181, "chi2_dof": 25.787441775295616, "block_rows": [{"frames": [0, 2215], "t": 92.0, "edge_nm": -41.51811605126925, "sd_nm": 5.0857508331210015, "spike": 0.0, "n": 611, "median_nm": 375.747802734375, "p90_nm": 724.7257690429688}, {"frames": [2215, 9121], "t": 4553.0, "edge_nm": 5012.778305902244, "sd_nm": 14739.318752627494, "spike": 0.0, "n": 611, "median_nm": 332.9380187988281, "p90_nm": 755.9932861328125}, {"frames": [9122, 18134], "t": 13522.0, "edge_nm": 345.961149034163, "sd_nm": 76.59549127420378, "spike": 0.0, "n": 611, "median_nm": 351.9684753417969, "p90_nm": 794.1000366210938}, {"frames": [18134, 27183], "t": 22554.0, "edge_nm": 204.36974922892014, "sd_nm": 13.322982786373265, "spike": 0.0, "n": 611, "median_nm": 383.90484619140625, "p90_nm": 786.0586547851562}, {"frames": [27183, 36182], "t": 36014.0, "edge_nm": 178.14084716286584, "sd_nm": 4.744713805787719, "spike": 0.0, "n": 611, "median_nm": 348.6913146972656, "p90_nm": 714.8651123046875}, {"frames": [36184, 40782], "t": 38385.5, "edge_nm": 259.92700599244245, "sd_nm": 45.498947745956855, "spike": 0.0, "n": 610, "median_nm": 332.79603576660156, "p90_nm": 817.4158203125002}, {"frames": [40783, 54019], "t": 45188.5, "edge_nm": 202.39197769555824, "sd_nm": 12.73342926259049, "spike": 0.0, "n": 610, "median_nm": 364.963134765625, "p90_nm": 731.7867614746094}, {"frames": [54020, 58779], "t": 58615.0, "edge_nm": 199.54671122826213, "sd_nm": 14.153961762171505, "spike": 0.0, "n": 610, "median_nm": 328.5609588623047, "p90_nm": 802.5115783691407}, {"frames": [58780, 67639], "t": 63138.0, "edge_nm": 207.8081572908289, "sd_nm": 11.375357363353107, "spike": 0.0, "n": 610, "median_nm": 333.8908386230469, "p90_nm": 797.4288330078126}, {"frames": [67639, 67799], "t": 67718.0, "edge_nm": 413.69499786134634, "sd_nm": 139.4725552859544, "spike": 0.0, "n": 610, "median_nm": 306.7002258300781, "p90_nm": 727.6905090332032}]} +{"kind": "edge_vs_time", "model": "insitu_all_n1345_ab_n1345", "blocks": 20, "slope_nm_per_10k_frames": 33.86337076837638, "slope_err": 3.6028562481231083, "chi2_dof": 24.43985810508043, "block_rows": [{"frames": [0, 92], "t": 47.0, "edge_nm": -45.733300456638204, "sd_nm": 5.972730750456674, "spike": 0.0, "n": 306, "median_nm": 346.20921325683594, "p90_nm": 697.48486328125}, {"frames": [92, 2215], "t": 153.5, "edge_nm": 8.480815838996643, "sd_nm": 4.037239737160938, "spike": 0.3229609118446005, "n": 306, "median_nm": 397.33929443359375, "p90_nm": 764.9903564453125}, {"frames": [2216, 4553], "t": 2393.5, "edge_nm": -21.40943602891845, "sd_nm": 10.701077369989804, "spike": 0.0, "n": 306, "median_nm": 335.74366760253906, "p90_nm": 780.2775573730469}, {"frames": [4554, 9124], "t": 9042.0, "edge_nm": 1499.136160533982, "sd_nm": 2924.2776144583254, "spike": 0.0, "n": 306, "median_nm": 325.2947540283203, "p90_nm": 736.9630737304688}, {"frames": [9127, 13522], "t": 13424.5, "edge_nm": 336.43722524323914, "sd_nm": 100.95910829699753, "spike": 0.0, "n": 306, "median_nm": 344.19960021972656, "p90_nm": 794.3620300292969}, {"frames": [13523, 18135], "t": 18026.0, "edge_nm": 314.9546680001456, "sd_nm": 90.69943187972225, "spike": 0.0, "n": 305, "median_nm": 364.7328186035156, "p90_nm": 794.9430541992189}, {"frames": [18136, 22555], "t": 22427.0, "edge_nm": 219.52206533053334, "sd_nm": 30.19368840362559, "spike": 0.0, "n": 305, "median_nm": 381.92877197265625, "p90_nm": 781.1710083007816}, {"frames": [22556, 27183], "t": 27080.0, "edge_nm": 191.4609737428267, "sd_nm": 11.485559455871835, "spike": 0.0, "n": 305, "median_nm": 399.74139404296875, "p90_nm": 782.5242309570315}, {"frames": [27184, 36014], "t": 31498.0, "edge_nm": 177.56003518093308, "sd_nm": 5.416184617547686, "spike": 0.0, "n": 305, "median_nm": 315.09613037109375, "p90_nm": 695.6967041015625}, {"frames": [36015, 36182], "t": 36104.0, "edge_nm": 186.36590038921668, "sd_nm": 10.318384979850176, "spike": 0.0, "n": 305, "median_nm": 394.2444763183594, "p90_nm": 747.2066772460937}, {"frames": [36184, 38385], "t": 38280.0, "edge_nm": 209.13899573117158, "sd_nm": 19.055250716401872, "spike": 0.0, "n": 305, "median_nm": 363.24029541015625, "p90_nm": 869.9376098632815}, {"frames": [38386, 40782], "t": 40695.0, "edge_nm": 352.35003460685107, "sd_nm": 154.76499718824974, "spike": 0.0, "n": 305, "median_nm": 324.04949951171875, "p90_nm": 713.7608276367188}, {"frames": [40783, 45188], "t": 45093.0, "edge_nm": 194.24407816927447, "sd_nm": 8.043167408906863, "spike": 0.0, "n": 305, "median_nm": 359.06243896484375, "p90_nm": 751.89091796875}, {"frames": [45189, 54019], "t": 49716.0, "edge_nm": 200.42316157330765, "sd_nm": 35.08634731967723, "spike": 4.710259511809274e-14, "n": 305, "median_nm": 371.7749938964844, "p90_nm": 719.8775634765626}, {"frames": [54020, 58615], "t": 54124.0, "edge_nm": 162.35443896402597, "sd_nm": 9.20132427346497, "spike": 0.0, "n": 305, "median_nm": 317.4246826171875, "p90_nm": 803.1417724609375}, {"frames": [58615, 58779], "t": 58699.0, "edge_nm": 189.97863003114347, "sd_nm": 16.954647789299845, "spike": 0.0, "n": 305, "median_nm": 353.8245544433594, "p90_nm": 794.6879028320317}, {"frames": [58780, 63138], "t": 63070.0, "edge_nm": 200.09355312497394, "sd_nm": 3.5437495207313816, "spike": 0.0, "n": 305, "median_nm": 335.685546875, "p90_nm": 754.1699829101564}, {"frames": [63138, 67639], "t": 67604.0, "edge_nm": 237.34896680245544, "sd_nm": 35.16875255249765, "spike": 0.0, "n": 305, "median_nm": 326.9967041015625, "p90_nm": 880.4885864257815}, {"frames": [67639, 67718], "t": 67678.0, "edge_nm": 349.91103420401646, "sd_nm": 131.56131639517486, "spike": 0.0, "n": 305, "median_nm": 310.333251953125, "p90_nm": 654.3248291015626}, {"frames": [67718, 67799], "t": 67764.0, "edge_nm": 410.29278098159864, "sd_nm": 192.997980817331, "spike": 0.0, "n": 305, "median_nm": 301.6166076660156, "p90_nm": 765.0703247070314}]} +{"kind": "score_by_height", "model": "insitu_start_edge_n1345_ab_n1345", "against": "insitu_all_n1345_ab_n1345", "reference": "insitu_all_n1345_ab_n1345", "bins": [-200.0, 0.0, 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1600.0], "held_out": [[6, 2.8028182983398438, 3.1937410223034903], [21, 8.35226077125186, 4.240500410550413], [24, -1.6689205169677734, 3.0379683435311353], [35, 6.130341012137277, 7.513311415973643], [87, -5.91106862035291, 1.453843706730819], [30, -8.465318806966145, 1.804884381927392], [16, -1.7379274368286133, 1.5037015855638427], [1, -0.32159423828125, NaN]], "not_drawn": [[2, 1.7363510131835938, 3.818153381347656], [261, 8.349466024230724, 5.056770484521747], [2710, 1.109646071543113, 0.6579140243545286], [784, -1.3983588899884904, 0.4557428696976062], [315, -1.7234584263392858, 1.8015044624660723], [15, -2.2852386474609374, 3.8523478302563], [0, NaN, NaN], [1, -2.4828033447265625, NaN]], "both": [[8, 2.5362014770507812, 2.452630041400092], [282, 8.349674143689745, 4.689704781944298], [2734, 1.085254850575936, 0.6526789464904168], [819, -1.0766195779318337, 0.5416855655093882], [402, -2.629732274297458, 1.4480456839299647], [45, -6.405292087131077, 1.788370844142891], [16, -1.7379274368286133, 1.5037015855638427], [2, -1.4021987915039062, 1.0806045532226562]]} +{"kind": "score_by_height", "model": "insitu_ab", "against": "insitu_all_n1345_ab_n1345", "reference": "insitu_all_n1345_ab_n1345", "bins": [-200.0, 0.0, 200.0, 400.0, 600.0, 800.0, 1000.0, 1200.0, 1600.0], "held_out": [[6, 1.636444091796875, 3.1195620691923764], [21, 7.884325299944196, 3.916008244582182], [24, -0.14374415079752603, 2.58225060470345], [35, -1.8043570382254464, 2.00917290757918], [87, -6.068990773168103, 1.5207716756997078], [30, -7.585941060384115, 2.1618714675128996], [16, -0.32597827911376953, 1.9309045292048077], [1, 0.373992919921875, NaN]], "not_drawn": [[2, -3.56072998046875, 1.5507812499999998], [261, 3.2220771760319384, 2.0987980874819456], [2710, 1.7179100346301315, 0.6503270949442256], [784, -0.895113925544583, 0.5450683595990254], [315, -1.7322496686662947, 1.8579118204212812], [15, -2.076038614908854, 4.070111545893428], [0, NaN, NaN], [1, -1.5738067626953125, NaN]], "both": [[8, 0.33715057373046875, 2.45413571338248], [282, 3.569265866110511, 1.96439677916502], [2734, 1.7015677886717322, 0.6450077843360604], [819, -0.933970468821543, 0.5286264153048706], [402, -2.670798116655492, 1.4944121736575828], [45, -5.749306911892361, 1.9909541262909525], [16, -0.32597827911376953, 1.9309045292048077], [2, -0.5999069213867188, 0.9738998413085938]]} +{"kind": "stack_flatness", "model": "ab_n1345", "tiles": 4, "near_nm": 400.0, "spots": 2669, "learnt_plane_nm_per_um": [0.6434141993522644, 0.23205149173736572], "learnt_plane_deg": 0.0391892066606552, "sweep_focus_nm": [55.207427978515625, 71.75557708740234, 80.04859924316406, 80.15206146240234, 85.95557403564453, 83.71806335449219, 81.63154602050781, 77.21646118164062, 76.26774597167969, 80.70989227294922], "sweep_focus_range_nm": 30.748146057128906, "residual_plane_nm_per_um": [-0.0074512431114944905, -0.26269908933582503], "residual_plane_err": [0.1843847456187278, 0.17729471354338047], "residual_rms_nm": 4.295758437040349, "chi2_dof": 1.4985184613566764, "tiles_range_nm": 19.191489934921265, "total_slope_nm_per_um": [0.6359629562407699, -0.03064759759845931], "tile_rows": [{"tile": [0, 0], "u_um": -7.5798265306122445, "v_um": -7.562489795918368, "dz_nm": 7.943193852901459, "sd_nm": 4.927247386450745, "n": 98}, {"tile": [1, 0], "u_um": -2.558814814814815, "v_um": -8.464777777777776, "dz_nm": 1.026254653930664, "sd_nm": 2.6449362431658954, "n": 216}, {"tile": [2, 0], "u_um": 2.9021593406593404, "v_um": -8.716571428571429, "dz_nm": 1.1041419506072998, "sd_nm": 2.7551432960473776, "n": 182}, {"tile": [3, 0], "u_um": 7.602802083333333, "v_um": -7.747833333333335, "dz_nm": 15.192945718765259, "sd_nm": 4.396278694892986, "n": 96}, {"tile": [0, 1], "u_um": -8.49992857142857, "v_um": -2.950634920634921, "dz_nm": 4.274507999420166, "sd_nm": 3.1242749251981947, "n": 189}, {"tile": [1, 1], "u_um": -3.1392208121827414, "v_um": -2.7807614213197973, "dz_nm": 1.7776689529418945, "sd_nm": 3.171202712396459, "n": 197}, {"tile": [2, 1], "u_um": 2.7187864077669905, "v_um": -2.479922330097087, "dz_nm": -3.998544216156006, "sd_nm": 3.0534422263743655, "n": 206}, {"tile": [3, 1], "u_um": 8.133148648648648, "v_um": -3.0184633204633204, "dz_nm": -0.10084915161132812, "sd_nm": 2.936164314086277, "n": 259}, {"tile": [0, 2], "u_um": -8.691268518518518, "v_um": 2.828037037037037, "dz_nm": -3.865224599838257, "sd_nm": 3.292813838202555, "n": 216}, {"tile": [1, 2], "u_um": -2.7527662337662337, "v_um": 2.954987012987013, "dz_nm": -3.9824309945106506, "sd_nm": 4.20462818604115, "n": 154}, {"tile": [2, 2], "u_um": 2.8048618421052627, "v_um": 2.7282894736842107, "dz_nm": -2.830849289894104, "sd_nm": 3.145782099305148, "n": 152}, {"tile": [3, 2], "u_um": 8.278283333333333, "v_um": 2.8922666666666665, "dz_nm": 1.0332257151603699, "sd_nm": 3.566361355665231, "n": 180}, {"tile": [0, 3], "u_um": -8.005141304347825, "v_um": 7.372304347826088, "dz_nm": -0.35791677236557007, "sd_nm": 5.027033092975451, "n": 92}, {"tile": [1, 3], "u_um": -2.667, "v_um": 7.897227272727273, "dz_nm": 3.221256285905838, "sd_nm": 3.1560695897311986, "n": 176}, {"tile": [2, 3], "u_um": 2.6205206185567014, "v_um": 8.223443298969071, "dz_nm": -1.8208704590797424, "sd_nm": 3.293186768390981, "n": 194}, {"tile": [3, 3], "u_um": 7.677354838709677, "v_um": 7.562451612903225, "dz_nm": -1.187035322189331, "sd_nm": 4.956147314478888, "n": 62}]} +{"kind": "stack_flatness", "model": "ab_n1345", "tiles": 6, "near_nm": 400.0, "spots": 2669, "learnt_plane_nm_per_um": [0.6434141993522644, 0.23205149173736572], "learnt_plane_deg": 0.0391892066606552, "sweep_focus_nm": [55.207427978515625, 71.75557708740234, 80.04859924316406, 80.15206146240234, 85.95557403564453, 83.71806335449219, 81.63154602050781, 77.21646118164062, 76.26774597167969, 80.70989227294922], "sweep_focus_range_nm": 30.748146057128906, "residual_plane_nm_per_um": [0.03728613263591298, -0.3417433997674075], "residual_plane_err": [0.15192996468548683, 0.14808060674909088], "residual_rms_nm": 4.802414182067407, "chi2_dof": 1.046621978890762, "tiles_range_nm": 23.445555806159973, "total_slope_nm_per_um": [0.6807003319881774, -0.10969190803004175], "tile_rows": [{"tile": [1, 0], "u_um": -5.503078313253012, "v_um": -8.832072289156624, "dz_nm": 6.734969854354858, "sd_nm": 5.475067642530723, "n": 83}, {"tile": [2, 0], "u_um": -1.663438144329897, "v_um": -9.507814432989692, "dz_nm": 2.1587443351745605, "sd_nm": 4.02315359182105, "n": 97}, {"tile": [3, 0], "u_um": 1.7957800000000002, "v_um": -9.911813333333335, "dz_nm": 3.478155016899109, "sd_nm": 3.876869051487875, "n": 75}, {"tile": [4, 0], "u_um": 5.565373563218392, "v_um": -9.247333333333335, "dz_nm": 5.034998416900635, "sd_nm": 4.385835421164925, "n": 87}, {"tile": [0, 1], "u_um": -9.20447619047619, "v_um": -5.655, "dz_nm": 9.505808115005493, "sd_nm": 5.683675971418373, "n": 84}, {"tile": [1, 1], "u_um": -5.8245375, "v_um": -5.598450000000001, "dz_nm": 1.360911786556244, "sd_nm": 4.465836495198642, "n": 80}, {"tile": [2, 1], "u_um": -1.793056701030928, "v_um": -5.858, "dz_nm": 4.338261604309082, "sd_nm": 4.342201436307231, "n": 97}, {"tile": [3, 1], "u_um": 1.5822083333333332, "v_um": -5.780666666666666, "dz_nm": -1.6700290441513062, "sd_nm": 5.132893328115095, "n": 72}, {"tile": [4, 1], "u_um": 6.223000000000002, "v_um": -5.583466666666666, "dz_nm": 3.3303142786026, "sd_nm": 4.289403679608888, "n": 90}, {"tile": [5, 1], "u_um": 9.212384615384616, "v_um": -5.584358974358975, "dz_nm": 7.847744703292847, "sd_nm": 4.708222765529344, "n": 78}, {"tile": [0, 2], "u_um": -9.590314285714284, "v_um": -2.1774857142857145, "dz_nm": 0.9057763814926147, "sd_nm": 6.825146976098581, "n": 70}, {"tile": [1, 2], "u_um": -5.962650000000001, "v_um": -1.5741199999999995, "dz_nm": -0.709103524684906, "sd_nm": 3.4508315509308174, "n": 100}, {"tile": [2, 2], "u_um": -1.9886341463414632, "v_um": -1.9677560975609756, "dz_nm": -0.9024484157562256, "sd_nm": 4.454832496545066, "n": 82}, {"tile": [3, 2], "u_um": 1.8463380952380952, "v_um": -1.8024190476190476, "dz_nm": -3.130177140235901, "sd_nm": 4.076180858908949, "n": 105}, {"tile": [4, 2], "u_um": 5.67726811594203, "v_um": -2.179623188405797, "dz_nm": -8.771616816520691, "sd_nm": 4.1546911010745635, "n": 138}, {"tile": [5, 2], "u_um": 9.617807692307693, "v_um": -1.8987032967032969, "dz_nm": 3.217936873435974, "sd_nm": 5.174728106551597, "n": 91}, {"tile": [0, 3], "u_um": -9.742365384615384, "v_um": 1.9697692307692307, "dz_nm": -3.3075257539749146, "sd_nm": 4.548798444755526, "n": 104}, {"tile": [1, 3], "u_um": -5.949673913043478, "v_um": 1.9291304347826084, "dz_nm": -13.93974769115448, "sd_nm": 5.333549979766066, "n": 69}, {"tile": [2, 3], "u_um": -2.1503765432098767, "v_um": 2.253407407407407, "dz_nm": -10.656002283096313, "sd_nm": 5.733474269908811, "n": 81}, {"tile": [3, 3], "u_um": 1.9042160493827158, "v_um": 2.1302469135802466, "dz_nm": -5.0205578207969666, "sd_nm": 4.0354928596592625, "n": 81}, {"tile": [4, 3], "u_um": 5.803899999999999, "v_um": 2.054488888888889, "dz_nm": -1.252502202987671, "sd_nm": 4.731320381154105, "n": 90}, {"tile": [5, 3], "u_um": 9.632597222222223, "v_um": 2.139555555555556, "dz_nm": 0.1729487180709839, "sd_nm": 4.747503635177515, "n": 72}, {"tile": [0, 4], "u_um": -9.019093406593404, "v_um": 5.60432967032967, "dz_nm": 0.1464376449584961, "sd_nm": 5.407768085907359, "n": 91}, {"tile": [1, 4], "u_um": -5.531970588235293, "v_um": 5.709588235294119, "dz_nm": 5.460772097110748, "sd_nm": 4.555535134466826, "n": 68}, {"tile": [2, 4], "u_um": -1.6370300000000002, "v_um": 5.89048, "dz_nm": 6.522591173648834, "sd_nm": 4.277349543157858, "n": 100}, {"tile": [3, 4], "u_um": 1.7293441558441556, "v_um": 6.147246753246754, "dz_nm": -2.308063268661499, "sd_nm": 4.532296660720625, "n": 77}, {"tile": [4, 4], "u_um": 5.888440298507463, "v_um": 5.726417910447761, "dz_nm": -2.1892483234405518, "sd_nm": 4.879558794889193, "n": 67}, {"tile": [5, 4], "u_um": 9.443357142857142, "v_um": 5.2637959183673475, "dz_nm": 4.558554768562317, "sd_nm": 7.420234199368479, "n": 49}, {"tile": [1, 5], "u_um": -5.6514999999999995, "v_um": 8.639632653061225, "dz_nm": -5.717275142669678, "sd_nm": 5.8764076291751, "n": 49}, {"tile": [2, 5], "u_um": -2.2354152542372883, "v_um": 9.501186440677966, "dz_nm": -5.5249364376068115, "sd_nm": 4.995619226825705, "n": 59}, {"tile": [3, 5], "u_um": 2.105059139784946, "v_um": 9.139677419354836, "dz_nm": -0.4422464370727539, "sd_nm": 5.474412476254123, "n": 93}, {"tile": [4, 5], "u_um": 5.4933490566037735, "v_um": 8.928716981132075, "dz_nm": -1.6786744594573975, "sd_nm": 6.766403826007675, "n": 53}]} diff --git a/benchmarks/uipsf/results/m2_pairs_runs.jsonl b/benchmarks/uipsf/results/m2_pairs_runs.jsonl index d8e146b5..7851c092 100644 --- a/benchmarks/uipsf/results/m2_pairs_runs.jsonl +++ b/benchmarks/uipsf/results/m2_pairs_runs.jsonl @@ -18,3 +18,7 @@ {"set": "insitu_start_edge_n1345_ab_n1345", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "focus_estimate_nm": 528.1454202943705, "messages": ["held from the start model: \u03b3 = 0.122 and the phase above order 8", "the data prefer the mirrored pupil by 867 nats: the sign of astigmatism and spherical aberration may be the other one", "44671 detections, 13006 blinks, 21140 frames: 223 held out, 4105 not drawn, 5972 rejected: brightness, 146 rejected: masked, 113 rejected: no fit, 5947 rejected: overlap, 802 rejected: photon step, 1345 rejected: shape, 436 rejected: wide, 274 rejected: z range, 1777 used", "18 of 361 blocks of 200 frames read"], "molecules_used": 1777, "geometry.focus": [682.49], "phase_nm": {"Z5(2, -2)": -2.2, "Z6(2, 2)": 71.87, "Z7(3, -1)": -3.51, "Z8(3, 1)": 41.28, "Z9(3, -3)": 3.83, "Z10(3, 3)": 1.59, "Z11(4, 0)": 55.08, "Z12(4, 2)": 17.4, "Z13(4, -2)": 3.11, "Z14(4, 4)": 1.03, "Z15(4, -4)": 2.42, "Z16(5, 1)": 30.56, "Z17(5, -1)": 5.05, "Z18(5, 3)": 5.65, "Z19(5, -3)": 1.39, "Z20(5, 5)": -10.08, "Z21(5, -5)": 1.11, "Z22(6, 0)": 34.41, "Z23(6, -2)": 4.51, "Z24(6, 2)": 15.89, "Z25(6, -4)": 3.55, "Z26(6, 4)": -2.3, "Z27(6, -6)": 0.44, "Z28(6, 6)": 3.11, "Z29(7, -1)": -1.61, "Z30(7, 1)": 13.52, "Z31(7, -3)": 0.73, "Z32(7, 3)": 0.15, "Z33(7, -5)": -0.96, "Z34(7, 5)": -5.47, "Z35(7, -7)": -2.14, "Z36(7, 7)": 1.17, "Z37(8, 0)": 17.51, "Z38(8, 2)": 12.43, "Z39(8, -2)": 3.83, "Z40(8, 4)": -0.73, "Z41(8, -4)": 1.64, "Z42(8, 6)": 0.86, "Z43(8, -6)": -0.89, "Z44(8, 8)": -0.99, "Z45(8, -8)": -1.8}, "psf.sigma": [38.8398], "psf.sigma_crlb": [0.5807], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "psf.sigma", "pupil.magnitude", "pupil.phase"], "minutes": 60.2, "saved": "insitu_start_edge_n1345_ab_n1345_3dcal.h5"} {"set": "insitu_start_edge_n1345_tilt_s315_ab_n1345", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "coverslip_tilt_deg": [[-1.6015218391302566, 0.023378054939884624], [-0.8090826512951427, 0.023687280281542916]], "focus_estimate_nm": 527.8653898224168, "messages": ["held from the start model: \u03b3 = 0.122 and the phase above order 8", "the data prefer the mirrored pupil by 867 nats: the sign of astigmatism and spherical aberration may be the other one", "44671 detections, 13006 blinks, 21140 frames: 223 held out, 4105 not drawn, 5972 rejected: brightness, 146 rejected: masked, 113 rejected: no fit, 5947 rejected: overlap, 802 rejected: photon step, 1345 rejected: shape, 436 rejected: wide, 274 rejected: z range, 1777 used", "18 of 361 blocks of 200 frames read"], "molecules_used": 1777, "geometry.focus": [1220.47], "phase_nm": {"Z5(2, -2)": -4.66, "Z6(2, 2)": 57.82, "Z7(3, -1)": -22.85, "Z8(3, 1)": 9.94, "Z9(3, -3)": 4.18, "Z10(3, 3)": 2.94, "Z11(4, 0)": 37.65, "Z12(4, 2)": -0.09, "Z13(4, -2)": -0.32, "Z14(4, 4)": 1.52, "Z15(4, -4)": -0.57, "Z16(5, 1)": 0.51, "Z17(5, -1)": -12.23, "Z18(5, 3)": 3.43, "Z19(5, -3)": 3.44, "Z20(5, 5)": -7.4, "Z21(5, -5)": 0.68, "Z22(6, 0)": 12.6, "Z23(6, -2)": 0.54, "Z24(6, 2)": 4.21, "Z25(6, -4)": -0.46, "Z26(6, 4)": 0.31, "Z27(6, -6)": 4.83, "Z28(6, 6)": -1.4, "Z29(7, -1)": -10.19, "Z30(7, 1)": -3.71, "Z31(7, -3)": 1.62, "Z32(7, 3)": -0.33, "Z33(7, -5)": -0.81, "Z34(7, 5)": -2.94, "Z35(7, -7)": -2.49, "Z36(7, 7)": 0.26, "Z37(8, 0)": 3.29, "Z38(8, 2)": 4.2, "Z39(8, -2)": 1.3, "Z40(8, 4)": 1.13, "Z41(8, -4)": -0.34, "Z42(8, 6)": -0.95, "Z43(8, -6)": 2.95, "Z44(8, 8)": -2.91, "Z45(8, -8)": -2.76}, "psf.sigma": [31.5444, 31.5444], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "geometry.tilt", "psf.sigma", "pupil.magnitude", "pupil.phase"], "minutes": 91.83, "saved": "insitu_start_edge_n1345_tilt_s315_ab_n1345_3dcal.h5"} {"set": "insitu_all_n1345_tilt_s315_ab_n1345", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "coverslip_tilt_deg": [[-2.9094230239083623, 0.03758280869758423], [-0.03852071278403147, 0.02513294850233905]], "focus_estimate_nm": 527.9233190203054, "messages": ["held from the start model: every aberration; learnt: the focus and the blur", "44671 detections, 13006 blinks, 21140 frames: 223 held out, 4105 not drawn, 5972 rejected: brightness, 146 rejected: masked, 113 rejected: no fit, 5947 rejected: overlap, 802 rejected: photon step, 1345 rejected: shape, 436 rejected: wide, 274 rejected: z range, 1777 used", "18 of 361 blocks of 200 frames read"], "molecules_used": 1777, "geometry.focus": [607.37], "phase_nm": {}, "psf.sigma": [31.5444, 31.5444], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "geometry.tilt", "psf.sigma", "pupil.magnitude", "pupil.phase"], "minutes": 41.39, "saved": "insitu_all_n1345_tilt_s315_ab_n1345_3dcal.h5"} +{"set": "insitu_all_n1345_ab_n1345", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "coverslip_tilt_deg": null, "focus_estimate_nm": 527.8488302799051, "messages": ["held from the start model: every aberration; learnt: the focus and the blur", "44671 detections, 13006 blinks, 21140 frames: 223 held out, 4105 not drawn, 5972 rejected: brightness, 146 rejected: masked, 113 rejected: no fit, 5947 rejected: overlap, 802 rejected: photon step, 1345 rejected: shape, 436 rejected: wide, 274 rejected: z range, 1777 used", "18 of 361 blocks of 200 frames read"], "molecules_used": 1777, "geometry.focus": [419.97], "phase_nm": {}, "psf.sigma": [39.462], "psf.sigma_crlb": [0.5438], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "psf.sigma", "pupil.magnitude", "pupil.phase"], "minutes": 42.13, "saved": "insitu_all_n1345_ab_n1345_3dcal.h5"} +{"set": "insitu_start_o6_edge_n1345_ab_n1345", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "coverslip_tilt_deg": null, "focus_estimate_nm": 527.9525130553463, "messages": ["held from the start model: \u03b3 = 0.122 and the phase above order 6", "the data prefer the mirrored pupil by 1467 nats: the sign of astigmatism and spherical aberration may be the other one", "44671 detections, 13006 blinks, 21140 frames: 223 held out, 4105 not drawn, 5972 rejected: brightness, 146 rejected: masked, 113 rejected: no fit, 5947 rejected: overlap, 802 rejected: photon step, 1345 rejected: shape, 436 rejected: wide, 274 rejected: z range, 1777 used", "18 of 361 blocks of 200 frames read"], "molecules_used": 1777, "geometry.focus": [536.98], "phase_nm": {"Z5(2, -2)": -5.95, "Z6(2, 2)": 61.31, "Z7(3, -1)": 0.71, "Z8(3, 1)": 24.65, "Z9(3, -3)": 4.77, "Z10(3, 3)": -1.89, "Z11(4, 0)": 29.49, "Z12(4, 2)": 6.24, "Z13(4, -2)": -1.31, "Z14(4, 4)": 4.73, "Z15(4, -4)": 1.34, "Z16(5, 1)": 14.38, "Z17(5, -1)": 8.66, "Z18(5, 3)": 1.65, "Z19(5, -3)": 2.0, "Z20(5, 5)": -5.64, "Z21(5, -5)": 0.02, "Z22(6, 0)": 9.96, "Z23(6, -2)": 0.64, "Z24(6, 2)": 6.32, "Z25(6, -4)": 2.56, "Z26(6, 4)": 1.98, "Z27(6, -6)": -0.88, "Z28(6, 6)": 1.79}, "psf.sigma": [36.1], "psf.sigma_crlb": [0.6125], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "psf.sigma", "pupil.magnitude", "pupil.phase"], "minutes": 69.55, "saved": "insitu_start_o6_edge_n1345_ab_n1345_3dcal.h5"} +{"set": "ab_n1345_h5", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "molecules_used": 3368, "height_nm": 5.000000953674316, "height_crlb": null, "bend_rms_600": 9.098855499153048, "bend_rms_1000": 12.554578064848013, "scatter": 1.390417200756403, "z_bend": {"-1000.0": null, "-900.0": -16.7, "-800.0": -18.8, "-700.0": -11.8, "-600.0": -4.2, "-500.0": 0.7, "-400.0": 5.1, "-300.0": 1.7, "-200.0": -3.3, "-100.0": -4.2, "0.0": -1.1, "100.0": -0.2, "200.0": -3.3, "300.0": -2.7, "400.0": -3.2, "500.0": 8.7, "600.0": 30.7, "700.0": 33.1, "800.0": 9.5, "900.0": 8.1, "1000.0": -5.4}, "phase_nm": {"Z5(2, -2)": -4.28, "Z6(2, 2)": 56.47, "Z7(3, -1)": -3.42, "Z8(3, 1)": 4.78, "Z9(3, -3)": 2.99, "Z10(3, 3)": -2.42, "Z11(4, 0)": 22.87, "Z12(4, 2)": -0.07, "Z13(4, -2)": 0.6, "Z14(4, 4)": 1.67, "Z15(4, -4)": 0.05, "Z16(5, 1)": 2.59, "Z17(5, -1)": 9.66, "Z18(5, 3)": 0.16, "Z19(5, -3)": 1.25, "Z20(5, 5)": -3.4, "Z21(5, -5)": 0.31, "Z22(6, 0)": 7.45, "Z23(6, -2)": 0.8, "Z24(6, 2)": 2.49, "Z25(6, -4)": 0.37, "Z26(6, 4)": 0.57, "Z27(6, -6)": -1.19, "Z28(6, 6)": 2.01, "Z29(7, -1)": 4.64, "Z30(7, 1)": 5.23, "Z31(7, -3)": 1.86, "Z32(7, 3)": -1.62, "Z33(7, -5)": -1.94, "Z34(7, 5)": -1.77, "Z35(7, -7)": -0.92, "Z36(7, 7)": 0.86, "Z37(8, 0)": -3.1, "Z38(8, 2)": 4.07, "Z39(8, -2)": -0.18, "Z40(8, 4)": 2.22, "Z41(8, -4)": 0.17, "Z42(8, 6)": 0.45, "Z43(8, -6)": -1.6, "Z44(8, 8)": 0.71, "Z45(8, -8)": 0.6}, "pupil.gamma": [0.2543], "pupil.gamma_crlb": [0.0044], "psf.sigma": [30.8001], "psf.sigma_crlb": [0.4003], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "geometry.height", "geometry.plane", "psf.sigma", "pupil.gamma", "pupil.magnitude", "pupil.phase"], "minutes": 7.49, "saved": "ab_n1345_h5_3dcal.h5"} +{"set": "insitu_start_edge_n1345_ab_n1345_h5", "files": 1, "wavelength_nm": 690.0, "pixel_nm": [127.0, 116.0], "coverslip_tilt_deg": null, "focus_estimate_nm": 534.5361535759328, "messages": ["held from the start model: \u03b3 = 0.254 and the phase above order 8", "the data prefer the mirrored pupil by 805 nats: the sign of astigmatism and spherical aberration may be the other one", "44671 detections, 13006 blinks, 21140 frames: 223 held out, 4105 not drawn, 5972 rejected: brightness, 146 rejected: masked, 113 rejected: no fit, 5947 rejected: overlap, 802 rejected: photon step, 1345 rejected: shape, 436 rejected: wide, 274 rejected: z range, 1777 used", "18 of 361 blocks of 200 frames read"], "molecules_used": 1777, "geometry.focus": [696.93], "phase_nm": {"Z5(2, -2)": -1.74, "Z6(2, 2)": 76.1, "Z7(3, -1)": -3.84, "Z8(3, 1)": 42.28, "Z9(3, -3)": 4.06, "Z10(3, 3)": 1.43, "Z11(4, 0)": 56.56, "Z12(4, 2)": 20.86, "Z13(4, -2)": 3.75, "Z14(4, 4)": 3.52, "Z15(4, -4)": 3.19, "Z16(5, 1)": 29.28, "Z17(5, -1)": 4.11, "Z18(5, 3)": 5.37, "Z19(5, -3)": 1.31, "Z20(5, 5)": -10.79, "Z21(5, -5)": 1.94, "Z22(6, 0)": 35.28, "Z23(6, -2)": 5.24, "Z24(6, 2)": 19.06, "Z25(6, -4)": 4.23, "Z26(6, 4)": -0.35, "Z27(6, -6)": 1.35, "Z28(6, 6)": 4.07, "Z29(7, -1)": -2.08, "Z30(7, 1)": 10.94, "Z31(7, -3)": 1.15, "Z32(7, 3)": -0.47, "Z33(7, -5)": -0.11, "Z34(7, 5)": -5.43, "Z35(7, -7)": -2.31, "Z36(7, 7)": 1.39, "Z37(8, 0)": 16.98, "Z38(8, 2)": 13.58, "Z39(8, -2)": 4.26, "Z40(8, 4)": 0.12, "Z41(8, -4)": 2.12, "Z42(8, 6)": 1.01, "Z43(8, -6)": -0.05, "Z44(8, 8)": -1.52, "Z45(8, -8)": -1.61}, "psf.sigma": [39.0545], "psf.sigma_crlb": [0.5818], "params": ["emitter.background", "emitter.photons", "emitter.xyz", "geometry.focus", "psf.sigma", "pupil.magnitude", "pupil.phase"], "minutes": 70.54, "saved": "insitu_start_edge_n1345_ab_n1345_h5_3dcal.h5"} diff --git a/docs/uipsf/architecture.md b/docs/uipsf/architecture.md index 136f483b..8378b92f 100644 --- a/docs/uipsf/architecture.md +++ b/docs/uipsf/architecture.md @@ -2667,8 +2667,8 @@ this is not yet a clean test of linearity. their printout). - `npc_rings.chain.yaml`, `rings.batch.yaml` and `rings_vs_z.py`: the NPC rings (`m2_pairs_npc_rings.jsonl`). -**Next, scripts written, not yet run** (the open hypotheses above, tested from the molecules' heights alone; each -script's docstring says how to read it): +**The follow-up's scripts** (the open hypotheses above, tested from the molecules' heights alone; each script's +docstring says how to read it; run below): - `heights.py`: every molecule of the movie (*used*, *held out*, *not drawn*) localised once per model, saved as `heights_.npz` -- height, CRLB, ½ Σ deviance, chip position, frame. The three below read these files. - `tilt_from_edge.py`: the coverslip's edge per tile of the field and a plane through it. A real tilt of 1.6° is @@ -2678,6 +2678,94 @@ script's docstring says how to read it): and the in situ pupils each fit better. - The stack again with h held at 5 nm (`HEIGHT=5`), and in situ started from it, to see whether the stack's h of 75 nm is part of the gap. +- `stack_flatness.py` (added in the follow-up): the AB stack's spots, each with its own δz free, mapped over the + field: how level and how flat a glass slide sits on M2. + +### Follow-up (November 2026) + +The follow-up's scripts were run on M2's data on 15 November 2026, with yesterday's models. The results are in +`benchmarks/uipsf/results/m2_pairs_followup.jsonl` (heights, tilt, drift, score per height, flatness), and +`m2_pairs_cross.jsonl` and `m2_pairs_runs.jsonl` hold the h = 5 nm runs. The stack held, focus learnt, is +`insitu_all_n1345_ab_n1345`, with the focus learnt (not from the edge). `heights.py` took ~6 min per model on +the CPU. + +**The tilt** (`tilt_from_edge.py`, 3 × 3 and 4 × 4 tiles; `stack_flatness.py`): +- *Most tiles have no molecules on the glass.* Their spike fraction is 0, so they lie under the nucleus, + and their "edge" is the nucleus' floor at 160-650 nm, not the coverslip. The plane through every tile + (0.5-1.0°, χ²/dof 40-80) measures that floor, not the glass. +- *Through the three tiles that do have molecules on the glass* (4 × 4, spike 0.7-0.9), the edge falls by + 23-29 nm per µm, 1.3-1.7°. That is the size the pupil learnt, but along the chip's y, while x changes by + only 2-5 nm per µm. The pupil's tilt is along x: in `optics.layers` the normal is (t_x, t_y, 1), and the + runs learnt t_x = −1.6° and t_y = −0.8° (edge, σ held), or t_x = −2.9° and t_y = 0.0° (the stack held). The + 3 × 3 tiling, with two glass tiles at spike 0.3-0.4, gives −8 to −15 nm per µm along y. Three tiles are + little, and a tile's glass can be a flat patch of the cell's underside. +- *A glass slide on M2 is level and flat* (`stack_flatness.py` on the AB sweeps, 2669 spots within 400 nm of + focus). The learnt focal plane slopes +0.64 and +0.23 nm per µm (0.04°). What it leaves per tile is a plane + of −0.01 / −0.26 ± 0.18 nm per µm (4 × 4) and 4-5 nm rms about it (tiles' range 19-23 nm), with χ²/dof 1.0-1.5: + noise. The 10 sweeps' foci moved 31 nm (55 nm in the first sweep, 72-86 nm after). The movie's 23-29 nm per + µm, and the pupil's 1.6-2.9°, are 30-70 times what this slide shows. If the tilt is real it is the cell + sample's (another coverslip in another holder), not M2's stage. + +**The drift** (`edge_vs_time.py`, 10 and 20 blocks of the ~68 000 frames counted): +- *Molecules on the glass appear only at the start.* At frames 92-2215 the spike fraction is 0.32 and the edge + +8 nm. After frame ~2200 the spike fraction is 0 in every block, and the "edge" is the nucleus' floor again. + The fitted line (+34 ± 4 and +48 ± 7 nm per 10 000 frames, the range −46 to +1499 nm with ill-determined + blocks) compares the glass at the start with the floor later. It is not a drift. +- *What the data bound*: from frame ~18 000 to the end, the floor is at 162-237 nm in the well-determined + blocks (errors ≤ 35 nm), within about ±20 nm of 200. The blocks' median height stays at 300-400 nm + throughout. A focus drift of more than a few tens of nm over the last 50 000 frames would show, and does not. + Between frame ~2200 and ~18 000, where the glass vanishes, it is not determined. + +**The score per height** (`score_by_height.py`; bins by the stack-held model's height; the movie's 223 *held +out* and 4105 *not drawn*; nats per molecule, the in situ pupil less the stack's, negative where in situ fits +better): + +| height (nm) | molecules | in situ edge, n 1.345 | in situ free, n 1.33 | +|---|---|---|---| +| 0-200 | 282 | +8.4 ± 4.7 | +3.6 ± 2.0 | +| 200-400 | 2734 | +1.1 ± 0.7 | +1.7 ± 0.7 | +| 400-600 | 819 | −1.1 ± 0.5 | −0.9 ± 0.5 | +| 600-800 | 402 | −2.6 ± 1.5 | −2.7 ± 1.5 | +| 800-1000 | 45 | −6.4 ± 1.8 | −5.8 ± 2.0 | + +- The stack's pupil fits better below ~400 nm, and the in situ pupils fit better above it, by more the deeper + the molecule. +- The surplus crowds at 200-400 nm (2710 of the 4105), which is why it favoured the stack. The *held out*, + drawn evenly in height, reach deeper, which is why they favoured in situ. +- That is a depth-dependent difference, as the index or the nucleus would make, not a pupil error that is the + same at every height. + +**h held at 5 nm** (`ab_n1345_h5`: `HEIGHT=5`, otherwise as `ab_n1345`, 3368 molecules kept): +- *The phase is unchanged*: 0.4 nm rms over Z5-Z45, the largest change in Z11 (24.2 → 22.9) and Z37 (−4.1 → −3.1). +- *γ doubles to compensate* (0.122 ± 0.008 → 0.254 ± 0.004), σ 31.5 → 30.8 nm. The z bend is a little larger + (rms 9.1 against 7.7 nm within 600 nm). +- *On the stack's 553 held-out molecules the two score alike*: 229.39 against 229.43 nats per molecule. h and + γ trade, and the stack cannot tell 5 nm from 75 nm. +- *In situ started from it* (`insitu_start_edge_n1345_ab_n1345_h5`, γ 0.254 held) lands where it did from h = + 75 nm: Z6 76.1 (71.9), Z11 56.6 (55.1), Z12 20.9 (17.4), Z8 42.3 (41.3), focus 697 nm (682), σ 39.1 nm. +- Against the h5 stack, `cross_score.py` gives +5.20 nats per molecule on the stack's held-out molecules + (+4.51 from h = 75), and −1.73 / +0.85 on the movie's held out and surplus (−1.75 / +0.36). The movie's + stack score is the h = 75 stack held, `insitu_all_n1345_ab_n1345`, since no h5 one was learnt. +- The twin test again prefers the mirrored pupil (805 nats). The stack's h is not part of the gap. + +**The order-6 cross-check** (above) is in these files too, as `insitu_start_o6_edge_n1345_ab_n1345`. + +**The hypotheses now**: +- *Ruled out*: + - The stack's h as part of the gap: held at 5 nm, the stack's phase and in situ's are unchanged, and only γ + moves. + - A tilted glass on M2's stage: a slide sits level to 0.04°. + - A focus drift over the last ~50 000 frames, beyond ±20 nm. +- *Supported*: a depth-dependent cause. The in situ pupils win by more the deeper the molecule and lose near + the glass. The candidates are the nucleus' refractive index above the buffer's, or a sample tilt. +- *Undecided*: + - A tilt of the cell's coverslip: the glass tiles slope by the right amount, but along y, not along the + pupil's x, and on three tiles. + - A focus drift in the first ~18 000 frames, which nothing here measures. +- *Next*: + - A focus per block of time in the learning, the first 18 000 frames against the rest. + - A tilt held at the edge's value (along y) in situ, to see what the pupil does with it. + - Learning the index per height range, or an index gradient. ## 4Pi from beads (October 2026; `docs/4pi.md` D7 and §8) diff --git a/docs/uipsf/roadmap.md b/docs/uipsf/roadmap.md index f43c843f..72636e9d 100644 --- a/docs/uipsf/roadmap.md +++ b/docs/uipsf/roadmap.md @@ -144,7 +144,12 @@ when a milestone lands or an item moves. channel prefers its beads' γ by 2 nats per molecule) -- which γ M2's objective has; the dual channel's focus. **In situ against molecule stacks on M2** (12 November 2026, architecture.md, "In situ against molecule stacks on M2"): the stack and the beads agree, in situ in the nucleus puts 15–57 nm more into astigmatism, spherical - and x coma, each model wins on its own held-out molecules; a sample tilt takes most of it; open. + and x coma, each model wins on its own held-out molecules; a sample tilt takes most of it. **Follow-up** + (15 November, "Follow-up (November 2026)" there): the difference depends on depth -- the stack's pupil fits + better below ~400 nm, in situ's above, more the deeper; the stack's h (5 or 75 nm) is not part of it; M2 + holds a slide level to 0.04°, while the movie's few glass tiles slope 1.3–1.7° along y (the pupil's tilt is + along x); no focus drift beyond ±20 nm over the last 50 000 frames, the first 18 000 undetermined. Next: a + focus per time block, a tilt held at the edge's, the index by depth. 10. **Release (M6):** the real benchmark against tuned v1 with no per-dataset settings, CUDA and Windows GPU runs, uipsf documentation, 2.0.