prsctrl.data.plot.plot_modulus_spectrum#

plot_modulus_spectrum(data: PrsData, min_n_wavelengths: int = 100, which_real: Literal['dI_I', 'dI-X_I', 'dI-Y_I'] = 'dI_I', save_fig: bool | str | Path = False, **plot_spectrum_kw) → tuple[Figure, ndarray[tuple[Any, ...], dtype[Axes]]] | tuple[None, None][source]#

Plot the modulus spectrum of the data and save it in the data directory (by default).

If the data has less than min_n_wavelengths, the modulus spectrum is not plotted, because the Kramers-Kronig transformation requires a certain energy range to be useful.

Parameters:
  • data – PrsData object.

  • min_n_wavelengths – Minimum number of wavelengths the data must have.

  • which_real – Which column to use as real spectrum. Can be "dI_I", "dI-X_I" or "dI-Y_I".

  • save_fig – If True, save in the data directory as <full name>_mod.pdf. If a path is given, the plot is saved at the path.

  • plot_spectrum_kw – Keyword arguments passed to plot_spectrum().

Returns:

(Figure, axes) or (None, None) if the modulus spectrum is not plotted.