satlas.models.linkedmodel.LinkedModel

class satlas.models.linkedmodel.LinkedModel(models)[source]

Links different models for simultaneous fitting.

__init__(models)[source]

Initializes the class for simultaneous fitting of different models.

Parameters:models (list of BaseModel children objects) – A list defining the different models.
__call__(x)[source]

Pass the seperate frequency arrays to the submodels, and return their response values as a list of arrays.

Parameters:x (list of floats or array_likes) – Frequency in MHz
Returns:Response of each spectrum for each seperate value in x.
Return type:list of floats or NumPy arrays

Methods

__init__(models) Initializes the class for simultaneous fitting of different models.
__call__(x) Pass the seperate frequency arrays to the submodels, and return their response values as a list of arrays.
display_chisquare_fit([scaled]) Display all relevent info of the least-squares fitting routine, if this has been performed.
display_mle_fit([scaled]) Give a readable overview of the result of the MLE fitting routine.
get_chisquare_mapping()
get_lnprior_mapping(params)
get_result([selection]) Return the variable names, values and estimated error bars for the parameters as seperate lists.
get_result_dict([method, scaled]) Returns the fitted parameters in a dictionary of the form {name: [value, uncertainty]}.
get_result_frame([method, selected, bounds, ...]) Returns the data from the fit in a pandas DataFrame.
plot([x, y, yerr, ax, show, plot_kws, linked]) Routine that plots the hfs, possibly on top of experimental data.
plot_spectroscopic([x, y, plot_kws]) Routine that plots the hfs of all the models, possibly on top of experimental data.
save(path) Saves the current spectrum, including the results of the fitting and the parameters, to the specified file.
seperate_response(x) Generates the response for each subspectrum.
set_boundaries(boundaryDict) Sets the boundaries of the fitparameters as supplied in the dictionary.
set_chisquare_mapping(mappingDict) Sets the prior mapping for the different parameters.
set_expr(exprDict) Sets the expression of the selected parameters to the given expressions.
set_literature_values(literatureDict) Sets the lnprior and chisquare mapping to handle the given literature values and uncertainties.
set_lnprior_mapping(mappingDict) Sets the prior mapping for the different parameters.
set_value(valueDict) Sets the value of the given parameters to the given values.
set_variation(varyDict) Sets the variation of the fitparameters as supplied in the dictionary.

Attributes

params Instance of lmfit.Parameters object characterizing the shape of the HFS.
shared Contains all parameters which share the same value among all models.