Module: sigma_g_filter#

Functions to help with the SigmaG clipping.

For more details see: Sifting Through the Static: Moving Object Detection in Difference Images by Smotherman et. al. 2021

class kbmod.filters.sigma_g_filter.SigmaGClipping(low_bnd=25, high_bnd=75, n_sigma=2, clip_negative=False)[source]#

This class contains the basic information for performing SigmaG clipping.

Attributes:
low_bndfloat

The lower bound of the interval to use to estimate the standard deviation.

high_bndfloat

The upper bound of the interval to use to estimate the standard deviation.

n_sigmafloat

The number of standard deviations to use for the bound.

clip_negativebool

A Boolean indicating whether to use negative values when computing standard deviation.

coefffloat

The precomputed coefficient based on the given bounds.

Methods

compute_clipped_sigma_g(lh)

Compute the SigmaG clipping on the given likelihood curve.

compute_clipped_sigma_g_matrix(lh)

Compute the SigmaG clipping on a matrix containing curves where each row is a single curve at different time points.

find_sigma_g_coeff(low_bnd, high_bnd)

Compute the sigma G coefficient from the upper and lower bounds of the percentiles.

invert_gauss_cdf

compute_clipped_sigma_g(lh)[source]#

Compute the SigmaG clipping on the given likelihood curve. Points are eliminated if they are more than n_sigma*sigmaG away from the median.

Parameters:
lhnumpy array

A single likelihood curve.

Returns:
good_index: numpy array

The indices that pass the filtering for a given set of curves.

compute_clipped_sigma_g_matrix(lh)[source]#

Compute the SigmaG clipping on a matrix containing curves where each row is a single curve at different time points. Points are eliminated if they are more than n_sigma*sigmaG away from the median.

Parameters:
lhnumpy.ndarray

A N x T matrix with N curves, each with T time steps.

Returns:
index_validnumpy.ndarray

A N x T matrix of Booleans indicating if each point is valid (True) or has been filtered (False).

static find_sigma_g_coeff(low_bnd, high_bnd)[source]#

Compute the sigma G coefficient from the upper and lower bounds of the percentiles.

Parameters:
low_bndfloat

The lower bound of the percentile on a scale of [0, 100].

high_bndfloat

The lower bound of the percentile on a scale of [0, 100].

Returns:
resultfloat

The corresponding sigma G coefficient.

Raises:
Raises a ValueError is the bounds are invalid.
kbmod.filters.sigma_g_filter.apply_clipped_sigma_g(clipper, result_data)[source]#

This function applies a clipped median filter to the results of a KBMOD search using sigmaG as a robust estimater of standard deviation.

Parameters:
clipperSigmaGClipping

The object to apply the SigmaG clipping.

result_dataResults

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