Cut wind direction into 8 bins
adcp_label_direction.RdAdapted from cutVecWinddir() from OpenAir.
Value
Returns dat with an additional column
sea_water_to_direction_degree_labels, the direction labels as an
ordered factor.
Details
Likely more efficient in the original vectorized form. Modified to match
adcp_label_speed(). Could re-visit both.
If n_petals is 8: Assigns direction data in bins of 45 degrees. -22.5
to 22.5 degree is North, 22.5 to 67.5 is NE, etc.
If n_petals is 16 (the default): Assigns direction data in bins of
22.5 degrees. -11.25 to 11.25 degree is North, 11.25 to 33.75 is NNE, etc.