environmentalinformatics-marburg / gimms

Download and process GIMMS3g NDVI binary data
Other
17 stars 7 forks source link

updateNasanex doesn't return complete paths for downloading #3

Closed ha0ye closed 4 years ago

ha0ye commented 4 years ago

Since the security certificate for NASA ecocast expired on 2020-03-15, gimms uses the fallback nasanex AWS server.

The updateNasanex() function seems to return the directory contents ok, but it doesn't have the server name prefixed:

> fls <- updateNasanex()
> head(fls)
[1] "AVHRR/GIMMS/3G/1980s/geo81aug15a.n07-VI3g" "AVHRR/GIMMS/3G/1980s/geo81aug15b.n07-VI3g"
[3] "AVHRR/GIMMS/3G/1980s/geo81dec15a.n07-VI3g" "AVHRR/GIMMS/3G/1980s/geo81dec15b.n07-VI3g"
[5] "AVHRR/GIMMS/3G/1980s/geo81jul15a.n07-VI3g" "AVHRR/GIMMS/3G/1980s/geo81jul15b.n07-VI3g"

which is an issue, since downloadGimms tries to use the paths as given for downloading.

A simple fix is to replace the return from updateNasanex() (line 113 of updateInventory.R) with:

    return(paste0(con, "/", cnt))
fdetsch commented 4 years ago

Thanks. The develop version of updateInventory() is now able to cope with the expired certificate using curl functionality. As a consequence, online file retrieval from ECOCAST is re-enabled.

I also implemented your PR. gimms:::updateNasanex() now returns the correct online file path, which comes in handy if ECOCAST cannot be reached.

Once r-winbuilder checks are satisfied, I'll push these changes to CRAN.

fdetsch commented 4 years ago

gimms-1.1.3 is on its way to CRAN.