Module: basic_filters#

Functions to do basic filtering of Results, such as filtering the points based on likleihood or the rows based on time range.

kbmod.filters.basic_filters.apply_likelihood_clipping(result_data, lower_bnd=-inf, upper_bnd=inf)[source]#

Filter individual time steps with points above or below given likelihood thresholds. Applies the filtering to the result_data in place.

Parameters:
result_dataResults

The values from trajectories. This data gets modified directly by the filtering.

lower_bndfloat

The minimum likleihood for a single observation. Default = -inf.

upper_bndfloat

The maximum likelihood for a single observation. Default = inf.

kbmod.filters.basic_filters.apply_time_range_filter(result_data, mjds, min_days=inf, colname=None)[source]#

Filter any row that does not have valid observations that cover at least threshold days. Applies the filtering to the result_data in place.

Parameters:
result_dataResults

The values from trajectories. This data gets modified directly by the filtering.

mjdsnumpy.ndarray

An array of the timestamps for each observation time.

min_daysfloat

The minimum time length from the first to last valid observation (in days). Default = inf

colnamestr

If provided, adds the duration as a column to results.

kbmod.filters.basic_filters.apply_unique_day_filter(result_data, mjds, min_days, min_per_day=1, colname=None)[source]#

Filter any row that does not have valid observations that occur on at least min_days unique days. Applies the filtering to the result_data in place.

Based on Wilson’s code from the two day analysis notebook.

Parameters:
result_dataResults

The values from trajectories. This data gets modified directly by the filtering.

mjdsnumpy.ndarray

An array of the timestamps for each observation time.

min_daysint

The minimum number of days on which we need a valid observation.

min_per_dayint

The minimum number of observations we need to see on a single day in order to count that day. Default = 1

colnamestr

If provided, adds the duration as a column to results. Default = None