Skip to content

Commit

Permalink
updates on tracelines and capzone examples
Browse files Browse the repository at this point in the history
  • Loading branch information
cneyens committed Jul 30, 2024
1 parent aad6055 commit 6052ccd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 29 deletions.
2 changes: 1 addition & 1 deletion R/plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ plot.aem <- function(x, y = NULL, add = FALSE, xlim, ylim, ...) {
#' @rdname tracelines
#' @include tracelines.R
#' @examples
#'
#' # -------
#' # plot arrows
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange', arrows = TRUE, length = 0.05)
Expand Down
16 changes: 2 additions & 14 deletions R/tracelines.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ outside_vertical <- function(aem, x, y, z, ...) {
#' @export
#' @seealso [capzone()]
#' @examples
#' # -------
#' # create a model with uniform background flow
#' k <- 10
#' top <- 10; base <- 0
Expand Down Expand Up @@ -270,18 +269,6 @@ outside_vertical <- function(aem, x, y, z, ...) {
#' mp <- aem(k, top, base, n = n, uf, rf)
#' pathsp <- tracelines(mp, x0 = x0, y0 = y0, z = top, times = times, ncores = 2)
#'
#' # -------
#' # plot arrows
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange', arrows = TRUE, length = 0.05)
#'
#' # plot point markers every 2.5 years
#' contours(m, xg, yg, col = 'dodgerblue', nlevels = 20)
#' plot(paths, add = TRUE, col = 'orange', marker = 2.5 * 365, pch = 20)
#'
#' # plot point markers every 600 days
#' plot(paths, add = TRUE, col = 'forestgreen', marker = 600, pch = 1)
#'
tracelines <- function(aem, x0, y0, z0, times, forward = TRUE, R = 1, tfunc = NULL, tol = 1e-3, ncores = 0, ...) {

if(!is.null(tfunc) & !is.list(tfunc)) tfunc <- list(tfunc)
Expand Down Expand Up @@ -441,6 +428,8 @@ endpoints <- function(tracelines, ...) {
#' m <- aem(k, top, base, n = n, uf, rf, w1, w2, as)
#'
#' # 5-year capture zone at two different starting levels
#' # here, the number of particles are set to small values to speed up the examples
#' # increase the number of particles to obtain a sharper delineation of the envelope
#' cp5a <- capzone(m, w1, time = 5 * 365, zstart = base, npar = 6, dt = 365 / 4)
#' cp5b <- capzone(m, w1, time = 5 * 365, zstart = 8, npar = 6, dt = 365 / 4)
#'
Expand All @@ -451,7 +440,6 @@ endpoints <- function(tracelines, ...) {
#' plot(cp5b, add = TRUE, col = 'forestgreen') # smaller zone
#'
#' # plot the convex hull of the endpoints as a polygon
#' # increase the number of particles to obtain a sharper delineation of the envelope
#' endp <- endpoints(cp5b)
#' hull <- chull(endp[, c('x', 'y')])
#' polygon(endp[hull, c('x', 'y')], col = adjustcolor('forestgreen', alpha.f = 0.7))
Expand Down
3 changes: 2 additions & 1 deletion man/capzone.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions man/tracelines.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6052ccd

Please sign in to comment.