Commit Graph
14 Commits
Author SHA1 Message Date
x01dcandClaude Sonnet 5 d963cd6dfd feat/auto-refresh stale at_each_angle hooks on redefinition
register_at_each_angle_hook() stores a function object by reference, so
editing a hook's def and forgetting to re-register left the old version
running silently -- easy to miss mid-beamtime. Detect it via
func.__globals__ (a redefined top-level def, or a reloaded module,
mutates the same namespace dict in place) and auto-adopt the new
definition with a printed note instead of failing or staying stale.

Centralizes the shared lookup/error logic (previously duplicated in
lamni.py and flomni.py) into TomoQueueMixin._resolve_at_each_angle_hook().

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 15:08:11 +02:00
x01dcandClaude Sonnet 5 e3c979a375 fix/correct matlab tool name to BEC_ptycho_align in tomo_alignment_scan
The tool is called BEC_ptycho_align now, not SPEC_ptycho_align.m as
the previous docs/comments said -- fixes the references introduced in
the previous commit (12b2538) in lamni.py's docstrings/print message
and the user docs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 13:24:37 +02:00
x01dcandClaude Sonnet 5 12b2538333 feat/add lamni.tomo_alignment_scan() -- dedicated fine-alignment scan
Replaces the awkward documented workaround (configure a full tomo_type
1 setup with 96 projections, then launch just sub_tomo_scan(1, 0)) with
a dedicated command, ported from flomni's tomo_alignment_scan(): adjust
tomo_parameters() (FOV/step/counting time), then call
lamni.tomo_alignment_scan() directly -- no tomo_type/sub-tomogram
bookkeeping involved, matching flomni's clean two-step workflow.

Runs 12 points evenly spaced across the full 360 degrees (lamni has no
180-degree symmetry the way flomni does, so unlike flomni's 5-point/
180-degree scan, this covers the full circle -- point count matches
what the old workaround's docs defaulted to, endpoint=False since
360==0 degrees). Aborts if x-ray-eye alignment hasn't been done yet
(tomo_fit_xray_eye unset), mirroring flomni's equivalent guard.
write_alignment_scan_numbers() writes the same 4-line scan-number/
angle/offset log flomni's version does, to
~/data/raw/logs/ptychotomoalign_scannum.txt for SPEC_ptycho_align.m,
also printed at the console (flomni's own console-print equivalent is
dead/commented-out code; lamni's actually prints).

Scope note: flomni's version conditionally skips its eye-out/optics-in
transition when already in measurement condition with feedback
running, to avoid an unneeded interferometer reset -- lamni has no
equivalent helpers for that check, so this calls leye_out()
unconditionally instead. Left as a possible follow-up, not in scope
here.

Item 6 of csaxs_bec/bec_ipython_client/plugins/LamNI/AI_docs/
FLOMNI_LAMNI_FEATURE_GAPS_2026-07.md. Documented in
docs/user/ptychography/lamni.md's "Fine alignment" section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 13:22:01 +02:00
x01dcandClaude Sonnet 5 4ada8e85ce docs/document tomo_queue_reacquire and tomo_queue_resume
Add both to the tomo-queue command reference in flomni.md and
lamni.md: tomo_queue_resume() as an alias for tomo_queue_execute(),
and tomo_queue_reacquire(job_index, projection_number) for reopening
a job (including an already-"done" one) at an earlier projection and
cascading later jobs to pending, mirroring the code added in the
previous commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 03:20:55 +02:00
x01dc f7a1bf4a98 update/docs 2026-07-20 14:22:53 +02:00
x01dcandClaude Sonnet 5 bac3fa8754 feat(lamni,bec_widgets): generalize tomo-params GUI to lamni, fix two sub_tomo_scan angle bugs
Generalize TomoParamsWidget to lamni via a SETUP_PROFILES mechanism
(setup detection, per-setup field lists/order, a new Offsets section,
a setup-agnostic "Duplicate job" queue button), fixing two latent
TomoQueueDialog bugs that silently mishandled lamni jobs along the way.

While verifying the GUI's projection-count preview against the CLI,
found two real, pre-existing bugs in LamNI.sub_tomo_scan() unrelated
to the GUI itself: a duplicate closing angle every sub-tomogram
(360=0 degrees), and a phase offset computed from the raw stepsize
instead of the achievable one, breaking the equally-spaced-when-
combined guarantee for sub-tomogram pairs/quads/the full set. Both
fixed to mirror Flomni's existing, correct equivalents.

Also fills in lamni's user documentation with the queue/command-job/
at-each-angle-hook system, which it previously lacked entirely,
mirroring flomni.md's coverage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-16 13:39:08 +02:00
x01dc f2cff67800 refactor 2026-07-12 08:07:50 +02:00
x01dc 0061aa1d32 refactor 2026-07-12 08:07:50 +02:00
x01dc d9004bffa7 feat(LamNI): migrate X-ray eye alignment from LabView/EPICS to BEC GUI
- Add x_ray_eye_align.py: GUI-based alignment procedure collecting sample
  centre at 8 angles (0-315 deg, full 360 deg rotation), submitting x/y
  offsets to XRayEye widget fit tab, reading sinusoidal fit parameters back
  via omny_xray_gui device signals
- Update gui_tools.py: modernise to current BEC widget API (single new()
  call with object_name, _is_deleted() existence checks, add_ring() progress
  bar API, start/eta time display); add lamnigui_show_xeyealign_fittab()
- Update alignment.py: add read_xray_eye_correction_from_gui(), remove
  obsolete GUI-procedure methods now in x_ray_eye_align.py, fix __init__
  (remove orphaned _reset_init_values() call)
- Update lamni.py: add set_client() call in __init__, add
  xrayeye_alignment_start(keep_shutter_open) and xrayeye_update_frame()
  matching FlOMNI naming convention, import XrayEyeAlignGUI
- Fix LamNIMoveToScanCenter: replace arg_input/arg_bundle_size device-bundle
  pattern with required_kwargs; float dict keys caused msgpack >= 1.0
  ValueError with strict_map_key=True
- Update all lamni_move_to_scan_center() call sites to keyword arguments
- Update docs/user/ptychography/lamni.md: document new commands, remove
  MATLAB/LabView references
2026-07-12 08:07:49 +02:00
holler 8265ad523c doku fix2
CI for csaxs_bec / test (pull_request) Successful in 2m2s
Read the Docs Deploy Trigger / trigger-rtd-webhook (push) Successful in 2s
CI for csaxs_bec / test (push) Has been cancelled
2026-04-13 11:52:52 +02:00
x12sa 4967474271 removed fsh commands
CI for csaxs_bec / test (push) Successful in 1m57s
2026-03-17 14:48:05 +01:00
x01dcandholler 70fa96bd58 added beck startup
CI for csaxs_bec / test (pull_request) Failing after 1m53s
CI for csaxs_bec / test (push) Failing after 1m55s
2026-03-06 14:39:34 +01:00
Mirko Holler 9186853faf lamni doc 2024-12-16 16:50:53 +01:00
Holler Mirko 58960944f8 init version 2024-11-15 15:37:41 +01:00