Commit Graph
1271 Commits
Author SHA1 Message Date
x12saandClaude Opus 5.5 eac8336052 fix(lamni): call lamni_lights_on/off on the Galil controller
CI for csaxs_bec / test (push) Failing after 2m57s
The LamNI Galil controller only exposes lamni_lights_on()/lamni_lights_off();
lamni.lights_on()/lights_off() called non-existent lights_on()/lights_off().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 18:25:30 +02:00
x12saandClaude Opus 5.5 2f238a2cc3 fix(lamni): interferometer position readout, scan-center drift and central stop moves
CI for csaxs_bec / test (push) Failing after 3m14s
- show_interferometer_positions() now calls the controller's positions
  method (was calling show_feedback_status) and the method is exposed via
  USER_ACCESS; loop status is taken from J2 like feedback_status() instead
  of misreading the J4 status field (reported True with feedback off).
- lamni_new_scan_center_interferometer: a first-iteration drift above
  150 um is now discarded instead of being skipped in the first move but
  still added in the second iteration.
- loptics_in()/loptics_out() now also move the central stop; lcs_in()
  moves lcsx/lcsy to their configured "in" position and lcs_out() moves
  lcsy to its configured "out" position (was hardcoded 3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:49:34 +02:00
x12saandClaude Opus 5.5 d56a2a6d47 fix(eiger): log JungfrauJoch cancel and flag a Dectris server left armed
CI for csaxs_bec / test (push) Failing after 3m15s
On 2026-10-10 an interlock abort left the Eiger2 Si 500K Dectris server
armed (state ready, stream acquire), and every re-init then failed with
"Detector busy" until the fibres were re-seated. The cancel path logged
nothing on success, so it was not possible to tell what happened.

- stop() logs a successful cancel with its reason, then the Dectris status
- recover_from_error() adds a hint to the error when Dectris is still armed
- on_stop logs that it was called
- tests: block cancel to the production JungfrauJoch host from fixtures

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G1MYT2ByPys8XL6BdfApAF
2026-10-12 11:33:23 +02:00
x12saandClaude Sonnet 5.5 53f74c67f0 fix(eps): use FE-PSH1-EMLS:STATE for front-end shutter state
CI for csaxs_bec / test (push) Failing after 2m54s
X12SA-FE-PH1:OPEN_EPS/CLOSE_EPS no longer exist (unreachable with the machine
up). Drop them and derive the FE shutter open/closed values from
X12SA-FE-PSH1-EMLS:STATE.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYAZk48UNnhKsnzdz7nJNR
2026-10-10 10:48:51 +02:00
x12saandClaude Sonnet 5.5 ad04a40061 feat(eps): move alarm status section towards the end of the status page
CI for csaxs_bec / test (push) Failing after 2m57s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYAZk48UNnhKsnzdz7nJNR
2026-10-10 10:31:30 +02:00
x12saandClaude Sonnet 5.5 bad25d9237 fix(eps): read operator-message PVs so the status page shows them
OPMSG_PVS were never part of all_bulk_pvs(), so the generator's bulk cache
never held them and the page always said "no operator messages".

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYAZk48UNnhKsnzdz7nJNR
2026-10-10 10:31:30 +02:00
x12saandClaude Sonnet 5.5 303fdbe2e3 chore(flomni): remove FZP_30nm_Tomas_Abe_2026.pdf from docs
CI for csaxs_bec / test (push) Failing after 2m57s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYAZk48UNnhKsnzdz7nJNR
2026-10-08 11:49:26 +02:00
x12saandClaude Sonnet 5.5 ae3045322b fix(tomo): drop extra scilog entry for tomo type 4 (flomni, LamNI)
Type 4 wrote a separate scilog entry dumping the whole angle list at scan
start. The regular start entry already names the angle file, so remove the
extra entry and the now-unused _scilog_angle_file_record/_angle_file_scilog.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYAZk48UNnhKsnzdz7nJNR
2026-10-08 11:49:11 +02:00
x12saandClaude Sonnet 5.5 533467775d feat(eiger): log Dectris detector server status on detector error
Log the read-only Simplon status endpoints (detector, stream, monitor,
filewriter) of the Eiger2 Si 500K detector server as one warning line,
right before the EigerError is raised in on_complete and before the
auto re-init wipes the error state. Only enabled when dectris_url is
set, which is the case for the Eiger2 Si 500K only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G1MYT2ByPys8XL6BdfApAF
2026-10-08 11:47:24 +02:00
x12saandClaude Sonnet 5.5 8c6977428e feat(flomni): reset manual shifts after sample change
The manual x/y shifts belong to the previous sample, so zero them once the
new sample is mounted in ftransfer_sample_change().

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LYAZk48UNnhKsnzdz7nJNR
2026-10-07 11:59:15 +02:00
x12saandClaude Sonnet 5.5 5112672368 feat(tomo): warn and confirm on manual tomo_scan_resume() when queue has an unfinished job
CI for csaxs_bec / test (push) Successful in 3m8s
A Ctrl-C abort leaves the queue job 'running'; resuming by hand bypasses the
queue and a later tomo_queue_resume() would resume it again. Manual
tomo_scan_resume() now lists the unfinished job, hints at tomo_queue_resume(),
and asks y/N. tomo_queue_execute() passes from_queue=True to skip the prompt.
OMNY port tracked in a TODO doc.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 22:41:22 +02:00
x12saandClaude Sonnet 5.5 acc5e3b477 config(detectors): use eiger2_si_500k with auto_reinitialize
Enable the Eiger 2 Si 500K (eiger_1_5 commented out) and set auto_reinitialize so
the detector is re-initialised on staging after a JungfrauJoch error.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAEkW1wjZszVKkhQrD8Ad5
2026-10-05 22:41:09 +02:00
x12saandClaude Sonnet 5.5 bb6bd111d0 fix(eiger): expose auto_reinitialize as a device attribute
The device server applies deviceConfig entries via update_config, which rejects keys
that are not attributes of the device ("Unknown config parameter"). A constructor
argument alone is therefore not enough to set auto_reinitialize from the config.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YAEkW1wjZszVKkhQrD8Ad5
2026-10-05 22:39:01 +02:00
x12saandClaude Sonnet 5.5 1f795c399e feat(eiger): optional auto-reinitialize of JungfrauJoch after detector error
When the detector goes into Error state, JungfrauJoch stays in WrongDAQState until
it is initialised again, so every following scan aborts in on_stage. With the new
auto_reinitialize device option, on_stage re-initialises the detector (like the
WEB UI "Initialize" button) before staging; the scan_repeat retry of the failed
projection then succeeds.

- JungfrauJochClient.recover_from_error(), single attempt, only from Error state
- wait_for_idle reports the broker's HTTP 500 message instead of a pydantic traceback
- on_complete fails immediately if the detector is in Error state
- default off; no re-initialisation during an acquisition

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-05 22:30:25 +02:00
x01dcandClaude Sonnet 5.5 517b0f7e3a fix(tomo): type-4 progress GUI + tomo_params window size
CI for csaxs_bec / test (push) Successful in 3m5s
- flomni GUI progress: guard division by total_projections == 0 (type 4
  file without END, endless golden ratio); the error was swallowed and the
  progress window stayed on the reset defaults for the whole scan.
- Fill tomo type/total/subtomo for type 4 right after scan start, so the
  GUI is meaningful during empty frames and the 0-deg reference shot.
- tomo_parameters() window opens at 730x1170.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5CiUfRUwnPyuAkq5Wyptm
2026-10-02 18:32:20 +02:00
x01dcandClaude Sonnet 5.5 28929b174c feat(lamni): tomo_type 4 (angles from file) via shared TomoAngleFileMixin
CI for csaxs_bec / test (push) Successful in 3m4s
Extract flomni's type-4 logic (tomo_angle_file property, parsing helpers,
per-line step/exptime/frames overrides, wait-for-growing-file loop) into
OMNY_shared/tomo_angle_file_mixin.py and use it from both Flomni and LamNI.

