Chlorophyll Fluorescence


This calculates baseline, fv/fm, fs, and fm' for a standard chlorophyll flourescence measurement. This can be used either for Fv/Fm (dark adapted) fluorescence or Phi2 (ambient adapted). Fv/Fm will show no value for LEF since the light intensity is blank. To calculate baseline, it uses a small set of infra-red (940) pulses at the beginning of the run. This connects with the integrated fluorescence orange protocol. Note that Fv/Fm and Phi2 are equal under dark conditions!
var data = json.data_raw;
var output = {};
var sample_cal = MathMEAN(data.slice(2,18));

// retrieve the baseline information from the data JSON and save (using measuring light 15, calibrating light 14)
for (i in json.get_ir_baseline) {	
	if (json.get_ir_baseline[i][0] == 15) {
		var slope_light = json.get_ir_baseline[i][1];
		var yint_light = json.get_ir_baseline[i][2];
	}
	if (json.get_ir_baseline[i][0] == 14) {
		var slope_cal = json.get_ir_baseline[i][1];
		var yint_cal = json.get_ir_baseline[i][2];
	}
}

// calculate the baseline
var shinyness = (sample_cal-yint_cal)/slope_cal; // where 0 is dull black electrical tape, and 1 is shiny aluminum
var baseline = slope_light*shinyness+yint_light;

if (!baseline) {
  baseline = 0;
}

var Fss = MathMEAN(data.slice(22,38)) - baseline;
var FmPs = MathMEAN(data.slice(42,88)) - baseline; // take the 4 largest values and average them
var fvfms = (FmPs-Fss)/FmPs;

var Fs = MathMEAN(data.slice(21,24)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var sat_vals = data.slice(42,88).sort();  // sort the saturating light values from low to high
var FmP = MathMEAN(sat_vals.slice(43,46)) - baseline; // take the 4 largest values and average them
var fvfm = (FmP-Fs)/FmP;

var Fsnn = Fs+json.slope_34*10+json.yintercept_34;
var FmPnn = FmP+json.slope_34*10+json.yintercept_34;
var fvfmnn = (FmPnn-Fsnn)/FmPnn;

var Fsn = Fs + baseline;
var FmPn = FmP + baseline;
var fvfmn = (FmPn-Fsn)/FmPn;

var Fs_stdev = MathSTDEV(data.slice(22,38));
var Fm_stdev = MathSTDEV(data.slice(42,88));
var Fs_relative_stdev = (MathMEAN(data.slice(42,88))-MathMEAN(data.slice(22,38))) / MathSTDEV(data.slice(22,38));

output["Phi2"] = MathROUND(fvfm,3);
// only display LEF if there is a light intensity measurement > 0 
if (typeof json.light_intensity != "undefined" && json.light_intensity > 0) {
	output["LEF"] = MathROUND((fvfm  * 0.45 * json.light_intensity),3);
}

output["Fs"] = MathROUND(Fs,1);
output["FmPrime"] = MathROUND(FmP,1);
if (baseline != 0) {
  output["baseline"] = baseline;
}
else {
  output["baseline"] = 0;
}

return output;
{
  "time_offset": 300,
  "time": 1415192550559,
  "device_id": 49,
  "firmware_version": "0.340",
  "sample": [
    [
      {
        "time": 1415192550559,
        "protocol_id": 1,
        "slope_34": 26.09,
        "yintercept_34": 714.66,
        "slope_35": 0.05,
        "yintercept_35": 497.82,
        "get_ir_baseline": [
          [
            15,
            148.43,
            92.74
          ],
          [
            14,
            3183.41,
            3771.16
          ]
        ],
        "light_intensity": 37,
        "r": 33,
        "g": 31,
        "b": 30,
        "temperature": 24.09,
        "relative_humidity": 34.79,
        "data_raw": [
          2278,
          2239,
          2255,
          2235,
          2233,
          2251,
          2229,
          2224,
          2265,
          2209,
          2213,
          2283,
          2262,
          2299,
          2298,
          2280,
          2294,
          2282,
          2271,
          2283,
          5531,
          5570,
          5596,
          5687,
          5706,
          5754,
          5756,
          5798,
          5825,
          5825,
          5874,
          5885,
          5888,
          5918,
          5904,
          5937,
          5953,
          5934,
          5964,
          5938,
          5958,
          12388,
          12926,
          13112,
          13171,
          13226,
          13283,
          13312,
          13335,
          13384,
          13426,
          13452,
          13468,
          13525,
          13480,
          13549,
          13563,
          13576,
          13577,
          13583,
          13590,
          13590,
          13592,
          13621,
          13607,
          13626,
          13619,
          13608,
          13633,
          13537,
          13622,
          13620,
          13623,
          13647,
          13628,
          13634,
          13559,
          13662,
          13662,
          13631,
          13634,
          13649,
          13664,
          13655,
          13669,
          13620,
          13672,
          13668,
          13656,
          13650,
          13664,
          12572,
          11594,
          10791,
          10110,
          9493,
          9018,
          8553,
          8230,
          7929,
          7692,
          7500,
          7295,
          7172,
          7033,
          6940,
          6858,
          6738,
          6676,
          6662
        ]
      }
    ]
  ]
}
Screen shot 2017 05 31 at 12.23.10 pm
Created by

PhotosynQ Admin


Protocol connections:
106
Latest Update:
Jan 2018