-
Notifications
You must be signed in to change notification settings - Fork 0
Folding
⚙️ Generated page — do not edit here. Source:
docs/folding_en.md. Edit it in the repository and the wiki rebuilds itself.
Module: core/folding.py (pure functions, no GUI)
A constant-acceleration Mössbauer spectrometer records two symmetric
half-spectra: the detector sees the same sequence of velocities in the forward
sweep and in the return sweep. A file of
The folding point is the symmetry channel
where find_best_integer_or_half_center).
Normos convention. Fitbauer internally uses the symmetry center (≈ 255.77 for a Normos upper folding point ≈ 511.55 in 512 channels). The number Normos reports is approximately twice the internal center.
read_normos_folding_pointreads the "Final folding point" from the.RESsidecar and converts it: if the value is ≥ 400 it is interpreted as full-spectrum convention (÷2); if it is < 400, as a half-spectrum.
The folding point rarely falls on an integer channel. The function folds into
For each folded point
The result is sorted from negative to positive velocity.
After folding, the edge channels (first and last) are less reliable because they
come from extrapolation. By default, EDGE_TRIM_DEFAULT = 1 channel is trimmed at
each end.
Normalization brings the baseline to ≈ 1.0 using the 90th percentile of the folded spectrum (robust against the absorption peaks, which are minima):
Poisson noise is propagated taking into account that each folded point is the mean of two Poisson channels:
The function returns the tuple (folded, sigma, y, norm).
The velocity axis goes from
Important: the axis is trimmed at the same positions as the spectrum
([edge_trim:-edge_trim]), it is not rescaled. Rescaling the axis after trimming
would stretch the velocity scale and bias the fitted BHF.
For spectra already folded in velocity space (e.g. ESRF synchrotron data), a
two-column velocity, counts CSV/TXT/DAT/EXP format is supported:
- Separators: comma, tab or spaces.
- Comment lines (
#) or non-numeric header are ignored. - If all values in column 2 are ≤ 1.0, they are interpreted as normalized
transmission and scaled to counts (
round(2_000_000 · col2)). - Inverted-column detection: if col0 has everything > 100 and col1 everything in [−20, 20], an error is raised suggesting that the columns be inverted.
- Deduplication: velocities closer than
$10^{-9}$ are averaged. - Validations: ≥ 10 points, velocity range ≥ 1 mm/s.
These files are not folded (they already come folded); they are loaded directly onto the velocity axis.
When there are Normos sidecar files next to the spectrum, Fitbauer reads them to inherit parameters:
| Sidecar | Function | What it extracts |
|---|---|---|
.RES |
read_normos_folding_point, read_normos_sidecar_params
|
Final folding point; final values WID/ARE/ISO/QUA/BHF |
.PLT |
read_normos_plt_velocity |
|
.JOB |
read_normos_sidecar_params |
Fixed VMAX and QUA(1) |
The final Normos values are translated into internal parameters
(s1_delta, s1_bhf, s1_quad, s1_gamma1, s1_depth) as a starting point.
counts (N canales)
↓ find_best_integer_or_half_center → center (subcanal)
↓ fold_integer_or_half → N/2 puntos doblados
↓ fold_and_normalize (edge_trim) → (folded, sigma, y, norm)
↓ velocity_axis (mismo recorte) → eje de velocidad -vmax..vmax
espectro listo para ajuste
© Jorge Sánchez Marcos, Nieves Menéndez González — Departamento de Química Física, UAM · Wiki generado desde docs/ para Fitbauer v5.0.0
Fitbauer v5.0.0
Start
- Home
- Installation
- User flows Data
- Folding
- Calibration (33 T)
- Spectrum comparison Fitting
- Distribution fitting
- Peak detection
- Profile likelihood
- Batch fitting Reference
- Command-line tools
- NORMOS (.JOB)
- Session format
- Sextet model (spec)
- Architecture
Inicio
- Inicio
- Instalación
- Flujos de usuario Datos
- Plegado (folding)
- Calibración (33 T)
- Comparación de espectros Ajuste
- Distribuciones
- Detección de mínimos
- Verosimilitud perfilada
- Ajuste en serie Referencia
- Línea de comandos
- NORMOS (.JOB)
- Formato de sesión
- Modelo de sextete (spec)
- Arquitectura