one minute - RG - final


use for one minute protocol
var data = json.data_raw;
var output = {};
var sample_cal = MathMEAN(data.slice(1,9));

// 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;

var F0 = MathMEAN(data.slice(52,60)) - baseline;
var Fm_sort = data.slice(61,110).sort();
var Fm = MathMEAN(Fm_sort.slice(44,49)) - baseline; // take the 4 largest values and average them
var fvfm = (Fm-F0)/Fm;


var Fs = MathMEAN(data.slice(150,160)) - baseline;
var sat_vals = data.slice(161,210).sort();  // sort the saturating light values from low to high
var FmP = MathMEAN(sat_vals.slice(44,49)) - baseline; // take the 4 largest values and average them
var Phi_1 = (FmP-Fs)/FmP;
var Fs_end = MathMEAN(data.slice(255,260));
var F0P_sort = data.slice(260,310).sort();
var F0Prime = MathMEAN(F0P_sort.slice(0,5)) - baseline;

var NPQ = (Fm - FmP) / FmP;

output["F0"] = MathROUND(F0,0);
output ["Fm"] = MathROUND(Fm,0);
output["Fv/Fm"] = MathROUND(fvfm,3);
output ["Fmp"] = MathROUND(FmP,0);
output ["Fs"] = MathROUND(Fs,0);
output ["PhiII"] = MathROUND(Phi_1,3);
output ["Fs end"] = MathROUND(Fs_end,0);
output ["F0'"] = MathROUND(F0Prime,0);
output ["NPQ"] = MathROUND(NPQ,3);


return output;
{
  "time_offset": 180,
  "time": 1472151857047,
  "device_id": 109,
  "firmware_version": "0.450",
  "sample": [
    [
      {
        "time": 1472151857047,
        "protocol_id": 1,
        "get_ir_baseline": [
          [
            15,
            4.31,
            -0.1
          ],
          [
            14,
            6188.48,
            6930.63
          ]
        ],
        "data_raw": [
          3746,
          3729,
          3741,
          3700,
          3763,
          3719,
          3734,
          3708,
          3674,
          3711,
          2029,
          2075,
          2103,
          2127,
          2155,
          2164,
          2196,
          2203,
          2214,
          2245,
          2269,
          2280,
          2280,
          2305,
          2296,
          2294,
          2324,
          2334,
          2352,
          2352,
          2348,
          2354,
          2373,
          2354,
          2382,
          2390,
          2378,
          2382,
          2409,
          2392,
          2413,
          2396,
          2394,
          2402,
          2397,
          2432,
          2424,
          2421,
          2421,
          2417,
          2394,
          2435,
          2402,
          2418,
          2429,
          2410,
          2419,
          2398,
          2411,
          2414,
          2415,
          7042,
          7699,
          7963,
          8070,
          8148,
          8207,
          8227,
          8240,
          8253,
          8275,
          8279,
          8324,
          8322,
          8340,
          8328,
          8338,
          8343,
          8339,
          8337,
          8353,
          8350,
          8366,
          8357,
          8384,
          8364,
          8370,
          8390,
          8372,
          8369,
          8396,
          8393,
          8369,
          8364,
          8373,
          8364,
          8396,
          8384,
          8377,
          8363,
          8372,
          8390,
          8375,
          8398,
          8361,
          8374,
          8363,
          8362,
          8377,
          8409,
          5443,
          5440,
          5431,
          5456,
          5448,
          5436,
          5419,
          5443,
          5435,
          5436,
          5436,
          5448,
          5458,
          5447,
          5426,
          5458,
          5470,
          5458,
          5420,
          5435,
          5443,
          5461,
          5441,
          5451,
          5468,
          5460,
          5455,
          5469,
          5437,
          5453,
          5430,
          5438,
          5454,
          5459,
          5446,
          5441,
          5442,
          5458,
          5438,
          5428,
          5452,
          5462,
          5443,
          5456,
          5431,
          5442,
          5460,
          5453,
          5453,
          5436,
          5546,
          5582,
          5593,
          5565,
          5591,
          5578,
          5586,
          5578,
          5608,
          5599,
          5588,
          5620,
          5620,
          5597,
          5595,
          5601,
          5627,
          5631,
          5632,
          5609,
          5622,
          5622,
          5609,
          5605,
          5625,
          5633,
          5632,
          5619,
          5620,
          5627,
          5609,
          5613,
          5596,
          5616,
          5601,
          5605,
          5621,
          5619,
          5623,
          5628,
          5595,
          5590,
          5618,
          5635,
          5613,
          5626,
          5609,
          5616,
          5595,
          5586,
          5363,
          5363,
          5357,
          5427,
          5379,
          5370,
          5391,
          5352,
          5373,
          5439,
          5376,
          5389,
          5393,
          5354,
          5382,
          5429,
          5368,
          5389,
          5371,
          5378,
          5370,
          5439,
          5380,
          5387,
          5378,
          5367,
          5368,
          5399,
          5396,
          5377,
          5375,
          5351,
          5379,
          5386,
          5378,
          5396,
          5360,
          5383,
          5371,
          5410,
          5376,
          5385,
          5399,
          5379,
          5381,
          5412,
          5390,
          5393,
          5376,
          5359,
          5369,
          5118,
          4984,
          4892,
          4775,
          4696,
          4624,
          4604,
          4541,
          4521,
          4494,
          4473,
          4455,
          4422,
          4379,
          4402,
          4367,
          4317,
          4345,
          4310,
          4320,
          4316,
          4266,
          4286,
          4280,
          4283,
          4268,
          4246,
          4239,
          4230,
          4220,
          4266,
          4272,
          4316,
          4335,
          4382,
          4410,
          4550,
          4459,
          4509,
          4553,
          4580,
          4597,
          4696,
          4687,
          4685,
          4707,
          4164,
          4163,
          4156
        ]
      }
    ]
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.5",
  "app_device": "x86-32",
  "location": [
    "-32.9700143",
    "-60.6247898"
  ]
}
Img 20171030 190259
Created by

Rodrigo Gomez


Protocol connections:
2
Latest Update:
Aug 2016