-
Notifications
You must be signed in to change notification settings - Fork 0
Spectrum comparison
⚙️ Generated page — do not edit here. Source:
docs/spectrum_comparison.md. Edit it in the repository and the wiki rebuilds itself.
Available since v4.10.0 · Menu File → Compare spectrum…
Modules: gui/file_actions.py (on_open_comparison, on_clear_comparison),
gui/canvas.py (render), gui/plotly_tools.py, gui/state.py
(ComparisonSpectrum)
Allows loading one or more additional spectra and overlaying them on the main spectrum as thin lines of distinct colors, without touching the fit engine or the calibration state. It is a purely visual aid to compare samples, follow a temperature series at a glance, or contrast a spectrum with a reference.
- Up to 6 comparison spectra simultaneously.
- Each one with a distinct color from the palette: orange, teal, pink, lime, violet, sky blue.
- They also appear in the exportable Plotly figure (interactive HTML).
- Fitting keeps working with comparison spectra active: they do not interfere.
- First load a main spectrum (File → Load…). Without a main spectrum, "Compare spectrum…" shows a warning and does nothing.
- File → Compare spectrum… → select an ADT/WS5/CSV file.
- The spectrum is normalized and overlaid (first line: orange).
- Repeat to add more (second: teal, etc.), up to 6.
- File → Clear comparison removes all (the action is enabled only when there is at least one).
on_open_comparison accepts the same formats as the main spectrum:
| Format | Treatment |
|---|---|
.csv, .txt, .dat, .exp
|
load_velocity_csv — already folded in velocity |
.ws5, .adt
|
Automatic folding: find_best_integer_or_half_center + fold_and_normalize with the optimal center, axis by velocity_axis
|
After loading, the spectrum is normalized to relative transmission (baseline ≈ 1.0) by dividing by the 90th percentile:
norm = float(np.percentile(y_raw, 90)) or 1.0
y_data = y_raw / normThe result is stored as a ComparisonSpectrum:
@dataclass
class ComparisonSpectrum:
"""Espectro cargado solo para comparación visual (sin ajuste)."""
path: Path
velocity: np.ndarray
y_data: np.ndarray
label: strand is added to self.comparison_spectra (list initialized in __init__ of
MossbauerQtWindow). The label is the file name without extension.
render() accepts a comparison= parameter (list of ComparisonSpectrum). The
comparison lines are drawn before the main spectrum, with the _COMPARISON_PALETTE
palette. They are stored in self._artists["cmp_lines"] and the layout signature
(layout_sig) includes n_cmp = len(comparison) to force a full redraw when the
number of compared spectra changes.
Each comparison spectrum is added as a Scattergl trace (lines, opacity 0.75) before
the main spectrum trace, with its palette color, so that it also appears in the
interactive HTML export.
- The
ComparisonSpectrumare display-only: they do not enterFitState, are not saved in the session, do not affect the calibration or the model. -
on_clear_comparisonempties the list and disables the clear action. - The rescaling of each spectrum is independent (its own 90th percentile), so that spectra with different absorption depth are compared on the same relative transmission scale.
The menu labels and messages are in locales/{es,en,fr}/strings.json:
-
file.compare_spectrum,file.clear_comparison -
status.comparison_added,status.comparison_cleared msg.comparison_needs_main
© 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