nksaunders / giants

Finding Giant Planets in TESS FFIs
2 stars 3 forks source link

additional smoothing and outlier rejection #5

Closed skgrunblatt closed 4 years ago

skgrunblatt commented 4 years ago

lines to add:

from astropy.stats import mad_std

flux = flux - scipy.ndimage.filters.gaussian_filter(flux, 90) #<2-day (5muHz) filter

#sigma clip and filter data bound = 3.5 # N sigma clipping mad = mad_std(flux) outlier_ind = np.where(abs(flux) >= bound*mad)[0] print("Outlier number: ",outlier_ind.size)

time_clean = np.delete(time, outlier_ind) flux_clean = np.delete(flux, outlier_ind) flux_err_clean = np.delete(flux_err, outlier_ind)

time = time_clean flux = flux_clean flux_err = flux_err_clean

nksaunders commented 4 years ago

Implemented!