Skip to contents

Creates a SpatRasterDataset (terra R-package) object from a variable from wrf file (or another compatible NetCDF) for all times and levels

Usage

wrf_sds(
  file = file.choose(),
  name = NA,
  map,
  latlon = FALSE,
  method = "bilinear",
  flip_h = FALSE,
  flip_v = FALSE,
  verbose = FALSE,
  ...
)

Arguments

file

wrf file

name

variable name

map

(optional) file with lat-lon variables and grid information

latlon

logical (default is FALSE), set TRUE project the output to "+proj=longlat +datum=WGS84 +no_defs"

method

method passed to terra::projection, default is bilinear

flip_h

horizontal flip (by rows)

flip_v

vertical flip (by cols)

verbose

display additional information

...

extra arguments passed to ncdf4::ncvar_get

Value

SpatRasterDataset object (from terra package), each time-step is considered one subdatasets and each layer is one nlyr.

Note

The convention adopted to select specific times and atmospheric layers on wrf_sds is sds[time,layer] to keep consistence with sds.