Polynomial¶
- class gdt.core.background.binned.Polynomial(counts, tstart, tstop, exposure)[source]¶
Bases:
objectClass for performing a polynomial fit on Time-Energy data. The fit is performed over the time axis, treating each energy channel separately, although the fits are performed simultaneously.
- Parameters:
counts (np.array) – The array of counts in each bin, shape (
num_times,num_chans)tstart (np.array) – The low-value edges of the time bins, shape (
num_times,)tstop (np.array) – The high-value edges of the time bins, shape (
num_times,)exposure (np.array) – The exposure of each bin, shape (
num_times,)
Attributes Summary
The degrees-of-freedom for each channel
The fit chi-squared statistic for each channel
'chisq'
Methods Summary
fit([order])Fit the data with a polynomial.
interpolate(tstart, tstop)Interpolation of the fitted polynomial
Attributes Documentation
- dof¶
The degrees-of-freedom for each channel
- Type:
(np.array)
- statistic¶
The fit chi-squared statistic for each channel
- Type:
(np.array)
- statistic_name¶
‘chisq’
- Type:
(str)
Methods Documentation
- fit(order=0)[source]¶
Fit the data with a polynomial. Model variances are used for chi-squared via two fitting passes. Adapted from the RMfit polynomial fitter.
- Parameters:
order (int) – The order of the polynomial
- Returns:
(np.array, np.array) – The fitted model value and model uncertainty at each input bin