satlas.models.models.MiscModel¶
-
class
satlas.models.models.MiscModel(func, args, name_list=None)[source]¶ Constructs a response from a supplied function. Call signature is
def func(x, par):
a = par[0]
b = par[1]
...
return y
-
__init__(func, args, name_list=None)[source]¶ The
MiscModeltakes a supplied function func and list of starting argument parameters args to contruct an object that responds with the given function for the parameter values. A list of names can also be supplied to customize the parameter names.Parameters: - func (callable) – A callable function with call signature func(x, args).
- args (list of values) – List of starting values for the parameters. The number of parameters is based on the length of the list of arguments.
- name_list (list of strings, optional) – List of names to be supplied to the parameters. The order of the names and the order of the parameters is the same, so name_list[0] corresponds to args[0].
Methods
__init__(func, args[, name_list])The MiscModeltakes a supplied function func and list of starting argument parameters args to contruct an object that responds with the given function for the parameter values.__call__(x)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. save(path)Saves the current spectrum, including the results of the fitting and the parameters, to the specified file. seperate_response(x)Wraps the output of the __call__in a list, for ease of coding in the fitting routines.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-