LamNI: type 4 in setter/params/queue/CLI/PDF/resume, overrides threaded
through tomo_scan_projection, progress reset before gates, no 180-deg
opposite-angle warning (laminography). Widget profile, webpage row, docs
and tests added.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5CiUfRUwnPyuAkq5Wyptm
2026-10-02 17:01:07 +02:00
x01dcandClaude Sonnet 5 c557eb22d6 feat(lamni): add 30nm zone-plate table to lfzp_info(), matching flomni
CI for csaxs_bec / test (push) Successful in 3m4s
lfzp_info() only showed a 60nm outermost-zone-width table; flomni's
ffzp_info() has always had both a 60nm and a 30nm table. Since the zone
plate now mounted in LamNI is the same one mounted in Flomni, add the
matching 30nm table (diameters 140/170/200/250um, from ffzp_info()) and
relabel the 60nm table's title to match flomni's "Outermost zone width
NN nm" convention, so the two tables read consistently side by side.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 16:38:06 +02:00
x01dcandClaude Sonnet 5 796b78e78f fix(lamni): zero manual_shift_x/y at the start of a fresh alignment run
CI for csaxs_bec / test (push) Successful in 3m6s
LamNI's alignment-start reset (_align_impl(), documented as "the actual
start of a fresh alignment run") already resets reset_correction()/
reset_xray_eye_correction() there, but never touched manual_shift_x/y --
unlike flomni's equivalent, which this session's work already fixed to
zero manual_shift_x/y at the same point. Same risk: a leftover manual
shift from a previous sample would otherwise bias the next sample's
alignment tomogram.

