skultrafast.twoD_plotter

Module Contents

Classes

ContourOptions

dict() -> new empty dictionary

TwoDimPlotter

class skultrafast.twoD_plotter.ContourOptions[source]

Bases: 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)

levels: int[source]
cmap: str[source]
linewidth: float[source]
add_lines: bool[source]
add_diag: bool[source]
class skultrafast.twoD_plotter.TwoDimPlotter[source]
ds: skultrafast.twoD_dataset.TwoDim[source]
contour(*times, ax=None, ax_size: float = 1.5, subplots_kws={}, aspect=None, labels={'x': 'Probe Freq. [cm-1]', 'y': 'Pump Freq. [cm-1]'}, direction: Tuple[int, int] | Literal[v, h] = 'v', contour_params: Dict[str, Any] = {}, scale: Literal[firstmax, fullmax, eachmax] = 'firstmax', average=None, fig_kws: dict = {}) Dict[str | int, Any][source]
single_contour(t, co: ContourOptions = ContourOptions(), ax=None) dict[source]
movie_contour(fname, contour_kw={}, subplots_kw={})[source]
plot_cls()[source]
plot_square(pump_range: Tuple[float, float], probe_range: Tuple[float, float] | None = None, symlog: bool = True, ax: matplotlib.pyplot.Axes | None = None, mode: Literal[trapz, sum, ptp, min, max] = 'trapz', **plot_kws)[source]

Plot the integrated signal of given region over the waiting time.

Parameters:
  • pump_range (Tuple[float, float]) – The range of the pump frequency in cm-1

  • probe_range (Tuple[float, float]) – The range of the probe frequency in cm-1. If not given uses the same as the pump range.

  • symlog (bool) – If True, use symlog scale for the time axis.

  • ax (plt.Axes) – The axes to plot on. If None, the current axes is used.

  • mode (str) – The mode of signal calculation. Can be either ‘trapz’ or ‘ptp’.

Returns:

l – The line objects created by the plot.

Return type:

plt.Line2D

elp(t, offset=None, p=None)[source]
psa(t: float, bg_correct: bool = True, normalize: float | Literal[max] | None = None, ax: matplotlib.pyplot.Axes | None = None, **kwargs)[source]

Plot the pump-slice amplitude spectrum for a given waiting time.

Parameters:
  • t (float) – Waiting time in ps.

  • bg_correct (bool, optional) – Whether to subtract a constant background, by default True.

  • normalize (Optional[Union[float, Literal['max']]], optional) – 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.

  • ax (Optional[matplotlib.axes.Axes], optional) – The axes to plot on. If None, the current axes is used.

diagonal(*t: float, offset: float | None = None, ax: matplotlib.pyplot.Axes | None = None) List[matplotlib.pyplot.Line2D][source]

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.

Parameters:
  • t (float) – The waiting time

  • offset (float, optional) – 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.

  • ax (matplotlib.axes.Axes, optional) – The axes to plot on. If None, the current axes is used.

Returns:

The plotted lines objects

Return type:

List[matplotlib.lines.Line2D]

anti_diagonal(*t: float, offset: float | None = None, p: float | None = None, ax: matplotlib.pyplot.Axes | None = None) List[matplotlib.pyplot.Line2D][source]

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.

Parameters:
  • t (float) – The waiting time

  • offset (float, optional) – 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.

  • p (float, optional) – The position of the anti-diagonal. If None, the position of the maximal signal is used.

  • ax (matplotlib.axes.Axes, optional) – The axes to plot on. If None, the current axes is used.

Returns:

The plotted lines objects

Return type:

List[matplotlib.lines.Line2D]

mark_minmax(t: float, which: Literal[both, min, max] = 'both', ax: matplotlib.pyplot.Axes | None = None, **kwargs)[source]

Marks the position of the minimum and maxium of a given time t.

trans(pump_wn: float | list[float], probe_wn: float | list[float], ax: matplotlib.pyplot.Axes | None = None, symlog=True, **kwargs) List[matplotlib.pyplot.Line2D][source]

Plot the 2D signal of single point over the waiting time.

Parameters:
  • pump_wn (float or list of float) – 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.

  • probe_wn (float or list of float) – 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.

  • ax (matplotlib.axes.Axes, optional) – The axes to plot on. If None, the current axes is used.

  • symlog (bool, optional) – If True, apply symlog scaling to the plot.

  • kwargs (dict) – Additional keyword arguments are passed to the plot function.

Returns:

The plotted lines objects

Return type:

List[matplotlib.lines.Line2D]