compute_area_weights: Compute weights for river catchment areas within the runoff...

View source: R/compute_area_weights.R

compute_area_weightsR Documentation

Compute weights for river catchment areas within the runoff area features.

Description

Computes weights for each individual river segment specific catchments falling in the areal units of the runoff HS. Function first takes a union between basins and HS (creating new catchment units which fall inside only one runoff unit), and calculating the area for each individual catchment unit. The weight is assigned by dividing the area of sub-catchment with the area of runoff unit. This function is called by compute_HSweights.

Usage

compute_area_weights(
  basins,
  HS,
  pycno = NULL,
  dasy = NULL,
  weights = NULL,
  n = 20,
  intensive = TRUE,
  riverID = "riverID",
  zoneID = "zoneID"
)

Arguments

basins

An 'sf' polygon feature specifying the river segment specific catchments.

HS

A 'HS' object, obtained with raster_to_HS.

pycno

Name of Pycnophylactic variable in HS input

dasy

Name of Dasymetric variable in basins input

weights

Name of a column in river to be used directly as weights. Defaults to NULL. See Details.

n

Number of iterations when using pycnophylactic interpolation. Default 25.

intensive

Whether the pycnophylactic variable is intensive (density, like runoff in mm), or not (in which case it is extensive, or counts like runoff in volume).

riverID

Column in basins containing unique IDs.

zoneID

Column in HS with unique IDs.

Value

Returns an 'sf' polygon feature (a union of basins, and HS) with added attributes (columns):

  • ID. Unique ID of the feature.

  • riverID. ID of the river segment each sub-catchment is associated to.

  • zoneID. ID of the runoff unit the sub-catchment is contained in.

  • weights. Weights computed for each sub-catchment.

  • target_area. Area of the sub-catchment (basin) in m^2.

  • source_area. Area of the runoff unit sub-catchment is contained in.


mkkallio/hydrostreamer documentation built on Oct. 14, 2023, 9:38 p.m.