edges_analysis.filters.filters.explicit_filter

edges_analysis.filters.filters.explicit_filter(times, bad, ret_times=False)[source]

Explicitly filter out certain times.

Parameters:
  • times (array-like) – The input times. This can be either a recarray, a list of tuples, a list of ints, or a 2D array of ints. The columns of the recarray (or the entries of the tuples) should correspond to year, ‘day` and hour. The last two are not required, eg. 2-tuples will be interpreted as (year, hour), and a list of ints will be interpreted as just years.

  • bad (str or array-like) – Like times, but specifying the bad entries. Need not have the same columns as times. If any bad exists within a given time frame, it will be considered bad. Likewise, if bad has higher scope than times, then it will also be bad. Eg.: times = [2018], bad=[(2018, 125)], times will be considered bad. Also, times=[(2018, 125)], bad=[2018], times will be considered bad. If a str, reads the bad times from a properly configured YAML file.

  • ret_times (bool, optional) – If True, return the good times as well as the indices of such in original array.

Returns:

  • keep – indices marking which times are not bad if inplace=False.

  • times – Only if ret_times=True. An array of the times that are good.