mathutils.py
- Math utils¶
Miscellaneous math utilities used throughout the code.
-
everest.mathutils.
Chunks
(l, n, all=False)¶ Returns a generator of consecutive n-sized chunks of list l. If all is True, returns all n-sized chunks in l by iterating over the starting point.
-
everest.mathutils.
Downbin
(x, newsize, axis=0, operation='mean')¶ Downbins an array to a smaller size.
Parameters:
-
everest.mathutils.
Interpolate
(time, mask, y)¶ Masks certain elements in the array y and linearly interpolates over them, returning an array y’ of the same length.
Parameters: - time (array_like) – The time array
- mask (array_like) – The indices to be interpolated over
- y (array_like) – The dependent array
-
everest.mathutils.
MedianFilter
(x, kernel_size=5)¶ A silly wrapper around
scipy.signal.medfilt()
.
-
everest.mathutils.
NumRegressors
(npix, pld_order, cross_terms=True)¶ Return the number of regressors for npix pixels and PLD order pld_order.
Parameters: cross_terms (bool) – Include pixel cross-terms? Default True
-
everest.mathutils.
SavGol
(y, win=49)¶ Subtracts a second order Savitsky-Golay filter with window size win and returns the result. This acts as a high pass filter.
-
everest.mathutils.
Scatter
(y, win=13, remove_outliers=False)¶ Return the scatter in ppm based on the median running standard deviation for a window size of
win
= 13 cadences (for K2, this is ~6.5 hours, as in VJ14).Parameters: