-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhurs_reprex.R
27 lines (23 loc) · 962 Bytes
/
hurs_reprex.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
reprex::reprex({
library(magrittr)
library(terra)
library(httr)
# NASA NEX-GDDP-CMIP6
nexgddp <- tempfile(fileext = ".nc")
"https://nex-gddp-cmip6.s3-us-west-2.amazonaws.com/NEX-GDDP-CMIP6/ACCESS-ESM1-5/historical/r1i1p1f1/hurs/hurs_day_ACCESS-ESM1-5_historical_r1i1p1f1_gn_2000_v1.1.nc" %>%
httr2::request() %>%
httr2::req_perform(path = nexgddp,
verbosity = 0)
# Values outside of [0,100]
(terra::rast(nexgddp)[[1]] > 100) %>%
plot()
# Original CMIP6 Model (warning, ~490 MB)
cmip6 <- tempfile(fileext = ".nc")
"https://esgf-data1.llnl.gov/thredds/fileServer/css03_data/CMIP6/CMIP/CSIRO/ACCESS-ESM1-5/historical/r1i1p1f1/day/hurs/gn/v20191115/hurs_day_ACCESS-ESM1-5_historical_r1i1p1f1_gn_20000101-20141231.nc" %>%
httr2::request() %>%
httr2::req_perform(path = cmip6,
verbosity = 0)
# Values outside of [0,100]
terra::rast(cmip6)[[1]] %>%
plot()
})