make_fract: Make fraction file

Description Usage Arguments Details Value Examples

View source: R/make_fract.R

Description

Creates a fraction file for the UW routing model An alternative function is provided for creating a fraction file of all 1's

Usage

1
make_fract(dem, bb, saveloc, basename, target_res = 1/16)

Arguments

dem

fine resolution DEM at least as large as the study area

bb

basin boundary shapefile defining the study area

saveloc

directory to save outputs

basename

basename for the outputs

target_res

target (coarse) resolution

Details

All coordinate systems should be geographic. I've been using WGS84. If the pixels are not square (in geographic coordinates), this becomes a pain.

Value

Returns the following rasters, in ASCII grid format: Fraction File at VIC model resolution Watershed mask at DEM resolution Watershed mask at VIC model resolution DEM clipped to basin boundaries

Examples

1
2
3
4
5
dem <- raster("/Volumes/HD4/SWOTDA/Data/IRB/irb_dem.tif")
bb <- readOGR("/Volumes/HD4/SWOTDA/Data/IRB/irb_bb_1_16/bb.shp")
saveloc <- "/Volumes/HD3/SWOTDA/FDT/v12032019/Routing_Inputs"
basename <- "irb"
fract <- make_fract(dem, bb, saveloc, basename, fineres = 1/16, coarseres = 1/16)

jschap1/routR documentation built on July 19, 2020, 8:42 p.m.