Skip to main content

Module joint_resolution

Module joint_resolution 

Source
Expand description

Fit a sample and the calibrant that measured its resolution together.

Pinning a calibrated resolution into a sample fit reports the temperature as more certain than it is: resolution width and temperature broaden the line the same way, so the uncertainty that belongs to their degeneracy is dropped. Carrying the calibration forward as a Gaussian prior does not recover it — the calibration’s own uncertainty is neither Gaussian nor separable. Its objective is flat where the kernel is narrower than the line it broadens and a wall above, and for the Gaussian family the two width coordinates trade off almost exactly, so a per-parameter sigma describes a direction the calibration never moves in.

What has none of those problems is the calibrant’s residuals themselves. This model evaluates the sample and the calibrant against ONE resolution drawn from the shared parameter vector and returns both predictions, so the optimizer sees a single objective

chi^2(T, n, w) = chi^2_sample(T, n, w) + chi^2_calibrant(w)

whose temperature uncertainty already contains what the calibrant failed to pin down.

The objective is exact: no part of the calibration is summarized, so the shape the summary would have lost is still there. The uncertainty READ OFF it is not. temperature_k_unc comes from the optimizer’s local curvature at the solution and is a Gaussian approximation like any other, so on a surface with a flat side and a wall it describes the solution’s neighbourhood rather than the whole interval. What the joint objective fixes is that the neighbourhood is now the right one — it includes the resolution’s freedom instead of holding it fixed.

The calibrant’s own density and temperature are what make it a calibrant and stay fixed; only the resolution is shared.

The two shared slots hold the SQUARED widths, in µs² and m². The kernel combines the timing and flight-path terms in quadrature, W² = timing(Δt)² + path(ΔL)², so a width itself enters W quadratically and ∂W/∂ΔL is exactly zero at ΔL = 0. W² is linear in the squares, so ∂W/∂(ΔL²) is finite there and a width seeded at zero is still fitted.

Structs§

JointResolutionModel
A sample and its calibrant, sharing one Gaussian resolution.
SpectrumSpec
One spectrum in a joint fit: its grid, what is in the beam, and how its free parameters are read out of the shared vector.

Enums§

Densities
Where a spectrum’s areal densities come from.