Skip to contents

Stream Definition By Threshold

Usage

taudem_threshold(
  input_area_grid,
  output_stream_raster_grid = NULL,
  mask_file = NULL,
  threshold_parameter = 100,
  n_processes = getOption("traudem.n_processes", 1),
  quiet = getOption("traudem.quiet", FALSE)
)

Arguments

input_area_grid

File name for grid to be thresholded.

output_stream_raster_grid

File name for stream raster grid.

mask_file

File name for grid used to mask the output stream raster, or general thresholded grid.

threshold_parameter

Threshold parameter.

n_processes

Number of processes for mpiexec. If NULL TauDEM is called without mpiexec.

quiet

If FALSE output from TauDEM CLI is suppressed.

Value

Path to output file (invisibly).

Examples

if (FALSE) { # interactive() && traudem::can_register_taudem()
test_dir <- withr::local_tempdir()
dir.create(test_dir)
file.copy(
   system.file("test-data", "DEM.tif", package = "traudem"),
   file.path(test_dir, "DEM.tif")
 )
filled_pit <- taudem_pitremove(file.path(test_dir, "DEM.tif"))
outputs <- taudem_d8flowdir(filled_pit)
outputs
contributing_area_grid <- taudem_aread8(outputs$output_d8flowdir_grid)
contributing_area_grid
thresholded <- taudem_threshold(contributing_area_grid)
thresholded
}