ParticleScatteringPlot

Examples using this class are:

class osaft.plotting.scattering.particle_plots.ParticleScatteringPlot(sol, theta_min=0, theta_max=3.141592653589793, resolution=100, cmap='winter')[source]

Bases: object

Class for plotting scattering field of the particle

Plots the acoustic field inside the particle using Matplotlib tricontourf or tripcolor plotting methods.

Parameters:
  • sol (BaseScattering) – solution to be plotted

  • theta_min (float, optional) – lower limit for tangential plot range

    Default: 0

  • theta_max (float, optional) – upper limit for tangential plot range

    Default: 3.141592653589793

  • resolution (Union[int, tuple[int, int]], optional) – if tuple (radial resolution, tangential resolution)

    Default: 100

  • cmap (str, optional) – color map

    Default: 'winter'

Public Methods:

plot([inst, phase, mode, displacement, ...])

Tricontourf plot for acoustic velocity field of the particle

animate([frames, interval, mode, ...])

Tricontourf animation for acoustic velocity field of the particle

plot_evolution([inst, mode, displacement, ...])

Tricontourf plot for acoustic velocity field evolution of the particle


animate(frames=64, interval=100.0, mode=None, displacement=True, symmetric=True, tripcolor=False, ax=None, **kwargs)[source]

Tricontourf animation for acoustic velocity field of the particle

Animates the velocity amplitude of the first-order acoustic velocity field of the particle over one period using Matplotlib’s tricontourf or tripcolor if ˜tripcolor = True`

Parameters:
  • frames (int, optional) – number of frames for the animation

    Default: 64

  • interval (float, optional) – interval between frames in ms

    Default: 100.0

  • mode (Optional[int], optional) – mode of oscillation

    Default: None

  • displacement (bool, optional) – if True displacement, else velocity plot

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (Optional[Axes], optional) – Axes object

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

FuncAnimation

plot(inst=True, phase=0, mode=None, displacement=True, symmetric=True, tripcolor=False, ax=None, **kwargs)[source]

Tricontourf plot for acoustic velocity field of the particle

Plots the velocity amplitude of the first-order acoustic velocity field of the particle using Matplotlib’s tricontourf or tripcolor if ˜tripcolor = True`

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • phase (float, optional) – phase [0, 2 * pi]

    Default: 0

  • mode (Optional[int], optional) – mode of oscillation

    Default: None

  • displacement (bool, optional) – if True displacement, else velocity plot

    Default: True

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • ax (Optional[Axes], optional) – Axes object

    Default: None

  • kwargs – passed through to tricontourf()

Return type:

tuple[Figure, Axes]

plot_evolution(inst=True, mode=None, displacement=False, symmetric=True, tripcolor=False, layout=(3, 3), **kwargs)[source]

Tricontourf plot for acoustic velocity field evolution of the particle

Plots the velocity amplitude of the first-order acoustic velocity field of the fluid over one period at different phases using Matplotlib’s tricontourf or tripcolor if tripcolor = True.

The first phase value is always :math:0\pi and the last one :math:2\pi. The total number of plots and, hence, also the steps between the different phase values is the defined by the product of the layout tuple.

Parameters:
  • inst (bool, optional) – if True instantaneous amplitude is plotted

    Default: True

  • mode (Optional[int], optional) – mode of oscillation

    Default: None

  • displacement (bool, optional) – if True displacement, else velocity plot

    Default: False

  • symmetric (bool, optional) – if True the symmetry of the solution is used

    Default: True

  • tripcolor (bool, optional) – switches between tripcolor and tricontourf plot

    Default: False

  • layout (tuple[int, int], optional) – number of rows and columns for plotting

    Default: (3, 3)

  • kwargs – passed through to the parent subplots command

Return type:

tuple[Figure, Axes]