mikejohnson51 / climateR

An R 📦 for getting point and gridded climate data by AOI
https://mikejohnson51.github.io/climateR/
MIT License
181 stars 40 forks source link

ClimateR freezes #96

Open Rapsodia86 opened 8 months ago

Rapsodia86 commented 8 months ago

Hi @mikejohnson51, I wanted to answer #94 but looks like I am not able to get the data downloaded. It just runs and never finishes. I tried on #93 and #94 examples, but no success.

system.time({
  cdat = terra::ext(c(-98.90219, -65.21105, 28.12502, 50.43962)) |>
    vect(crs = '+proj=longlat +ellps=WGS84 +no_defs') |>
    getTerraClimNormals(
      varname = "tmin",
      scenario = "19812010",
      month = 5:9)
})

Here is the session info:

sessionInfo()
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] terra_1.7-74   climateR_0.3.4

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.12         pillar_1.9.0        compiler_4.2.2     
 [4] viridis_0.6.5       tools_4.2.2         digest_0.6.35      
 [7] bit_4.0.5           lifecycle_1.0.4     tibble_3.2.1       
[10] gtable_0.3.4        viridisLite_0.4.2   RNetCDF_2.9-1      
[13] pkgconfig_2.0.3     rlang_1.1.3         cli_3.6.2          
[16] rstudioapi_0.15.0   parallel_4.2.2      ncmeta_0.3.6       
[19] gridExtra_2.3       dplyr_1.1.4         globals_0.16.3     
[22] generics_0.1.3      vctrs_0.6.5         hms_1.1.3          
[25] bit64_4.0.5         grid_4.2.2          tidyselect_1.2.1   
[28] glue_1.7.0          listenv_0.9.1       R6_2.5.1           
[31] gifski_1.12.0-2     parallelly_1.37.1   future.apply_1.11.1
[34] fansi_1.0.6         ggplot2_3.4.4       readr_2.1.5        
[37] tzdb_0.4.0          purrr_1.0.2         magrittr_2.0.3     
[40] scales_1.3.0        codetools_0.2-18    assertthat_0.2.1   
[43] future_1.33.1       colorspace_2.1-0    arrow_15.0.1       
[46] utf8_1.2.4          munsell_0.5.0  

Maybe I need some updates? Thanks!

Originally posted by @Rapsodia86 in https://github.com/mikejohnson51/climateR/issues/94#issuecomment-2004584463

acrunyon commented 4 months ago

I'm having this same problem. getMACA() worked yesterday, but when I try it today, even just downloading one day for one point, it hangs. I also updated both ClimateR and AOI (and associated packages), but issue persists. Could it be a problem with the MACA THREDDS server?

    future1 = getMACA(AOI, 
                      model = gcms[1], varname = vars[1], scenario  = "rcp45",
                      startDate = "2023-01-01", endDate = "2023-01-02")
acrunyon commented 4 months ago

I'm having this same problem. getMACA() worked yesterday, but when I try it today, even just downloading one day for one point, it hangs. I also updated both ClimateR and AOI (and associated packages), but issue persists. Could it be a problem with the MACA THREDDS server?

    future1 = getMACA(AOI, 
                      model = gcms[1], varname = vars[1], scenario  = "rcp45",
                      startDate = "2023-01-01", endDate = "2023-01-02")

Update:: I believe the freezing is due to a firewall or security setting on my government computer because the function works fine on a personal comp. Not surprise that a bulk download would be blocked...

amrcode1 commented 1 month ago

Hi Mike, great work with climateR. I was practicing with the getTerraClim function and it also freezes.

The error occurred initially on my personal computer, but when I tried it in my office I had no problem. After checking the repository issues I found this thread. Now I managed to overcome the problem by installing the same version of R (4.1.3) as my office and paying attention to an important detail:

looking at a message when loading the climateR package, the following appears: climateR_error

I was able to install this package (tzdb) and work correctly with climateR, at least with the mentioned function and in the R version 4.1.3.

Checking in the version that maintains the error R 4.2.2, I installed the tzdb package and still the error persists when trying to download the data with the getTerraClim function.

Checking the DESCRIPTION file, I saw that the tzdb package is not included in the imports section and it is crucial according to the message with which I was able to resolve the issue on my computer.

Glad to be able to help resolve this issue with your help.

I'm in a Windows 11 pc both office and home.