diff --git a/csaxs_bec/bec_ipython_client/plugins/LamNI/AI_docs/HW_COMMISSIONING_SESSION_2026-07.md b/csaxs_bec/bec_ipython_client/plugins/LamNI/AI_docs/HW_COMMISSIONING_SESSION_2026-07.md index 1e44f44..82783fa 100644 --- a/csaxs_bec/bec_ipython_client/plugins/LamNI/AI_docs/HW_COMMISSIONING_SESSION_2026-07.md +++ b/csaxs_bec/bec_ipython_client/plugins/LamNI/AI_docs/HW_COMMISSIONING_SESSION_2026-07.md @@ -1,6 +1,6 @@ # flomni/lamni parity fixes — 2026-07 session summary -Branch `fixes/lamni_hw_commissioning`, commits `6c3d603..c3877ec`. Very brief +Branch `fixes/lamni_hw_commissioning`, commits `6c3d603..e3c979a`. Very brief by design — `git show ` on any commit below has the full reasoning and diff; that's the source of truth if something needs revisiting. @@ -39,13 +39,58 @@ diff; that's the source of truth if something needs revisiting. before this session — confirmed identical to flomni's, nothing changed there. GUI needed no new UI code, just flipping lamni's `has_zero_deg_reference` profile flag to `True`. +8. **`e59a42f`** — ported flomni's per-projection/tomogram JSONL timing log + (`~/data/raw/logs/timing_statistics/*.jsonl`) and `scilog_last_ptycho_scans(n)` + to lamni, adapted for lamni's own param names (no `fovx`/`fovy`/ + `single_point_instead_of_fermat_scan` — uses `tomo_circfov`/ + `lamni_piezo_range_x`/`y` instead). +9. **`b4c262d`** — lamni now offers a tomo-parameter reset when the active + BEC account changes (`_maybe_reset_params_on_account_change()`/ + `_set_default_tomo_params()`), preventing a new experiment silently + inheriting the previous one's tuned FOV/stitch/etc. +10. **`7863b8f`** — `lfzp_in()`/`losa_in()` now skip the move (and, for the + FZP, the expensive feedback-disable + reset-enable cycle) when already in + position, matching flomni's `ffzp_in()`/`fosa_in()`. Also added the same + optimization to `losa_out()` as a lamni-side enhancement (flomni's + `fosa_out()` has no equivalent). **Found and fixed a real correctness + risk while checking every existing caller**: `x_ray_eye_align.py`'s + "Step 0: FZP centre" (start of a fresh alignment run) depended entirely + on `lfzp_in()`'s old *unconditional* reset to re-zero the interferometer + — now explicitly calls `lfzp_in(force_feedback_reset=True)` there so that + behavior is preserved regardless of the new skip-optimization. +11. **`db18929`** — added flomni's OSA collision-clearance warning + (`ffzp_info()`) to lamni's `lfzp_info()`. lamni's own collision-boundary + constant has never been measured, so it's read from `loptz`'s device + config (`userParameter.collision_offset`, currently unset everywhere, + including the simulated config) via a new non-raising + `_get_user_param_optional()` helper — prints a clear "not commissioned" + warning and skips the numeric estimate until someone adds the real + measured value to the config. Deliberately **not** a CLI-settable + parameter (per your explicit correction) — this is deployment-level + hardware calibration. +12. **`12b2538`, `e3c979a`** — new `lamni.tomo_alignment_scan()`, replacing + the awkward documented workaround (configure a full tomo_type-1 setup + with 96 projections, launch just `sub_tomo_scan(1, 0)`) with a dedicated + command mirroring flomni's: adjust `tomo_parameters()`, then call + `tomo_alignment_scan()` directly — no tomo_type/sub-tomogram bookkeeping + needed. Runs 12 points across the full 360° (lamni has no 180° symmetry + the way flomni does, so covers the whole circle rather than flomni's + 5-point/180° scan). Aborts if x-ray-eye alignment hasn't been done yet. + Writes the same 4-line scan-number/angle/offset log flomni's version + does, to `~/data/raw/logs/ptychotomoalign_scannum.txt`, for + **`BEC_ptycho_align`** (not `SPEC_ptycho_align.m` as initially assumed — + corrected in `e3c979a`). `docs/user/ptychography/lamni.md`'s "Fine + alignment" section rewritten to match. Known scope limit: calls + `leye_out()` unconditionally (flomni's equivalent skip-if-already-set-up + optimization has no lamni-side helpers to reuse yet — separate follow-up + if needed). **Parked, not done:** `DataDrivenLamNI`'s broken `_start_beam_check()` calls (missing mixin) — deferred on request, separate task if ever needed. ## What to test to confirm everything's still healthy -**Automated** — should show `423 passed, 15 skipped`: +**Automated** — should show `458 passed, 15 skipped`: ``` /opt/bec_deployments/production/bec_venv/bin/python -m pytest tests/ -q ``` @@ -59,17 +104,31 @@ beamline:** - `lamni.tomo_queue_add()` a couple of jobs → `tomo_queue_execute()` → `tomo_queue_reacquire(0, )` on a finished job → confirm status flips and later jobs go `pending` → `tomo_queue_resume()` re-runs them. -- `lamni.tomo_parameters()`: confirm the hook line (if one's registered) and - the "Estimated Fermat scan points" line both appear, with a warning shown - for a deliberately tiny piezo range / coarse step. +- `lamni.tomo_parameters()`: confirm the hook line (if one's registered), + the "Estimated Fermat scan points" line, and the account-change reset + prompt (switch `bec.active_account` and re-instantiate `LamNI`) all behave + as expected. - GUI (`TomoParamsWidget`, lamni active): hover a queued job and confirm only relevant fields show; confirm the new Fermat-points field updates live and - turns orange under the same tiny-FOV condition. + turns orange under a tiny-FOV condition; confirm the "0° reference each + sub-tomo" checkbox (type 1) is now available. - A real `lamni_fermat_scan` with too few points should still hit its `ScanAbortion` safety net unchanged (the warning above is advisory, not a replacement for it). -- `lamni.zero_deg_reference_at_each_subtomo = True` (or the GUI's "0° - reference each sub-tomo" checkbox, type 1 only), run a short type-1 +- `lamni.zero_deg_reference_at_each_subtomo = True`, run a short type-1 `tomo_scan()`, and confirm the extra 0-deg shots land right before - sub-tomograms 1/3/5/7 plus one final shot after sub-tomogram 8, in the - console output / `tomography_scannumbers.txt`. + sub-tomograms 1/3/5/7 plus one final shot after sub-tomogram 8. +- Call `lamni.lfzp_in()`/`losa_in()`/`losa_out()` twice in a row and confirm + the second call skips the move; run `start_x_ray_eye_alignment()` twice in + a row (FZP already in position the second time) and confirm the + interferometer is still freshly reset at Step 0 both times. +- `lamni.lfzp_info()`: confirm the OSA "not commissioned" warning appears + (no `collision_offset` configured yet); once a real value is measured and + added to `loptz`'s device config, confirm the collision-clearance numbers + print sensibly. +- `lamni.tomo_alignment_scan()`: with `tomo_fit_xray_eye` unset, confirm it + aborts; with it set, confirm 12 scans run across 360°, the scan-number + file is written, and the console/scilog summary is correct. Confirm + `BEC_ptycho_align` can actually consume the written file format (this is + the one item in this batch whose exact file-format compatibility with the + real Matlab tool hasn't been confirmed against real data).