Found via an audit of whether this session's flomni-side changes (+ the
merged fixes/flomni4 branch) called for any analogous LamNI changes --
this was the one confirmed real gap; everything else either already
existed on LamNI, is generic/shared infrastructure that needed no
changes, or is structurally inapplicable (LamNI is 360-degree-only
laminography).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 16:32:16 +02:00
x01dc f08c3ef7b7 Merge remote-tracking branch 'origin/fixes/flomni4' into feat/flomni_tomo_from_angles_file
CI for csaxs_bec / test (push) Successful in 3m7s
# Conflicts:
#	csaxs_bec/bec_ipython_client/plugins/flomni/flomni.py
#	csaxs_bec/bec_widgets/widgets/tomo_params/tomo_params.py
2026-10-01 16:19:45 +02:00
x01dcandClaude Sonnet 5 8e2a320e58 feat(flomni): add "Edit command" for pending command jobs in the tomo queue
CI for csaxs_bec / test (push) Successful in 3m9s
The "Load into editor" button in the queue dialog is now dual-purpose:
for a single selected tomo job it behaves as before, but for a single
selected *pending* command job it relabels to "Edit command" and opens
CommandJobBuilderDialog pre-populated with that job's steps/label/
idempotent flag. On OK the job is replaced in place (same queue
position, same id/added_at); on Cancel the queued job is untouched.

Previously a command job could only be "edited" by deleting it and
rebuilding it from scratch via "Add command..." -- tedious for a
multi-step job and easy to get wrong.

Restricted to status == "pending" (reusing _MOVABLE_STATUSES, the same
set already used for "is this row safe to reorder") -- an "incomplete"
command job may have partially executed steps, a materially different
and riskier case than a never-started one.

Live-verified against the running simulated flomni session: button
correctly relabels per selection, editing a real queued command job
replaces it in place with the id/label preserved, and the session's
queue was left exactly as found afterward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 16:04:22 +02:00
x01dcandClaude Sonnet 5 91eb55bf13 docs(flomni): "Compensating" -> "New" for move_foptz_with_shift's shift fields
CI for csaxs_bec / test (push) Successful in 3m15s
manual_shift_x/manual_shift_y are replaced outright by
move_foptz_with_shift (self.manual_shift_x = manual_shift_x), not adjusted
relative to the previous value -- "Compensating" wrongly implied the
latter. Wording-only change across the GUI field labels, the action's
help/docstring text, and the two AI_docs testing notes that describe them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 15:52:26 +02:00
x01dcandClaude Sonnet 5 47cbb08c13 fix(flomni): check OSA collision warning against fosaz's defined IN position
The foptz-target OSA-collision warning was checking fosaz's current live
readback, but fosaz is normally parked safely OUT except when actually in
use -- so the warning would almost never fire in practice. Check against
fosaz's "in" user_parameter instead (the same nominal position
FlomniOpticsMixin.fosa_in() itself checks before refusing a fosaz move),
since that's the real question: would this foptz target collide with the
OSA if it were swapped in.

