interp_down: Interpolate and downscale from gridded climate data sets

Description Usage Arguments Details Value Examples

View source: R/tusk.R

Description

Interpolate and downscale gridded climate data for a given coordinate pair

Usage

1
2
interp_down(netcdf, worldclim = NULL, param, coords, nearest,
  data_set = "ts401", downscale = FALSE)

Arguments

netcdf

the ncdf object the data should be extracted from

worldclim

path to folder with worldclim .bil files (optional, and only used if downscale is TRUE)

param

the name of the paramater to extract as character string

coords

the coordinates of the point to get the data for as list with $lon and $lat

nearest

a nearest gridpoints objects as returned from four_nearest()

data_set

the kind of data set used (see ?supported_sets)

downscale

logical: shall the data be downscaled to 30 arc seconds?

Details

Interpolation is done using inverse distance weighting over the four nearest grid points. The results will depend on the kind of data used for interpolation. E.g., using CRU TS 3.22 will result in monthly data starting in January 1901. For CRU precipitation and temperature data, the data can be downscaled to 30 arc seconds resolution using the Worldclim climatology. In this case, for the given points, the anomalies of the nearest gridpoints are calculated based on their local 1950-2000 climatology, and interpolated. The interpolated anomalies are then rescaled to the Worldclim climatology for the nearest point in the Worldclim grid.

Value

a data.frame holding the extracted and interpolated data

Examples

1
2
3
4
5
6
7
8
## Not run: 
library(ncdf4)
cru_maxtemp <- nc_open("~/Data/cru_ts3.22.1901.2013.tmp.dat.nc")
my_coords <- list(lon = 0.3, lat = 40.81)
my_nearest <- nearest_points(my_coords, cru_maxtemp, "ts322")
interp_down(cru_maxtemp, "tmx", my_coords, my_nearest, "ts322")

## End(Not run)

cszang/tusk documentation built on May 14, 2019, 12:27 p.m.