magpack.vectorop.normalize#

normalize(vector_field)#

Scales all vectors in the array to unit length.

Parameters:
vector_fieldnp.ndarray

Vector field shape (3, nx, ny, nz)

Returns:
np.ndarray

Unit-normalized vector field.