optmat.solid.models.fitted#

The fitted models of solids, loaded from their stored records.

A fit (optmat.solid.fitting, tools/fit/run_solid.py) stores its full UDM parameter set and the covariance of its free parameters in data/solid/models/fitted/<name>.json. The model is named fit/<name>, and its uncertainty in n and k follows by linear propagation.

Functions

fitted_models()

Return every stored solid fit as a model, named fit/<name>.

Classes

FittedModel(material, name, citation, ...[, ...])

A UDM fitted here, with the covariance of its free parameters.

class optmat.solid.models.fitted.FittedModel(material, name, citation, wavelength_range, kind, axis='', udm=None, attributes=(), values=<factory>, free=(), scales=<factory>, covariance=<factory>, reduced_chi2=nan, *, status='user', status_reason='', modified=(), base='', intervals=())[source]#

Bases: UdmModel

A UDM fitted here, with the covariance of its free parameters.

Attributes:
attributestuple of str

The UDM’s attributes.

valuesdict of str to float

Every parameter.

freetuple of str

The fitted parameters.

scalesdict of str to tuple of str

The fitted groups of parameters, each scaled by one factor.

covariancenumpy.ndarray

Their covariance (with the datasets’ offsets after them).

reduced_chi2float

The fit’s reduced chi-squared.

Its overrides are the parameters (``values``, any subset, merged into the fit’s)
and the intervals; the UDM is rebuilt from them, and the covariance and the
chi-squared are dropped (NaN).
DERIVED: ClassVar[tuple[str, ...]] = ('wavelength_range', 'covariance', 'free', 'reduced_chi2', 'scales', 'udm')#

Fields derived from the inputs, which an override may not name.

EVALUATION_VERSION: ClassVar[int] = 1#
INPUTS: ClassVar[tuple[str, ...]] = ('intervals', 'values')#

The parameters with_parameters() may change.

attributes: tuple[str, ...] = ()#
covariance: Float[ndarray, 'p p']#
free: tuple[str, ...] = ()#
index_sigma(wavelength)[source]#

Return the one-sigma uncertainties of n and k from the fit’s covariance.

Linear propagation with a central-difference Jacobian (step 1e-6 of each parameter’s value): the parameters’ own uncertainty only, not the model’s form.

Parameters:
wavelengtharray_like or float

Vacuum wavelength, m.

Returns:
tuple of numpy.ndarray

The uncertainties sigma_n and sigma_k.

reduced_chi2: float = nan#
scales: Mapping[str, tuple[str, ...]]#
values: Mapping[str, float]#
optmat.solid.models.fitted.fitted_models()[source]#

Return every stored solid fit as a model, named fit/<name>.

Returns:
dict of str to FittedModel

The models.