1) Get familiar with caladaptR
2) Hands-on practice with:
3) More caladaptR users!
+ foundational concepts
+ code recipes
+ working examples
+ practice
functional pRoficiency!
Cal-Adapt is California’s official portal for peer-reviewed climate data.
Datasets are selected with guidance and priorities from California State agencies.
Modeled Climate Data:
See also: What climate data does Cal-Adapt provide?.
Spatial extent of LOCA downscaled climate data layers:
Feature | Cal-Adapt website | Cal-Adapt FTP | caladapt-py | caladaptR |
Download rasters | ||||
Statewide | ✔ | ✔ | ✔ | ✔ |
User area-of-interest | ✔ | ✔ | ✔ | |
10 recommended GCMs | ✔ | ✔ | ✔ | ✔ |
All 32 GCMs | ✔ | ✔ | ||
Query features | ||||
Points (user-provided) | ✔ | ✔ | ✔ | |
Lines (user-provided) | ✔ | ✔ | ||
Polygons (user-provided) | ✔ | ✔ | ✔ | |
Polygons (presets, boundary layers) | ✔ | ✔ | ||
Other | ||||
Extract underlying tables from preset charts | ✔ |
More info:
caladaptr
is an API client package
caladaptR users need to know:
In general, there are five steps to using caladaptR:
cap1 <- ca_loc_pt(coords = c(-121.4687, 38.5938)) %>% ## specify a location
ca_cvar(c("tasmax", "tasmin")) %>% ## climate variables
ca_gcm(gcms[1:4]) %>% ## GCM(s)
ca_scenario(scenarios[1:2]) %>% ## emission scenarios(s)
ca_period("year") %>% ## temporal aggregation period
ca_years(start = 2040, end = 2060) ## start and end dates
## Cal-Adapt API Request
## Location(s):
## x: -121.469
## y: 38.594
## Variable(s): tasmax, tasmin
## Temporal aggregration period(s): year
## GCM(s): HadGEM2-ES, CNRM-CM5, CanESM2, MIROC5
## Scenario(s): rcp45, rcp85
## Dates: 2040-01-01 to 2060-12-31
##
## General issues
## - none found
## Issues for querying values
## - none found
## Issues for downloading rasters
## - none found
cap1_rtbl <- cap1 %>% ca_getvals_db(db_fn = “c:/data/mydata.sqlite”, db_tbl = “temp_min_max”)
See also Large Queries vignette
cap1_tifs <- cap1 %>% ca_getrst_stars(out_dir = “c:/data/tifs”)
ca_read_stars()
See also Raster Vignettes
Samples:
R Notebooks are written in “R Markdown”, which combines text and R code.
Remember:
When you’re in a R Notebook, the working directory is where the Rmd file resides.