View source: R/nctools-regrid.R
nc_regrid | R Documentation |
Regrid a variable from a ncdf file
nc_regrid( filename, varid = NA, dim = 1:2, new, mask = NULL, output, extrap = FALSE, log = TRUE, keepRange = FALSE, ... )
filename |
The filename of the original ncdf file. |
varid |
What variable to read the data from. Can be a string with the name of the variable or an object of class ncvar4. If set to NA, the function will determine if there is only one variable in the file and, if so, read from that, but if there are multiple variables in the file, an error is generated. |
dim |
A vector including the names of the dimensions to interpolate, e.g. c("longitude", "latitude") |
new |
A list including information of the new coordinates, the names
should match the ones provides in |
mask |
An optional matrix providing the ocean/land mask. The maks will be multiplied by each layer of the new regrided array, so dimensions must be consistent. The mask contains 1s in the area for valid data and NAs for the invalid ones (e.g. 1s in the ocean, NAs in the land). |
output |
The filename to save the regrided variable. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.