# Read an example Licor file included in the PhotoGEA package
licor_file <- read_gasex_file(
PhotoGEA_example_file_path('c3_aci_1.xlsx')
)
# Define a new column that uniquely identifies each curve
licor_file[, 'species_plot'] <-
paste(licor_file[, 'species'], '-', licor_file[, 'plot'] )
# Organize the data
licor_file <- organize_response_curve_data(
licor_file,
'species_plot',
c(9, 10, 16),
'CO2_r_sp'
)
# Calculate the total pressure in the Licor chamber
licor_file <- calculate_total_pressure(licor_file)
# Calculate temperature-dependent values of C3 photosynthetic parameters
licor_file <- calculate_temperature_response(licor_file, c3_temperature_param_bernacchi)
# Define an error function for one curve from the set
error_fcn <- error_function_c3_aci(
licor_file[licor_file[, 'species_plot'] == 'tobacco - 1', , TRUE]
)
# Evaluate the error for:
# alpha_old = 0
# J_at_25 = 236
# RL_at_25 = 4e-8
# Tp_at_25 = 22.7
# Vcmax_at_25 = 147
error_fcn(c(0, 236, 4e-8, 22.7, 147))
# Make a plot of likelihood vs. Vcmax when other parameters are fixed to the
# values above.
vcmax_error_fcn <- function(Vcmax) {error_fcn(c(0, 236, 4e-8, 22.7, Vcmax))}
vcmax_seq <- seq(135, 152, length.out = 41)
lattice::xyplot(
exp(-sapply(vcmax_seq, vcmax_error_fcn)) ~ vcmax_seq,
type = 'b',
xlab = 'Vcmax_at_25 (micromol / m^2 / s)',
ylab = 'Negative log likelihood (dimensionless)'
)
Run the code above in your browser using DataLab