skultrafast.filter

This module contains various filters and binning methods. All take a dv tup and return a tup.

Module Contents

Functions

svd_filter(tup[, n])

Only use the first n-components.

wiener(tup[, size, noise])

uniform_filter(tup[, sigma])

Apply an uniform filter to data.

gaussian_filter(tup[, sigma])

Apply an uniform filter to data.

sg_filter(tup[, window_length, polyorder, deriv, axis])

Apply a Savitzky-Golay filter to a tup.

bin_channels(tup[, n, method])

Bin the data onto n-channels.

weighted_binner(n, wl, dat, std)

Given wavelengths and data it bins the data into n-wavelenths.

_idx_range(arr, a, b)

Returns a boolean array which is True where arr is between

cut_tup(tup[, from_t, to_t, from_wl, to_wl])

norm_tup(tup[, min_div])

skultrafast.filter.svd_filter(tup, n=6)[source]

Only use the first n-components.

Parameters:
  • tup – data object.

  • n – number of svd components used.

skultrafast.filter.wiener(tup, size=(3, 3), noise=None)[source]
skultrafast.filter.uniform_filter(tup, sigma=(2, 2))[source]

Apply an uniform filter to data.

skultrafast.filter.gaussian_filter(tup, sigma=(2, 2))[source]

Apply an uniform filter to data.

skultrafast.filter.sg_filter(tup, window_length=11, polyorder=2, deriv=0, axis=0)[source]

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.

skultrafast.filter.bin_channels(tup, n=200, method=np.mean)[source]

Bin the data onto n-channels.

skultrafast.filter.weighted_binner(n, wl, dat, std)[source]

Given wavelengths and data it bins the data into n-wavelenths. Returns bdata and bwl

skultrafast.filter._idx_range(arr, a, b)[source]

Returns a boolean array which is True where arr is between a and b.

Parameters:
  • arr (array) – Array to find the range in.

  • a (float) – First edge of the region.

  • b (float) – Second edge of the region.

Returns:

The resulting boolean array

Return type:

arr of bool

skultrafast.filter.cut_tup(tup, from_t=-1e+20, to_t=1e+20, from_wl=-1e+20, to_wl=1e+20)[source]
skultrafast.filter.norm_tup(tup, min_div=3)[source]