postgkyl.diagnostics.mom.rotations.parrotate¶
- postgkyl.diagnostics.mom.rotations.parrotate(array, rotator, *, coords='0:3', inplace=False, tag=None, label=None)¶
Component of
arrayparallel torotator:(u . v_hat) v_hat.Projects the three-component vector field
array(u) onto the unit vector of therotatorfield (v), returning the parallel vector(u . v_hat) v_hatwith 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
rotatorcomponents 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
arrayinstead 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.