magpack.rotations.rotate_scalar_field#

rotate_scalar_field(field, rot_matrix, order=1)#

Rotates a scalar field according to the provided rotation matrix.

Parameters:
fieldnp.ndarray

Scalar field to be rotated, shape (x, y, z).

rot_matrixnp.ndarray

Rotation matrix, shape (3, 3).

orderint

Interpolation order (0 to 5, default is 1).

Returns:
np.ndarray

Rotated scalar field, shape (x, y, z).