skultrafast.dv

Module Contents

Functions

add_to_cls(cls)

add_tup(str_lst)

trimmed_mean(arr[, axis, ratio, use_sem])

smooth_spline(x, y, s)

svd_filter(d[, n])

apply_spline(t, d[, s])

normalize(x)

weighted_binner(n, wl, dat, std)

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

binner(n, wl, dat[, func])

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

fi(…)

Given a value, it finds the index of the nearest value in the array.

subtract_background(dat, t, tn[, offset])

polydetrend(x[, t, deg])

exp_detrend(y, t[, start_taus, use_constant])

arr_polydetrend(x[, t, deg])

meaner(dat, t, llim, ulim[, proportiontocut])

legend_format(l)

apply_sg(y, window_size, order[, deriv])

apply_sg_scan(y, window_size, order[, deriv])

calc_error(args)

Calculates the error from a leastsq fit infodict.

min_pulse_length(width_in_cm[, shape])

wavelength2rgb(w)

Converts a wavelength to a RGB color.

equal_color(plots1, plots2)

find_linear_part(t)

Finds the first value of an 1d-array where the difference betweeen

rebin(a, new_shape)

Resizes a 2d array by averaging or repeating elements,

efa(dat, n[, reverse])

Doing evolving factor analyis.

moving_efa(dat, n, ncols[, method])

pfid_tau_to_w(tau)

Given the rise time of the pertuabed

als(dat[, n])

spec_int(tup, r[, is_wavelength])

do_nnls(A, b)

exp_fit(x, y[, start_taus, use_constant, amp_max, ...])

calc_ratios(fitter[, tmin, tmax])

make_fi(data_to_search)

Attributes

tup

skultrafast.dv.tup[source]
skultrafast.dv.add_to_cls(cls)[source]
skultrafast.dv.add_tup(str_lst)[source]
skultrafast.dv.trimmed_mean(arr, axis=-1, ratio=2.0, use_sem=True)[source]
skultrafast.dv.smooth_spline(x, y, s)[source]
skultrafast.dv.svd_filter(d, n=6)[source]
skultrafast.dv.apply_spline(t, d, s=None)[source]
skultrafast.dv.normalize(x)[source]
skultrafast.dv.weighted_binner(n, wl, dat, std)[source]

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

skultrafast.dv.binner(n, wl, dat, func=np.mean)[source]

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

skultrafast.dv.fi(w: numpy.ndarray, x: float) int[source]
skultrafast.dv.fi(w: numpy.ndarray, x: List[float]) List[int]

Given a value, it finds the index of the nearest value in the array.

Parameters:
  • w (np.ndarray) – Array where to look.

  • x (float or list of floats) – Value or values to look for.

Returns:

Indicies of the nearest values.

Return type:

int or list of ints

skultrafast.dv.subtract_background(dat, t, tn, offset=0.3)[source]
skultrafast.dv.polydetrend(x, t=None, deg=3)[source]
skultrafast.dv.exp_detrend(y, t, start_taus=[1], use_constant=True)[source]
skultrafast.dv.arr_polydetrend(x, t=None, deg=3)[source]
skultrafast.dv.meaner(dat, t, llim, ulim, proportiontocut=0.0)[source]
skultrafast.dv.legend_format(l)[source]
skultrafast.dv.apply_sg(y, window_size, order, deriv=0)[source]
skultrafast.dv.apply_sg_scan(y, window_size, order, deriv=0)[source]
skultrafast.dv.calc_error(args)[source]

Calculates the error from a leastsq fit infodict.

skultrafast.dv.min_pulse_length(width_in_cm, shape='gauss')[source]
skultrafast.dv.wavelength2rgb(w)[source]

Converts a wavelength to a RGB color.

skultrafast.dv.equal_color(plots1, plots2)[source]
skultrafast.dv.find_linear_part(t)[source]

Finds the first value of an 1d-array where the difference betweeen consecutively values varys.

skultrafast.dv.rebin(a, new_shape)[source]

Resizes a 2d array by averaging or repeating elements, new dimensions must be integral factors of original dimensions

Parameters:
  • a (array_like)

  • array. (Input)

  • new_shape (tuple of int)

  • array (Shape of the output)

Returns:

  • rebinned_array (ndarray)

  • If the new shape is smaller of the input array, the data are averaged,

  • if the new shape is bigger array elements are repeated

See also

resize

Return a new array with the specified shape.

Examples

>>> a = np.array([[0, 1], [2, 3]])
>>> b = rebin(a, (4, 6)) #upsize
>>> b
array([[0, 0, 0, 1, 1, 1],
[0, 0, 0, 1, 1, 1],
[2, 2, 2, 3, 3, 3],
[2, 2, 2, 3, 3, 3]])
>>> c = rebin(b, (2, 3)) #downsize
>>> c
array([[ 0. , 0.5, 1. ],
[ 2. , 2.5, 3. ]])
skultrafast.dv.efa(dat, n, reverse=False)[source]

Doing evolving factor analyis.

skultrafast.dv.moving_efa(dat, n, ncols, method='svd')[source]
skultrafast.dv.pfid_tau_to_w(tau)[source]

Given the rise time of the pertuabed free induction decay, calculate the corresponding spectral width in cm-^1.

skultrafast.dv.als(dat, n=5)[source]
skultrafast.dv.spec_int(tup, r, is_wavelength=True)[source]
skultrafast.dv.do_nnls(A, b)[source]
skultrafast.dv.exp_fit(x, y, start_taus=[1], use_constant=True, amp_max=None, amp_min=None, weights=None, amp_penalty=0, verbose=True, start_amps=None)[source]
skultrafast.dv.calc_ratios(fitter, tmin=0.35, tmax=200)[source]
skultrafast.dv.make_fi(data_to_search)[source]