vccs
Vue 3용 차트 컴포넌트 모음, Recharts에서 포팅
Software for fitting Mössbauer spectra
저장소 README에서 가져옴
README 전체를 불러오는 중입니다. 아래는 저장된 발췌입니다.
Software for Mössbauer spectrum fitting and analysis. Stable desktop application to load, fold, simulate and fit ⁵⁷Fe Mössbauer spectra. Current stable version: v5.1.2 Launch: python fitbauer.py Headless CLI fitting: mossbauer_fit_cli.py (discrete) · fit_bhf_distribution_cli.py (distributions) Authors: Jorge Sánchez Marcos · Nieves Menéndez González Department of Physical Chemistry · UAMREADME 전문 보기 ↗
Stable desktop application to load, fold, simulate and fit ⁵⁷Fe Mössbauer spectra.
Current stable version: v5.2.5
Launch: python fitbauer.py
Headless CLI fitting: mossbauer_fit_cli.py (discrete) · fit_bhf_distribution_cli.py (distributions)
Authors: Jorge Sánchez Marcos · Nieves Menéndez González
Department of Physical Chemistry · UAM
NORMOS (R. A. Brand, 1990-1994) is the program behind a large part of the published Mössbauer literature. It runs under DOS, it is proprietary and it is no longer maintained. Fitbauer exists so that this body of work —and those files— can keep being used from a current, open, cross-platform program.
That demands two things: producing the same numbers as NORMOS, and speaking its file format. Both have been verified against the original program.
Fitbauer's physics has been checked on two independent benchmarks.
1. Synthetic benchmark. NORMOS generates a spectrum from known parameters, Fitbauer fits it, and the result is compared with the truth.
| spectra | fits | comparisons | |
|---|---|---|---|
| Round-trip NORMOS → Fitbauer | 411 | ~1,150 | 6,497 |
Median deviation from the true value:
| Block | position | BHF | linewidth |
|---|---|---|---|
| First-order sextet/doublet | 2·10⁻⁷ mm/s | 6·10⁻⁶ T | 8·10⁻⁷ mm/s |
| Full Hamiltonian | 6·10⁻⁵ mm/s | 1.4·10⁻³ T | 5·10⁻⁴ mm/s |
| Texture and intensities | 2·10⁻⁷ mm/s | 6·10⁻⁶ T | 2·10⁻⁵ mm/s |
| Multi-site and constraints (up to 10 sites) | 7·10⁻⁶ mm/s | 1·10⁻⁵ T | 7·10⁻⁵ mm/s |
In the first-order core the agreement is exact to numerical precision. The residual tail in the Hamiltonian case is the approximation made by NORMOS 1994 itself, not by Fitbauer.
2. Real-job benchmark. 407 distinct jobs fitted in NORMOS over the years —not
synthetic: laboratory measurements, with their models and their results—
reloaded into Fitbauer and refitted from NORMOS's own solution, on the data
folded exactly as NORMOS folds them (whole channel pairs at ⌊PFP⌋ + 0.5) and
with the same free parameters; recomputed this way, NORMOS's χ² matches the one
in its .RES to about 1 %. A comparison
only means something where NORMOS fitted well and both programs see the same
spectrum, so only those jobs are kept:
.JOB still matches
its .RES (19 jobs discarded, mostly with the folding point far from the
centre, where NORMOS's folding cannot be reproduced);On the remaining 146 jobs:
Fitbauer reaches the same or a lower χ² in 146 of 146; median reduced χ²: NORMOS 1.40 · Fitbauer 1.38.
Median parameter agreement:
| δ | ΔEQ | BHF | Γ | depth |
|---|---|---|---|---|
| 0.0006 mm/s | 0.0015 mm/s | 0.0034 T | 0.0014 mm/s | 0.0001 |
In units of NORMOS's own errors the differences have a median of 0.15–0.2σ
and no bias; the few above 3σ are jobs where NORMOS had stopped short of the
minimum (Fitbauer's χ² is lower, and NORMOS reaches it when started from
Fitbauer's solution). The figures hardly change with a χ² cut of 1.5 or 3. Among the discarded
jobs, two had NORMOS stopped in a local minimum: from the same starting values
Fitbauer reaches a reduced χ² of about 1.5 instead of 20–30, and NORMOS
confirms it when started there. The jobs are laboratory
data and are not distributed; the synthetic bank and the reports are in
validacion/informe/.
.JOB filesFile ▸ NORMOS (.JOB)
.JOB names its
files in the header, and Fitbauer looks for them next to it. Both
NORMOS-SITE jobs (discrete sites) and NORMOS-DIST jobs (distributions)
work; the latter are detected automatically and open the P(BHF)/P(ΔEQ) panel.WID/W13 widths versus Γ₁, D13/D23
area ratios versus depth ratios, the global numbering of NDEX constraints—
are handled automatically, and the importer warns about everything it could
not carry over.Fitbauer does not run NORMOS and does not ship it: it only speaks its text format, which is not proprietary.
| NORMOS | Fitbauer | |
|---|---|---|
| 2D distributions | — | P(BHF,ΔEQ), P(IS,ΔEQ), P(BHF,IS), as a histogram or as bivariate Gaussians (VBF) |
| Regularizers | Tikhonov and maximum entropy | plus total variation (edge-preserving) |
| Choosing α | by hand | L-curve with automatic elbow and click-to-pick |
| P(IS) | singlet kernel | singlet, doublet or sextet kernel |
| Distribution shapes | histogram, Gaussian, binomial | plus multi-Gaussian VBF (Rancourt–Ping) |
| Errors | covariance matrix | plus Monte Carlo bootstrap and asymmetric profile-likelihood intervals |
| Minimum search | single start | multi-start and automatic global escalation (differential evolution) |
| Series of spectra | one file at a time | sequential batch fitting with warm start |
| Superparamagnetism | — | Néel–Arrhenius with lognormal size distribution and global multi-temperature fit |
| Voigt profile | approximate pseudo-Voigt | exact Voigt |
| Diagnostics | χ² | plus residual tests (lag-1, runs), correlations (also of P with Γ, δ…) and insufficient-grid warning |
| Outputs | text | Markdown/PDF reports, TSV with subspectra and complete JSON session |
| Headless use | — | CLI for discrete and distribution fits |
| Platform | DOS | Windows, macOS and Linux |
| Languages | English | 8 languages, with integrated help |
| Licence | proprietary | Apache 2.0, open source |
Several parts of the calculation are also measurably more accurate: Hamiltonian
diagonalisation in double precision (Hermitian LAPACK versus general EISPACK in
REAL*4), a source kernel integrated over each channel instead of sampled, and
cubic interpolation when folding instead of truncating to a whole channel.
Stated just as plainly. None of this blocks routine ⁵⁷Fe work, but it is worth knowing:
BEXT): population polarization is
there; the line shift it causes is not..JOB, the LAMDA smoothing parameter is not
carried over: NORMOS's is absolute and Fitbauer's is dimensionless, so it has
to be set with the L-curve.The complete inventory, capability by capability and with the exact NORMOS source
reference, is in
validacion/informe/COVERAGE_NORMOS_EN.md;
what remains, with what to touch and how to validate it, is in
PENDING_NORMOS_EN.md.
.ws5 and .adt files; download measurements and calibrations from the laboratory web database.P(BHF), P(ΔEQ), P(IS) and three 2D modes (P(BHF,ΔEQ), P(IS,ΔEQ), P(BHF,IS)); Hesse-Rübartsch regularization; L-curve α estimation; simultaneous sharp components.The interface language is English by default.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
python fitbauer.py
Try the included sample data:
data_sample/magnetita_Fe3O4.adtdata_sample/Fe3O4_session.jsonTypical workflow:
Open spectrum → check folding/Vmax → choose model → fit
→ inspect residuals/areas → export session/report
Up to ten simultaneous components (singlet / doublet / sextet, plus the relaxation types below). Each component has its own type, parameters and fixed/free status. The Fit button optimises all free parameters; the status panel reports integrated areas, covariance or bootstrap (Monte Carlo) errors, and fit statistics.
For sextets the main parameters are:
| Parameter | Meaning |
|---|---|
| δ (IS) | Isomer shift (mm/s) |
| ΔEQ | First-order quadrupole splitting (mm/s) |
| BHF | Hyperfine field (T) |
| Γ 1,6 | FWHM of the outer lines (mm/s) |
| Γ 2,5 rel / Γ 3,4 rel | Relative widths of lines 2,5 and 3,4 |
| Depth | Global absorption amplitude |
| int1 / int2 | Relative intensities (≈ D13, D23); int3 fixed to 1 |
Models the spectrum as a sum of many sextets (or doublets) on a regular grid. The Hesse-Rübartsch-style optimisation minimises:
weighted spectral residual² + α · roughness(P)²
Use L-curve α to find a good compromise between residual and smoothness. Besides the histogram there are parametric shapes (Gaussian, VBF multi-Gaussian, NORMOS-style binomial, fixed and, for P(ΔEQ) of glasses and amorphous materials, pure or extended Czjzek); in the Gaussian shapes the width σ can be bounded with σ min / σ max. The Add active sharp components option mixes the distribution with discrete phases (e.g. a broad distribution + metallic Fe at BHF ≈ 33 T). Two-dimensional modes fit P(BHF, ΔEQ), P(IS, ΔEQ) and P(BHF, IS), as a regularized histogram or as bivariate Gaussians. The distribution plot shows a Monte Carlo 1σ band for the histogram and, when δ or ΔEQ are correlated with the grid variable (κ slopes), the δ(x)/ΔEQ(x) line with its uncertainty; each overlay can be switched off.
| Type | Description |
|---|---|
| Relajacion | Phenomenological blocked/superparamagnetic interpolation |
| BlumeTjon | Dynamic two-state ±BHF exchange |
| NeelSize | Néel–Arrhenius + lognormal size distribution (also as a global multi-temperature fit) |
Fitbauer is a Python application — there is no compiled .exe. You run it with
Python, either through the bundled installer script (recommended) or by setting up
the environment by hand. The one-liner is in Quick start; this
section covers every case. The standalone reference is INSTALL_EN.md.
| Python | 3.11 or newer (CI runs on 3.12). On Windows, tick “Add Python to PATH” in the installer. |
| pip | Ships with Python; the installer upgrades it inside the virtual environment. |
| OS | Windows 10/11, macOS 12+, or Linux (X11 or Wayland). |
| Internet | Needed once to download the Python dependencies, and for Help ▸ Check for updates. |
| Disk | ~400 MB for the virtual environment (mostly PySide6/Qt). |
Runtime dependencies, installed automatically: numpy >= 2.0, scipy,
matplotlib, requests, PySide6 >= 6.5.
Clone the repository:
git clone https://github.com/sullymike/Fitbauer.git
cd Fitbauer
…or download a release ZIP from the Releases page, unzip it, and open a terminal in the resulting folder. The release ZIP is the source, not a binary — you still run one of the installs below.
From the project folder:
Linux / macOS
python3 install.py
./fitbauer
Windows
py install.py
fitbauer.bat
If py is not recognised, use python install.py.
install.py does everything in one step:
.venv/;requirements.txt;fitbauer (Linux/macOS) and fitbauer.bat (Windows);~/.local/share/applications/fitbauer.desktop (Education category);./fitbauer.Installer flags:
python install.py # full install + menu registration
python install.py --menu-only # only (re)register the menu entry
python install.py --no-menu # install, leave the menus untouched
python install.py --uninstall # remove the menu entry
If you would rather manage the environment yourself:
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install --upgrade pip
pip install -r requirements.txt
python fitbauer.py
For the test suite, also install the dev requirements:
pip install -r requirements-dev.txt
QT_QPA_PLATFORM=offscreen pytest -q # add "xvfb-run -a" on headless Linux
./fitbauer (Linux/macOS) or fitbauer.bat (Windows), or
the application-menu entry..venv and run python fitbauer.py.python mossbauer_fit_cli.py (discrete) or
python fit_bhf_distribution_cli.py (distributions).First run, with the bundled sample data:
data_sample/magnetita_Fe3O4.adtdata_sample/Fe3O4_session.jsongit pull, then re-run python install.py — it reuses .venv
and refreshes the dependencies. With a release ZIP, unzip the new one over the
folder and re-run python install.py.pip install pyinstaller
pyinstaller Fitbauer.spec # → dist/Fitbauer/
The folder dist/Fitbauer/ then runs without any Python installation.
| Symptom | Fix |
|---|---|
python3: command not found | Install Python 3 from python.org or your distro's package manager. |
| GUI does not start | Check the venv is active, then pip install -r requirements.txt and python -m py_compile fitbauer.py mossbauer_qt.py. |
ImportError for PySide6, or a Qt "platform plugin" error on Linux | Install the system libraries Qt needs — on Debian/Ubuntu: libgl1, libxkbcommon-x11-0, libegl1. On a headless machine set QT_QPA_PLATFORM=offscreen. |
| PDF report fails | The Markdown report is still written; PDF export needs optional rendering libraries on some systems. |
| Menu entry not created | Re-run python install.py --menu-only (on macOS this step is intentionally skipped). |
core/ Physics and fitting engine (no GUI dependency)
gui/ Modular Qt/Matplotlib GUI — thin controllers only
locales/ Translations: en / es / fr / de / pt / ru / ja / ch
data_sample/ Sample spectra and sessions
tests/ Physics, fitting, CLI and Qt tests
The physics and fitting engines live exclusively in core/; the GUI is a thin client. See docs/architecture.md for details.
See CHANGELOG.md.
Fitbauer is released under the Apache License 2.0 — see LICENSE and
NOTICE.
This program uses the Qt toolkit through the PySide6 bindings, under the terms of
the GNU Lesser General Public License v3 (LGPLv3). Qt is not modified; the full licence
text ships in licenses/LGPL-3.0.txt and
licenses/GPL-3.0.txt. In the binary builds, the Qt libraries are
bundled as ordinary shared libraries and can be replaced by a compatible build, as LGPLv3 §4
provides.
Every third-party component and its licence is listed in
THIRD-PARTY-LICENSES.md.
© Jorge Sánchez Marcos, Nieves Menéndez González — Department of Physical Chemistry, UAM.