Skip to content

Instantly share code, notes, and snippets.

View VEZY's full-sized avatar

Rémi Vezy VEZY

View GitHub Profile
# Script to reproduce the figure A1: Tuzet et al. (2003) conductance model parameterization using 6 Coffea
# sprouts sap fluxes and leaf water potential. (1) Sf and Ψf parameters fit using data Ψmin and Ψmax data from (Dauzat et al., 2001) ;
# (2) Root-to-leaf plant conductivity (K) and (3) G0 and G1 parameters fitting.
# Importing packages ------------------------------------------------------
library(RColorBrewer)
CustomPalette= rev(brewer.pal(4, "RdYlBu")) # Not very nice for screen but Colorblind friendly (difficult for so many colors).
Linecolors= list(Measurement= CustomPalette[1],
Simulated= CustomPalette[3],
@VEZY
VEZY / expand_grid.jl
Last active August 22, 2019 13:33
R's expand.grid() equivalent in Julia
using DataFrames
"""
Create a Data Frame from All Combinations of Factor Variables (see R's base::expand.grid)
# Arguments
... Array, Dict, or Tuple containing at least one value
# Return
A DataFrame containing one row for each combination of the supplied argument. The first factors vary fastest.
@VEZY
VEZY / LUE_Van_Oijen_et_al._2010.R
Created November 6, 2019 13:42
Computation of the light use efficiency following Van Oijen et al. (2010), used in CAF2007 model.
LUE= function(CO2A,Tair,PAR,K,RUBISC){
# CO2A in ppm
# Tair in degC
# PAR in MJ PAR m-2 ground d-1
# K in m2 ground m-2 leaf
# RUBISC in g Rubisco m-2 leaf
EAVCMX = 68000 # (J mol-1)
EAKMC = 65800 # (J mol-1)
EAKMO = 1400 # (J mol-1)