Live-verified against the running simulated flomni session: fosaz's
defined IN position is 13.1mm; the warning now correctly engages right at
the real physical crossover (foptz=19 -> +0.90mm clearance, safe;
foptz=20 -> -0.10mm, warns), matching compute_osa_remaining_space()
exactly through the real dialog/client/device-RPC code path.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 15:52:16 +02:00
x01dcandClaude Sonnet 5 a5fcc73049 feat(flomni): warn on OSA collision risk when picking a foptz target
CI for csaxs_bec / test (push) Successful in 2m58s
The tomo-queue "move_foptz_with_shift" dialog now shows a live warning
when the entered foptz target would leave <=0 mm OSA clearance against a
normal OMNY pin (same collision check fosa_in() already enforces for
fosaz moves, surfaced here at data-entry time instead). Advisory only --
the queued action itself stays a plain absolute move, not gated on this.

Extracted the clearance formula out of FlomniOpticsMixin._osa_remaining_space
into a module-level compute_osa_remaining_space(foptz_val, fosaz_val) so
the GUI (a separate process with only RPC device access, no Flomni
instance to call a bound method on) can reuse the exact same formula
instead of duplicating it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 15:38:56 +02:00
x01dcandClaude Sonnet 5 437d9e7559 feat(flomni): fix tomo-queue move allow-list, drop idgap stub, add foptz+shift action
CI for csaxs_bec / test (push) Successful in 3m10s
Queue-control "command job" changes:
- Remove the "optimize_idgap" stub action (not commissioned, always a
  no-op) from both Flomni's and LamNI's action registry, and delete the
  now-dead TomoQueueMixin.optimize_idgap() method.
- Fix the "move" action's device allow-list: "mokev" doesn't exist in the
  current device config at all -- the real energy device is "ccm_energy"
  (LamNI's copy already had this right). Also drop "ftray" (sample
  transfer tray), which was only ever there as a sim-testable move target.
