openSTARS (version 1.0.0)

calc_offset: Calculate offset

Description

Recursive function to calculate the offset from the downstream junction needed to place points with fixed distance along the streams. It is called by calc_prediction_sites for each outlet and should not be called by the user.

Usage

calc_offset(dt, id, offs, dist)

Arguments

dt

data.table containing the attributes of the stream segments

id

integer; 'stream' of the stream segment

offs

number; offset from outlet of the stream segment (downstream); equals the length of the segment if the point shall be placed directly at the downstream junction.

dist

number giving the distance between the points to create in map units.

Value

Nothing; change 'offset' in dt.

Examples

Run this code
# NOT RUN {
 outlets <- dt.streams[next_str == -1, stream]
 netID <- 1
 for(i in outlets){
   calc_offset(dt.streams, id = i, offs = 0, dist = 200)
 }
# }

Run the code above in your browser using DataLab