InsertRS: Inserts pre-processed images into appropriate forcing NetCDF...

Description Usage Arguments Details See Also Examples

View source: R/RS_get.R

Description

InsertRS takes a raster stack or brick of RS images and exports individual images to matching (by date) forcing NetCDF files.

Usage

1
2
InsertRS(inFile, forcPath, forcName = "LDASIN_DOMAIN1", varName = NULL,
  varUnit = NULL, varLong = NULL, varNA = -1e+36, overwrite = TRUE)

Arguments

inFile

The name of the raster stack/brick or NetCDF file (full pathname) to export.

forcPath

Path to the forcing data you want to modify. Forcing data files MUST match the size/resolution of the images in the inFile.

forcName

The suffix for the forcing data files to modify (DEFAULT="LDASIN_DOMAIN1")

varName

Name for the NetCDF variable to export. The varibale will be copied as-is, so make sure it matches the variable name needed in the forcing data.

varUnit

Units for the NetCDF export variable. Only required if the inFile is a raster stack/brick. If the inFile is a NetCDF file, the units will carry over.

varLong

Long name for the NetCDF export variable. Only required if the inFile is a raster stack/brick. If the inFile is a NetCDF file, the longname will carry over.

varNA

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

overwrite

Boolean to allow the tool to overwrite existing variables if found in the forcing data. (DEFAULT=TRUE)

Details

InsertRS takes a raster stack or brick (as created by ConvertRS2Stack or SmoothStack) or a NetCDF file (as created by ConvertStack2NC) of RS images and exports each layer (time step) to the appropriate time step forcing file. Only looks for the date (not time) and inserts at the 00:00 hour on that date. The input stack, brick, or file should be already processed through the ConvertRS2Stack, SmoothStack, or ConvertStack2NC tools or follow the same layer (date) naming convention.

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Export the raster stack of LAI images created through ConvertRS2Stack to 
## the forcing data.

## Not run: 
InsertRS(lai.b, forcPath="FORCING", forcName="LDASIN_DOMAIN3",
         varName="LAI", varUnit="(m^2)/(m^2)", varLong="Leaf area index")

## Export the NetCDF of LAI images created through ConvertStack2NC to the 
## forcing data.

InsertRS("BCNED_LAI.nc", forcPath="FORCING", forcName="LDASIN_DOMAIN3", 
         varName="LAI")

## End(Not run)

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