Coder Social home page Coder Social logo

paukes / eee2eye Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 2.26 MB

A simple package to calculate the evaporation to input (E:I) ratio for a lake based on d18O-H2O (can be used to assess water balances or water residence time). The calculation needs the lake's steady-state isotope value, source water, precipitation value, temperature, humidity, and seasonality.

License: Other

R 100.00%
isotope water lakes

eee2eye's Introduction

eee2eye

Calculating E:I Values from δ18O-H~2~O (‰)

Please see ‘EI-Calculations.pdf’ in the ‘man/ei_calcs’ folder for a step-by-step description of the Isotope Mass Balance used to calculate E:I.

Briefly, this function calculates E:I ratios, based on δ18O-H~2~O data. Environmental conditions (i.e. evaporation rate, humidity, temperatures, etc.) are set for the sub-arctic around Yellowknife, NT.

The function is based on a table with the following input parameters per sample:

  • dL (‰) = -11.77, steady-state lake isotope value (measured value from field)
  • dI (‰) = -20.7, source water, likely precipitation (value from Gibson 2001 and GNIP 1999)
  • dP (‰) = -23, average value during evaporation season (signal of rain)
  • temp (C) = 14.3, average temp. on lake (from Gibson & Reid, 2010)
  • humid (dec) = 0.68, relative humidity (from Gibson & Reid, 2010)
  • k = 0.7, estimated for our area (see ‘Note’ at bottom to calculate an approximate value)

Installation

remotes::install_github("paukes/eee2eye")

Example E:I Calculation

Load the package

library(eee2eye)

Add E:I ratios to the data.frame of field data:

# create example database
ei_input <- data.frame(dL_permille = c(-11.77, -15.67, -18.23),
                       dI_permille = c(-20.7, -18.2, -20.2),
                       dP_permille = c(-23, -28, -32), 
                       temp_C = c(14.3, 12.1, 8.9), 
                       h_dec = c(0.68, 0.71, 0.58), 
                       k = c(0.7, 0.72, 0.65))

# add calculated E:I values
ei_input <- eee2eye(ei_input, 'dL_permille', 'dI_permille', 'dP_permille', 'temp_C', 'h_dec', 'k')

Add E:I ratios to a data.frame of field data when not all input values are known or estimated for each field site so common values can be specified:

ei_input <- eee2eye(ei_input, 'dL_permille', -20.7, 'dP_permille', 14.3, 0.68, 0.7)

See the vignette for more information.

Example WRT Calculation

# create example database
ei_input <- data.frame(E.I = c(0.2042, 0.3138, 0.1838),
                      e_myr = c(0.3965, 0.3965, 0.3965),
                      SA_m2 = c(315900, 300825, 589950),
                      V_m3 = c(2466000, 3004064, 5712829))

# add calculated WRT values
ei_input <- eee2eye_WRT(ei_input, 'E.I', 'e_myr', 'SA_m2', 'V_m3')

A Note About the Seasonality Value (k):

k is a very difficult parameter to quantify in that we don’t know much about it. For this reason we created a small function that you could approximate a k value based on the decimal latitude of your sampling site:

k_season <- function(x) {
  k <- (((90 - x) / 90 ) * 0.5) + 0.5
  return(k)
}

eee2eye's People

Contributors

jjvenky avatar paukes avatar

Watchers

 avatar

Forkers

jjvenky

eee2eye's Issues

Water Residence Times

Next step is to include the ability to calculate water residence times from the E/I ratio.

Two ideas about how to structure this:

  1. new function that takes all the inputs like eee2eye(ei_input, 'dL_permille', 'dI_permille', 'dP_permille', 'temp_C', 'h_dec', 'k') but adds evap rate, surface area, and volume; then it calls the original eee2eye() and then does the final WRT calculation

  2. new function that takes calculated E/I ratios and plus evap rate, surface area, and volume and then does the final WRT calculation; this would be two function calls to get both E/I and WRT

I prefer the second one because it is a clearer separation of steps.

Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.