Skip to content

Commit

Permalink
Update documentation in isotope_conversion file.
Browse files Browse the repository at this point in the history
  • Loading branch information
rfiorella committed Dec 21, 2024
1 parent 4f1b498 commit 8de09e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ Description: Functions for downloading,
<doi:10.1029/2020JG005862>, and the readme
file at <https://github.com/lanl/NEONiso>. Tools for calibrating water
isotope products have been added as of 0.6.0, but have known deficiencies
and should be considered very experimental currently.
and should be considered experimental and unsupported.
License: GPL-3
BugReports: https://github.com/lanl/NEONiso/issues
URL: https://github.com/lanl/NEONiso,
https://lanl.github.io/NEONiso/
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
RoxygenNote: 7.3.0
Imports:
dplyr,
zoo,
Expand Down
31 changes: 26 additions & 5 deletions R/isotope_conversions.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
# break out functions that are various transformations
# of isotope ratios and delta values.
#------------------------------------------------------
#' get_Rstd
#' Return heavy-to-light isotope ratio of primary standard.
#'
#' Returns the heavy-to-light isotope ratio of the dominant
#' standard for that element. Vienna Standard Mean Ocean Water
#' (VSMOW) for oxygen and hydrogen isotopes, Vienna Pee Dee
#' Belemnite (VPDB) for carbon stable isotopes.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down Expand Up @@ -30,7 +35,10 @@ get_Rstd <- function(element) {
return(r)
}

#' R_to_delta
#' Convert heavy-to-light isotope ratio to delta values.
#'
#' Converts a heavy-to-light stable isotope ratio to
#' a corresponding delta value, in per mil values.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand All @@ -55,7 +63,10 @@ R_to_delta <- function(R_values, element) {
return(delta)
}

#' delta_to_R
#' Converts delta value to heavy-to-light isotope ratio
#'
#' Converts a delta value (in per mil) to the heavy-to-light
#' isotope ratio.
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand All @@ -80,7 +91,12 @@ delta_to_R <- function(delta_values, element) {

}

#' calculate_12CO2
#' Calculate 12C-CO2 Mole Fractions
#'
#' This function calculates mole fractions of 12CO2 based on the total CO2 mole
#' fraction, the delta13C value of the mixture, and the assumed fraction of CO2
#' that does not correspond to 12CO2 or 13CO2 (assumed fixed at 0.00474, e.g.,
#' Griffis et al. 2004 Agricultural and Forest Meteorology)
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down Expand Up @@ -110,7 +126,12 @@ calculate_12CO2 <- function(total_co2, delta13c, f = 0.00474) {
return(light_co2)
}

#' calculate_13CO2
#' Calculate 13C-CO2 Mole Fractions
#'
#' This function calculates mole fractions of 13CO2 based on the total CO2 mole
#' fraction, the delta13C value of the mixture, and the assumed fraction of CO2
#' that does not correspond to 12CO2 or 13CO2 (assumed fixed at 0.00474, e.g.,
#' Griffis et al. 2004 Agricultural and Frest Meteorology)
#'
#' @author Rich Fiorella \email{rfiorella@@lanl.gov}
#'
Expand Down

0 comments on commit 8de09e4

Please sign in to comment.