Fzp move beyond #338

Merged
holler merged 20 commits from fzp-move-beyond into main 2026-10-26 13:19:41 +01:00
20 Commits
Author SHA1 Message Date
Mirko HollerandClaude Opus 5.5 98abc5a1ca Merge main into fzp-move-beyond: FZP how-tos keep the branch version (rewritten 2026-10-23: move-beyond, loop settings, scan modes; supersedes the 2026-10-20 update on main)
CI for csaxs_bec / test (pull_request) Successful in 4m42s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 4m30s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 13:05:49 +01:00
Mirko HollerandClaude Opus 5.5 2c168e6154 feat(flomni): flomni_loop_settings stores target_shaper_scale and jump_max_um_x/_y as own signals (scan-mode profiles)
CI for csaxs_bec / test (push) Successful in 4m26s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 12:12:02 +01:00
Mirko HollerandClaude Opus 5.5 76723df5e3 docs(flomni): scan-mode profiles (high_res, high_res_1v5, normal, low_res) instead of fast_scan
CI for csaxs_bec / test (push) Successful in 4m30s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 11:59:03 +01:00
Mirko HollerandClaude Opus 5.5 43e92f1e44 feat(flomni, lamni): end-of-scan statistics with the time split: scan time (kickoff -> end in the RT loop), exposure (points x requested exp_time x frames, passed with the kickoff), overhead per point
CI for csaxs_bec / test (push) Successful in 4m18s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 11:18:10 +01:00
Mirko HollerandClaude Opus 5.5 9edeb661f9 feat(lamni): rt_positions prints the average of the per-point standard deviations and the average angle to the BEC CLI at the end of each scan (as flOMNI); the log line printed the sums
CI for csaxs_bec / test (push) Successful in 4m28s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 11:01:34 +01:00
Mirko HollerandClaude Opus 5.5 68ea8235e6 feat(flomni): rt_positions prints the average of the per-point standard deviations (sample vs FZP during the exposures) to the BEC CLI at the end of each scan; no ZeroDivisionError when no point was read
CI for csaxs_bec / test (push) Successful in 4m18s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 10:59:15 +01:00
Mirko HollerandClaude Opus 5.5 81d9e9eec0 docs(flomni): PDFs of the realtime_system guide and the FZP how-tos (for the web HMI tab Docs)
CI for csaxs_bec / test (push) Successful in 4m29s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QnSJvqxh9oDbshx8qXgeiX
2026-10-26 10:43:30 +01:00
x01dc 692ee47836 token added to config file
CI for csaxs_bec / test (push) Failing after 2m35s
2026-10-26 09:27:16 +01:00
x01dc 5937d93040 mod config files
CI for csaxs_bec / test (push) Successful in 4m40s
2026-10-26 09:08:33 +01:00
Claude 04aa7713fb fix(flomni): two 0-deg shots at the start of type 1, stop on declined gates, arrow-key tweaks, CLI angle range
CI for csaxs_bec / test (push) Successful in 4m34s
- tomo_scan type 1 with zero_deg_reference_at_each_subtomo: no extra reference before sub-tomogram 1
  of a new scan (fixed 0-deg shot + sub-tomogram 1's first projection = 2 in a row, was 3)
- tomo_scan: a declined eye/optics or filter gate raises FlomniError instead of returning (the tomo
  queue marked the job "done" without data)
- feye_out / feye_in: "no" (direct beam still visible, fttrx1 missing) raises FlomniOpticsError instead
  of returning (tomo_alignment_scan measured on with the eye in)
- tweak_cursor and laser_parameters_tweak_tracking: read_escape_suffix() waits briefly for a split
  arrow-key sequence and ignores ESC alone (read(2) unpacking raised); tweak_cursor message names the device
- tomo_parameters_cli: angle range re-asked until 180 or 360; _get_val re-asks on a non-number
- check_position_is_valid message 0-20; collect_empty_frames docstring: the sample is moved out
- omny/AI_docs/TODO_flomni_review_2026-10_findings.md: the same bugs in OMNY (x-ray eye Ctrl-C, special angles)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-24 06:55:43 +00:00
Claude b939793416 fix(flomni): x-ray eye Ctrl-C handler looked up fsamx by device object; ffzp_info collision position
- start_x_ray_eye_alignment: _get_user_param_safe() needs the device name (dev[name]); with dev.fsamx the
  KeyboardInterrupt handler raised KeyError and fsamx was never returned to its in position
- ffzp_info: the OSA collides at fosaz = 33 - foptz (compute_osa_remaining_space), printed 33 - fosaz

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-24 06:43:17 +00:00
Claude 1a5b53c031 fix(flomni): review fixes: absolute isclose tolerances, alignment retry, special angles, resume after completion
- np.isclose(a, b, x) took x as rtol: fsamx out (+-1.6 mm), gripper sensor voltage (+-0.55 V / +-1.1 V at
  -2.2 V), fsamx in checks now use atol (0.2 / 0.5 mm, 0.25 / 0.5 V, fsamx out 0.5 mm = Galil tolerance)
- tomo_alignment_scan: an angle with a TimeoutError is repeated (successful was set unconditionally, the
  angle was skipped); ptychotomoalign_scannum.txt is rewritten with the accepted scans if numbers shifted
- special angles: special_angle_tolerance is used (was hard-coded 0.5; init value 20 -> 0.5), any remaining
  special angle matches (not only the first in the list), kept on tomo_scan_resume in the same session
- tomo_scan_resume after a completed scan does nothing (progress tomo_completed; re-acquired the last
  projection and repeated the end-of-scan steps before); tomo_queue_reacquire clears the flag
- laser_parameters_tweak_tracking docstring: step 0.02

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-24 06:38:54 +00:00
Claude 7c0a15115d docs(flomni): loop settings out of the user guide; beamline-scientist document local_contact_only-realtime_system.md
Mirko 2026-10-23: a user could change the loop settings and even save them as the new default. The user guide now
only says that the real-time loop settings are set by the local contact, that every scan stores them, and where the
details are; the commands (realtime_system, trigger, tracker), the profiles, save_as_default, the baseline device,
the connection and the web HMI are in plugins/flomni/docs/local_contact_only-realtime_system.md. The detector
trigger section of the user guide keeps the explanation and the measured times, without commands. show() / help()
name the document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 18:57:47 +00:00
Claude 76aa2b9e56 feat(flomni): realtime_system.help(name) / help("all"); marked beamline scientists / local contact only
- help("<setting>"): what it does (help text of the flOMNI definition, as the web HMI tooltips), range, live and
  saved value, the loop parameters it sets, its rules; help("all"): every setting by group
- realtime_system is for beamline scientists / local contact only (Mirko 2026-10-23): module docstring, a line at
  show() / help(), user guide section heading and note
- tests: help output

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 18:56:12 +00:00
Claude 533fca8c24 feat(flomni): realtime_system goes through the device flomni_loop_settings (RPC); token in its device config
Mirko 2026-10-23: the token goes into the device config (behind the beamline firewall like the other devices); the
user commands call the BEC device in the background.

- FlomniLoopSettings: api_get / api_post (RPC for flomni.realtime_system; only /api/settings* and /api/status;
  10 s timeout, no back-off). Not named set / put: the BEC device server treats those as ophyd writes (refused on
  a readOnly device; checked in bec_server rpc_handler.py)
- FlomniRealtimeSystem: requests through dev.flomni_loop_settings when it exists and is enabled (errors from the
  device -> RealtimeSystemError), else direct HTTP as before; show() names the route
- ptycho_flomni.yaml: token field (empty: token_file is used)
- tests: RPC methods and path check; routing through a device and back to direct HTTP when it is disabled
  (checked against bec_server: deviceConfig keys are matched to the constructor parameters, device_manager is
  passed, the constructor does no network access)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 16:39:40 +00:00
Claude e418f96a1e feat(flomni): baseline device flomni_loop_settings - the loop settings stored with every scan
Decisions Mirko 2026-10-23: settings only (not all loop parameters), snapshot at the scan start, web HMI down ->
marked unavailable and the scan continues, flOMNI only for now, token part of the device configuration.

- devices/omny/flomni_loop_settings.py (new): FlomniLoopSettings, readoutPriority baseline (the Fermat scan reads
  the baseline devices in prepare_scan): one signal per setting (21, NaN when not available), available, message,
  unsaved / inconsistent counts, violated error rules, definition path + sha1, compact snapshot_json; never
  raises; after a failure no new attempt for 60 s (a tomogram does not wait for the timeout at every projection);
  show() / snapshot() for the user
- devices/omny/webhmi_client.py (new): the HTTP client (URL with port-80 fallback, token value or file, errors)
  shared by the device and flomni.realtime_system (which now uses it; behaviour unchanged)
- ptycho_flomni.yaml: flomni_loop_settings with token_file (the token value only in a config that is not
  committed), host mpc2844.psi.ch, timeout 2 s
- tests: tests_devices/test_flomni_loop_settings.py (stub web HMI: values, counts, unavailable / back-off,
  unreachable, token file); checked end-to-end against the web HMI with the flOMNI definition and fakecore (all
  21 settings filled)
- user guide: the settings are stored with every scan

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 16:36:46 +00:00
Claude 1806b721b1 flomni: interferometer_trigger_* removed (use realtime_system.trigger_*); realtime_system falls back to port 80
- the former flomni.interferometer_trigger_* aliases are removed (Mirko 2026-10-23); user guide updated
- flomni.realtime_system: when the default URL http://<rtx host>:8080 is not reachable, the request goes to port
  80 of the same host (nftables redirect to the web HMI on the loop machine) and that URL is kept; an explicit URL
  (argument or FLOMNI_WEBHMI_URL) gets no fallback; test added

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 14:02:37 +00:00
Claude 6dbf8784ff docs(flomni): realtime_system in the user guide; FZP how-tos with the loop-settings profiles
- user guide: detector-trigger commands under flomni.realtime_system.trigger_* (old names still work), new section
  "Real-time loop settings (expert)"
- calibration how-to: steps 1-3 as profiles fzp_off / fzp_calibration / production (+ fast_scan); trigger values are
  OnTargetTrigger parameters; move-beyond sizing with the loop-settings rule (0.6 x stroke - Abbe limit)
- range how-to: FZP range through the loop settings (Ub / Lb and Feedforward limits together)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 12:55:32 +00:00
Claude 79f5cced42 feat(flomni): flomni.realtime_system - loop settings through the web HMI; ConstEmitter emitter_* removed
The ConstEmitter is no longer in the flOMNI loop (flOMNI 773df74, branch fzp-move-beyond): its values are module
parameters, set with their rules by the web HMI on mpc2844 (RT-system webhmi/loopsettings.py, REST /api/settings).

- flomni_realtime_system.py (new): FlomniRealtimeSystem, flomni.realtime_system: show / get / check / set
  (refused with the reason, adjust=True for the dependent settings) / profiles / apply_profile / unsaved /
  save_as_default, shortcuts trigger_* and tracking_targets; stdlib HTTP, API token from ~/.flomni_webhmi_token
  (FLOMNI_WEBHMI_TOKEN_FILE), URL http://<rtx host>:8080 (FLOMNI_WEBHMI_URL). No logic of its own: the same rules
  as the web page.
- flomni.py: flomni.realtime_system; laser_parameters_* and laser_parameters_tweak_tracking() through it;
  interferometer_trigger_* are aliases of realtime_system.trigger_* (renamed, Mirko: "interferometer" was
  confusing next to flomni.laser_*)
- rt_flomni_ophyd.py: emitter_* methods and their USER_ACCESS entries removed (the e-commands now answer with an
  error line); move_xyz stays
- tests: test_flomni_realtime_system.py against a small local HTTP server standing in for the web HMI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 12:55:31 +00:00
Claude ea9f8cdf01 docs(flomni): FZP how-tos as Markdown, updated for the PREEMPT_RT loop, move-ahead renamed to move-beyond
Markdown versions of local_contact_only-howto_calibrate_the_fzp_scanner.pdf and
local_contact_only-howto_limit_the_fzp_scanner_range.pdf (original text kept, update sections for the present
flOMNI loop). New section "Move-beyond" (FAST_FZP_PID_LOOP(0) < 0 of the sample PIDs): mechanism, sizing (about
half the FZP stroke), Abbe correction on the FZP side, hold (5) now reads the FZP drive incl. feedforward
(flomni repo, branch fzp-move-beyond, 6a15f68). The PDFs are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019aWcwG89wi7oVyrefukXX6
2026-10-23 10:34:48 +00:00