# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Compute pressure at a given elevation from a calibration point
#' @param P vector of pressure observations (e.g., a time series)
#' @param elev Vector of elevations (in meters)
#' @param calibE Elevaiton of calibration point
#' @return Pressure in hPa; in the form of a matrix with elevation as rows and pressure as columns
#' @export
pressureCorrection <- function(P, elev, newElev) {
.Call(`_NSmetabolism_pressureCorrection`, P, elev, newElev)
}
#' Inverse distance weighted interpolation
#'
#' @details Interpolation is done assuming locations are in the rows of vals. Thus, if vals
#' is an n by m matrix, each of the m output values will be the inverse distance weighted
#' average for the n sites
#'
#' @param vals A location-by-value matrix
#' @param dist Distance to each value
#' @param pow Power to use for distance
#' @return The inverse distance weighted average of vals
#' @export
idw_matrix <- function(vals, dist, pow = 2) {
.Call(`_NSmetabolism_idw_matrix`, vals, dist, pow)
}
#' Perform inverse distance weighting with a correction for discharge
#'
#' This function works on a vector of k output sites, where the length
#' of each input list and the input vector Q must be k.
#' For each input site, the corresponding input lists contain vectors of neighbor sites;
#' so for site k with discharge Q[k], vals[[k]] is a vector for the n neighbors of site k.
#'
#' @param vals input values of variable to interpolate
#' @param dist distance from focal point to vals; negative for downstream sites
#' @param nbQ discharge of measured sites
#' @param Q discharge of focal site
#' @return interpolated value of vals
#' @export
idw_river <- function(vals, dist, nbQ, Q) {
.Call(`_NSmetabolism_idw_river`, vals, dist, nbQ, Q)
}
#' Computes the input dissolved oxygen flux
#' @param upQ Upstream discharge (m^3/s)
#' @param upDO Upstream dissolved oxygen concentration (g/m^3)
#' @param latQ Lateral input discharge (m^3/s)
#' @param latDO Lateral input DO concentration (g/m^3)
#' @return double; the input flux (mg/min) of dissolved oxygen
#'
computeInputDOFlux <- function(upQ, upDO, latQ, latDO) {
.Call(`_NSmetabolism_computeInputDOFlux`, upQ, upDO, latQ, latDO)
}
#' Compute advective flux in g/(m^3 * min)
#' @param inputDOFlux dissolved oxygen mass flux of input water (g/[m^3 * min])
#' @param DOconc dissolved oxygen concentration (g/m^3)
#' @param data Fixed site data, including at least Q, area, and dx
#' @return dissolved oxygen concentration flux (g/[m^3 * min])
#'
computeAdvection <- function(inputDOFlux, DOconc, data) {
.Call(`_NSmetabolism_computeAdvection`, inputDOFlux, DOconc, data)
}
#' Compute gross primary productivity from light (g O2 / [m^2 * day])
#' @details P1 is in units of (W*day)/gO2, P2 is in (m^2 * day) / gO2
#' @param lP1 The log of the slope of the PI curve
#' @param lP2 The log of the saturation term of the PI curve
#' @param data Fixed site data, including at least Q, area, and dx
#' @references Uehlinger U. et al. 2000. Variability of photosynthesis-irradiance curves and
#' ecosystem respiration in a small river. Freshwater Biology 44:493-507.
#' @return double; computed GPP
#'
computeGPP <- function(PAR, lP1, lP2) {
.Call(`_NSmetabolism_computeGPP`, PAR, lP1, lP2)
}
#' Compute ecosystem respiration at in-situ temperature (gO2 / [m^2 * day])
#' @param temperature Water temperature (degrees C)
#' @param ER24_20 Ecosystem respiration rate at 20 degrees (gO2 / [m^2 * day])
#' @return Temperature-adjusted ER
#'
inSituER <- function(temperature, ER24_20) {
.Call(`_NSmetabolism_inSituER`, temperature, ER24_20)
}
#' Computes reaeration flux (g/(m^2 * day))
#'
#' @param temp Water temperature (degrees C)
#' @param pressure Atmospheric pressure (hPa)
#' @param DO dissolved oxygen concentration, mg/L
#' @param k600 Gas transfer coefficient for Schmidt number of 600
#' @return computed rearation flux
#' @export
computeRF <- function(temp, pressure, DO, k600) {
.Call(`_NSmetabolism_computeRF`, temp, pressure, DO, k600)
}
#' Compute gas transfer velocity for oxygen at a given temperature (m/day)
#' @param temp Water temperature (degrees C)
#' @param k600 Gas transfer coefficient for Schmidt number of 600 (m/day)
#' @references Wanninkhof R. (1992). Relationship between wind speed and gas exchange over the
#' ocean. Journal of Geophysical Research, 97, 7373.
#'
#' Van de Bogert, M.C., Carpenter, S.R., Cole, J.J. & Pace, M.L. (2007). Assessing pelagic
#' and benthic metabolism using free water measurements. Limnology and Oceanography:
#' Methods, 5, 145–155.
#' @return k at the given temperature (m/day)
kT <- function(temp, k600) {
.Call(`_NSmetabolism_kT`, temp, k600)
}
#' Compute dissolved oxygen saturation given temperature and pressure (mg/L OR g/m^3)
#' @param temp Water temperature (degrees C)
#' @param P atmospheric pressure, in hPa
#' @references Benson BB and Krause D. 1984. The concentration and isotopic fractionation of
#' oxygen dissolved in freshwater and seawater in equilibrium with the atmosphere.
#' Limnol. Oceanogr., 29, 620–632.
#'
#' Benson BB and Krause D. 1980. The concentration and isotopic fractionation of gases
#' dissolved in freshwater in equilibrium with the atmosphere. 1. Oxygen. Limnol.
#' Oceanogr., 25(4):662-671
#' @return oxygen saturation concentration at given temperature and pressure
osat <- function(temp, P) {
.Call(`_NSmetabolism_osat`, temp, P)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.