REddyProc
package included several utility functions that were somewhat out of the package scope. These functions are removed from package.
This vignette shows how to replace them by functions from the bigleaf
package.
if (!require("bigleaf", quietly = TRUE)) stop(
"bigleaf package must be installed to create this vignette.")
library(REddyProc)
Vapour pressure deficit (VPD) was computed with REddyProc in \(hPa\) from relative humidity in \(\%\) and air temperature in \(^{\circ}C\).
<- fCalcVPDfromRHandTair(DEGebExample$rH, DEGebExample$Tair) VPD0
bigleaf
package computes VPD in \(kPa\) and requires relative humidity as fraction .
<- rH.to.VPD(DEGebExample$rH/100, DEGebExample$Tair)*10 VPD.hPa
Saturation vapor pressure (SVP) or eSat in \(hPa\) was computed from air temperature.
<- seq(10,25,by = 5) Tair
<- fCalcSVPfromTair(Tair) eSat0
is replaced by Esat.slope
which uses \(kPa\) as pressure unit:
<- Esat.slope(Tair)$Esat * 10) (eSat
## [1] 12.26030 17.01672 23.32596 31.60057
Actual vapor pressure (AVP) or e in \(hPa\) was also computed from Vapor mole fraction (VMF) in \(mol/mol\) and pressure in \(hPa\).
<- seq(0.01,0.03,by = 0.005)
VMF <- 1000 press.in.hPa
<- fCalcAVPfromVMFandPress(VMF, press.in.hPa) e0
There is no replacement function, as this is just the multiplication of the two arguments.
<- VMF * press.in.hPa) (e
## [1] 10 15 20 25 30
Relative humidity (rH) in \(\%\) was computed from AVP in \(hPa\) and temperature.
<- seq(0,30,by = 5)
e.in.hPa <- 25 Tair
<- fCalcRHfromAVPandTair(e.in.hPa, Tair)) (rH0
Again this is replaced by a function using pressure units \(kPa\) and relative humidity as fraction.
<- e.to.rH(e.in.hPa/10, Tair)*100) (rH
## [1] 0.0000 15.8225 31.6450 47.4675 63.2900 79.1125 94.9350
<- seq(300,500,by = 50)
LE <- 25 Tair
<- fCalcETfromLE(LE, Tair) ET0
The corresponding bigleaf function LE.to.ET
returns a value in kg/m2/s. This needs to be converted to mmol/m2/s as returned by the former fCalcETfromLE
.
<- LE.to.ET(LE, Tair)
ETkg <- kg.to.mol(ETkg)*1000) (ETmmol
## [1] 6.819916 7.956569 9.093222 10.229874 11.366527
Photon flux density (PPFD) of visible light can be computed from energy in incoming radiation
<- 200 Rg
bigleaf
function Rg.to.PPFD
combines the two former REddyProc functions fConvertVisibleWm2toPhotons
and fConvertGlobalToVisible
.
<- fConvertGlobalToVisible(fConvertVisibleWm2toPhotons(Rg)) PPFDVis0
<- Rg.to.PPFD(Rg)) (PPFDVis
## [1] 460
The PPFD of light including non-visible parts, i.e. former fConvertVisibleWm2toPhotons
, is obtained by setting argument frac_PAR
to 1.
<- Rg.to.PPFD(Rg, frac_PAR = 1)) (PPFDAll
## [1] 920
Potential radiation (\(W m^{-2}\)) depends on time and geo-location.
<- 160
doy <- seq(6,18,by = 0.2)
hour <- 39.94
latDeg <- -5.77
longDeg <- +1 timezone
Formerly, REddyProc provided:
<- fCalcPotRadiation(doy, hour, latDeg, longDeg, timezone)) (potRad0
This is replaced by bigleaf:
head(potRad <- potential.radiation(doy, hour, latDeg, longDeg, timezone))
## [1] 1.722378 48.072563 95.193985 142.957488 191.232157 239.885672
Extraterrestrial solar radiation was formerly computed by REddyProc by:
<- fCalcExtRadiation(doy)) (extRad0
This is replaced by bigleaf:
<- extraterrestrial.radiation(doy)) (extRad
## [1] 1324.598
Required computation of sun position (computeSunPosition
) and difference between apparent local time time and time zone time (computeSolarToLocalTimeDifference
) have been moved to package solartime
.