skultrafast.dv ============== .. py:module:: skultrafast.dv Classes ------- .. autoapisummary:: skultrafast.dv.tup Functions --------- .. autoapisummary:: skultrafast.dv.add_to_cls skultrafast.dv.add_tup skultrafast.dv.trimmed_mean skultrafast.dv.smooth_spline skultrafast.dv.svd_filter skultrafast.dv.apply_spline skultrafast.dv.normalize skultrafast.dv.weighted_binner skultrafast.dv.binner skultrafast.dv.fi skultrafast.dv.subtract_background skultrafast.dv.polydetrend skultrafast.dv.exp_detrend skultrafast.dv.arr_polydetrend skultrafast.dv.meaner skultrafast.dv.legend_format skultrafast.dv.apply_sg skultrafast.dv.apply_sg_scan skultrafast.dv.calc_error skultrafast.dv.min_pulse_length skultrafast.dv.wavelength2rgb skultrafast.dv.equal_color skultrafast.dv.find_linear_part skultrafast.dv.rebin skultrafast.dv.efa skultrafast.dv.moving_efa skultrafast.dv.pfid_tau_to_w skultrafast.dv.als skultrafast.dv.spec_int skultrafast.dv.do_nnls skultrafast.dv.exp_fit skultrafast.dv.calc_ratios skultrafast.dv.make_fi Module Contents --------------- .. py:class:: tup Bases: :py:obj:`tuple` .. py:attribute:: wl .. py:attribute:: t .. py:attribute:: data .. py:function:: add_to_cls(cls) .. py:function:: add_tup(str_lst) .. py:function:: trimmed_mean(arr, axis=-1, ratio=2.0, use_sem=True) .. py:function:: smooth_spline(x, y, s) .. py:function:: svd_filter(d, n=6) .. py:function:: apply_spline(t, d, s=None) .. py:function:: normalize(x) .. 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:: binner(n, wl, dat, func=np.mean) Given wavelengths and data it bins the data into n-wavelenths. Returns bdata and bwl .. py:function:: fi(w: numpy.ndarray, x: float) -> int fi(w: numpy.ndarray, x: Iterable[float]) -> List[int] Given a value, it finds the index of the nearest value in the array. :param w: Array where to look. :type w: np.ndarray :param x: Value or values to look for. :type x: float or list of floats :returns: Indicies of the nearest values. :rtype: int or list of ints .. py:function:: subtract_background(dat, t, tn, offset=0.3) .. py:function:: polydetrend(x, t=None, deg=3) .. py:function:: exp_detrend(y, t, start_taus=[1], use_constant=True) .. py:function:: arr_polydetrend(x, t=None, deg=3) .. py:function:: meaner(dat, t, llim, ulim, proportiontocut=0.0) .. py:function:: legend_format(l) .. py:function:: apply_sg(y, window_size, order, deriv=0) .. py:function:: apply_sg_scan(y, window_size, order, deriv=0) .. py:function:: calc_error(args) Calculates the error from a leastsq fit infodict. .. py:function:: min_pulse_length(width_in_cm, shape='gauss') .. py:function:: wavelength2rgb(w) Converts a wavelength to a RGB color. .. py:function:: equal_color(plots1, plots2) .. py:function:: find_linear_part(t) Finds the first value of an 1d-array where the difference betweeen consecutively values varys. .. py:function:: rebin(a, new_shape) Resizes a 2d array by averaging or repeating elements, new dimensions must be integral factors of original dimensions :param a: :type a: array_like :param Input array.: :param new_shape: :type new_shape: tuple of int :param Shape of the output array: :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* .. seealso:: :py:obj:`resize` Return a new array with the specified shape. .. rubric:: 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. ]]) .. py:function:: efa(dat, n, reverse=False) Doing evolving factor analyis. .. py:function:: moving_efa(dat, n, ncols, method='svd') .. py:function:: pfid_tau_to_w(tau) Given the rise time of the pertuabed free induction decay, calculate the corresponding spectral width in cm-^1. .. py:function:: als(dat, n=5) .. py:function:: spec_int(tup, r, is_wavelength=True) .. py:function:: do_nnls(A, b) .. py:function:: 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) .. py:function:: calc_ratios(fitter, tmin=0.35, tmax=200) .. py:function:: make_fi(data_to_search)