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:
rotates vectors with negative v by 180 degrees
then doubles those angles to make a complete circle again
computes a mean direction from this, and halves that angle again.
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.