diff --git a/Rpkg/R/CalStream_Order.R b/Rpkg/R/CalStream_Order.R index f76fd87..6ff8351 100644 --- a/Rpkg/R/CalStream_Order.R +++ b/Rpkg/R/CalStream_Order.R @@ -76,7 +76,7 @@ CalcStreamOrder=function(basinID,dsID,segments){ blist2=which(segments2==btemp) segments[blist2]=order_no[i] } - outputlist=list("summary"=summary, "channel_orders"=segments) + outputlist=list("summary"=summary, "order_mask"=segments) } return(outputlist) diff --git a/Workflow_Example.Rmd b/Workflow_Example.Rmd index acb0be1..d30fc49 100644 --- a/Workflow_Example.Rmd +++ b/Workflow_Example.Rmd @@ -150,13 +150,17 @@ image.plot(area,main="drainage Area") Next you can use the flow direction file and the drainage areas to define a river network given a user specified drainage area threshold to define rivers (i.e. any cell with >=riv_th cells draining to it will count as a river) ```{r} subbasin=CalcSubbasins(travHS$direction, area=area, mask=watershed.mask, riv_th=60, merge_th=0) + +#you can also calcualte stream order if you would like here: +streamorder=CalcStreamOrder(subbasin$summary[,1], subbasin$summary[,6], subbasin$segments) ``` *Note:Try changing the riv_th to change the density of the river network that is created. The merge threshold is used to lump together river segments with drainage areas below this threshold. Use help(CalcSubbasins) to learn more about the options for this function * Take a look at the resulting river network ```{r} -par(mfrow=c(1,2)) +par(mfrow=c(1,3)) image.plot(subbasin$segments, main="Stream Segments") +image.plot(streamorder$order_mask, main="Stream Segments") image.plot(subbasin$subbasins, main="Sub basins") ```