diff --git a/R/integrate_profile.R b/R/integrate_profile.R index 621a0195e..4d2d864dd 100644 --- a/R/integrate_profile.R +++ b/R/integrate_profile.R @@ -238,10 +238,11 @@ integrate_profile.vp <- function(x, alt_min = 0, alt_max = Inf, alpha = NA, airspeed_v <- get_quantity(x, "v") - get_quantity(x, "v_wind") output$airspeed <- weighted.mean(sqrt(airspeed_u^2 + airspeed_v^2), weight_densdh, na.rm = TRUE) output$heading <- weighted.mean((pi / 2 - atan2(airspeed_v, airspeed_u)) * 180 / pi, weight_densdh, na.rm = TRUE) - output$ff_wind <- weighted.mean(sqrt(u_wind^2 + v_wind^2), weight_densdh, na.rm = TRUE) - output$dd_wind <- weighted.mean((pi / 2 - atan2(v_wind, u_wind)) * 180 / pi, weight_densdh, na.rm = TRUE) output$airspeed_u <- weighted.mean(airspeed_u, weight_densdh, na.rm = TRUE) output$airspeed_v <- weighted.mean(airspeed_u, weight_densdh, na.rm = TRUE) + output$ff_wind <- weighted.mean(sqrt(u_wind^2 + v_wind^2), weight_densdh, na.rm = TRUE) + output$u_wind <- weighted.mean(u_wind, weight_densdh, na.rm = TRUE) + output$v_wind <- weighted.mean(v_wind, weight_densdh, na.rm = TRUE) } class(output) <- c("vpi", "data.frame") @@ -372,6 +373,9 @@ integrate_profile.vpts <- function(x, alt_min = 0, alt_max = Inf, output$heading <- colSums(((pi / 2 - atan2(airspeed_v, airspeed_u)) * 180 / pi) * weight_densdh, na.rm = TRUE) output$airspeed_u <- colSums(airspeed_u * weight_densdh, na.rm = TRUE) output$airspeed_v <- colSums(airspeed_v * weight_densdh, na.rm = TRUE) + output$ff_wind <- colSums(sqrt(get_quantity(x,"u_wind")^2 + get_quantity(x,"v_wind")^2) * weight_densdh, na.rm = TRUE) + output$u_wind <- colSums(get_quantity(x,"u_wind") * weight_densdh, na.rm = TRUE) + output$v_wind <- colSums(get_quantity(x,"v_wind") * weight_densdh, na.rm = TRUE) } class(output) <- c("vpi", "data.frame")