skultrafast.twoD_plotter ======================== .. py:module:: skultrafast.twoD_plotter Attributes ---------- .. autoapisummary:: skultrafast.twoD_plotter.NormalizerModes Classes ------- .. autoapisummary:: skultrafast.twoD_plotter.ContourOptions skultrafast.twoD_plotter.TwoDimPlotter Functions --------- .. autoapisummary:: skultrafast.twoD_plotter.normalizer Module Contents --------------- .. py:type:: NormalizerModes :canonical: Literal['max', 'absmax', 'min'] | float | None .. py:function:: normalizer(x: numpy.ndarray, y: numpy.ndarray, mode: NormalizerModes) .. py:class:: ContourOptions Bases: :py:obj:`TypedDict` dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2) .. py:attribute:: levels :type: int .. py:attribute:: cmap :type: str .. py:attribute:: linewidth :type: float .. py:attribute:: add_lines :type: bool .. py:attribute:: add_diag :type: bool .. py:class:: TwoDimPlotter .. py:attribute:: ds :type: skultrafast.twoD_dataset.TwoDim .. py:method:: contour(*times, ax=None, ax_size: float = 1.5, subplots_kws={}, mode: Literal['filled', 'lines'] = 'filled', aspect=None, labels={'x': 'Probe Freq. [cm-1]', 'y': 'Pump Freq. [cm-1]'}, direction: Union[Tuple[int, int], Literal['v', 'h']] = 'v', contour_params: Dict[str, Any] = {}, scale: Literal['firstmax', 'fullmax', 'eachmax'] = 'firstmax', average: Optional[int] = None, fig_kws: dict = {}, normalize: Optional[NormalizerModes] = None, cls_result: Optional[skultrafast.twoD_dataset.CLSResult] = None, cls_plot_kws: dict = {}, cls_fit_plot_kws: dict = {}) -> Dict[Union[str, int], Any] .. py:method:: single_contour(t, co: ContourOptions = ContourOptions(), ax=None) -> dict .. py:method:: movie_contour(fname, contour_kw={}, subplots_kw={}) .. py:method:: plot_cls() .. py:method:: plot_square(pump_range: Tuple[float, float], probe_range: Optional[Tuple[float, float]] = None, symlog: bool = True, ax: Optional[matplotlib.pyplot.Axes] = None, mode: Literal['trapz', 'sum', 'ptp', 'min', 'max'] = 'trapz', normalize: Optional[Union[float, Literal['max']]] = None, draw_rect_axis: Optional[matplotlib.pyplot.Axes] = None, **plot_kws) Plot the integrated signal of given region over the waiting time. :param pump_range: The range of the pump frequency in cm-1 :type pump_range: Tuple[float, float] :param probe_range: The range of the probe frequency in cm-1. If not given uses the same as the pump range. :type probe_range: Tuple[float, float] :param symlog: If True, use symlog scale for the time axis. :type symlog: bool :param ax: The axes to plot on. If None, the current axes is used. :type ax: plt.Axes :param mode: The mode of signal calculation. Can be either 'trapz' or 'ptp'. :type mode: str :param normalize: Whether to normalize the signal. If a float is given, the signal is divided by the value at that time. If 'max' is given, the signal is divided by its maximum value. If 'absmax' is given, the signal is divided by the absolute maximum value. If 'min' is given, the signal is divided by the minimum value. :type normalize: Optional[Union[float, Literal['max', 'absmax', 'min']]] :param draw_rect_axis: If not None, a rectangle indicating the region is drawn on this axes. :type draw_rect_axis: Optional[plt.Axes] :returns: **l** -- The line objects created by the plot. :rtype: plt.Line2D .. py:method:: elp(t, offset=None, p=None) .. py:method:: psa(t: float, bg_correct: bool = True, normalize: Optional[Union[float, Literal['max']]] = None, ax: Optional[matplotlib.pyplot.Axes] = None, **kwargs) Plot the pump-slice amplitude spectrum for a given waiting time. :param t: Waiting time in ps. :type t: float :param bg_correct: Whether to subtract a constant background, by default True. :type bg_correct: bool, optional :param normalize: Whether to normalize the spectrum. If a float is given, the spectrum is divided by the value at that pump frequency. If 'max' is given, the spectrum is divided by its maximum value, by default not normalized. :type normalize: Optional[Union[float, Literal['max']]], optional :param ax: The axes to plot on. If None, the current axes is used. :type ax: Optional[matplotlib.axes.Axes], optional .. py:method:: diagonal(*t: float, offset: Optional[float] = None, ax: Optional[matplotlib.pyplot.Axes] = None) -> List[matplotlib.pyplot.Line2D] Plots the signal along the diagonal. If offset is not None, the signal is shifted by offset, otherwise the offset is determined from the signal by shifting it to the maximal signal. :param t: The waiting time :type t: float :param offset: The offset from the signal, is the spectra is calibrated should be 0. If None, the offset is determined from the signal by looking for maximal signal. :type offset: float, optional :param ax: The axes to plot on. If None, the current axes is used. :type ax: matplotlib.axes.Axes, optional :returns: The plotted lines objects :rtype: List[matplotlib.lines.Line2D] .. py:method:: anti_diagonal(*t: float, offset: Optional[float] = None, p: Optional[float] = None, ax: Optional[matplotlib.pyplot.Axes] = None) -> List[matplotlib.pyplot.Line2D] Plots the signal along a antidiagonal. If offset is not None, the digonal goes through the to the maximal signal. If the frequency axes are calibrated, the offset should be 0. p deterimines the position where the anti-diagonal goes through. If None, again the position of the maxium is used. :param t: The waiting time :type t: float :param offset: The offset from the signal, is the spectra is calibrated should be 0. If None, the offset is determined from the signal by looking for maximal signal. :type offset: float, optional :param p: The position of the anti-diagonal. If None, the position of the maximal signal is used. :type p: float, optional :param ax: The axes to plot on. If None, the current axes is used. :type ax: matplotlib.axes.Axes, optional :returns: The plotted lines objects :rtype: List[matplotlib.lines.Line2D] .. py:method:: mark_minmax(t: float, which: Literal['both', 'min', 'max'] = 'both', ax: Optional[matplotlib.pyplot.Axes] = None, **kwargs) Marks the position of the minimum and maxium of a given time t. .. py:method:: trans(pump_wn: Union[float, list[float]], probe_wn: Union[float, list[float]], ax: Optional[matplotlib.pyplot.Axes] = None, symlog=True, normalize: Optional[Union[float, Literal['max']]] = None, **kwargs) -> List[matplotlib.pyplot.Line2D] Plot the 2D signal of single point over the waiting time. :param pump_wn: The pump frequency. Also takes a list. If a list is given, the length of the list must be the same as the length of probe_wn or of length 1. :type pump_wn: float or list of float :param probe_wn: The probe frequency. Also takes a list. If a list is given, the length of the list must be the same as the length of pump_wn or of length 1. :type probe_wn: float or list of float :param ax: The axes to plot on. If None, the current axes is used. :type ax: matplotlib.axes.Axes, optional :param symlog: If True, apply symlog scaling to the plot. :type symlog: bool, optional :param normalize: Whether to normalize the transients. If a float is given, the transients are divided by the value at that time. If 'max' is given, the transients are divided by its maximum value, by default not normalized. :type normalize: Optional[normalizer_modes], optional :param kwargs: Additional keyword arguments are passed to the plot function. :type kwargs: dict :returns: The plotted lines objects :rtype: List[matplotlib.lines.Line2D] .. py:method:: pump_slice(pump_wn: float, *t, normalize: Optional[NormalizerModes] = None, ax: Optional[matplotlib.pyplot.Axes] = None, **kwargs) -> list[matplotlib.pyplot.Line2D] Plot a slice along the probe axis for a given pump frequency. :param pump_wn: The pump frequency. :type pump_wn: float :param t: The waiting time, can be multiple. :type t: float :param normalize: Whether to normalize the slice. If a float is given, the slice is divided by the value at that probe frequency. If 'max' is given, the slice is divided by its maximum value, by default not normalized. :type normalize: Optional[NormalizerModes], optional :param ax: The axes to plot on. If None, the current axes is used. :type ax: matplotlib.axes.Axes, optional :returns: The plotted line object. :rtype: plt.Line2D .. py:method:: probe_slice(probe_wn: float, *t, normalize: Optional[NormalizerModes] = None, ax: Optional[matplotlib.pyplot.Axes] = None, **kwargs) -> list[matplotlib.pyplot.Line2D] Plot a slice along the pump axis for a given probe frequency. :param probe_wn: The probe frequency. :type probe_wn: float :param t: The waiting time, can be multiple. :type t: float :param normalize: Whether to normalize the slice. If a float is given, the slice is divided by the value at that pump frequency. If 'max' is given, the slice is divided by its maximum value, by default not normalized. :type normalize: Optional[NormalizerModes], optional :param ax: The axes to plot on. If None, the current axes is used. :type ax: matplotlib.axes.Axes, optional :returns: The plotted line object. :rtype: plt.Line2D