diff --git a/R/blackmarbler.R b/R/blackmarbler.R index 70ba051..4f6d29c 100644 --- a/R/blackmarbler.R +++ b/R/blackmarbler.R @@ -734,11 +734,11 @@ bm_extract <- function(roi_sf, if(add_n_pixels){ - r_n_obs <- exact_extract(r_out, roi_sf, function(values, coverage_fraction) + r_n_obs <- exact_extract(r, roi_sf, function(values, coverage_fraction) sum(!is.na(values)), progress = !quiet) - r_n_obs_poss <- exact_extract(r_out, roi_sf, function(values, coverage_fraction) + r_n_obs_poss <- exact_extract(r, roi_sf, function(values, coverage_fraction) length(values), progress = !quiet) diff --git a/readme_figures/readme_test.R b/readme_figures/readme_test.R index 30f2caa..3e19d7d 100644 --- a/readme_figures/readme_test.R +++ b/readme_figures/readme_test.R @@ -30,9 +30,22 @@ bearer <- read.csv("~/Desktop/bearer_bm.csv")$token # getData function to load a polygon of Ghana #roi_sf <- gadm(country = "GHA", level=1, path = tempdir()) |> st_as_sf() +# Test ------------------------------------------------------------------------- + ######### roi_sf <- gadm(country = "CHE", level=1, path = tempdir()) |> st_as_sf() + +r_201804 <- bm_raster(roi_sf = roi_sf, + product_id = "VNP46A3", + date = "2018-04", # The day is ignored + variable = "AllAngle_Composite_Snow_Free", + quality_flag_rm = c(1, 2), + bearer = bearer) + + + + ######## r <- bm_raster(roi_sf = roi_sf, product_id = "VNP46A3",