postgkyl.diagnostics.mom.rotations.perprotate

postgkyl.diagnostics.mom.rotations.perprotate(array, rotator, *, coords='0:3', inplace=False, tag=None, label=None)

Component of array perpendicular to rotator: u - (u . v_hat) v_hat.

Both fields are assumed to be three-component with components on the last axis.

Parameters:
  • array – The three-component vector field to be rotated/projected; must be NumPy-backed.

  • rotator – The field defining the rotation direction; must be NumPy-backed.

  • coords – Half-open ‘lo:hi’ slice string selecting which rotator components form the direction vector. Defaults to ‘0:3’; use ‘3:6’ to rotate along the magnetic field of a six-component EM field.

  • inplace – mutate and return array instead of a new dataset.

  • tag – optional tag for the returned dataset.

  • label – optional label for the returned dataset.

Returns:

A three-component dataset of the perpendicular component.

Raises:

ValueError – if either input is modal DG coefficients, or the component counts do not match a three-component field.

CLI: mom_rotations_perprotate