supressed scipy warning
@@ -312,13 +312,19 @@ class LightCurve(object):
# Reduce `window_length` and `polyorder` for short segments;
# this prevents `savgol_filter` from raising an exception
# If the segment is too short, just take the median
+
if np.any([window_length > (h - l), (h - l) < break_tolerance]):
trend_signal[l:h] = np.nanmedian(lc_clean.flux[l:h])
else:
+ # Scipy outputs a warning here that is not useful, will be fixed in version 1.2
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore')
trend_signal[l:h] = signal.savgol_filter(x=lc_clean.flux[l:h],
window_length=window_length,
polyorder=polyorder,
**kwargs)
+ return(0)
+
trend_signal = np.interp(self.time, lc_clean.time, trend_signal)
flatten_lc = self.copy()
with warnings.catch_warnings():
