rsh249 / cRacle

Finally an R package dedicated to the CRACLE method for estimating climate from biological proxies.
MIT License
2 stars 1 forks source link

Error in writing to raster in getextr? #6

Open TheTams opened 2 years ago

TheTams commented 2 years ago

I am having the following error when using getextr in a remote session. This error did not happen using a small test data set in which the character vector of species names is testvec <- c("Betula glandulosa", "Papaver radicatum", "Salix arctica") and 10 minute resolution for bioclim from worldclim was used

It happened in the first species when I use worldclim 30s data.

> vec1_data <- getextr(sp_vec_1, climrast, maxrec = 999999999, schema = "flat", repo = c("gbif"), rm.outlier = TRUE, alpha = 0.01, nmin = 15)
[1] "Pinus balfouriana"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  405  records in this query from  gbif  for  Pinus balfouriana"
Aggregate Raster for flat or species filtering
Error in file(rastergrd, "w") : cannot open the connection
Calls: getextr ... .stopRasterWriting -> hdr -> .writeHdrRaster -> file
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted

If I use 2.5 min data, it failed on the 7th taxa.

vec1_data <- getextr(sp_vec_1, climrast, maxrec = 999999999, schema = "flat", repo = c("gbif"), nmin = 15)
[1] "Pinus aristata"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  517  records in this query from  gbif  for  Pinus aristata"
Aggregate Raster for flat or species filtering
Begin flat aggregate sampling... 1 
Taxon list of lenth: 1 
[1] "Pinus balfouriana"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  405  records in this query from  gbif  for  Pinus balfouriana"
Aggregate Raster for flat or species filtering
Begin flat aggregate sampling... 1 
Taxon list of lenth: 1 
[1] "Pinus longaeva"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  1233  records in this query from  gbif  for  Pinus longaeva"
Aggregate Raster for flat or species filtering
Begin flat aggregate sampling... 1 
Taxon list of lenth: 1 
[1] "Pinus pinceana"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  449  records in this query from  gbif  for  Pinus pinceana"
Aggregate Raster for flat or species filtering
Begin flat aggregate sampling... 1 
Taxon list of lenth: 1 
[1] "Pinus cembroides"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  2210  records in this query from  gbif  for  Pinus cembroides"
Aggregate Raster for flat or species filtering
Begin flat aggregate sampling... 1 
Taxon list of lenth: 1 
[1] "Pinus culminicola"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  278  records in this query from  gbif  for  Pinus culminicola"
Aggregate Raster for flat or species filtering
Begin flat aggregate sampling... 1 
Taxon list of lenth: 1 
[1] "Pinus edulis"
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
New names:
* NA -> ...1
* NA -> ...2
* NA -> ...3
* NA -> ...4
[1] "There are  3123  records in this query from  gbif  for  Pinus edulis"
Aggregate Raster for flat or species filtering
Error in file(rastergrd, "w") : cannot open the connection
Calls: getextr ... .stopRasterWriting -> hdr -> .writeHdrRaster -> file
In addition: There were 50 or more warnings (use warnings() to see the first 50)
Execution halted
TheTams commented 2 years ago

Trying with 10m on my full size job ended with a different and interesting error

...
[1] "Picea abchasius"
New names:
* NA -> ...1
* NA -> ...2
Error in `$<-.data.frame`(`*tmp*`, "lat", value = numeric(0)) : 
  replacement has 0 rows, data has 5
Calls: getextr -> subfun -> <Anonymous> -> $<- -> $<-.data.frame
Execution halted