Learn R Programming

SeaVal (version 1.1.1)

upscale_chirps: Upscales monthly CHIRPS data to a coarser grid

Description

this is mostly auxiliary and called from download_chirps_monthly. Uses the function upscale_regular_lon_lat, but derives the weights for upscaling only once for efficiency and avoids simultaneous loading of all CHIRPS data.

Usage

upscale_chirps(
  update = TRUE,
  years = NULL,
  months = NULL,
  upscale_grid = data.table(expand.grid(lon = seq(GHA_extent()[1], GHA_extent()[2], 0.5),
    lat = seq(GHA_extent()[3], GHA_extent()[4], 0.5))),
  root_dir = NULL,
  version = "UCSB",
  us_dir = file.path(root_dir, "upscaled")
)

Value

Nothing.

Arguments

update

Logical, if TRUE, files that have already been upscaled are skipped

years, months

Which years and months do you want to upscale? NULL upscales everything there is (except if update is TRUE).

upscale_grid

A regular lon/lat grid for upscaling. Defaults to half degrees.

root_dir

directory where the high-resolution file is stored.

version

Version specifier, should be 'UCSB' or 'ICPAC'. The latter only works if you have access to CHIRPS blended.

us_dir

Directory where the low-resolution file will be stored.

Examples

Run this code
if(interactive()){
upscale_chirps()
}

Run the code above in your browser using DataLab