suter_a 4319b4ad69 PStringUtils::ToInt: signal conversion errors via from_chars
ToInt() previously wrapped strtol() with a nullptr endptr, so a failed
conversion was indistinguishable from a legitimate 0 (matching the old
TString::Atoi() behaviour). Switch the implementation to std::from_chars
and add an optional `bool *ok` out-parameter that reports success: it is
set to false on a non-numeric string or an out-of-range value, true
otherwise. Leading whitespace is skipped and trailing characters are
ignored, preserving the Atoi-like prefix semantics. The parameter
defaults to nullptr, so existing call sites keep compiling unchanged.

Convert the parse-validation call sites in PMsrHandler to the single
-parse ToInt(token, &ok) form, replacing the IsInt() guard + separate
ToInt() (which parsed every token twice). All downstream >0 / >=0 /
range / enum checks are preserved.

Left untouched the call sites where IsInt() acts as a structural
discriminator rather than a numeric validator (write path, xy-data
index-vs-label, fParamInUse usage scans) and the IsFloat-guarded ToInt
offsets, where switching to ToInt(&ok) would change parsing semantics.

All 85 integration tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-06 11:54:33 +02:00
2026-04-15 20:29:55 +02:00
2019-05-15 10:14:39 +02:00
2026-05-28 09:30:52 +02:00
2026-05-28 09:30:52 +02:00
2025-10-15 07:58:50 +02:00
2025-11-06 14:13:08 +01:00

musrfit - muSR and beta-NMR data analysis package

Contents

This is a data analysis package to analyze time differential muSR and beta-NMR data. Currently it allows the following:

  • set up most commonly used fitting functions for muSR and beta-NMR
  • fit data, including global fits
  • show the fit results and the residuals
  • show the Fourier transform of the data
  • easily extract the fit parameters and import in other programs (gnuplot, qtiplot/origin, ...)
  • generate input fitting files for follow-up runs
  • generate global input fitting files based on a single run template
  • implement more sophisticated user functions (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles)

Currently supported platforms:

Documentation

For a more exhaustive user documentation see:

https://lmu.pages.psi.ch/musrfit-docu/index.html

Contacts

andreas.suter@psi.ch

For the beta-NMR related parts, please contact Zaher Salman zaher.salman@psi.ch

2025-06-08 11:00:15 +02:00
Languages
C++ 88.3%
Wolfram Language 6.5%
C 2.5%
CMake 1.7%
Perl 0.5%
Other 0.4%