1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! `feffit` — a pure-Rust port of `xraylarch`'s `larch/xafs/feffit.py`.
//!
//! This crate fits a sum of Feff paths to experimental EXAFS chi(k). It builds
//! on [`feffdat`] (the per-path EXAFS equation) and [`xafsft`](mod@xafsft) (the Fourier
//! transforms and FT windows).
//!
//! This milestone provides the **residual core**: a [`Transform`] (the k/R FT
//! configuration with cached windows) and a [`DataSet`] that produces the fit
//! residual for fixed numeric path parameters in k/R/q space, for one or more
//! k-weights (a list-valued `kweight` concatenates the per-k-weight residuals).
//! Verified against larch's `FeffitDataSet._residual` to FFT round-off.
//!
//! It also provides the **end-to-end fit** ([`fit::feffit`]): the global
//! parameter/constraint system ([`params`]) drives per-path parameter
//! expressions through the residual core and the MINPACK Levenberg-Marquardt
//! minimiser ([`lm`]), then computes the fit statistics and propagates the
//! parameter uncertainties onto the constraint and path parameters by
//! forward-mode automatic differentiation (`stderr(f) = sqrt(gᵀ C g)`, the
//! first-order propagation larch performs with the `uncertainties` package).
//! Verified against larch's `feffit()` on a two-path Cu fit.
//!
//! The `sigma2_eins`/`sigma2_debye` Debye-Waller constraint helpers are
//! available in path expressions, bound to each path's geometry through a
//! [`crate::params::FuncCtx`].
//!
//! After a fit, [`DataSet::save_outputs`] forward/back-transforms the data and
//! model (and optionally each path) χ(k) into χ(R)/χ(q) output arrays (larch
//! `save_outputs`/`_xafsft`).
//!
//! Background refinement ([`DataSet::enable_refine_bkg`]) fits a cubic B-spline
//! background as extra variables (larch `refine_bkg`), with the FITPACK spline
//! pieces in [`bkg`].
//!
//! Not yet ported: the GNXAS g(r) model.
// Absorbed sub-crates. These were sibling workspace crates; they now live here
// as modules so the whole engine ships as a single publishable crate. Their
// public APIs are unchanged — only the path (`feffit::feffdat::…` instead of
// `feffdat::…`) differs.
pub use DataSet;
pub use ;
pub use ;
pub use ;