From 9353b50c0b7605dc0983ca8ad7d1009f0358463b Mon Sep 17 00:00:00 2001 From: Rob Marty Date: Fri, 19 Apr 2024 10:40:45 -0400 Subject: [PATCH] docs --- man/bm_extract.Rd | 3 +++ man/bm_raster.Rd | 3 +++ readme_figures/testing.R | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/man/bm_extract.Rd b/man/bm_extract.Rd index 0ff9ab9..9d0681c 100644 --- a/man/bm_extract.Rd +++ b/man/bm_extract.Rd @@ -19,6 +19,7 @@ bm_extract( file_dir = NULL, file_prefix = NULL, file_skip_if_exists = TRUE, + h5_dir = NULL, quiet = FALSE, ... ) @@ -83,6 +84,8 @@ For \code{VNP46A3} and \code{VNP46A4} (monthly and annual data): \item{file_skip_if_exists}{(If \code{output_location_type = file}). Whether the function should first check wither the file already exists, and to skip downloading or extracting data if the data for that date if the file already exists (default: \code{TRUE}).} +\item{h5_dir}{Black Marble data are originally downloaded as \code{h5} files. If \code{h5_dir = NULL}, the function downloads to a temporary directory then deletes the directory. If \code{h5_dir} is set to a path, \code{h5} files are saved to that directory and not deleted. The function will then check if the needed \code{h5} file already exists in the directory; if it exists, the function will not re-download the \code{h5} file.} + \item{quiet}{Suppress output that show downloading progress and other messages. (Default: \code{FALSE}).} \item{...}{Additional arguments for \code{raster::approxNA}, if \code{interpol_na = TRUE}} diff --git a/man/bm_raster.Rd b/man/bm_raster.Rd index 37d665f..dc96051 100644 --- a/man/bm_raster.Rd +++ b/man/bm_raster.Rd @@ -17,6 +17,7 @@ bm_raster( file_dir = NULL, file_prefix = NULL, file_skip_if_exists = TRUE, + h5_dir = NULL, quiet = FALSE, ... ) @@ -78,6 +79,8 @@ For \code{output_location_type = file}:} \item{file_skip_if_exists}{Whether the function should first check wither the file already exists, and to skip downloading or extracting data if the data for that date if the file already exists (default: \code{TRUE}).} +\item{h5_dir}{Black Marble data are originally downloaded as \code{h5} files. If \code{h5_dir = NULL}, the function downloads to a temporary directory then deletes the directory. If \code{h5_dir} is set to a path, \code{h5} files are saved to that directory and not deleted. The function will then check if the needed \code{h5} file already exists in the directory; if it exists, the function will not re-download the \code{h5} file.} + \item{quiet}{Suppress output that show downloading progress and other messages. (Default: \code{FALSE}).} \item{...}{Additional arguments for \code{raster::approxNA}, if \code{interpol_na = TRUE}} diff --git a/readme_figures/testing.R b/readme_figures/testing.R index 01fbfeb..65c52c2 100644 --- a/readme_figures/testing.R +++ b/readme_figures/testing.R @@ -43,9 +43,18 @@ r_202110 <- bm_raster(roi_sf = roi_sf, h5_dir = "~/Desktop/h5_test", quiet = T) +r_202110 <- bm_extract(roi_sf = roi_sf, + product_id = "VNP46A3", + variable = "NearNadir_Composite_Snow_Free", + date = "2021-10-01", + bearer = bearer) + a <- terra::extract(r_202110, roi_sf, fun = sum, exact = T)$t2021_10 b <- exact_extract(r_202110, roi_sf, fun = "sum") +plot(r_202110) +plot(roi_sf,add=T) + e_202110 <- bm_raster(roi_sf = roi_sf, product_id = "VNP46A3", date = c("2021-10-01", "2021-11-01"),