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:
objectClass 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 plottedtheta_min (
float, optional) – lower limit for tangential plot rangeDefault:0theta_max (
float, optional) – upper limit for tangential plot rangeDefault:3.141592653589793resolution (
Union[int,tuple[int,int]], optional) – if tuple (radial resolution, tangential resolution)Default:100cmap (
str, optional) – color mapDefault:'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 animationDefault:64interval (
float, optional) – interval between frames in msDefault:100.0mode (
Optional[int], optional) – mode of oscillationDefault:Nonedisplacement (
bool, optional) – ifTruedisplacement, else velocity plotDefault:Truesymmetric (
bool, optional) – ifTruethe symmetry of the solution is usedDefault:Truetripcolor (
bool, optional) – switches between tripcolor and tricontourf plotDefault:Falseax (
Optional[Axes], optional) – Axes objectDefault:Nonekwargs – passed through to tricontourf()
- Return type:
- 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) – ifTrueinstantaneous amplitude is plottedDefault:Truephase (
float, optional) – phase [0, 2 * pi]Default:0mode (
Optional[int], optional) – mode of oscillationDefault:Nonedisplacement (
bool, optional) – ifTruedisplacement, else velocity plotDefault:Truesymmetric (
bool, optional) – ifTruethe symmetry of the solution is usedDefault:Truetripcolor (
bool, optional) – switches between tripcolor and tricontourf plotDefault:Falseax (
Optional[Axes], optional) – Axes objectDefault:Nonekwargs – passed through to tricontourf()
- Return type:
- 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\piand 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 thelayouttuple.- Parameters:
inst (
bool, optional) – ifTrueinstantaneous amplitude is plottedDefault:Truemode (
Optional[int], optional) – mode of oscillationDefault:Nonedisplacement (
bool, optional) – ifTruedisplacement, else velocity plotDefault:Falsesymmetric (
bool, optional) – ifTruethe symmetry of the solution is used