radis.tools.fitting moduleΒΆ
Fitting Tools embedded RADIS, for simple cases
For more advanced cases, use Fitroom : https://github.com/radis/fitroom
Originally in radis-examples : https://github.com/radis/radis-examples
- LTEModel(factory, fittable_parameters, fixed_parameters={}) Spectrum [source]ΒΆ
A model returning a single-slab LTE spectrum
- Parameters:
model_input (dict) β input dictionary (typically: temperatures). Example
{'Trot':value}
- Returns:
Spectrum
- Return type:
calculated spectrum
Examples
Compare performance between old 1T fitting example and new fitting module
Compare performance between old 1T fitting example and new fitting moduleSee also
- Tvib12Tvib3Trot_NonLTEModel(factory, fittable_parameters, fixed_parameters={}) Spectrum [source]ΒΆ
A model returning a single-slab non-LTE spectrum with Tvib=(T12, T12, T3), Trot
Used for non-LTE CO2 modeling. See the multi-temperature fit example
- Parameters:
fittable_parameters (dict) β input dictionary of fittable parameters (typically: temperatures). Example
{'T12':value, 'T3':value, 'Trot':value}
fixed_parameters (dict) β input dictionary of non-fittable parameters. Will override input conditions given to
non_eq_spectrum()
- Returns:
Spectrum
- Return type:
calculated spectrum
Examples
See also
- fit_spectrum(factory, s_exp, model, fit_parameters, bounds={}, fixed_parameters={}, plot=False, verbose=True, solver_options={'maxiter': 300}) Spectrum | OptimizeResult [source]ΒΆ
Fit an experimental spectrum with an arbitrary model and an arbitrary number of fit parameters.
- Parameters:
s_exp (Spectrum) β experimental spectrum. Should have only spectral array only. Use
take()
, e.g:sf.fit_spectrum(s_exp.take('transmittance'))
model (func -> Spectrum) β a line-of-sight model returning a Spectrum. Example :
Tvib12Tvib3Trot_NonLTEModel()
fit_parameters (dict) β
example:
{fit_parameter:initial_value}s
bounds (dict, optional) β
example:
{fit_parameter:[min, max]}
fixed_parameters (dict) β
fixed parameters given to the model. Example:
fit_spectrum(fixed_parameters={"vib_distribution":"treanor"})
- Other Parameters:
plot (bool) β if
True
, plot spectra as they are computed; and plot the convergence of the residual. DefaultFalse
verbose (bool, or
2
) β use2
for high verbose level.solver_options (dict) β parameters forwarded to the solver. More info in
minimize
Example:{"maxiter": (int) max number of iteration default ``300``, }
- Returns:
s_best (Spectrum) β best spectrum
res (OptimizeResults) β output of
minimize
Examples
See a one-temperature fit example or a multi-temperature fit example.
More advanced tools for interactive fitting of multi-dimensional, multi-slabs spectra can be found in
fitroom
.See also