skultrafast.dataset =================== .. py:module:: skultrafast.dataset Attributes ---------- .. autoapisummary:: skultrafast.dataset.ndarray Classes ------- .. autoapisummary:: skultrafast.dataset.EstDispResult skultrafast.dataset.FitExpResult skultrafast.dataset.LDMResult skultrafast.dataset.TimeResSpec skultrafast.dataset.PolTRSpec skultrafast.dataset.PlotterMixin skultrafast.dataset.TimeResSpecPlotter skultrafast.dataset.PolTRSpecPlotter skultrafast.dataset.DataSetInteractiveViewer skultrafast.dataset.SasViewer Functions --------- .. autoapisummary:: skultrafast.dataset.delegator Module Contents --------------- .. py:data:: ndarray :type: Type[numpy.ndarray] .. py:class:: EstDispResult Bases: :py:obj:`tuple` .. py:attribute:: correct_ds .. py:attribute:: tn .. py:attribute:: polynomial .. py:class:: FitExpResult .. py:attribute:: lmfit_mini :type: lmfit.Minimizer .. py:attribute:: lmfit_res :type: lmfit.minimizer.MinimizerResult .. py:attribute:: fitter :type: FitExpResult.fitter .. py:attribute:: pol_resolved :type: bool :value: False .. py:attribute:: std_errs :type: Optional[numpy.ndarray] :value: None .. py:attribute:: var :type: Optional[numpy.ndarray] :value: None .. py:attribute:: r2 :type: Optional[numpy.ndarray] :value: None .. py:method:: calculate_stats() .. py:method:: make_sas(model: skultrafast.kinetic_model.Model, QYs: Dict[str, float] = {}, y0: Optional[numpy.ndarray] = None) Generate the species associated spectra from a given model using the current das. :param model: Model describing the kinetics. The number of transition rates should be identical to the number of DAS-rates. Currtenly, the function assumes that the transitions are added in a sorted way, e.g. fastest rates first. :type model: Model :param QYs: Values for the yields. :type QYs: dict :param y0: Starting concentrations. If none, y0 = [1, 0, 0, ...]. :type y0: ndarray :rtype: ndarry .. py:class:: LDMResult .. py:attribute:: skmodel :type: object .. py:attribute:: coefs :type: numpy.ndarray .. py:attribute:: fit :type: numpy.ndarray .. py:attribute:: alpha :type: numpy.ndarray .. py:class:: TimeResSpec(wl: numpy.ndarray, t: numpy.ndarray, data: numpy.ndarray, err: numpy.ndarray | None = None, name=None, freq_unit: Literal['nm', 'cm'] = 'nm', disp_freq_unit=None, auto_plot=True) .. py:attribute:: wn .. py:attribute:: wl .. py:attribute:: t .. py:attribute:: data .. py:attribute:: err :value: None .. py:attribute:: _wavelengths .. py:attribute:: _wavenumbers .. py:attribute:: auto_plot :value: True .. py:attribute:: plot .. py:attribute:: t_idx .. py:attribute:: wl_idx .. py:attribute:: wn_idx .. py:attribute:: trans .. py:attribute:: spec .. py:attribute:: map .. py:property:: wavelengths .. py:property:: wavenumbers .. py:method:: __iter__() For compatibility with dv.tup .. py:method:: wl_d(wl: float) Returns the nearest transient for given wavelength. .. py:method:: wn_i(wn1, wn2, method='trapz') Integrates the signal from wn1 to wn2 :param wn1: Wavenumber of the first edge :param float: Wavenumber of the first edge :param wn2: Wavenumber of the second edge :param float: Wavenumber of the second edge :param method: Method used to integrate. :param ('trapz': Method used to integrate. :param 'spline'): Method used to integrate. .. py:method:: wn_d(wn: float) Returns the nearest transient for given wavenumber. .. py:method:: t_d(t) Returns the nearest spectrum for given delaytime. .. py:method:: copy() -> TimeResSpec Returns a copy of the TimeResSpec. .. py:method:: from_txt(fname, freq_unit='nm', time_div=1.0, transpose=False, disp_freq_unit=None, loadtxt_kws=None) :classmethod: Directly create a dataset from a text file. :param fname: Name of the file. This function assumes the data is given by a (n+1, m+1) table. Excludig the [0, 0] value, the first row gives the frequencies and the first column gives the delay-times. :type fname: str :param freq_unit: Unit of the frequencies. :type freq_unit: {'nm', 'cm'} :param time_div: Since `skultrafast` prefers to work with picoseconds and programs may use different units, it divides the time-values by `time_div`. Use `1`, the default, to not change the time values. :type time_div: float :param transpose: Transposes the loaded array. :type transpose: bool :param disp_freq_unit: See class documentation. :type disp_freq_unit: Optional[str] :param loadtxt_kws: Dict containing keyword arguments to `np.loadtxt`. :type loadtxt_kws: dict .. py:method:: save_txt(fname, freq_unit='wl') Saves the dataset as a text file. :param fname: Filename (can include path) :type fname: str :param freq_unit: Which frequency unit is used. :type freq_unit: 'nm' or 'cm' (default 'nm') .. py:method:: cut_freq(lower=-np.inf, upper=np.inf, invert_sel=False, freq_unit=None) -> TimeResSpec Removes channels inside (or outside ) of given frequency ranges. :param lower: Lower bound of the region :type lower: float :param upper: Upper bound of the region :type upper: float :param invert_sel: Invert the final selection. :type invert_sel: bool :param freq_unit: Unit of the given edges. :type freq_unit: 'nm', 'cm' or None :returns: TimeResSpec containing only the listed regions. :rtype: TimeResSpec .. py:method:: mask_freq_idx(idx) Masks given freq idx array :param idx: Boolean array, same shape as the freqs. Where it is `True`, the freqs will be masked. :type idx: array .. py:method:: mask_freqs(freq_ranges, invert_sel=False, freq_unit=None) Mask channels inside of given frequency ranges. :param freq_ranges: List containing the edges (lower, upper) of the frequencies to keep. :type freq_ranges: list of (float, float) :param invert_sel: When True, it inverts the selection. Can be used mark everything outside selected ranges. :type invert_sel: bool :param freq_unit: Unit of the given edges. :type freq_unit: 'nm', 'cm' or None :rtype: None .. py:method:: cut_time(lower=-np.inf, upper=np.inf, invert_sel=False) -> TimeResSpec Remove spectra inside (or outside) of given time-ranges. :param lower: Lower bound of the region :type lower: float :param upper: Upper bound of the region :type upper: float :param invert_sel: Inverts the final selection. :type invert_sel: bool :returns: TimeResSpec containing only the requested regions. :rtype: TimeResSpec .. py:method:: scale_and_shift(scale: float = 1, t_shift: float = 0, wl_shift: float = 0) -> TimeResSpec Return a dataset which is scaled and/or has shifted times and frequencies. scale : float Scales the whole dataset by given factor. t_shift : float Shifts the time-axis of an dataset. wl_shift : float Shifts the wavelengths axis and updates the wavenumbers too. :returns: A modified new dataset :rtype: TimeResSpec .. py:method:: mask_times(time_ranges, invert_sel=False) Mask spectra inside (or outside) of given time-ranges. :param time_ranges: List containing the edges of the time-regions to keep. :type time_ranges: list of (float, float) :param invert_sel: Invert the selection. :type invert_sel: bool :rtype: None .. py:method:: subtract_background(n: int = 10) Subtracts the first n-spectra from the dataset .. py:method:: bin_freqs(n: int, freq_unit=None, use_err: bool = True) -> TimeResSpec Bins down the dataset by averaging over several transients. :param n: The number of bins. The edges are calculated by np.linspace(freq.min(), freq.max(), n+1). :type n: int :param freq_unit: Whether to calculate the bin-borders in frequency- of wavelength space. If `None`, it defaults to `self.disp_freq_unit`. :type freq_unit: 'nm', 'cm' or None :param use_err: If true, use error for weighting. :type use_err: bool :returns: Binned down `TimeResSpec` :rtype: TimeResSpec .. py:method:: bin_times(n, start_index=0) -> TimeResSpec Bins down the dataset by binning `n` sequential spectra together. :param n: How many spectra are binned together. :type n: int :param start_index: Determines the starting index of the binning :type start_index: int :returns: Binned down `TimeResSpec` :rtype: TimeResSpec .. py:method:: estimate_dispersion(heuristic='abs', heuristic_args=(), deg: int = 2, shift_result: float = 0, t_parameter: float = 1.3) Estimates the dispersion from a dataset by first applying a heuristic to each channel. The results are than robustly fitted with a polynomial of given order. :param heuristic: Determines which heuristic to use on each channel. Can also be a function which follows `func(t, y, *args) and returns a `t0`-value. The heuristics are described in `zero_finding`. :type heuristic: {'abs', 'diff', 'gauss_diff', 'max'} or func :param heuristic_args: Arguments which are given to the heuristic. :type heuristic_args: tuple :param deg: Degree of the polynomial used to fit the dispersion (defaults to 2). :type deg: int (optional) :param shift_result: The resulting dispersion curve is shifted by this value. Default 0. :type shift_result: float :param t_parameter: Determines the robustness of the fit. See statsmodels documentation for more info. :type t_parameter: float :returns: Tuple containing the dispersion corrected version of the dataset, an array with time-zeros from the heuristic, and the polynomial function resulting from the robust fit. :rtype: EstDispResult .. py:method:: interpolate_disp(polyfunc: Union[Callable, Iterable]) -> TimeResSpec Correct for dispersion by linear interpolation . :param polyfunc: Function which takes wavenumbers and returns time-zeros. :type polyfunc: Union[Callable, Iterable] :returns: New TimeResSpec where the data is interpolated so that all channels have the same delay point. :rtype: TimeResSpec .. py:method:: fit_exp(x0, fix_sigma=True, fix_t0=True, fix_last_decay=True, model_coh=False, lower_bound=0.1, verbose=True, use_error=False, fixed_names=None, from_t=None) Fit a sum of exponentials to the dataset. This function assumes the dataset is already corrected for dispersion. :param x0: Starting values of the fit. The first value is the estimate of the system response time omega. If `fit_t0` is true, the second float is the guess of the time-zero. All other floats are interpreted as the guessing values for exponential decays. :type x0: list of floats or array :param fix_sigma: If to fix the IRF duration sigma. :type fix_sigma: bool (optional) :param fix_t0: If to fix the the time-zero. :type fix_t0: bool (optional) :param fix_last_decay: Fixes the value of the last tau of the initial guess. It can be used to add a constant by setting the last tau to a large value and fix it. :type fix_last_decay: bool (optional) :param model_coh: If coherent contributions should by modeled. If `True` a gaussian with a width equal the system response time and its derivatives are added to the linear model. :type model_coh: bool (optional) :param lower_bound: Lower bound for decay-constants. :type lower_bound: float (optional) :param verbose: Prints the results out if True. :type verbose: bool :param use_error: If the errors are used in the fit. :type use_error: bool :param fixed_names: Can be used to fix time-constants :type fixed_names: list of str :param from_t: Can be used to cut of early times. :type from_t: float or None .. py:method:: lifetime_density_map(taus=None, alpha=0.0001, cv=True, maxiter=30000, **kwargs) Calculates the LDM from a dataset by regularized regression. :param taus: List with potential decays for building the basis. If `None`, use automatic determination. :type taus: array or None :param alpha: The regularization factor. :type alpha: float :param cv: If to apply cross-validation, by default True. :type cv: bool .. py:method:: concat_datasets(other_ds) Merge the dataset with another dataset. The other dataset need to have the same time axis. :param other_ds: The dataset to merge with :type other_ds: TimeResSpec :returns: The merged dataset. :rtype: TimeResSpec .. py:method:: merge_nearby_channels(distance: float = 8, use_err: bool = False) -> TimeResSpec Merges sequetential channels together if their distance is smaller than given. :param distance: The minimal distance allowed between two channels. If smaller, they will be merged together, by default 8. :type distance: float, optional :param use_err: :type use_err: bool :returns: The merged dataset. :rtype: TimeResSpec .. py:method:: apply_filter(kind, args) -> TimeResSpec Apply a filter to the data. Will always return a copy of the data. :returns: * **kind** (*callable or in ('svd', 'uniform', 'gaussian')*) -- What kind of filter to use. Either a string indicating a inbuild filter or a callable. * **args** (*any*) -- Argument to the filter. Depends on the kind. .. py:class:: PolTRSpec(para: TimeResSpec, perp: TimeResSpec, iso: Optional[TimeResSpec] = None) .. py:attribute:: para .. py:attribute:: perp .. py:attribute:: wavenumbers .. py:attribute:: wavelengths .. py:attribute:: t .. py:attribute:: disp_freq_unit .. py:attribute:: plot .. py:attribute:: _copy .. py:attribute:: bin_times .. py:attribute:: bin_freqs .. py:attribute:: cut_time .. py:attribute:: scale_and_shift .. py:attribute:: cut_freq .. py:attribute:: mask_freqs .. py:attribute:: mask_times .. py:attribute:: subtract_background .. py:attribute:: merge_nearby_channels .. py:attribute:: interpolate_disp .. py:attribute:: apply_filter .. py:attribute:: t_idx .. py:attribute:: wn_idx .. py:attribute:: wl_idx .. py:method:: copy() -> PolTRSpec .. py:method:: wl_d(wl) .. py:method:: wn_d(wn) .. py:method:: t_d(t) .. py:method:: fit_exp(x0, fix_sigma=True, fix_t0=True, fix_last_decay=True, from_t=None, model_coh=False, lower_bound=0.1, use_error=False, fixed_names=None) -> FitExpResult Fit a sum of exponentials to the dataset. This function assumes the two datasets is already corrected for dispersion. :param x0: Starting values of the fit. The first value is the guess of the time-zero. The second value is the estimate of the system response time omega. If `fit_t0` is true, All other floats are interpreted as the guessing values for exponential decays. :type x0: list of floats or array :param fix_sigma: If to fix the IRF duration sigma. :type fix_sigma: bool (optional) :param fix_t0: If to fix the the time-zero. :type fix_t0: bool (optional) :param fix_last_decay: Fixes the value of the last tau of the initial guess. It can be used to add a constant by setting the last tau to a large value and fix it. :type fix_last_decay: bool (optional) :param from_t: If not None, data with t Callable[Ellipsis, Optional[PolTRSpec]] Helper function to delegate methods calls from PolTRSpec to the methods of TimeResSpec. :param pol_tr: :type pol_tr: PolTRSpec :param method: The method to wrap. Uses function annotations to check if the method returns a new TimeResSpec. :type method: method of TimeResSpec .. py:class:: PlotterMixin .. py:property:: x .. py:method:: lbl_spec(ax=None, add_legend=True) .. py:method:: upsample_spec(y, kind='cubic', factor=4) .. py:method:: univariate_spline(y) .. py:class:: TimeResSpecPlotter(dataset: TimeResSpec, disp_freq_unit='nm') Bases: :py:obj:`PlotterMixin` .. py:attribute:: _ds_name :value: 'self.pol_ds.para' .. py:attribute:: dataset .. py:attribute:: freq_unit :value: 'nm' .. py:method:: _get_wl() .. py:method:: _get_wn() .. py:method:: map(symlog=True, equal_limits=True, plot_con=True, con_step=None, con_filter=None, ax=None, **kwargs) Plot a colormap of the dataset with optional contour lines. :param symlog: Determines if the yscale is symmetric logarithmic. :type symlog: bool :param equal_limits: If true, it makes to colors symmetric around zeros. Note this also sets the middle of the colormap to zero. Default is `True`. :type equal_limits: bool :param plot_con: Plot additional contour lines if `True` (default). :type plot_con: bool :param con_step: Controls the contour-levels. If `con_step` is a float, it is used as the step size between two levels. If it is an array, its elements are the levels. If `None`, it defaults to 20 levels. :type con_step: float, array or None :param con_filter: Since contours are strongly affected by noise, it can be prefered to filter the dataset before calculating the contours. If `con_filter` is a dataset, the data of that set will be used for the contours. If it is a tuple of int, the data will be filtered with an uniform filter before calculation the contours. If `None`, no data prepossessing will be applied. :type con_filter: None, int or `TimeResSpec`. :param ax: Takes a matplotlib axis. If none, it uses `plt.gca()` to get the current axes. The lines are plotted in this axis. :type ax: plt.Axis or None .. py:method:: spec(*args, norm=False, ax=None, n_average=0, upsample=1, use_weights=False, offset=0.0, add_legend=False, **kwargs) Plot spectra at given times. :param \*args: List of the times where the spectra are plotted. :type \*args: list or ndarray :param norm: If true, each spectral will be normalized. If given a float, each spectrum will be normalized to given position. :type norm: bool or float :param ax: Axis where the spectra are plotted. If none, the current axis will be used. :type ax: plt.Axis or None. :param n_average: For noisy data it may be preferred to average multiple spectra together. This function plots the average of `n_average` spectra around the specific time-points. :type n_average: int :param upsample: If upsample is >1, it will plot an upsampled version of the spectrum using cubic spline interplotation. :type upsample: int, :param use_weights: If given a tuple, the function will plot the average of the given range. use_weights determines if error weights are in calculating the average. :type use_weights: bool :param offset: If non-zero, each spectrum will be shifted by 'offset' relatively to the last one. 'auto' is not yet implemented. :type offset: float or 'auto' :param add_offset: Weather to add an legend :type add_offset: bool :returns: List containing the Line2D objects belonging to the spectra. :rtype: list of `Lines2D` .. py:method:: trans_integrals(*args, symlog: bool = True, norm=False, ax=None, **kwargs) -> List[matplotlib.pyplot.Line2D] Plot the transients of integrated region. The integration will use np.trapz in wavenumber-space. :param args: Tuple of wavenumbers determining the region to be integrated. :type args: tuples of floats :param symlog: If to use a symlog scale for the delay-time. :type symlog: bool :param norm: If `true`, normalize to transients. If it is a float, the transients are normalzied to value at the delaytime norm. :type norm: bool or float :param ax: Takes a matplotlib axes. If none, it uses `plt.gca()` to get the current axes. The lines are plotted in this ax :type ax: plt.Axes or None :param kwargs: :type kwargs: Further arguments passed to plt.plot :returns: List containing the plotted lines. :rtype: list of Line2D .. py:method:: trans(*args, symlog=True, norm=False, ax=None, freq_unit='auto', linscale=1, add_legend=True, **kwargs) Plot the nearest transients for given frequencies. :param \*args: Spectral positions, should be given in the same unit as `self.freq_unit`. :type \*args: list or ndarray :param symlog: Determines if the x-scale is symlog. :type symlog: bool :param norm: If `False`, no normalization is used. If `True`, each transient is divided by the maximum absolute value. If `norm` is a float, all transient are normalized by their signal at the time `norm`. :type norm: bool or float :param ax: Takes a matplotlib axes. If none, it uses `plt.gca()` to get the current axes. The lines are plotted in this axis. :type ax: plt.Axes or None :param freq_unit: How to interpret the given frequencies. If 'auto' it defaults to the plotters freq_unit. :type freq_unit: 'auto', 'cm' or 'nm' :param linscale: If symlog is True, determines the ratio of linear to log-space. :type linscale: float :param add_legend: If to add the legend automatically. :type add_legend: bool :param All other kwargs are forwarded to the plot function.: :returns: List containing the plotted lines. :rtype: list of Line2D .. py:method:: trans_fit(*args, symlog=True, freq_unit='auto', add_legend=True, ax=None, **kwargs) Plot the nearest transients for given frequencies. :param \*args: Spectral positions, should be given in the same unit as `self.freq_unit`. :type \*args: list or ndarray :param symlog: Determines if the x-scale is symlog. :type symlog: bool :param ax: Takes a matplotlib axes. If none, it uses `plt.gca()` to get the current axes. The lines are plotted in this axis. :type ax: plt.Axes or None :param freq_unit: How to interpret the given frequencies. If 'auto' it defaults to the plotters freq_unit. :type freq_unit: 'auto', 'cm' or 'nm' :param add_legend: If to add the legend automatically. :type add_legend: bool .. py:method:: overview() Plots an overview figure. .. py:method:: svd(n=5) Plot the SVD-components of the dataset. :param n: Determines the plotted SVD-components. If `n` is an int, it plots the first n components. If `n` is a list of ints, then every number is a SVD-component to be plotted. :type n: int or list of int .. py:method:: das(first_comp=0, ax=None, add_legend=True, **kwargs) Plot a DAS, if available. :param fist_comp: Index of the first shown component, useful if fast components model coherent artefact and should not be shown :type fist_comp: int :param ax: Axes to plot. :type ax: plt.Axes or None :param kwargs: Keyword args given to the plot function :type kwargs: dict :param add_legend: If true, add legend automatically. :type add_legend: bool :rtype: Tuple of (List of Lines2D) .. py:method:: edas(ax=None, legend=True, **kwargs) Plot a EDAS, if expontial fit is available. :param ax: Axes to plot. :type ax: plt.Axes or None :param kwargs: Keyword args given to the plot function :type kwargs: dict :rtype: Tuple of (List of Lines2D) .. py:method:: interactive() Generates a jupyter widgets UI for exploring a spectra. .. py:method:: plot_disp_result(result: EstDispResult) Visualize the result of a dispersion correction, creates a figure .. py:class:: PolTRSpecPlotter(pol_dataset: PolTRSpec, disp_freq_unit=None) Bases: :py:obj:`PlotterMixin` .. py:attribute:: perp_ls .. py:attribute:: para_ls .. py:attribute:: pol_ds .. py:method:: _get_wl() .. py:method:: _get_wn() .. py:method:: spec(*times, norm=False, ax=None, n_average=0, add_legend=True, **kwargs) Plot spectra at given times. :param \*times: List of the times where the spectra are plotted. :type \*times: list or ndarray :param norm: If true, each spectral will be normalized. :type norm: bool :param ax: Axis where the spectra are plotted. If none, the current axis will be used. :type ax: plt.Axis or None. :param n_average: For noisy data it may be prefered to average multiple spectra together. This function plots the average of `n_average` spectra around the specific time-points. :type n_average: int :param upsample: If >1, upsample the spectrum using cubic interpolation. :type upsample: int :param add_legend: Add legend automatically :type add_legend: bool :returns: List containing the Line2D objects belonging to the spectra. :rtype: tuple of (List of `Lines2D`) .. py:method:: trans(*args, symlog=True, norm=False, ax=None, add_legend=True, **kwargs) Plot the nearest transients for given frequencies. :param wls: Spectral positions, should be given in the same unit as `self.freq_unit`. :type wls: list or ndarray :param symlog: Determines if the x-scale is symlog. :type symlog: bool :param norm: If `False`, no normalization is used. If `True`, each transient is divided by the maximum absolute value. If `norm` is a float, all transient are normalized by their signal at the time `norm`. :type norm: bool or float :param ax: Takes a matplotlib axes. If none, it uses `plt.gca()` to get the current axes. The lines are plotted in this axis. :type ax: plt.Axes or None :param add_legend: If true, it will add the legend automatically. :type add_legend: bool :param All other kwargs are forwarded to the plot function.: :returns: Tuple of lists containing the plotted lines. :rtype: list of Line2D .. py:method:: das(ax=None, plot_first_das=True, **kwargs) Plot a DAS, if available. :param ax: Axes to plot. :type ax: plt.Axes or None :param plot_first_das: If true, the first DAS is omitted. This is useful, when the first component is very fast and only modeles coherent contributions. :type plot_first_das: bool :param kwargs: Keyword args given to the plot function :type kwargs: dict :rtype: Tuple of (List of Lines2D) .. py:method:: edas(ax=None, *, add_legend=True, **kwargs) Plots a SAS (also called EDAS), if available. :param ax: Axes to plot. :type ax: plt.Axes or None :param kwargs: Keyword args given to the plot function :type kwargs: dict :rtype: Tuple of (List of Lines2D) .. py:method:: sas(model: skultrafast.kinetic_model.Model, QYs: Dict[str, float] = {}, y0: Optional[numpy.ndarray] = None, ax=None, *, add_legend=True, **kwargs) Plots a SAS (also called EDAS), if available. :param mode: Kinetic model :type mode: Model :param yield: Dict with the yields :param ax: Axes to plot. :type ax: plt.Axes or None :param kwargs: Keyword args given to the plot function :type kwargs: dict :rtype: Tuple of (List of Lines2D) .. py:method:: trans_anisotropy(*wls: float, symlog: bool = True, ax: Optional[matplotlib.pyplot.Axes] = None, freq_unit=typing.Literal['auto', 'nm', 'cm'], mode: Literal['aniso', 'dichro']) Plots the anisotropy over time for given frequencies. :param wls: Which frequencies are plotted. :type wls: floats :param symlog: Use symlog scale :type symlog: bool :param ax: Matplotlib Axes, if `None`, defaults to `plt.gca()`. :type ax: plt.Axes or None :param freq_unit: Unit of the frequecies. :type freq_unit: ['auto', 'nm', 'cm'] :param mode: Plot anisotropy or dichroism. :type mode: ['aniso', 'dichro'] :returns: List with the line objects. :rtype: list of Line2D .. py:class:: DataSetInteractiveViewer(dataset, fig_kws=None) .. py:attribute:: trans_line .. py:attribute:: spec_line .. py:attribute:: _events :value: [] .. py:method:: init_events() Connect mpl events .. py:method:: update_lines(event) If the mouse cursor is over the 2D image, update the dynamic transient and spectrum .. py:class:: SasViewer .. py:attribute:: fit_result :type: FitExpResult .. py:attribute:: model :type: skultrafast.kinetic_model.Model .. py:attribute:: fig :type: matplotlib.pyplot.Figure .. py:attribute:: lines :type: List[matplotlib.lines.Line2D]