- Add a new "move_foptz_with_shift" action: moves foptz (the FZP
  optics-Z stage) and sets the compensating manual_shift_x/manual_shift_y
  in one atomic step. foptz is deliberately NOT in the plain move
  allow-list -- moving it shifts the aligned scan center (interferometer
  mirrors aren't perfectly parallel to the beam), so this is the only way
  to queue a foptz move, specifically so the compensating shift can never
  be forgotten.
- The foptz target is validated against the device's real, live limits
  (not a hand-duplicated static number) both in the GUI spinbox's range
  and in the CLI's add-time validation, so a queued job can't raise when
  it executes unattended later; a defense-in-depth check also exists at
  execution time.

Retargeted the e2e command-job tests from ftray to foptz (now the only
sim-testable move-adjacent path) and updated the AI_docs testing/GUI-testing
notes to match the new action set.

Also fixes a pre-existing, unrelated broken import
(plugins.omny.omny_general_tools -> plugins.OMNY_shared.omny_general_tools,
already broken on main) in _bootstrap.py/test_tomo_queue.py/
test_tomo_queue_command_jobs.py that was blocking omny_e2e_tests collection
entirely, needed to actually verify this change's own test rewrites.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 15:11:49 +02:00
x01dcandClaude Sonnet 5 cf66e0d1ec feat(flomni): info popup for manual shift x in tomo parameters GUI
CI for csaxs_bec / test (push) Successful in 3m2s
Add a per-field "?" help button, same pattern already used for the
offsets section and Fermat asymmetry. Explains that manual_shift_x is
a constant, angle-independent offset applied on top of the alignment,
only needed in special cases (e.g. when the FZP-to-sample distance is
changed after alignment).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 13:11:15 +02:00
x01dcandClaude Sonnet 5 2a91f94c06 feat(flomni): add manual_shift_x fine-adjustment parameter
CI for csaxs_bec / test (push) Successful in 2m59s
Mirrors the existing manual_shift_y: a persistent, GUI/CLI-settable x
offset applied to the scan center in tomo_scan_projection() and
tomo_acquire_at_angle(), included in tomo-queue snapshots, and reset to
0 at the start of every x-ray-eye alignment run (and on account-change
defaults) so a leftover fine adjustment never biases the next sample's
alignment tomogram. Bounded to +/-10um in the GUI and CLI, narrower
than manual_shift_y's +/-50um range.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 12:58:34 +02:00
x12saandClaude Sonnet 5.5 b4cec42211 fix(tomo_params): enable 'run all sub-tomos forward' on entering edit mode
CI for csaxs_bec / test (push) Successful in 2m58s
_enter_edit_mode_with() called _set_fields_enabled(True) before setting
_edit_mode, so the always-forward checkbox was evaluated with
_edit_mode=False and stayed disabled until the angle range was toggled.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-01 12:54:28 +02:00
x12saandClaude Sonnet 5.5 b3830dc3e5 feat(flomni): option to run all type-1 sub-tomos forward (0->180)
CI for csaxs_bec / test (push) Successful in 3m5s
Add tomo_type1_always_forward (180 deg range only, default off). Every
sub-tomo sweeps 0->180 with an unchanged angle set, so the 0 deg
reference (zero_deg_reference_at_each_subtomo) is taken before all 8
sub-tomos instead of every second one.

Exposed in tomo_parameters(), queue params and the tomo params widget;
resume/reacquire use the same plan. Tests and docs updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-01 12:33:49 +02:00
x01dcandClaude Sonnet 5 c9bf65adda docs(flomni): state the angle-file column-1 range as 0-360
CI for csaxs_bec / test (push) Successful in 3m1s
Keep the user-facing docs at the simple, nominal 0-360 sweep rather
than advertising the stage's -2/362 physical overtravel margin that
_tomo_scan_at_angle()/angle_file.py actually tolerate -- that margin is
a safety/robustness allowance, not something to document as an
intended input range.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 12:06:25 +02:00
x01dcandClaude Sonnet 5 d119bd2ce8 fix(flomni): widen tomo_type-4 angle range to stage overtravel; fix GUI clipping
CI for csaxs_bec / test (push) Successful in 3m4s
Angle files now accept -2 to 362 degrees (the fsamroy rotation stage's
physical overtravel range) instead of the nominal 0-360 sweep. This
required widening both the parser's bounds (angle_file.py) and
_tomo_scan_at_angle()'s own gate (a new _min_scan_angle(), alongside the
existing _max_scan_angle()) -- without the latter, an angle just outside
[0, 360] would have parsed fine but then been silently skipped during
acquisition with no error, which is worse than rejecting it upfront.

Also fixes the type-4 GUI section's "Content:" label clipping its second
wrapped line: QFormLayout sizes that row from the label's sizeHint() at
construction (holding the short "---" placeholder) and doesn't reliably
recompute it when setText() later swaps in longer, word-wrapped content.
_set_angle_file_summary() now recomputes the label's minimum height from
heightForWidth() after every update.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 11:49:49 +02:00
x01dcandClaude Sonnet 5 0332f1c681 fix(flomni): reset tomo progress before pre-flight gates, not after
CI for csaxs_bec / test (push) Successful in 3m18s
tomo_scan() only reset the progress dict (projection/subtomo/angle/
tomo_start_time/heartbeat/...) inside the "new scan" block, which runs
after the eye/optics-in and filter-out-of-beam gates. If either gate
declined (e.g. the setup isn't in measurement condition, which disabling
rt feedback can trigger) or the tomo_type-4 angle-file check raised,
tomo_scan() returned/raised having never touched progress, leaving the
GUI/webpage showing projection/angle/start-time from whatever scan last
completed -- arbitrarily old, and easy to mistake for a scan still
running.

Hoists the "is this a new scan" check to the top of tomo_scan() and
calls progress.reset() there, before any gate runs; the heavier new-scan
actions (sample DB registration, PDF report, collect_empty_frames(), the
0-deg reference shot) stay exactly where they were, after the gates.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 11:22:45 +02:00
x01dcandClaude Sonnet 5 67884c0c3f feat(flomni): tomo_type 4 -- live-appendable angle files, per-line overrides
CI for csaxs_bec / test (push) Successful in 2m59s
Angle files can now be grown while a scan is running: tomo_scan() polls
and re-reads the file whenever it catches up to the current end,
picking up newly appended lines automatically instead of requiring
tomo_scan_resume(). A file is "complete" only once it ends with an
explicit END sentinel line -- without one the scan waits indefinitely
at EOF rather than stopping, so a static/legacy angle file needs END
appended or a scan against it will hang at the end.

