Skip to content

Commit 72be6d1

Browse files
committed
change definition of height-integrated ground speed ff (issue #233)
1 parent 5e56980 commit 72be6d1

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

R/integrate_profile.R

+11-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#' \item{\code{vir}}{Vertically Integrated Reflectivity in cm^2/km^2}
3030
#' \item{\code{mtr}}{Migration Traffic Rate in individuals/km/h}
3131
#' \item{\code{rtr}}{Reflectivity Traffic Rate in cm^2/km/h}
32-
#' \item{\code{mt}}{Migration Traffic in individuals/km, cumulated from
32+
#' \item{\code{mt}}{Migration Traffic in individuals/km, cumulated from
3333
#' the start of the time series up to \code{datetime}}
3434
#' \item{\code{rt}}{Reflectivity Traffic in cm^2/km, cumulated from
3535
#' the start of the time series up to \code{datetime}}
@@ -110,10 +110,10 @@
110110
#' @examples
111111
#' # MTR for a single vertical profile
112112
#' integrate_profile(example_vp)
113-
#'
113+
#'
114114
#' # MTRs for a list of vertical profiles
115115
#' integrate_profile(c(example_vp, example_vp))
116-
#'
116+
#'
117117
#' # MTRs for a time series of vertical profiles
118118
#' # load example data:
119119
#' data(example_vpts)
@@ -172,7 +172,9 @@ integrate_profile.vp <- function(x, alt_min = 0, alt_max = Inf, alpha = NA,
172172
v <- sum(get_quantity(x, "v")[index] * get_quantity(x, "dens")[index],
173173
na.rm = TRUE
174174
) / sum(get_quantity(x, "dens")[index], na.rm = TRUE)
175-
ff <- sqrt(u^2 + v^2)
175+
ff <- sum(get_quantity(x, "ff")[index] * get_quantity(x, "dens")[index],
176+
na.rm = TRUE
177+
) / sum(get_quantity(x, "dens")[index], na.rm = TRUE)
176178
dd <- (pi / 2 - atan2(v, u)) * 180 / pi
177179
# time-integrated measures not defined for a single profile:
178180
mt <- NA
@@ -267,7 +269,11 @@ integrate_profile.vpts <- function(x, alt_min = 0, alt_max = Inf,
267269
) / colSums(get_quantity(x, "dens")[index, ],
268270
na.rm = TRUE
269271
)
270-
ff <- sqrt(u^2 + v^2)
272+
ff <- colSums(get_quantity(x, "ff")[index, ] * get_quantity(x, "dens")[index, ],
273+
na.rm = TRUE
274+
) / colSums(get_quantity(x, "dens")[index, ],
275+
na.rm = TRUE
276+
)
271277
dd <- (pi / 2 - atan2(v, u)) * 180 / pi
272278
# time-integrated measures:
273279
dt <- (c(0, x$timesteps) + c(x$timesteps, 0)) / 2

man/bioRad-package.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/integrate_profile.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)