Skip to content

Instantly share code, notes, and snippets.

View dlebauer's full-sized avatar
😀

David LeBauer dlebauer

😀
View GitHub Profile
pft variable phylogeny distn parama paramb n citation
forb_priors mort2 plants gamma 1.47 0.0578 0 LeBauer 2010 Expert Prior
forb_priors growth_resp_factor grass beta 2.63 6.52 0 LeBauer 2010 Expert Prior
forb_priors fineroot2leaf grass lnorm 0.811 0.843 0 Chapin 2002 Principles of Terrestrial Ecosystem Ecology
forb_priors root_turnover_rate grass weibull 1.67 0.657 66 Gill 2000 Global patterns of root turnover for terrestrial ecosystems
forb_priors seedling_mortality monocots beta 3.61 0.433 0 LeBauer 2010 Expert Prior
forb_priors Vcmax lnorm 4.51 0.64 19 Wullschleger 1993 Biochemical Limitations to Carbon Assimilation in C3 Plants: A Retrospective Analysis of the A/Ci Curves from 109 Species
forb_priors root_respiration_rate angiosperm gamma 4.95 0.762 36 George 2003 Fine-root respiration in a loblolly pine and sweetgum forest growing in elevated CO2
forb_priors r_fract plants beta 2 4 0 LeBauer 2010 Expert Prior
forb_priors c2n_leaf grass gamma 4.18 0.13 95 Wright 2004 The world-wide leaf economics spectr
@dlebauer
dlebauer / README.md
Last active March 18, 2022 21:16
UA Drone Day 2022 flight plan

flight_plan_sm

sum_out <- broom.mixed::tidyMCMC(coda_out, conf.int = TRUE, conf.level = 0.95) %>%
rename(mean = estimate, sd = std.error, pc2.5 = conf.low, pc97.5 = conf.high) %>%
mutate(sig = if_else(pc2.5 * pc97.5 > 0, TRUE, FALSE)) # test if UCL and LCL both have the same sign
years <- data.frame(year_index = 1:length(unique(x$year)), year = unique(x$year))
states <- data.frame(state_index = 1:length(unique(x$state)), state = unique(x$state))
sum_rep <- broom.mixed::tidyMCMC(coda_rep, conf.int = TRUE, conf.level = 0.95) %>%
rename(mean = estimate, sd = std.error, pc2.5 = conf.low, pc97.5 = conf.high) %>%
separate(term, sep = '\\[|\\]|,', into = c('term', 'i', 'j', 'other'), convert = TRUE) %>%
@dlebauer
dlebauer / organic_ag_data_nass_quickstats.R
Created July 27, 2021 18:24
start to wrangle NASS quickstats organic survey data
#CSV downloaded from https://quickstats.nass.usda.gov/results/12827E57-2B20-368C-A91F-1B97FF8F7B35#E2E0BF24-9F88-35DB-8526-8E47D941FDBF
library(dplyr)
library(tidyr)
nass_data <- readr::read_csv("raw_data/E2E0BF24-9F88-35DB-8526-8E47D941FDBF.csv",na = '(D)',
skip = 1,
col_names = c(
"program", "period", "week_ending", "geo_level", "state", "state_ansi",
"ag_district", "ag_district_code", "county", "county_ansi", "zip_code",
"region", "watershed_code", "watershed", "commodity", "data_item",
@dlebauer
dlebauer / download_terraref_from_dryad.R
Created July 27, 2021 18:21
code to download and unzip trait data from Dryad and then plot it
library(ggplot2)
library(dplyr)
download.file(url = 'https://datadryad.org/stash/downloads/file_stream/624637', destfile = 'trait_data.zip', mode = 'wb')
unzip(zipfile = 'trait_data.zip', unzip = 'unzip')
s6heights <- readr::read_csv('traits/season_6_traits/season_6_canopy_height_sensor.csv')
s4heights <- readr::read_csv('traits/season_4_traits/season_4_canopy_height_sensor.csv')
heights <- bind_rows(s4heights, s6heights)
select
t.treatment_id :: text as treatmentDbId,
t.site_id :: text as observationUnitDbId,
t.variable_id :: text as observationVariableDbId,
v.name as observationVariableName,
t.id :: text as observationDbId,
t.mean :: text as value,
t.date as observationTimeStamp,
s.sitename as observationUnitName,
t.cultivar_id :: text as germplasmDbId,
@dlebauer
dlebauer / MAB.R
Last active April 10, 2021 01:47
how much easier is it to estimate a mean than a minimum?
n_sim <- 10000
mu <- -10
sd <- 2
n <- 30
z <- array(NA, c(3,n_sim))
for(i in 1:n_sim){
x <- rnorm(n, mu, sd)
z[1, i] <- mean(x)

Environment comparisons

This folder contains code used to compare setaria growth in different environments.

Contents:

  • inputs/

  • scripts/ folder:

@dlebauer
dlebauer / pecan.xml
Created January 28, 2021 20:03
testing out met workflow from web interface
<?xml version="1.0"?><pecan>
<info>
<notes/>
<userid>-1</userid>
<username/>
<date>2021/01/28 19:56:08 +0000</date>
</info>
<outdir>/data/workflows/PEcAn_99000000009</outdir>
<database>
<bety>
@dlebauer
dlebauer / simple_purple_shaker.py
Last active January 16, 2021 18:07
Pyzero implementation of the purple shaker guy from scratch
import pgzrun
import time
import random
WIDTH = 400
HEIGHT = 400
guy = Actor("purple_guy")
guy.pos = (200, 200)
guy.angle = -25