Skip to content

Commit

Permalink
extract fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramarty committed Mar 27, 2024
1 parent 3574568 commit 30a7090
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/blackmarbler.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
13 changes: 13 additions & 0 deletions readme_figures/readme_test.R
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 30a7090

Please sign in to comment.