From 0b294d3f879e571e07508664a9c0426e7272d705 Mon Sep 17 00:00:00 2001 From: Mike Mahoney Date: Mon, 19 Aug 2024 22:09:06 -0400 Subject: [PATCH] Document merge option --- R/download.R | 6 ++++++ R/get_stac_data.R | 5 ++++- man/get_stac_data.Rd | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/R/download.R b/R/download.R index 2b0be42..cc0f64f 100644 --- a/R/download.R +++ b/R/download.R @@ -80,6 +80,12 @@ rsi_download_rasters <- function(items, gdalwarp_options <- set_gdalwarp_extent(gdalwarp_options, aoi, NULL) } + # Which loop gets parallelized is determined based on which has more steps, + # working from the assumption that all downloads take about as long + # + # so if we aren't merging, or if there's more assets than tiles, we'll + # parallelize the outside loop that walks over assets (which, unless the user + # has set up wild nested futures, turns the inside one into a serial process) asset_iterator <- ifelse( merge || (n_tiles_out < ncol(download_locations)), function(...) future.apply::future_lapply(..., future.seed = TRUE), diff --git a/R/get_stac_data.R b/R/get_stac_data.R index 2308a67..b88003c 100644 --- a/R/get_stac_data.R +++ b/R/get_stac_data.R @@ -132,7 +132,10 @@ #' @param composite_function Character of length 1: The name of a #' function used to combine downloaded images into a single composite #' (i.e., to aggregate pixel values from multiple images into a single value). -#' Must be one of of "sum", "mean", "median", "min", "max". +#' Options include "merge", which 'stamps' images on top of one another such that +#' the "last" value downloaded for a pixel -- which isn't guaranteed to be the most +#' recent one -- will be the only value used, or any of "sum", "mean", "median", +#' "min", or "max", which consider all values available at each pixel. #' Set to `NULL` to not composite #' (i.e., to rescale and save each individual file independently). #' @inheritParams rstac::stac_search diff --git a/man/get_stac_data.Rd b/man/get_stac_data.Rd index 780984a..661483f 100644 --- a/man/get_stac_data.Rd +++ b/man/get_stac_data.Rd @@ -241,7 +241,10 @@ sequential ID will be appended instead.} \item{composite_function}{Character of length 1: The name of a function used to combine downloaded images into a single composite (i.e., to aggregate pixel values from multiple images into a single value). -Must be one of of "sum", "mean", "median", "min", "max". +Options include "merge", which 'stamps' images on top of one another such that +the "last" value downloaded for a pixel -- which isn't guaranteed to be the most +recent one -- will be the only value used, or any of "sum", "mean", "median", +"min", or "max", which consider all values available at each pixel. Set to \code{NULL} to not composite (i.e., to rescale and save each individual file independently).}