3.7. fmas.tools

This module implements functions for postprocessing of simulation data.

change_reference_frame

Change reference frame.

spectrogram

Compute spectrogram for time-domain input signal.

plot_spectrogram

Generate a figure of a spectrogram.

plot_evolution

Generate a figure of a pulse propagation scenario.

plot_details_prop_const

Generate a figure of the group-velocity and group-velocity dispersion.

fmas.tools.change_reference_frame(w, z, uwz, v0)

Change reference frame.

Shift to moving frame of reference in which the dynamics is slow.

Parameters
  • w (numpy.ndarray) – Angular-frequency grid.

  • z (numpy.ndarray) – \(z\)-grid.

  • uwz (numpy.ndarray, 2-dim) – Frequency domain representation of analytic signal.

  • v0 (float) – Reference velocity.

fmas.tools.plot_claw(z, t, u, Cp, t_lim=None, w_lim=None, DO_T_LOG=False, ratio_Iw=1e-06)

Generate a figure showing the conservation law.

Generates a plot showing the z-propagation characteristics of the squared magnitude field envelope (left subfigure) and the spectral intensity (right subfigure).

Parameters
  • z (numpy.ndarray) – \(z\)-grid.

  • t (numpy.ndarray) – Temporal grid.

  • u (numpy.ndarray) – Time-domain representation of analytic signal.

  • Cp (numpy.ndarray) – Classical analog of photon number.

  • t_lim (list, 2-tuple) – Time range in the form (t_min, t_max) (default=None).

  • w_lim (list, 2-tuple) – Angular frequency range in the form (w_min,w_max) (default=None).

  • DO_T_LOG (bool) – Flag indicating whether time-domain propagation characteristics will be shown on log-scale (default=True).

fmas.tools.plot_details_prop_const(w, vg, beta2)

Generate a figure of the group-velocity and group-velocity dispersion.

Generates a plot showing the grop-velocity (top subplot) and group-velocity dispersion (bottom subplot).

Parameters
  • w (numpy.ndarray) – Angular frequency grid.

  • vg (numpy.ndarray) – Group-velocity profile.

  • beta2 (numpy.ndarray) – Group-velocity dispersion profile.

fmas.tools.plot_evolution(z, t, u, t_lim=None, w_lim=None, DO_T_LOG=False, ratio_Iw=1e-06)

Generate a figure of a pulse propagation scenario.

Generates a plot showing the z-propagation characteristics of the squared magnitude field envelope (left subfigure) and the spectral intensity (right subfigure).

Parameters
  • z (numpy.ndarray) – \(z\)-grid.

  • t (numpy.ndarray) – Temporal grid.

  • u (numpy.ndarray) – Time-domain representation of analytil signal.

  • t_lim (list, 2-tuple) – Time range in the form (t_min, t_max) (default=None).

  • w_lim (list, 2-tuple) – Angular frequency range in the form (w_min,w_max) (default=None).

  • DO_T_LOG (bool) – Flag indicating whether time-domain propagation characteristics will be shown on log-scale (default=True).

fmas.tools.plot_spectrogram(t_delay, w_opt, P_tw)

Generate a figure of a spectrogram.

Generate figure showing the intensity normalized spectrogram. Scales the spectrogram data so that maximum intensity per time and frequency is unity.

Parameters
  • t_delay (numpy.ndarray, 1-dim) – Delay time grid.

  • w_opt (numpy.ndarray, 1-dim) – Angular-frequency grid.

  • P_tw (numpy.ndarray, 2-dim) – Spectrogram data.

fmas.tools.spectrogram(t, w, ut, t_lim=None, Nt=1000, Nw=256, s0=20.0)

Compute spectrogram for time-domain input signal.

Computes spectrogram of a time-domain input signal via short time Fourier transform employing a Gaussian window function.

Parameters
  • t (numpy.array, 1-dim) – Temporal grid.

  • w (numpy.array, 1-dim) – Angular-frequency grid.

  • Et (numpy-array, 1-dim) – Time-domain representation of analytic signal.

  • t_lim (list) – Delay time bounds for temporal axis considered for constructing the spectrogram (tMin, tMax), default is (min(t),max(t)).

  • Nt (int) – Number of delay times samples in [tMin, tMax], used for signal localization (default: Nt=1000).

  • Nw (int) – Number of samples in angular-frequency domain kept as output (default: Nw=256).

  • s0 (float) – Root-mean-square width of Gaussian function used for signal localization (default: s0=20.0).

Returns

(t_spec, w_spec, P_tw), where t_seq (numpy.ndarray, 1-dim) are delay times, w (numpy.ndarray, 1-dim) are angular frequencies, and P_tw (numpy.ndarray, 2-dim) is the spectrogram.

Return type

list