yeh_tm.System.create_animated_field_map

System.create_animated_field_map(dz, dt, w, A=1, phi=0, component=0, t0=0, frames=1000, filename=None, pol=(1, 0), x=0, y=0, interval=100, repeat=False, xlabel='', ylabel='', cmap=None)

Create an animated field map for the current system settings using matplotlib’s animation module.

Supports arbitrary frequency / amplitude profiles for pulsed excitation and both 1d and 2d animations. Uses the real value of the field.

Important

To actually see the animation, store the returned animation object in a variable until the script terminates. This is an issue related to calling matplotlib.FuncAnimation from within the scope of a function.

New in version 02-05-2016.

Parameters:
  • dz (float) – Step size along the z-axis.
  • dt (float) – Temporal step size between frames (physical units). Time and space are connected via t = 2 pi / x and vice versa.
  • w (mixed) – Either single frequency value or an array of frequencies whose fields are added coherently.
  • A (mixed) – Amplitude associated with each frequency. If a single float, this amplitude is applied to all frequencies. (default = 1)
  • phi (mixed) – Relative phase associated with each frequency. If a single float, this phase is applied to all frequencies. (default = 0)
  • component (int) – Which field component to use? (0 = x -default-, 1 = y, 2 = z)
  • t0 (float) – Time of first frame. For zero phase, the (pulsed) field is usually centered around 0 at time 0. (physical units, default = 0)
  • frames (int) – Number of frames to calculate.
  • filename (str) – If a filename is given, the final animation will be saved to this file. (default = None).
  • pol (tuple) – (Complex) Ratio of x- and y-amplitudes of incident radiation, internally normalized to unit length (default = x-pol).
  • x (mixed) – Array of x-coordinates to be used for field calculations. Set to 0 or None if not used. Only x OR y may be an array.
  • y (mixed) – Array of y-coordinates to be used for field calculations. Set to 0 or None if not used. Only x OR y may be an array.
  • interval (int) – Waiting time between each frame in ms. (default = 100).
  • repeat (bool) – Should the animation be repeated? (default = False).
  • xlabel (str) – X-Label (default = ‘’).
  • ylabel (str) – Y-Label (default = ‘’).
  • cmap (colormap) – Matplotlib colormap to be used for 2d plotting or format string for 1d plotting; None defaults to ‘r-‘. (default = None).
Returns:

Animation object. You have to assign this object to some variable to prevent it from being garbage collected by the python interpreter.