postgkyl.diagnostics.mom.rotations.parrotate

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

Component of array parallel to rotator: (u . v_hat) v_hat.

Projects the three-component vector field array (u) onto the unit vector of the rotator field (v), returning the parallel vector (u . v_hat) v_hat with its x, y, z components. 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 parallel projection.

Raises:

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

CLI: mom_rotations_parrotate