bluegreen-labs/daymetr

some data can not download

Closed this issue · 3 comments

cr_daymet<-download_daymet_batch("CR_header_site.csv",
start = 1980,
end = 2019,
internal = TRUE)

Error in curl::curl_fetch_disk(url, x$path, handle = handle) :
Could not resolve host: daymet.ornl.gov
Downloading DAYMET data for: 134 at 51.0313052819043/-117.983126697915 latitude/longitude !

As the statement says: 'could not resolve host' the server is down or unreachable from your network.

Also, it is a bad idea to start your site names with numbers, this is cause for issues during downloading and post processing.

The below example works for me.

library(daymetr)

# create demo locations
locations <- data.frame(site = c("site1", "site2"),
                        lat = rep(36.0133, 2),
                        lon = rep(-84.2625, 2))

# write csv to file
write.table(locations, paste0(tempdir(),"/locations.csv"),
            sep = ",",
            col.names = TRUE,
            row.names = FALSE,
            quote = FALSE)

# download data
test_data <- download_daymet_batch(
  file_location = paste0(tempdir(),"/locations.csv"),
  start = 1980,
  end = 1980,
  internal = TRUE,
  silent = FALSE)

I am trying to download the daymet data for 42224 sites, but it has the following message:
CR_daymet<-download_daymet_batch("CR_header_site.csv",
start = 1980,
end = 2019,
internal = TRUE)

Error : cannot allocate vector of size 125 Kb
Downloading DAYMET data for: sub_510 at 49.34868/-117.7382 latitude/longitude !

Done !

Error : cannot allocate vector of size 125 Kb
Downloading DAYMET data for: sub_511 at 49.44258/-117.7657 latitude/longitude !

I can't reproduce your problem, so this isn't an issue with the package but with how you format the data. Without a reproducible example from your side I can't do anything with the above statement.

Please provide a reproducible example.