dime-worldbank / big-data-poverty-estimation

Develop machine learning models for poverty estimation
25 stars 7 forks source link

Error in "01_download_black_marble_annual" Script #38

Open GIS243 opened 5 months ago

GIS243 commented 5 months ago

Hi

I encountered an error while processing the "01_download_black_marble_annual" file. The script halted with the message:

Error in bm_mk_raster(loc_sf = survey_buff_sf, product_id = "VNP46A3", : could not find function "bm_mk_raster"

> months <- seq(from = ymd("2012-01-01"), to = ymd("2021-12-01"), by=1) %>%
+   substring(1, 7) %>%
+   unique()
> 
> for(year_month_i in months){
+   
+   OUT_FILE <- file.path(ntl_bm_dir, "FinalData", "monthly_rasters", 
+                         paste0("bm_vnp46A3_",
+                                year_month_i %>% str_replace_all("-", "_"),
+                                ".tif"))
+   
+   if(!file.exists(OUT_FILE)){
+     print(year_month_i)
+     
+     r <- bm_mk_raster(loc_sf = survey_buff_sf,
+                       product_id = "VNP46A3",
+                       time = year_month_i,
+                       bearer = BEARER,
+                       mask = F)
+     
+     writeRaster(r, OUT_FILE)
+   }
+ }

[1] "2012-01"