getNodeProperties: Properties of GRiwrm nodes

View source: R/getNodeProperties.R

getNodePropertiesR Documentation

Properties of GRiwrm nodes

Description

getNodeProperties returns properties of a single node, and

Usage

getNodeProperties(id, griwrm)

getAllNodesProperties(griwrm)

Arguments

id

character Id of the node in the GRiwrm object

griwrm

[GRiwrm object] describing the network of the semi-distributed model (See CreateGRiwrm)

Details

A "Gauged" node is either a node containing a model that is already calibrated (parameters are already fixed) or a node containing a model where observations are available for calibration.

A "Ungauged" node is a node containing a model which derives its parameters from another "donor" node.

Value

getNodeProperties returns a list with the following items:

  • "position" (character): Position of the node in the network ("Upstream" or "Intermediate")

  • "DirectInjection" (logical): is the node a Direct Injection node?

  • "Diversion" (logical): is the node a Diversion node?

  • "Reservoir" (logical): is the node a Reservoir?

  • "airGR" (logical): is the node contains an airGR model?

  • "calibration" (character): describe if the node is a "Gauged", or an "Ungauged" station, (see details), or "NA" otherwise

  • "Upstream" (logical): is the node an upstream node?

  • "RunOff" (logical): is the node contains an hydrological model?

getAllNodesProperties returns a data.frame constituted from the list returned by getNodeProperties for all nodes.

See Also

CreateGRiwrm()

Examples

###############################################################################
# Severn network with :                                                       #
# - a Diversion on the node "54001" which transfer flows to the node "540029" #
# - node 54002 as a Direct Injection node                                     #
###############################################################################
data(Severn)
nodes <- Severn$BasinsInfo
nodes$model <- "RunModel_GR4J"
str(nodes)
nodes <- nodes[, c("gauge_id", "downstream_id", "distance_downstream", "model", "area")]
# Add a Diversion node from node "54001" to "54029"
nodes <- rbind(nodes,
               data.frame(
                 gauge_id = "54001",
                 downstream_id = "54029",
                 distance_downstream = 20,
                 model = "Diversion",
                 area = NA
               ))
# Set node '54002' as a Direct Injection node
nodes$model[nodes$id == "54002"] <- NA
# Mismatch column names are renamed to stick with GRiwrm requirements
rename_columns <- list(id = "gauge_id",
                       down = "downstream_id",
                       length = "distance_downstream")
# Create GRiwrm object and display properties
griwrm <- CreateGRiwrm(nodes, rename_columns)

str(getNodeProperties("54001", griwrm))

getAllNodesProperties(griwrm)

inrae/airGRiwrm documentation built on Sept. 27, 2024, 6:08 p.m.