WqedLSF
- class exovetter.utils.WqedLSF(x, y, s=None, order=2, func=<function sine>, **kwargs)[source]
Bases:
object
Least squares fit to an analytic function based on
lsf.c
in Wqed, which in turn was based on Bevington and Robinson.- Parameters:
- xarray_like
1D numpy array containing ordinate (e.g., time).
- yarray_like
1D numpy array containing coordinate (e.g., flux).
- sarray_like or float
A scalar or 1D numpy array containing 1-sigma uncertainties. If not given, it is set to unity (default).
- orderint
How many terms of function to fit. Default is 2.
- funcobj
The analytic function to fit. Default is
sine()
.- kwargsdict
Additional keywords to pass to
func
.
- Raises:
- ValueError
Invalid input.
Attributes Summary
Covariance matrix for the best fit.
Best fit parameters.
Residuals, defined as
y - best_fit
.Sum of the squares of the residuals.
Methods Summary
Amplitude from best fit.
Phase from best fit.
get_best_fit_model
([x])Get best fit model to data.
Attributes Documentation
- covariance
Covariance matrix for the best fit.
- params
Best fit parameters.
- residuals
Residuals, defined as
y - best_fit
.
- variance
Sum of the squares of the residuals.
Methods Documentation
- compute_amplitude()[source]
Amplitude from best fit.
Note
Taken from Appendix 1 of Breger (1999, A&A 349, 225), which was written by M Montgomery.
- Returns:
- amp, amp_uncfloat
Amplitude and its uncertainty.
- Raises:
- ValueError
Fitted function is not sine with order 2.