Analysis Pipeline¶
The library supports two distinct analysis pathways. Choose based on your system.
Pathway |
Best for |
Key function |
|---|---|---|
Joint forward-model inference |
Molecular liquids with translation + rotation |
|
Classical per-Q HWHM extraction |
Atomic/ionic systems, quick scans |
Pathway 1 — Joint Forward-Model Inference¶
Preferred for molecular liquids where rotational broadening is present. Fits all Q-bins simultaneously to the full S*(*Q, ω) forward model. The Bessel-weight structure j₀(QR)² : j₁(QR)² : j₂(QR)² acts as a global Q constraint that prevents the per-bin degeneracy of classical analysis.
Stage |
Name |
Module |
What it does |
|---|---|---|---|
04 |
Resolution binning |
Averages the frozen-sample spectrum over each Q bin to produce a measured resolution kernel (captures Lorentzian wings that a Gaussian misses). |
|
05 |
Data binning |
Bins detectors into Q groups; averages spectra with proper error propagation. |
|
06 |
MAP optimisation |
Multi-start Nelder-Mead MAP search over the joint log-likelihood. Returns the starting point for MCMC. |
|
07 |
MCMC sampling |
emcee ensemble sampler (or Metropolis-Hastings fallback). Reports acceptance fraction, autocorrelation time, and Gelman-Rubin R̂. |
|
08 |
Visualisation |
S*(*Q, ω) colour maps, Γ(*Q*²) dispersion, marginal/joint posteriors. |
Pathway 2 — Classical HWHM Extraction¶
Independent elastic + Lorentzian fit per Q-bin, then fit Γ(Q) vs Q² to a translational model. Quicker and sufficient for systems without rotation.
Stage |
Name |
Module |
What it does |
|---|---|---|---|
04 |
HWHM extraction |
Per-Q-bin curve fit of the convolved elastic + quasi-elastic + background model. Returns Q, Γ, δΓ, EISF arrays. |
|
05 |
Dispersion fitting |
User code + |
|
See Classical HWHM Workflow for the complete classical workflow code.