Cal_LHB: Calculate sap flow density using the LHB approach

View source: R/Calculation_LHB.R

Cal_LHBR Documentation

Calculate sap flow density using the LHB approach

Description

A function to calculate sap flow density using the LHB approach (Trcala and Cermak 2016). The temperatures that are directly measured by sensors (upper, lower and side) must be provided.

Usage

Cal_LHB(data, T_up, T_low, T_side, K, ratio = 2, Heat, Zax = 1.5, Ztg = 0.5)

Arguments

data

a data frame that includes the measured sap flow data

T_up

a string indicates the column name for the temperature measured by the upper sensor

T_low

a string indicates the column name for the temperature measured by the lower sensor

T_side

a string indicates the column name for the temperature measured by the side sensor

K

a numeric value (constant K) or a string that indicates the column name (dynamic K). K value indicates the dTasym value when zero sap flow occurs, see Nadezhdina et al. 2012

ratio

a numeric value; the ratio between the thermal conductivities of wood in the axial and tangential directions; default: 2 (Trcala and Cermak 2016)

Heat

a numeric value; the heating power used for the probe (W m-1)

Zax

a numeric value; axial distance of the sensors, cm. Default: 1.5

Ztg

a numeric value; tangential distance of the sensors, cm. Default: 0.5

Value

a data frame with an additional column of the calculated sap flow density (SFD_lhb, g cm-2 h-1).

Examples

# load example data
df <- read.csv(file = system.file("extdata", "Soil_resp_example.csv", package = "FluxGapsR"),
header=T)

# convert the data into long format
df <- df %>%
  pivot_longer(cols = Temp1U:Temp8S,
               names_to = c(".value","Position"),
               names_sep = c(5)) %>%
  pivot_longer(cols = starts_with(c("K","Temp")),
               names_to = c(".value","Depth"),
               names_sep = -1) %>%
  pivot_wider(names_from = Position,
              values_from = Temp)

# calculate sap flow density using dynamic K values that are provided as a variable
df_lhb1 <- Cal_LHB(df,T_up = "U",T_low = "L",T_side = "S",K="K",Heat=2.6)
tapply(df_lhb1$SFD_lhb, df_lhb1$Depth, summary)

# calculate sap flow density using constant K value
df_lhb2 <- Cal_LHB(df,T_up = "U",T_low = "L",T_side = "S",K=.8,Heat=2.6)
tapply(df_lhb2$SFD_lhb, df_lhb2$Depth, summary)

junbinzhao/SapCal documentation built on Dec. 1, 2022, 10:29 a.m.