CartesianGrid¶
-
class
hcipy.field.
CartesianGrid
(coords, weights=None)¶ Bases:
hcipy.field.grid.Grid
A grid representing a N-dimensional Cartesian coordinate system.
Attributes Summary
The w-coordinate (dimension 3).
The x-coordinate (dimension 0).
The y-coordinate (dimension 1).
The z-coordinate (dimension 2).
Methods Summary
rotate
(self, angle[, axis])Rotate the grid in-place.
rotated
(self, angle[, axis])A rotated copy of this grid.
scale
(self, scale)Scale the grid in-place.
shift
(self, shift)Shift the grid in-place.
Attributes Documentation
-
w
¶ The w-coordinate (dimension 3).
-
x
¶ The x-coordinate (dimension 0).
-
y
¶ The y-coordinate (dimension 1).
-
z
¶ The z-coordinate (dimension 2).
Methods Documentation
-
rotate
(self, angle, axis=None)¶ Rotate the grid in-place.
Caution
All structure in the coordinates will be destroyed.
- Parameters
- anglescalar
The angle in radians.
- axisndarray or None
The axis of rotation. For two-dimensional grids, it is ignored. For three-dimensional grids it is required.
- Returns
- Grid
Itself to allow for chaining these transformations.
-
rotated
(self, angle, axis=None)¶ A rotated copy of this grid.
- Parameters
- anglescalar
The angle in radians.
- axisndarray or None
The axis of rotation. For two-dimensional grids, it is ignored. For three-dimensional grids it is required.
- Returns
- Grid
The rotated grid.
-
scale
(self, scale)¶ Scale the grid in-place.
- Parameters
- scalearray_like or scalar
The factor with which to scale the grid.
- Returns
- Grid
Itself to allow for chaining these transformations.
-
shift
(self, shift)¶ Shift the grid in-place.
- Parameters
- shiftarray_like
The amount with which to shift the grid.
- Returns
- Grid
Itself to allow for chaining these transformations.
-