VectorGrid#

class streamtracer.VectorGrid(vectors, grid_spacing=None, origin_coord=None, cyclic=None, *, grid_coords=None)#

Bases: object

A grid of vectors.

Parameters:
  • vectors (array) – A (nx, ny, nz, 3) shaped array. The three values at (i, j, k, :) specify the (x, y, z) components of the vector at index (i, j, k).

  • grid_spacing (array, optional) – A (3,) shaped array, that contains the grid spacings in the (x, y, z) directions. If not specified grid_coords must be specified.

  • [float (origin_coord =) – The coordinate of the vectors[0, 0, 0, :] vector at the corner of the box. Defaults to [0, 0, 0].

  • float – The coordinate of the vectors[0, 0, 0, :] vector at the corner of the box. Defaults to [0, 0, 0].

  • float] – The coordinate of the vectors[0, 0, 0, :] vector at the corner of the box. Defaults to [0, 0, 0].

  • optional – The coordinate of the vectors[0, 0, 0, :] vector at the corner of the box. Defaults to [0, 0, 0].

  • cyclic ([bool, bool, bool], optional) – Whether to have cyclic boundary conditions in each of the (x, y, z) directions. Defaults to [False, False, False].

  • grid_coords (list[array], optional) – A len(3) list storing the {x, y, z} coordinates of the grid. If not specified grid_spacing must be specified.

Notes

If any of cyclic are True, then the grid values on each side of the cyclic dimension must match, e.g. if cyclic=[False, True, False], vectors[:, 0, :, :] must equal vectors[:, -1, :, :].

Attributes Summary

cyclic

origin_coord

xcoords

Coordinates of the x grid points.

ycoords

Coordinates of the x grid points.

zcoords

Coordinates of the x grid points.

Attributes Documentation

cyclic#
origin_coord#
xcoords#

Coordinates of the x grid points.

ycoords#

Coordinates of the x grid points.

zcoords#

Coordinates of the x grid points.