% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/wrf_sds.R
\name{wrf_sds}
\alias{wrf_sds}
\title{Creates SpatRasterDataset object from wrf file}
\usage{
wrf_sds(
  file = file.choose(),
  name = NA,
  map,
  latlon = FALSE,
  method = "bilinear",
  flip_h = FALSE,
  flip_v = FALSE,
  verbose = FALSE,
  ...
)
}
\arguments{
\item{file}{wrf file}

\item{name}{variable name}

\item{map}{(optional) file with lat-lon variables and grid information}

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

\item{method}{method passed to terra::projection, default is bilinear}

\item{flip_h}{horizontal flip (by rows)}

\item{flip_v}{vertical flip (by cols)}

\item{verbose}{display additional information}

\item{...}{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.
}
\description{
Creates a SpatRasterDataset (terra R-package) object from a variable from wrf file (or another compatible NetCDF) for all times and levels
}
\note{
The convention adopted to select specific times and atmospheric layers on wrf_sds is sds[time,layer] to keep consistence with sds.
}
\examples{
file <- paste0(system.file("extdata",package="eva3dm"),"/wrf_4d_o3_Boston.nc")
O34d <- wrf_sds(file,'o3',verbose = TRUE)

# selecting one time, keeping multiple layers
O34d[1,]

# selecting one layer, keeping multiple times
O34d[,1]

}
