extract_spaxel_info¶
- threadcount.fit.extract_spaxel_info(fit_results, fit_info=None, model_params=None, result_dict=None, names_only=False)[source]¶
Extract ModelResult attributes into numpy array.
This function broadcasts
threadcount.lmfit_ext.summary_array()to all ModelResult in fit_results and handles None values.If names_only is True, the output is a list containing the attribute names. (simply fit_info + model_params.)
If result_dict is not None, the output will be appendeded to result_dict, otherise a new
ResultDictwill be returned. The keys in the dict correspond to the entries in fit_info and model_params.Each entry of results[key] will have the same spatial shape as fit_results, giving an easy way of viewing spatial maps of these parameters.
- Parameters:
fit_results (Array of
lmfit.model.ModelResult) – The set of ModelResults to extract the information from.fit_info (list of string) – Any attribute that can return a float value from
lmfit.model.ModelResult, e.g. [“chisqr”, “aic”, “aic_real”, “success”] (aic_real is defined inthreadcount.lmfit_extmodule)model_params (list of str) – Options here are the param names, or the param names with “_err” appended. As an example, lets say we have a param name = “height”, and we wish to extract the value of the “height” parameter and it’s fit error, then model_params = [“height”, “height_err”]. The full list you can choose from for a model is model.make_params().valerrsdict().keys().
result_dict (
ResultDict, optional) – Append these results to result_dict or create a new one (if None), by default Nonenames_only (bool, optional) – Return a list of the attribute names this call generates, by default False. It is essentially fit_info + model_params.
- Returns:
A ResultDict where the keys are the strings in fit_info and model_params, and the values are the numpy arrays of same spatial shape as fit_results. Essentially images of the parameters.
- Return type: