skultrafast.filter ================== .. py:module:: skultrafast.filter .. autoapi-nested-parse:: This module contains various filters and binning methods. All take a dv tup and return a tup. Functions --------- .. autoapisummary:: skultrafast.filter.svd_filter skultrafast.filter.wiener skultrafast.filter.uniform_filter skultrafast.filter.gaussian_filter skultrafast.filter.sg_filter skultrafast.filter.bin_channels skultrafast.filter.weighted_binner skultrafast.filter._idx_range skultrafast.filter.cut_tup skultrafast.filter.norm_tup Module Contents --------------- .. py:function:: svd_filter(tup, n=6) Only use the first n-components. :param tup: data object. :param n: number of svd components used. .. py:function:: wiener(tup, size=(3, 3), noise=None) .. py:function:: uniform_filter(tup, sigma=(2, 2)) Apply an uniform filter to data. .. py:function:: gaussian_filter(tup, sigma=(2, 2)) Apply an uniform filter to data. .. py:function:: sg_filter(tup, window_length=11, polyorder=2, deriv=0, axis=0) Apply a Savitzky-Golay filter to a tup. Parameter --------- tup: Data window_length: Winodw length of the filter polyorder: The order of local polynomial. Must be smaller than window_length. deriv: The order of the derivative to compute. This must be a nonnegative integer. The default is 0. .. py:function:: bin_channels(tup, n=200, method=np.mean) Bin the data onto n-channels. .. py:function:: weighted_binner(n, wl, dat, std) Given wavelengths and data it bins the data into n-wavelenths. Returns bdata and bwl .. py:function:: _idx_range(arr, a, b) Returns a boolean array which is True where arr is between a and b. :param arr: Array to find the range in. :type arr: array :param a: First edge of the region. :type a: float :param b: Second edge of the region. :type b: float :returns: The resulting boolean array :rtype: arr of bool .. py:function:: cut_tup(tup, from_t=-1e+20, to_t=1e+20, from_wl=-1e+20, to_wl=1e+20) .. py:function:: norm_tup(tup, min_div=3)