Each line may also carry optional step=/exptime=/frames= key=value
tokens overriding the Fermat step size, exposure time, and burst frame
count for that projection and (sticky) every one after it, falling
back to the live tomo_parameters() configuration whenever not set.
Threaded through as kwargs that default to None and are omitted when
empty, so every existing tomo_type 1/2/3 call site and test stub is
unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NPZ9gzN2rt3wgiMnTKyrug
2026-10-01 11:01:16 +02:00
x01dcandClaude Opus 5.5 9373fe307a fix(flomni): no 0-deg damage-estimation shots for tomo_type 4
CI for csaxs_bec / test (push) Successful in 3m4s
Sub-tomogram numbers in a user angle file are just labels, so inserting
extra 0-deg projections at odd sub-tomogram transitions is surprising.
tomo_type 4 now ignores golden_projections_at_0_deg_for_damage_estimation;
the CLI no longer prompts for it and the widget hides it for type 4.
The unconditional 0-deg reference shot at the start of a new tomogram
is unchanged; further 0-deg shots can be put in the file directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 14:57:11 +02:00
x01dcandClaude Opus 5.5 35ac94cfd5 feat(flomni): tomo_type 4 -- angles read from a file
CI for csaxs_bec / test (push) Successful in 3m7s
New angular sampling mode: tomo_angle_file points to a plain-text file
with one angle (0-360 deg) per line, optional 2nd column = sub-tomogram
number, '#' comments. Only the path is stored; the file is re-read at
every tomo_scan() start, resume and queued-job run, so an edited file
always takes effect on the next (re)start. The parsed angle list is
logged to scilog at scan start.

- OMNY_shared/angle_file.py: shared pure parser + summary, incl.
  warning for 180-deg-opposite/duplicate angles
- flomni: tomo_type 4 branch in tomo_scan()/tomo_scan_resume(), bad
  file fails before any acquisition, angles >180 not gated by
  tomo_angle_range, CLI prompt/display, PDF report
- tomo queue: path snapshotted per job; setter does not validate so
  stale paths never break non-type-4 jobs; reacquire bounds by file
- TomoParams widget: type 4 (flomni only) with Browse... file dialog,
  live content preview, validation blocking Submit/Add to queue
- webpage: show angle file in param tables

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 14:46:56 +02:00
x12saandClaude Sonnet 5.5 b15b236673 revert(config): drop shutter_eh1 and restore shutter_es name
CI for csaxs_bec / test (push) Successful in 3m5s
Reverts 7ebc33c and c8f96d5.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-29 14:06:36 +02:00
x12saandClaude Sonnet 5.5 7ebc33c3e1 refactor(config): rename shutter_es to shutter_oh (optics hutch shutter)
CI for csaxs_bec / test (push) Successful in 3m0s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-29 14:04:34 +02:00
x12saandClaude Sonnet 5.5 c8f96d5942 feat(config): add EH1 endstation shutter A open status (shutter_eh1)
CI for csaxs_bec / test (push) Successful in 3m3s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-29 14:00:56 +02:00
x12saandClaude Sonnet 5.5 2e05d1e456 feat(webcam): add exposure, auto-exposure, gain and brightness control to WebcamViewer
CI for csaxs_bec / test (push) Successful in 2m58s
Settings are posted to the camera server's /camera/settings endpoint and read
back on startup in a background thread, so an unreachable server cannot block
device loading. set_exposure_time() disables auto exposure first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-29 13:49:17 +02:00
x12saandClaude Sonnet 5.5 7cb553414a fix(tests): give leye_out shutter test a csaxs and client stub
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 2m56s
leye_out() now reads self.csaxs and self.client (slit/filter handling), which
the bare LamNIOpticsMixin subclass in the test did not define.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 84586ec4bb feat(lamni): move slits and filters in leye_in/leye_out like flomni's feye
leye_in() now widens sl1xs/sl1ys by 0.3mm and narrows the exposure-box
filters to 5% transmission before moving the eye in, and leye_out()
restores the pre-eye slit size and fully opens the filters again, with
a manual-override prompt if the slits were hand-adjusted while the eye
was in. Mirrors flomni's feye_in()/feye_out() intent (which has this
logic only as dead/commented-out code); LamNI now takes an optional
csaxs reference so it can call csaxs.fil_trans() like Flomni does.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 b80c6417d2 fix(lamni): go-live audit tier 2 -- wrong numbers and missing flomni ports
- tomo_scan_projection() now adds the projection to the reconstruction queue
  itself (like flomni), so custom at_each_angle hooks and direct calls are
  reconstructed; _at_each_angle()/MagLamNI no longer do it (no double entry).
  tomo_alignment_scan() opts out (_reconstruct=False) to keep its previous
  behaviour -- flomni's alignment projections are queued, LamNI's never were.
