Commit Graph
759 Commits
Author SHA1 Message Date
x12sa c131bccada fix: add timeout to MCS card status checks to prevent deadlock
CI for csaxs_bec / test (push) Successful in 1m34s
2026-07-05 10:24:00 +02:00
x12sa 11e5dbe5ce webpage_generator: tomo queue - don't reopen a manually collapsed running job
CI for csaxs_bec / test (push) Successful in 1m30s
renderTomoQueue auto-opened the running job whenever the open-state snapshot
was empty, so collapsing the only open job (the running one) made the snapshot
empty and re-opened it on the next refresh. Open-state was also keyed by
positional index, which mis-assigns the flag when jobs are added/removed/
reordered.

- Snapshot open jobs by stable key (added_at|label) via a data-key attribute
  instead of positional index.
- Auto-open a running job only once, on first appearance, tracked in
  window.__tqAutoOpened; afterwards honor the DOM snapshot so a manual collapse
  sticks. Prune the set when jobs disappear.
2026-07-05 09:06:12 +02:00
x12sa 4975b3e3ca webpage_generator: report blocked on interlock even when scan is interrupted
CI for csaxs_bec / test (push) Successful in 1m34s
A block interrupts the running scan, clearing active_request_block, so
the old _derive_status() (which only returned 'blocked' inside the
queue_has_active_scan branch) fell through to 'idle' with the blocked
LED off, despite watched beamline states being out of spec.

- _derive_status: return 'blocked' on beamline_blocking OR queue_locks,
  independent of active scan; only fresh-heartbeat 'scanning' outranks it.
- _cycle: beamline_blocking = enabled is True AND any(state mismatched).
  Gated on enabled so a disabled/unknown interlock with an out-of-spec
  state does not raise BLOCKED. Also counted as activity so the idle
  clock restarts once cleared.
- beamline-states card summary updated in lock-step: mismatched states are
  only called "currently blocking" when enabled, else "out of spec
  (interlock disabled/unknown, not blocking)", so pill and card can't
  disagree.
- status-detail JS: describe blocking beamline states when no explicit
  queue lock is present. Update help text.
2026-07-05 08:53:30 +02:00
x12sa daf527b8df webpage_generator: make tomo-queue and tomo-type formula setup-configurable
CI for csaxs_bec / test (push) Successful in 1m36s
webpage_generator: report blocked on interlock even when scan is interrupted

- Add HAS_TOMO_QUEUE and TOMO_TYPES capability flags to
  WebpageGeneratorBase, defaulting to flomni's current behavior
  (type1 grid-8, type2/3 golden-capped) so this is a no-op for flomni.
- Gate the tomo_queue global-var read in _cycle() behind
  HAS_TOMO_QUEUE; unaffected: queue_status/queue_locks/beamline_states,
  which come from BEC's own primary scan queue and stay common to
  all setups.
- _render_html() now conditionally emits the 'Tomo queue' card and
  its DEFAULT_ORDER slot, and drives the projection-count formula
  from a TOMO_TYPES JSON blob (generic calcProjections()) instead of
  a hardcoded per-instrument JS branch.
- LamniWebpageGenerator: HAS_TOMO_QUEUE=False, TOMO_TYPES with
  2-subtomo and 8-subtomo equally_spaced_grid entries (placeholder
  keys pending real tomo_type values from the LamNI producer side).

A block interrupts the running scan, clearing active_request_block, so
the old _derive_status() (which only returned 'blocked' inside the
queue_has_active_scan branch) fell through to 'idle' with the blocked
LED off, despite watched beamline states being out of spec.

- _derive_status: return 'blocked' on beamline_blocking OR queue_locks,
  independent of active scan; only fresh-heartbeat 'scanning' outranks it.
- _cycle: compute beamline_blocking = any(state mismatched), defined
  identically to the beamline-states card so pill and card can't disagree;
  also count it as activity so the idle clock restarts once cleared.
- status-detail JS: describe blocking beamline states when no explicit
  queue lock is present. Update help text."
