nc_regrid: Regrid a variable from a ncdf file

View source: R/nctools-regrid.R

nc_regridR Documentation

Regrid a variable from a ncdf file

Description

Regrid a variable from a ncdf file

Usage

nc_regrid(
  filename,
  varid = NA,
  dim = 1:2,
  new,
  mask = NULL,
  output,
  extrap = FALSE,
  log = TRUE,
  keepRange = FALSE,
  ...
)

Arguments

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 dim.

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.


roliveros-ramos/nctools documentation built on Aug. 13, 2022, midnight