Skip to contents

This function downloads (or retrieves from cache) monthly Tmin, Tmax, and PPT climatologies (maps of long-term average climate) from a specified data source for the specified bounding box. It is intended for use with downscale_core(), but can also be used as stand-alone raster data.

Usage

input_refmap(
  bbox,
  reference = "refmap_climr",
  cache = TRUE,
  indiv_tiles = FALSE,
  xyz = NULL
)

input_refmap_db(reference = "refmap_climatena")

Arguments

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.

reference

A character or a SpatRaster. For character, label of the normal baseline to use. Can be obtained from list_refmaps(). For SpatRaster, 36 layers normal climate variables with names PPT01:PPT12, Tmax01:Tmax12 and Tmin01:Tmin12. Defaults to list_refmaps()[1].

cache

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

indiv_tiles

logical. Only download necessary tiles instead of full bounding box?

xyz

a terra::SpatRaster with a single layer containing elevation values in metres, or a data.frame with the following columns "long", "lat", "elev", and a unique "id". Any extra columns will be ignored and not output.

Value

A SpatRaster containing reference period climatologies, lapse rates and digital elevation model layers, that can be used with downscale_core().

Details

The first 36 layers of the output raster correspond with the actual climate variables. The raster also contains lapse rates for each variable, and a corresponding digital elevation model.

See also