Skip to contents

input_obs produces anomalies of the average observed climate for a given period, relative to the 1961-1990 reference period. The anomalies are calculated from the "cru.gpcc" dataset which is the Climatic Research Unit TS dataset (for temperature) and Global Precipitation Climatology Centre dataset (for precipitation).

input_obs_ts produces anomalies of observed climate for a given time series of individual years.

Usage

input_obs(dbCon, bbox = NULL, period = list_obs_periods(), cache = TRUE)

input_obs_ts(
  dbCon,
  dataset = c("cru.gpcc", "climatena"),
  bbox = NULL,
  years = 2010:2022,
  cache = TRUE
)

Arguments

dbCon

A db connection object created by data_connect.

bbox

numeric. Vector of length 4 giving bounding box of study region, in the order ymax,ymin,xmax,xmin. In general this is created by get_bb(), but can also be user-defined.

period

character. Vector of labels of the periods to use. Can be obtained from list_obs_periods(). Default to "2001_2020".

cache

logical. Specifying whether to cache new data locally or no. Defaults to TRUE.

dataset

Character. Which observational dataset to use? Options are "climatena" for the ClimateNA gridded time series or "cru.gpcc" for the combined Climatic Research Unit TS dataset (for temperature) and Global Precipitation Climatology Centre dataset (for precipitation).

years

numeric. Years to retrieve obs anomalies for. Defaults to 2010:2022. See list_obs_years() for available years.

Value

A list of SpatRasters, each with possibly multiple layers, that can be used with downscale_core(). Each element of the list corresponds to a particular period, and the values of the SpatRaster are anomalies of the obs period compare to the reference period.

List of length 1 containing a SpatRaster

Details

Generally, this function should only be used in combination with downscale_core() as the values returned in the rasters are anomalies compared to the 1961-1990 reference period, and are usually not meaningful without the whole downscale process.

The returned raster contains anomalies for each year specified in years. In general this function should only be used in conjunction with downscale_core().