dolfyn.calc_principal_heading

dolfyn.calc_principal_heading(vel, tidal_mode=True)[source]

Compute the principal angle of the horizontal velocity.

Parameters
velnp.ndarray (2,…,Nt), or (3,…,Nt)

The 2D or 3D velocity array (3rd-dim is ignored in this calculation)

tidal_modebool (default: True)
Returns
p_headingfloat or ndarray

The principal heading(s) in degrees clockwise from North.

Notes

The tidal mode follows these steps:
  1. rotates vectors with negative v by 180 degrees

  2. then doubles those angles to make a complete circle again

  3. computes a mean direction from this, and halves that angle again.

  4. The returned angle is forced to be between 0 and 180. So, you may need to add 180 to this if you want your positive direction to be in the western-half of the plane.

Otherwise, this function simply compute the average direction using a vector method.