res_wind_speed: Resultant wind speed and direction

View source: R/derived_values.R

res_wind_speedR Documentation

Resultant wind speed and direction

Description

Calculate the resultant wind speed and direction from a collection of wind speeds and directions.

Usage

res_wind_speed(speed, dir, na.rm = TRUE)

res_wind_dir(speed, dir, na.rm = TRUE)

Arguments

speed

Wind speeds.

dir

Wind directions in degrees clockwise from north.

na.rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

Details

Resultant wind speeds are vector-averaged. We first find the average values of the east-west and north-south components,

Ve = -sum(u_i * sin(theta_i)) / N

Vn = -sum(u_i * cos(theta_i)) / N

where u is the speed and theta is the direction. The resultant speed and direction can then be calculated with

U_R = sqrt(Ve^2 + Vn^2)

theta_R = arctan(Ve/Vn) + 180

Value

res_wind_speed returns the resultant wind speed. res_wind_dir returns the resultant wind direction.

References

\insertRef

us_environmental_protection_agency_meteorological_2000atmoschem.process

Examples

# opposite winds cancel out
res_wind_speed(1, c(0, 180))

# A scalar average would return 180 in this case. Resultant wind direction
# produces the correct value.
res_wind_dir(1, c(355, 5))


ASRCsoft/atmoschem.datasets documentation built on Feb. 15, 2023, 9:26 a.m.