iiasa / RE4AFAGRI_platform

Official repository of the RE4AFAGRI modelling platform, H2020 LEAP-RE
https://www.re4afagri.africa
5 stars 1 forks source link

error_message M-LED process_clusters.R #23

Open beniaminogallizia opened 1 day ago

beniaminogallizia commented 1 day ago

Hi, I'm working on a new country, Mozambique. I'm aving this error message while running process_cluster.R. In particular the run stopped at line 79. I already checked the version for R and Rstudio.

Error in (function (cond) : error in evaluating the argument 'x' in selecting a method for function 'raster': subscript out of bounds

cluster

This is the clusters' matrix.

Do you have any suggestions?

Thank you in advance.

Beniamino

giacfalk commented 12 hours ago

Dear @beniaminogallizia, great that you are looking into an implementation of M-LED for Mozambique.

The reason is most likely that you did no download the nighttime light dataset that is being read in line 79.

The data file in question is referred to here: https://github.com/iiasa/RE4AFAGRI_platform/wiki/Examples-and-exercises#preparing-the-population-clusters-also-relevant-for-onsset and can be downloaded from here: https://eogdata.mines.edu/nighttime_light/annual/v21/2021/VNL_v21_npp_2021_global_vcmslcfg_c202205302300.median_masked.dat.tif.gz.

Could you confirm if you downloaded it and unzipped it?

beniaminogallizia commented 9 hours ago

It works! I was using the nighttime light file specific for Mozambique that i used for OnSSET, apparently it was not suitable.

Thank you again!

giacfalk commented 8 hours ago

Great! Please keep us posted on your model development outcomes, if you wish :)