The "no web authentication yet" hint always said
flomni.set_web_password(), which doesn't exist in a LamNI session. Each
generator now declares CLIENT_NAME and the hint uses it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALDnH16dC6iyHjhe5Ey4w9
lamni.xrayeye_refit([angles]) redoes the sinusoidal X-ray eye fit from the
last alignment's points, leaving out the given angles (misclicks, sample
barely visible). Prints each point's deviation from the new fit, shows the
kept points on the GUI Fit tab and asks before replacing tomo_fit_xray_eye.
The raw offsets are kept in the lamni_xeye_fit_data global var (cleared with
the fit); archived alignments can be refitted via file=.
Also clear omny_xray_gui.fit_params_x/y before submitting new alignment
points, so a previous run's fit is not taken as the new one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ALDnH16dC6iyHjhe5Ey4w9
Ellipse tool is hidden by default and only enabled by the LamNI client in the
extended/smear rotation-centre modes after the FZP click. Adds angle lock
toggle/field, rotation-aware geometry, and roi_angle_{step} submit signal.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- test_x_ray_eye_align: mock mvx/mvy as 0 so find_rotation_center() sees no
pending arrow press; add a test that arrow shifts during the isolated
calibration are applied with angle=0.0 and subtracted from the clicks.
- test_lamni_tomo_angle_file: drop the "Tomo type 4" scilog assertion; that
entry was removed in ae30453.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The GUI arrow buttons were enabled during find_rotation_center() but never
polled. In isolated mode they now move lsamx/lsamy via
lamni_move_to_scan_center(angle=0.0); the running shift is subtracted from
the 0 and 180 deg clicks before computing the axis midpoint, so the new
center stays correct when the particle had to be brought into the FOV.
Extended mode now disables the (non-functional) arrow buttons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the min-projection, the opaque sample holder rotating through the
X-ray eye view blackened every pixel it passed at any angle and shrank the
usable field of view. SmearComposite now ignores, per frame, pixels darker
than opaque_level (default 0.25) times the frame's 99th-percentile value
and takes the minimum over the remaining frames; pixels opaque at every
angle fall back to the plain minimum, and opaque_level=0 is the plain
minimum. opaque_level is passed through from
lamni.xrayeye_rotation_center_calibration_smear_experimental() and stored
in the calibration HDF5.
The smear capture-rate test now replaces the module's time instead of
patching time.time globally, which EPICS CA threads left running by other
tests also advanced.
Docs: smear opaque_level, LamNI optics in/out incl. central stop,
interferometer feedback commands, and moving to the scan centre including
the X-ray eye fit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0155LWmbktVgWdnRZqtveqQv
The smear rotation-center aid built a max-projection composite, which suits
bright features on a dark background. On the X-ray eye the sample shows up
in absorption (dark on bright), and a max-projection washes those features
out because every pixel sees the bright background at some point during the
rotation.
Add projection="min"|"max" to _smear_sweep(),
find_rotation_center_smear_experimental() and
lamni.xrayeye_rotation_center_calibration_smear_experimental(), defaulting
to "min". Invalid values raise before any motion; the choice is stored in
the calibration HDF5. User and developer docs updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- main.yaml: load ptycho_lamni.yaml instead of ptycho_flomni.yaml
- ptycho_lamni.yaml: add lcsx/lcsy central stop stages; new 250 um / 30 nm
FZP (Abe Tomas 05/2026) optics positions; updated lsamx/lsamy centers,
X-ray eye in positions, cam_xeye rotation and pixel calibration
- ptycho_flomni.yaml: optics/OSA positions for the 250 um / 30 nm Tomas
FZP; updated fttrx in/out
- bl_detectors.yaml: disable eiger2_si_500k
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
- 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>
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
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
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
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>
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
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>
- 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
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
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
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
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
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
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
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
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
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
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
_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>
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>
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
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
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
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
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>
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>
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>
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>