Description Usage Arguments Details Value Examples
Interpolate and downscale gridded climate data for a given coordinate pair
1 2 | interp_down(netcdf, worldclim = NULL, param, coords, nearest,
data_set = "ts401", downscale = FALSE)
|
netcdf |
the ncdf object the data should be extracted from |
worldclim |
path to folder with worldclim .bil files
(optional, and only used if |
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? |
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.
a data.frame holding the extracted and interpolated data
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.