From cf1fcdb184795fcd5f813641c6361b0ac776115c Mon Sep 17 00:00:00 2001 From: salman Date: Sun, 25 Oct 2026 10:54:17 +0100 Subject: [PATCH] Exclude LEM and HAL from automatic prompt-peak t0 Skip musrt0 -g for LEM and HAL/HIFI using both the selected instrument and the MSR's RUN/ADDRUN entries. Preserve manual t0 values entered through the GUI or editor. Update the preference text and documentation, cover portable and legacy filenames plus mixed-instrument MSRs, and register the t0 regression test in the Electron suite. --- CHANGELOG.md | 7 +++-- docs/source/preferences.rst | 8 +++-- index.html | 4 +-- muSRFitelec.js | 37 +++++++++++++++++----- muSRFitlib.js | 6 ++-- package.json | 2 +- tests/electron-t0-prompt-peak.test.js | 45 +++++++++++++++++++-------- 7 files changed, 77 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 506b8c9..10d3daa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -79,10 +79,11 @@ release path documented in [`TODO.md`](TODO.md). thread-count preference in musredit and is useful on shared workstations. - The Electron **Preferences** dialog now includes an **Estimate t0 from the - prompt peak (non-LEM data)** option (on by default). For local fits of - non-LEM instruments, muSRFlow runs `musrt0 --getT0FromPromptPeak` before + prompt peak (except LEM/HAL)** option (on by default). For eligible local bulk + fits, muSRFlow runs `musrt0 --getT0FromPromptPeak` before `musrfit` to write explicit `t0` lines from the histogram peak into the - generated MSR; the step is skipped automatically for LEM data. + generated MSR. LEM and HAL/HIFI are always excluded, checking both the GUI + selection and actual RUN/ADDRUN entries in the MSR. ### Bundled ROOT + musrfit runtime - muSRFlow can now run against a relocatable ROOT + musrfit runtime instead of diff --git a/docs/source/preferences.rst b/docs/source/preferences.rst index 4cb3eb9..e74055a 100644 --- a/docs/source/preferences.rst +++ b/docs/source/preferences.rst @@ -57,12 +57,14 @@ Initial parameters sensible starting values (for example an approximate frequency or asymmetry) instead of generic defaults. - **Estimate t0 from the prompt peak (non-LEM data)** (on by default): before a + **Estimate t0 from the prompt peak (except LEM/HAL)** (on by default): before a local fit, muSRFlow runs ``musrt0 --getT0FromPromptPeak`` to write explicit ``t0`` lines into the generated MSR. This forces musrfit to use the histogram peak as the time-zero for instruments whose data-file header t0 is - unreliable; the step is skipped automatically for LEM data. Uncheck it to - preserve the MSR as generated. + unreliable; the step is never applied to LEM or HAL/HIFI data, regardless + of this preference. RUN and ADDRUN entries are also checked so an expert + MSR cannot bypass the exclusion through a different GUI selection. + Uncheck it to preserve the MSR as generated for other instruments too. Output file suffixes The suffixes appended to generated artifacts: **Asymmetry** (default diff --git a/index.html b/index.html index 4393d8a..318e46e 100644 --- a/index.html +++ b/index.html @@ -779,9 +779,9 @@ pairs of a multi-run (global) fit."> - Before a local fit, run musrt0 --getT0FromPromptPeak so t0 is written from the histogram peak. Applies to every instrument except LEM, whose data file already carries a reliable t0. + Before a local fit, run musrt0 --getT0FromPromptPeak so t0 is written from the histogram peak. Never applied to LEM or HAL/HIFI data.
Output file suffixes