Module: array_stats

This modules implements functions for the statistical operations on arrays

eval_mad(arr)[source]
Parameters:arr
eval_skew_minimization_stats(data)[source]

Returns stats after skewness minimization

Parameters:

data : 1d numpy array

Returns:

bkg_lvl : float, bkg level

bkg_sig : float, bkg std dev

skew : skewness of the bkg

size : size of the array used to eval the stats

minimize_skewness(data, sigma_range, min_size_ratio, grid_size=50)[source]

the minimum skewness in the range |m-s1,m+s1| is chosen, where m is the mean of the data, and s1=std(data)*`sigma_range`

Parameters:

data : 1d numpy array

sigma_range : float

min_size_ratio : float

min size of the skewness minimized data set. If size<data.size*`min_size_ratio`, then the a less restrictive skew is chosen until the minimun size condition is satisfied

grid_size : Optional[int]

size of the grid to evaluate the skewness

sigma_clipping()[source]