Detrending

gerbls.clean_savgol(phot, N_flares=3, sigma_clip=5.0, window_length=1.0, chunk_length=0.0, verbose=True)[source]

Clean the data using a Savitsky-Golay filter. Also performs sigma clipping and flare rejection. Cubic splines will be used to interpolate over any masked data.

Parameters:
  • phot (gerbls.pyDataContainer) – Input data to be cleaned.

  • N_flares (int, optional) – Number of iterations to detect flares, by default 3. Flares are defined as 4 or more consecutive positive 2-sigma deviants.

  • sigma_clip (float, optional) – Whether to remove outliers more than X sigma from the initial baseline, by default 5. To turn off, enter 0.

  • window_length (float, optional) – Window length in time units (days) for the Savitsky-Golay filter, by default 1.

  • chunk_length (float, optional) – If given, divide the data into chunks first where the time gaps in data are longer than this length, and apply the filter independently to each chunk, by default 0.

  • verbose (bool, optional) – Whether to print any text/warnings, by default True

Returns:

  • cphot (gerbls.pyDataContainer) – Cleaned data.

  • cmask (numpy.ndarray) – Mask corresponding to valid cleaned data.