ConvertStack2NC: Convert a raster stack to a NetCDF file.

Description Usage Arguments Details See Also Examples

View source: R/RS_get.R

Description

ConvertStack2NC takes a raster stack of RS images and outputs a NetCDF file with a time dimension and specified variable name & metadata.

Usage

1
2
ConvertStack2NC(inStack, outFile = NULL, varName = NULL,
  varUnit = NULL, varLong = NULL, varNA = -1e+36, flipY = TRUE)

Arguments

inStack

The name of the raster stack to export.

outFile

Name for an output NetCDF file.

varName

Name for the NetCDF export variable.

varUnit

Units for the NetCDF export variable.

varLong

Long name for the NetCDF export variable.

varNA

Value to set for "NA" or "no data". Default is -1.e+36.

flipY

Reverse y indices, e.g., to match geogrid S->N orientation (DEFAULT=TRUE).

Details

ConvertStack2NC converts a raster stack to an output NetCDF file. The raster stack should be already processed through the ConvertRS2Stack tool or follow the same layer (date) naming convention.

See Also

Other MODIS: CalcStatsRS, ConvertRS2Stack, GapFillRS, GetMODIS, InsertRS, SmoothStack

Examples

1
2
3
4
5
6
7
8
## Export the raster stack of LAI images created through ConvertRS2Stack
## to a NetCDF file. Use the full time series of images.

## Not run: 
ConvertStack2NC(lai.b, outFile="BCNED_LAI.nc", varName="LAI", 
                varUnit="(m^2)/(m^2)", varLong="Leaf area index")

## End(Not run)

mccreigh/rwrfhydro documentation built on Feb. 28, 2021, 1:53 p.m.