Sersic model fitting
SphotModel, ModelFitter, ModelScaleFitter and the optimiser dispatchers (iNM, dual-annealing, triple-annealing, L-BFGS-B polish).
- class sphot.fitting.SphotModel(*args: Any, **kwargs: Any)[source]
Bases:
PSFConvolvedModel2D- set_conditions(list_of_conditions)[source]
Set condition functions.
- Parameters:
list_of_conditions (list of 2-tuple) – list of conditions, each as a 2-tuple. Each tuple
(a, b)is evaluated asa >= b. Either entry of the tuple can be a parameter name or a numerical value. For example,[('r_eff', 10), ('r_eff_1', 'r_eff_0')]returns True iffr_eff >= 10ANDr_eff_1 >= r_eff_0.
- class sphot.fitting.ModelFitter(model, cutoutdata, **kwargs)[source]
Bases:
objectA fitter class to perform Sersic model fitting to data.
- class sphot.fitting.ModelScaleFitter(model, cutoutdata, base_params=None, **kwargs)[source]
Bases:
ModelFitter
- sphot.fitting.iterative_NM(func, args, x0, bounds, rtol_init=0.001, rtol_iter=0.0001, rtol_convergence=1e-06, xrtol=1, max_iter=20, maxfev_eachiter=100, progress=None, progress_text='Running iNM...', **kwargs)[source]
Iterative Nelder-Mead minimization. The original implementation by Scipy tends to miss the global minimum. Rather than setting the tolerance to be small, the success rate tends to be higher when the tolerance is set to be larger and the minimization is run multiple times.