2026-07-05 05:20:51 +02:00
x12sa dab331f9d0 docs update
CI for csaxs_bec / test (push) Successful in 1m28s
2026-07-04 08:16:03 +02:00
x12sa 625a9f1063 fix(flomni): warn on OSA position vs IN-position clearance mismatch in ffzp_info
CI for csaxs_bec / test (push) Successful in 1m32s
fosaz_info previously only reported remaining collision clearance for the
live fosaz position, giving no indication of clearance once OSA is moved
back to its defined IN position if foptz has shifted while OSA was OUT.

Now compares live fosaz against fosaz_in (10 um tolerance):
- if live fosaz is further IN than nominal (closer to collision), warn and
  show current remaining space (the number that matters right now)
- if OSA is OUT/away from IN, no warning, but also report remaining space
  at the IN position using current foptz, as a heads-up before moving OSA in
2026-07-04 08:09:23 +02:00
x12sa 89df83286f feat/webpage_generator: make tomo-queue and tomo-type formula setup-configurable
CI for csaxs_bec / test (push) Successful in 1m32s
- Add HAS_TOMO_QUEUE and TOMO_TYPES capability flags to
  WebpageGeneratorBase, defaulting to flomni's current behavior
  (type1 grid-8, type2/3 golden-capped) so this is a no-op for flomni.
- Gate the tomo_queue global-var read in _cycle() behind
  HAS_TOMO_QUEUE; unaffected: queue_status/queue_locks/beamline_states,
  which come from BEC's own primary scan queue and stay common to
  all setups.
- _render_html() now conditionally emits the 'Tomo queue' card and
  its DEFAULT_ORDER slot, and drives the projection-count formula
  from a TOMO_TYPES JSON blob (generic calcProjections()) instead of
  a hardcoded per-instrument JS branch.
- LamniWebpageGenerator: HAS_TOMO_QUEUE=False, TOMO_TYPES with
  2-subtomo and 8-subtomo equally_spaced_grid entries (placeholder
  keys pending real tomo_type values from the LamNI producer side).
2026-07-04 07:50:01 +02:00
x12sa c514cbfb79 added umv fsamy tracked command to docs 2026-07-04 07:16:25 +02:00
x12sa 41e63b0ba4 updated osa parameters for abes fzp
CI for csaxs_bec / test (push) Successful in 1m33s
2026-07-03 15:53:44 +02:00
x12sa 225a4e6f65 feat(flomni): log per-projection and per-tomogram scan timing AND guard tomo_scan_projection against single-point mode
CI for csaxs_bec / test (push) Successful in 1m30s
Add JSONL timing logs under ~/data/raw/logs/timing_statistics/ for
building a scan-time prediction model. Times each projection in
_tomo_scan_at_angle (final successful attempt only, retries excluded)
and each tomogram in tomo_scan, capturing raw scan parameters plus
elapsed/idle/active durations.

tomo_scan_projection always runs a fermat scan; warn and confirm when
called directly with single_point_instead_of_fermat_scan set, pointing
to tomo_acquire_at_angle instead. Internal callers pass _internal=True
to skip the prompt.
2026-07-03 15:05:55 +02:00
x12sa da3d417e59 docs updated
CI for csaxs_bec / test (push) Successful in 1m33s
2026-07-03 13:32:31 +02:00
x12sa 1a5126096d random offset control added to gui, and json file writing 2026-07-03 13:28:34 +02:00
x12sa a1295ac967 option for random offset in single point acquisitions 2026-07-03 13:28:02 +02:00
x12sa be900c228e parameter update 2026-07-03 12:10:28 +02:00
x12sa 7e656ea9c1 list active account on webpage top 2026-07-03 11:34:35 +02:00
x12sa e6a5568faf fix in writing reconstruction file 2026-07-03 11:29:35 +02:00
x12sa 65c2d5e080 table in queue modified
CI for csaxs_bec / test (push) Successful in 1m31s
2026-07-03 07:19:59 +02:00
x12sa 3d6b6d448d config update 2026-07-03 07:02:37 +02:00
x12sa cb66b967f6 block entry while queue or tomo heartbeat 2026-07-03 07:02:30 +02:00
x12sa 4d225c2d79 adjustments 2026-07-03 07:02:07 +02:00
x12sa e2b9fbeb28 tomo queue added 2026-07-03 06:48:28 +02:00
x12sa bf3ca21535 added check so gui only works with flomni
CI for csaxs_bec / test (push) Successful in 1m39s
2026-07-02 14:08:46 +02:00
x12sa c4566d6d2a improvements in gui
CI for csaxs_bec / test (push) Successful in 1m34s
2026-07-02 13:06:32 +02:00
11099d226e Feat/slit gui and tomo parameter gui (#241)
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 1m33s
---------

Co-authored-by: x12sa <x12sa@psi.ch>
Co-authored-by: menzel <andreas.menzel@psi.ch>
Reviewed-on: #241
2026-07-02 09:02:25 +02:00
x12saandholler 0972f4971b added ROI selector to saved datafile
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 1m34s
2026-07-02 08:47:33 +02:00
x12saandholler 453057e185 save roi in pixels with images 2026-07-02 08:47:33 +02:00
x12saandholler cc10cee82b parameter adjustments 2026-07-02 08:47:33 +02:00
x12saandholler 43d18e0ca1 single point acquisition zero z damaged hardware 2026-07-02 08:47:33 +02:00
x12saandholler e13ca157da optics out also in x 2026-07-02 08:47:33 +02:00
64694331e3 Update predict_gap constants to corrected 3-parameter fit
Replace the 4-parameter (quadratic) constants with the 3-parameter
pure-exponential fit from plot_intensity_map.py (operating-locus
calibration, gap-residual RMS ~14 um). c2 was insignificant (0.2 sigma)
and left E_inf degenerate (+/-11 keV).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 08:47:33 +02:00
x12saandholler b16ab20ddf added predict gap to csaxs 2026-07-02 08:47:33 +02:00
wakonig_k d949797eb1 fix: reorder positions in lamni fermat scan test to comply with ascending default
CI for csaxs_bec / test (pull_request) Successful in 1m31s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 1m30s
2026-07-01 19:34:40 +02:00
x12saandholler 82b03274b7 fix docs
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 1s
CI for csaxs_bec / test (push) Successful in 1m38s
2026-07-01 11:49:18 +02:00
wakonig_k 4b05244df2 chore: cleanup unused code
CI for csaxs_bec / test (pull_request) Successful in 1m31s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 1m34s
2026-07-01 11:20:54 +02:00
x12saandwakonig_k 0fd5c26332 saving of images tested
CI for csaxs_bec / test (push) Successful in 1m31s
CI for csaxs_bec / test (pull_request) Successful in 1m31s
2026-07-01 11:19:51 +02:00
x12saandwakonig_k 46a1909296 command history 2026-07-01 11:19:27 +02:00
wakonig_k 9796bcb73f feat(flomni): add functionality to save reference and alignment images as HDF5 files 2026-07-01 11:19:27 +02:00
x12saandholler 7f2c2bedc7 docs(flomni): document tomo_scan_resume, scan queueing, and related tomo_parameters() additions
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Successful in 1m31s
- Add tomo_scan_resume() as the primary recommended way to continue an
  interrupted scan, in both the user guide and the setup reference
  (manual subtomo_start/start_angle/projection_number kept as fallback)
- Add a new "Queueing multiple scans" section (short walkthrough in the
  user guide, full command reference + status semantics in the setup
  reference, cross-linked via a new anchor)
- Document the live progress report's ETA, automatic gap detection, and
  the total-time-lost-to-gaps summary
- Document the zero_deg_reference_at_each_subtomo tomo_parameters() option
- Fix stale SPEC_ptycho_align.m references -> BEC_ptycho_align.m
2026-06-30 14:31:36 +02:00
x12saandholler b362842e4f feat(flomni): tomo scan queue, crash-safe resume, idle-time-aware ETA, uniform angular step fix
- Tomo scan queue: queue multiple parameter sets and run them sequentially,
  unattended, on the same sample (tomo_queue_add/show/execute/delete/clear);
  resumes a partially-completed job automatically rather than restarting it
- tomo_scan_resume(): resume a crashed/interrupted tomo scan from the exact
  subtomo/angle it stopped at, instead of restarting from the beginning
- Idle-time-aware ETA: detects gaps (crashes, beamline-down pauses) and
  excludes them from the remaining-time estimate; reports total time lost
  to gaps at the end of a scan
- Fixed non-uniform angular spacing in the interlaced 8-sub-tomogram
  tomogram (sub_tomo_scan): phase offsets and per-projection step now
  derive from the same corrected value, independent of requested total
- Fixed corr_pos_y/corr_angle_y/corr_pos_y_2/corr_angle_y_2/
  tomo_alignment_fit being silently wiped on every client restart
  (XrayEyeAlign.__init__); tomo_alignment_fit now also resets at sample
  change, where it was previously missed
- Tracked, stepped fsamy moves (umvr_fsamy_tracked/umv_fsamy_tracked) to
  keep the laser tracker locked during large moves, used in sample
  transfer and manual x-ray-eye alignment jogs
- Added zero_deg_reference_at_each_subtomo for radiation-damage tracking
- tomo_parameters(): fixed several display/rounding inconsistencies and
  added a notification when the requested projection count gets adjusted
2026-06-30 14:31:36 +02:00
x12saandholler 4e472a9a6a fix/get new tomo ID 2026-06-30 14:31:36 +02:00
x12saandholler a684cfda96 feat / added auto vertical centering in first step of alignment. 2026-06-30 14:31:36 +02:00
x12saandholler aef8c80040 tracked fsamy movements 2026-06-30 14:31:36 +02:00
x12saandholler 923415e152 removed a description field 2026-06-30 14:31:36 +02:00
x12saandholler 05ef894e4a fix/slits_show_all working again 2026-06-30 14:31:36 +02:00
x12saandholler 716e2e8e61 feat(xray_eye): add target crosshair, zoom controls, fix ROI styling and zoom-reset bug
- Add show/hide/positionable target crosshair (RPC), separate from bec_widgets' mouse crosshair
- Add zoom in/out/fit buttons; fix manual zoom/pan being wiped on every live-view re-enable
- Add reset_zoom() RPC method, called at start of x_ray_eye_align.py
- Style ROI outline blue/thinner (was near-white via compact_color default)
2026-06-30 14:31:36 +02:00
x12saandholler c4fa9b2eb7 Add scan number display and beamline states diagnostic card
- Append the current BEC scan number to the Projection info-item,
  e.g. "120 / 400 (S06650→S06770)", for direct comparison against
  ptycho reconstruction filenames (which use the same S##### scan
  number convention). Read from
  primary.info[0].active_request_block.scan_number — already
  available on the queue object, no new global var needed.

- Add tomo_start_scan_number to the progress payload, mirroring the
  existing tomo_start_time pattern: a new tomo_progress key to be
  written once by the scan loop when a tomogram begins. Producer side
  (flomni.py) not yet implemented — falls back to showing only the
  current scan number until then.

- New "Beamline states" draggable card (positioned just above
  Contacts): lists every beamline state currently registered with
  BEC, its live status (valid/invalid/warning/unknown), and whether
  the scan interlock is watching it. Cross-references
  bec.builtin_actors.scan_interlock.states_watched/.enabled against
  each state's live status to flag which watched states are
  currently mismatched (i.e. actually contributing to a queue lock),
  vs. states that are invalid but not watched and therefore not
  blocking anything (e.g. a simulated/test shutter).

  This is a display-only diagnostic; the "blocked" experiment_status
  itself is unchanged and still derived from the queue's own locks
  (_read_queue_locks), not from beamline states directly.

- Add fmtScan() JS helper (S##### zero-padded formatting, matching
  the existing ptycho filename convention) and renderBeamlineStates().

- Help panel updated to explain both additions.
2026-06-30 14:31:36 +02:00
x12saandholler 88a320fd59 decrease velocity of fsamy for better tracker following 2026-06-30 14:31:36 +02:00
x12saandholler 00b1996c21 remove z movement in scan as piezo broken
write z propagation to reconstruction file
2026-06-30 14:31:36 +02:00
x12saandholler 59072625b3 added manual shift y in the user query 2026-06-30 14:31:36 +02:00
x12saandholler 6acaadbc24 fix angular start in even subtomos 2026-06-30 14:31:36 +02:00