- write_pdf_report(): branch on tomo_type (a golden-ratio scan reported a stale
  type-1 count and a hardcoded '8 sub-tomograms'), e-account from
  bec.active_account, tolerate a missing detector_distance.
- tomo_parameters_cli(): range guards (stitch 0-50, frames 1-100, >= 8
  projections, type-3 >= 1, golden max 0-1e6, bunch size 20-100).
- Webpage: projection count for tomo type 1 used flomni's 180-degree
  sub-tomograms (half the real count); TOMO_TYPES gets a base_angle. Also show
  the piezo range, manual shift and 0-degree reference rows.
- Tomo-params GUI: manual shift is mm end to end (label/range said um, +-1000);
  golden bunch size floor 20 for LamNI (setter/CLI already required it, so a
  smaller GUI value broke tomo_queue_execute). flomni fields untouched.
- lfzp_info() and the queue 'move Energy' entry used the legacy 'mokev' device
  (only in device_configs/legacy); now ccm_energy.
- Special-angle UnboundLocalError fixed in flomni too (list consumed only after
  a successful projection, so retries still see the special angle).
- Tomo type 3: exact integer sub-tomogram numbering (float truncation mislabelled
  the boundary projection for ~35 values of n < 400).
- XrayEyeAlign.align(): always reset the GUI (DAP forwarding, crosshair) on any
  failure; xrayeye_update_frame() warns when beamline states are invalid.
- Stale text / debug print; gap doc updated with the current status.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 657e192b8c fix(lamni): go-live audit tier 1 -- lost projections, shutter, endless-scan GUI, scilog
Found by auditing LamNI against the battle-tested flomni:

- _tomo_scan_at_angle swallowed TimeoutError alarms: the projection was never
  retried, its failed scan numbers were logged as a success and it never
  reached reconstruction. Now the queue is reset and the alarm re-raised so
  @scan_repeat re-acquires it. The special-angle list is consumed only after
  success (a retry must still see it) and num_repeats is always defined.
- tomo_alignment_scan had the same swallow; it now retries (bounded) and
  rewrites ptychotomoalign_scannum.txt with the scan numbers actually acquired.
- leye_out() opened the fast shutter instead of closing it (regression from
  4967474 'removed fsh commands').
- Progress GUI: an endless golden-ratio scan (golden_max_number_of_projections
  == 0) divided by zero on the first projection, and any GUI/RPC failure
  propagated into the scan (retried 10x by @scan_repeat, then aborted). Now
  guarded and wrapped like flomni's dea43ed.
- raise_window() disabled as in flomni (it can hide the GUI window).
- write_to_scilog and the PDF report entry used the removed bec.logbook API;
  they now use bec.messaging.scilog like flomni, never raise, and include the
  at-each-angle hook source in the end-of-scan/timing entries.
- extra_tomo: num_repeats unbound for non-special angles.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 27cdaa197c feat(lamni,flomni): tomo_parameters() opens the GUI window, CLI is tomo_parameters_cli()
- shared TomoQueueMixin.tomo_parameters() opens OMNY_TomoParams in its own
  window (lamni_tomo_params / flomni_tomo_params); repeat calls do not open
  a second one; a missing or failing GUI raises the setup's error and points
  to tomo_parameters_cli() instead of silently falling back
