pept.processing.VectorGrid2D#
- class pept.processing.VectorGrid2D(xpixels: Pixels, ypixels: Pixels)[source]#
Bases:
object
Object produced by
VectorField2D
storing 2 grids of voxels xpixels, ypixels, for example velocity vector fields / quiver plots.Examples
Compute a velocity vector field in the Y and Z dimensions (velocities were first calculated using
pept.tracking.Velocity
):>>> from pept.processing import * >>> trajectories = pept.PointData(...) >>> field = VectorField2D(0.6, ["vy", "vz"], "yz").fit(trajectories) >>> field VectorGrid2D(xpixels, ypixels)
Create a quiver plot using Plotly (may be a bit slow):
>>> scaling = 16 >>> fig = field.quiver(scaling) >>> fig.show()
Create a 2D vector field (needs PyVista):
>>> scaling = 16 >>> fig = field.vectors(scaling) >>> fig.plot(cmap = "magma")
Methods
__init__
(xpixels, ypixels)quiver
([factor])vectors
([factor])