GithubHelp home page GithubHelp logo

tekknosol / glimmr Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 824 KB

Compute gasfluxes with R

Home Page: https://tekknosol.github.io/glimmr/

License: GNU General Public License v3.0

R 98.30% Rebol 1.70%
limnology ghg biogeochemistry gasexchange

glimmr's Introduction

glimmr

Gas Fluxes and Dynamic Chamber Measurements

tidyverse_lifecycle_badge Travis-CI Build Status

Overview

The glimmr package provides functions to convert high frequency concentration data obtained by (dynamic-) chamber measurements into gasfluxes. Data recorded with different devices can be processed automatically. The data is separated into chunks covering the single chamber applications and containing additional meta information (e.g. IDs, temperature…) provided by a metadata file.

Furthermore glimmr contains functions to calculate gasfluxes with the ‘Boundary Layer Equation’ (BLE).

To calculate gasfluxes from high frequency chamber measurements, glimmr offers a cusomizable system of gas analyzer definitions (analyzer()), as well as two preconfigured devices with read_, process_ and inspect_ functions:

  • process_chamber() & inspect_chamber(): custom devices
  • read_gasmet(), process_gasmet() & inspect_gasmet(): GASMET
  • read_losgatos(), process_losgatos() & inspect_losgatos(): LosGatos

Installation

# The package is not released on CRAN yet.
# Development version from GitHub:
# install.packages("devtools")
devtools::install_github("tekknosol/glimmr")

Getting started

Calculate fluxes from device records and a meta file containing information about single measurements. Fluxes are reported in [mmol/m²/d] using linear model fitting and robust linear model fitting with robust::lmRob()

# read data
gasmet <- read_gasmet("path/to/gasmet_file.txt")
meta_gasmet <- read_csv("path/to/meta_file.csv")

# create diagnostic plot(s)
inspect_gasmet(gasmet, meta_gasmet)

Diagnosis plot

# compute fluxes in mmol/m²/d
# F_LM: Liner Model
# F_RLM: Robust Liner Model
process_gasmet(gasmet, meta_gasmet)
#> End of interval determined by number of observations. Count = 10
#> Using temperature from meta file. Column = temp
#> # A tibble: 18 x 9
#>    date       site  begin               gas     rep     F_LM   LM_r2
#>    <date>     <chr> <dttm>              <chr> <dbl>    <dbl>   <dbl>
#>  1 2017-04-12 plotA 2017-04-12 09:01:49 CH4       1  0.0259  0.0119 
#>  2 2017-04-12 plotA 2017-04-12 09:08:56 CH4       2 -0.144   0.360  
#>  3 2017-04-12 plotA 2017-04-12 09:14:25 CH4       3  0.0980  0.118  
#>  4 2017-04-12 plotB 2017-04-12 16:47:41 CH4       1  0.0151  0.00160
#>  5 2017-04-12 plotB 2017-04-12 16:55:41 CH4       2 -0.0601  0.0449 
#>  6 2017-04-12 plotB 2017-04-12 17:02:20 CH4       3  0.107   0.307  
#>  7 2017-04-12 plotA 2017-04-12 09:01:49 CO2       1 -7.58    0.533  
#>  8 2017-04-12 plotA 2017-04-12 09:08:56 CO2       2  1.73    0.0987 
#>  9 2017-04-12 plotA 2017-04-12 09:14:25 CO2       3 -0.945   0.101  
#> 10 2017-04-12 plotB 2017-04-12 16:47:41 CO2       1 25.9     0.987  
#> 11 2017-04-12 plotB 2017-04-12 16:55:41 CO2       2 23.1     0.953  
#> 12 2017-04-12 plotB 2017-04-12 17:02:20 CO2       3 26.6     0.991  
#> 13 2017-04-12 plotA 2017-04-12 09:01:49 N2O       1 -0.0419  0.282  
#> 14 2017-04-12 plotA 2017-04-12 09:08:56 N2O       2  0.0262  0.279  
#> 15 2017-04-12 plotA 2017-04-12 09:14:25 N2O       3  0.0111  0.153  
#> 16 2017-04-12 plotB 2017-04-12 16:47:41 N2O       1  0.00409 0.0134 
#> 17 2017-04-12 plotB 2017-04-12 16:55:41 N2O       2  0.0154  0.176  
#> 18 2017-04-12 plotB 2017-04-12 17:02:20 N2O       3  0.0121  0.0712 
#> # … with 2 more variables: F_RLM <dbl>, RLM_r2 <dbl>

Calculate gas transfer coefficient used with the Boundary Layer Equation (BLE).

# Windpseed in m/s
windspeed <- c(2, 4.3, 1.8) 
# Water temperature in °C
watertemperature <- c(18, 21, 19.3) 

# Calculate gas transfer coefficient
calc_kW(windspeed, watertemperature)
#> [1] 1.488888 7.426978 1.246858

glimmr's People

Contributors

tekknosol avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

glimmr's Issues

rename package

  • rename .rproj file
  • rename folder
  • git remote set-url origin [GitHub repo URL]
  • change value of package property in DESCRIPTION
  • rename pkg-name.R
  • edit README (title, ...)

gerneralization of preprocess_gasmet()

  • Don't restrict to CO2 AND CH4
  • use default windowsize if not provided
  • use default meta information if not provided
  • warn or throw error when air pressure is missing

offset notation

0:0 notation written in excel causes csv file to include 00:00:00
Maybe use different separator

LosGatos temperature

use temperature:
start & end provided: mean
start provided: start
non provided: LosGatos ambient temperature

CRAN release v0.2.0

  • Check that description is informative
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Polish NEWS
  • If new failures, update email.yml then revdepcheck::revdep_email_maintainers()
  • Bump version (in DESCRIPTION and NEWS)
  • devtools::check_win_devel() (again!)
  • devtools::submit_cran()
  • pkgdown::build_site()
  • Approve email
  • Tag release
  • Bump dev version
  • Write blog post
  • Tweet

read LosGatos folder

function to read all files within specific LosGatos folder.
use ziped files and txt only when no zip is existing

Define custom devices

Define custom device to call functions like:

device <- analyzer(...)
process_chamber(data, meta, device)
inspect_chamber(data, meta, device)
  • implement analyzer as S3 objects
  • allow gals to be updated
  • update documentation

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.