- rename the prompt-based versions to tomo_parameters_cli()
- docs: describe both, and use the CLI in the queue examples that rely on
  the command blocking until the values are entered
- add tests with a fake GUI

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gUjUT2xCNpnBQkThn3CqP
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 0d42cb303b fix(lamni,flomni): create documentation folder before writing the tomo PDF report
PDFWriter does not create directories, so tomo_scan() failed with
FileNotFoundError when ~/data/raw/documentation did not exist. Also add an omny
TODO for porting the remaining ~/Data10 paths and the same folder fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gUjUT2xCNpnBQkThn3CqP
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 7753dfff38 fix(lamni): port flomni's tomo_reconstruct scan-list fallback and folder resync
- fall back to the last completed scan number when _current_scan_list is
  missing or stale (direct calls outside tomo_scan_projection)
- re-read ptycho_reconstruct_foldername on every write so changes from
  another client session are picked up
- add tests

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gUjUT2xCNpnBQkThn3CqP
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 af7878988e feat(lamni): add lamni_move_to_scan_center wrapper, document shift computation
- LamNI.lamni_move_to_scan_center(shift_x, shift_y, angle): thin client
  wrapper around scans.lamni_move_to_scan_center with the same parameters
  and docstring
- user docs: describe how the per-projection shift is computed (base shift,
  x-ray eye fit, manual shift, correction tables) in the fine alignment
  section, and add a section on checking the x-ray eye correction with the
  eye still in

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gUjUT2xCNpnBQkThn3CqP
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 b066b526c1 fix(lamni): scan defaults, sim feedback interlock, fttrz draft
- lamni/omny fermat scan: default exp_time 0.1, drop unused readout_time
  (devices already fall back to their own configured readout time)
- sim_lamni: refuse the sd scan start and abort a running scan while the
  interferometer feedback loop is off; add tests
- simulated_lamni.yaml: lsamrot sim_velocity 48 (4x hw)
- lamni_optics_mixin / ptycho_lamni.yaml: commented-out draft for moving the
  fttrz flight tube in leye_out/leye_in, pending commissioned positions

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gUjUT2xCNpnBQkThn3CqP
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 15c720e89e fix(lamni): fully reset tomo progress when a new tomo scan starts
tomo_scan() only reset the timing/ETA fields, so after a finished scan the
progress GUI kept showing the old subtomo, angle and projection == total
(rings at 100 %) while the initial 0-degree reference shot ran, with an ETA
computed from the old projection count against the new start time.

New _reset_progress_for_new_scan() resets every field (incl. the right
totals for the tomo type) in one global-var update and refreshes the GUI.
Resumes are unaffected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:07:46 +02:00
hollerandClaude Sonnet 5 fd4e8a2de1 fix(lamni): tomo_scan_resume resumes at the interrupted angle, not a shifted sweep
_subtomo_angle_plan() used an explicit start_angle as the origin of a new
360-degree sweep. Resuming subtomo 2 at 85 deg generated 435..85; the >360
artifacts were silently skipped by _tomo_scan_at_angle's range gate, so the
resume began at 355 deg, re-measured done angles, never reached the rest and
reported wrong progress indices.

start_angle is now the literal resume point on the sub-tomogram's own grid:
the plan returns the remaining tail of the normal sweep plus a subtomo_offset
used for progress numbering (mirrors Flomni). Off-grid angles raise ValueError.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:07:46 +02:00
x12saandClaude Sonnet 5 00ddc5f560 fix(eiger): resolve live preview data channel per detector, not "default" only
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 2m57s
The Eiger2 Si 500K's multi-threshold JFJ preview messages key the frame
under a threshold name (e.g. "threshold_1"), not "default" as eiger_1_5/
eiger_9 do -- confirmed by capturing the live JFJ ZMQ preview stream.
_preview_callback hardcoded "default", so it silently dropped every
frame for eiger2_si_500k (251+ "without data" errors in DeviceServer.log,
matching the empty BEC image widget). Now prefers "default" when present
and falls back to whichever single channel the broker actually sent.

Also document the JFJoch Web UI (http://sls-jfjoch-001.psi.ch:8080) and
the Eiger 2 Si 500K detector server address (129.129.122.159) in
bl_detectors.yaml's Eiger section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 12:44:42 +02:00