burstfit.curvefit
CurveFit Objects
class CurveFit()
Simple wrapper class to handle curve fitting. It can also retry the fitting with modified bounds if errors are encountered or if the fitting errors are not finite. See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.curve_fit.html for details of inputs.
Arguments:
function
- Fitting functionxdata
- Input x data array (independent variable)ydata
- Input y data array to fit (dependent variable)bounds
- Lower and upper bounds on parametersp0
- Initial guess for the parametersretry
- To retry the fitting in case of RunTimeError or infinite fit errorsretry_frac_runtimeerror
- To set the bounds using p0 in case of RuntimeErrorretry_frac_infinite_err
- To set the bounds using p0 in case of infinite fit errors
run_fit
| def run_fit()
Runs the fitting function and checks for errors and retries.
Returns:
popt
- List of converged parameterserr
- Errors on the parameters
cf
| def cf()
Do the actual curve fitting using curve_fit
Returns:
popt
- List of converged parameterserr
- Errors on the parameters