dataset.TimeResSpec¶
- class dataset.TimeResSpec(wl: ndarray, t: ndarray, data: ndarray, err: ndarray | None = None, name=None, freq_unit: Literal['nm', 'cm'] = 'nm', disp_freq_unit=None, auto_plot=True)[source]¶
Class for working with time-resolved spectra. If offers methods for analyzing and pre-processing the data. To visualize the data, each
TimeResSpecobject has an instance of anDataSetPlotterobject accessible underplot.- Parameters:
wl (array of shape(n)) – Array of the spectral dimension
t (array of shape(m)) – Array with the delay times.
data (array of shape(n, m)) – Array with the data for each point.
err (array of shape(n, m) or None (optional)) – Contains the std err of the data, can be
None.name (str (optional)) – Identifier for data set.
freq_unit ('nm' or 'cm' (optional)) – Unit of the wavelength array, default is ‘nm’.
disp_freq_unit ('nm','cm' or None (optional)) – Unit which is used by default for plotting, masking and cutting the dataset. If
None, it defaults tofreq_unit.
- wavelengths, wavenumbers, t, data
Arrays with the data itself.
- Type:
- plot¶
Helper class which can plot the dataset using
matplotlib.- Type:
- t_idx¶
Helper function to find the nearest index in t for a given time.
- Type:
function
- wl_idx¶
Helper function to search for the nearest wavelength index for a given wavelength.
- Type:
function
- wn_idx¶
Helper function to search for the nearest wavelength index for a given wavelength.
- Type:
function
- auto_plot¶
When True, some function will display their result automatically.
- Type:
bool
- __init__(wl: ndarray, t: ndarray, data: ndarray, err: ndarray | None = None, name=None, freq_unit: Literal['nm', 'cm'] = 'nm', disp_freq_unit=None, auto_plot=True)[source]¶
Class for working with time-resolved spectra. If offers methods for analyzing and pre-processing the data. To visualize the data, each
TimeResSpecobject has an instance of anDataSetPlotterobject accessible underplot.- Parameters:
wl (array of shape(n)) – Array of the spectral dimension
t (array of shape(m)) – Array with the delay times.
data (array of shape(n, m)) – Array with the data for each point.
err (array of shape(n, m) or None (optional)) – Contains the std err of the data, can be
None.name (str (optional)) – Identifier for data set.
freq_unit ('nm' or 'cm' (optional)) – Unit of the wavelength array, default is ‘nm’.
disp_freq_unit ('nm','cm' or None (optional)) – Unit which is used by default for plotting, masking and cutting the dataset. If
None, it defaults tofreq_unit.
- wavelengths, wavenumbers, t, data
Arrays with the data itself.
- Type:
- plot¶
Helper class which can plot the dataset using
matplotlib.- Type:
- t_idx¶
Helper function to find the nearest index in t for a given time.
- Type:
function
- wl_idx¶
Helper function to search for the nearest wavelength index for a given wavelength.
- Type:
function
- wn_idx¶
Helper function to search for the nearest wavelength index for a given wavelength.
- Type:
function
- auto_plot¶
When True, some function will display their result automatically.
- Type:
bool
Methods
__init__(wl, t, data[, err, name, ...])Class for working with time-resolved spectra.
apply_filter(kind, args)Apply a filter to the data.
bin_freqs(n[, freq_unit, use_err])Bins down the dataset by averaging over several transients.
bin_times(n[, start_index])Bins down the dataset by binning
nsequential spectra together.concat_datasets(other_ds)Merge the dataset with another dataset.
copy()Returns a copy of the TimeResSpec.
cut_freq([lower, upper, invert_sel, freq_unit])Removes channels inside (or outside ) of given frequency ranges.
cut_time([lower, upper, invert_sel])Remove spectra inside (or outside) of given time-ranges.
estimate_dispersion([heuristic, ...])Estimates the dispersion from a dataset by first applying a heuristic to each channel.
fit_exp(x0[, fix_sigma, fix_t0, ...])Fit a sum of exponentials to the dataset.
from_txt(fname[, freq_unit, time_div, ...])Directly create a dataset from a text file.
interpolate_disp(polyfunc)Correct for dispersion by linear interpolation .
lifetime_density_map([taus, alpha, cv, maxiter])Calculates the LDM from a dataset by regularized regression.
mask_freq_idx(idx)Masks given freq idx array
mask_freqs(freq_ranges[, invert_sel, freq_unit])Mask channels inside of given frequency ranges.
mask_times(time_ranges[, invert_sel])Mask spectra inside (or outside) of given time-ranges.
merge_nearby_channels([distance, use_err])Merges sequetential channels together if their distance is smaller than given.
save_txt(fname[, freq_unit])Saves the dataset as a text file.
scale_and_shift([scale, t_shift, wl_shift])Return a dataset which is scaled and/or has shifted times and frequencies.
subtract_background([n])Subtracts the first n-spectra from the dataset
t_d(t)Returns the nearest spectrum for given delaytime.
wl_d(wl)Returns the nearest transient for given wavelength.
wn_d(wn)Returns the nearest transient for given wavenumber.
wn_i(wn1, wn2[, method])Integrates the signal from wn1 to wn2
Attributes
wavelengthswavenumbers