PSI


alternating 850nm and 940 nm
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 7/27/2016
//============================================

//Define the output object here
var output = {};

output["850nm"] = [];
output['940nm'] = [];
output['850nm-940nm'] = [];
output["abs850nm"] = [];
output["abs940nm"] = [];

//Check if the key time exists in json

for(i=0,len=json.data_raw.length;i<len;i++){
	
   if(i % 2){
      output['940nm'].push(json.data_raw[i]);
   }
   else{
      output['850nm'].push(json.data_raw[i]);
   }
    
}
for(i in output['850nm']){
   output['abs850nm'].push(MathLOG(output['850nm'][i]/output['850nm'][0])*-1);
}

for(i in output['940nm']){
  
  
   output['abs940nm'].push(MathLOG(output['940nm'][i]/output['940nm'][0])*-1);
} 
for(i in output['abs850nm']){
	
  if(output['abs850nm'][i] !== undefined && output['abs940nm'][i] !== undefined ){
		output['850nm-940nm'].push(output['abs850nm'][i] - output['abs940nm'][i]);
  }
}
delete output["850nm"]; 
delete output["940nm"];
var a = MathMEAN(output['850nm-940nm'].slice(138,148));
var b = MathMEAN(output['850nm-940nm'].slice(338,348));
var c = MathMEAN(output['850nm-940nm'].slice(438,448));
var d = MathMEAN(output['850nm-940nm'].slice(538,548));

output["p700"] = (b-a);
output["p700+"] = (a-c);
output["p700-"] = (d-b);
output["phi1"] = (b-a)/(d-c); 
output["d-c"] = (d-c); 
output["d"] = d;
output["c"] = c;
output["a"] = a;
output["b"] = b;
//Return data
return output;
{
  "time_offset": 240,
  "time": 1469729370144,
  "device_version": "1",
  "device_id": "d4:f5:7f:ff:ff:ff",
  "device_battery": 28,
  "device_firmware": "1.05",
  "firmware_version": "1.05",
  "device_time": 1467909946,
  "sample": [
    [
      {
        "time": 1469729370149,
        "protocol_id": 1,
        "averages": 32,
        "data_raw": [
          47274,
          31,
          46723,
          10,
          46738,
          10,
          46750,
          10,
          46766,
          10,
          46780,
          10,
          46791,
          11,
          46804,
          11,
          46807,
          10,
          46813,
          10,
          46821,
          11,
          46825,
          10,
          46829,
          11,
          46833,
          11,
          46829,
          11,
          46835,
          11,
          46835,
          10,
          46836,
          11,
          46837,
          11,
          46838,
          11,
          46836,
          11,
          46836,
          11,
          46837,
          11,
          46837,
          10,
          46839,
          11,
          46838,
          11,
          46839,
          11,
          46839,
          11,
          46838,
          11,
          46842,
          11,
          46840,
          11,
          46840,
          11,
          46841,
          11,
          46839,
          11,
          46837,
          11,
          46839,
          11,
          46838,
          11,
          46844,
          11,
          46840,
          11,
          46845,
          11,
          46840,
          11,
          46838,
          11,
          46838,
          11,
          46839,
          11,
          46840,
          11,
          46842,
          11,
          46841,
          11,
          46840,
          11,
          46837,
          11,
          46838,
          11,
          46838,
          172,
          46813,
          76,
          46780,
          68,
          46761,
          64,
          46749,
          62,
          46748,
          61,
          46746,
          60,
          46746,
          60,
          46745,
          59,
          46744,
          59,
          46743,
          59,
          46740,
          59,
          46741,
          59,
          46742,
          59,
          46742,
          59,
          46738,
          59,
          46738,
          59,
          46741,
          58,
          46738,
          59,
          46737,
          59,
          46742,
          59,
          46739,
          58,
          46739,
          58,
          46734,
          58,
          46737,
          58,
          46734,
          58,
          46738,
          58,
          46735,
          58,
          46733,
          58,
          46737,
          58,
          46734,
          58,
          46734,
          58,
          46734,
          58,
          46735,
          58,
          46732,
          58,
          46727,
          58,
          46731,
          58,
          46729,
          58,
          46731,
          58,
          46734,
          58,
          46731,
          58,
          46730,
          58,
          46730,
          58,
          46727,
          58,
          46728,
          58,
          46728,
          58,
          46727,
          58,
          46727,
          58,
          46725,
          58,
          46727,
          58,
          46730,
          58,
          46727,
          58,
          46726,
          58,
          46725,
          58,
          46724,
          58,
          46725,
          58,
          46723,
          58,
          46728,
          58,
          46724,
          58,
          46728,
          58,
          46726,
          57,
          46726,
          58,
          46723,
          58,
          46724,
          58,
          46724,
          58,
          46726,
          58,
          46725,
          58,
          46722,
          58,
          46721,
          58,
          46725,
          58,
          46724,
          58,
          46723,
          58,
          46721,
          58,
          46719,
          58,
          46720,
          58,
          46720,
          58,
          46721,
          58,
          46720,
          58,
          46720,
          58,
          46720,
          58,
          46718,
          58,
          46720,
          58,
          46719,
          58,
          46715,
          58,
          46715,
          58,
          46717,
          58,
          46715,
          58,
          46716,
          58,
          46714,
          58,
          46714,
          58,
          46716,
          58,
          46714,
          58,
          46717,
          58,
          46715,
          58,
          46715,
          58,
          46717,
          58,
          46713,
          58,
          46713,
          58,
          46711,
          58,
          46712,
          58,
          46708,
          8,
          46678,
          10,
          46693,
          10,
          46715,
          10,
          46729,
          10,
          46744,
          11,
          46756,
          10,
          46767,
          10,
          46779,
          10,
          46781,
          10,
          46787,
          11,
          46790,
          10,
          46795,
          11,
          46796,
          11,
          46799,
          11,
          46804,
          11,
          46802,
          11,
          46803,
          11,
          46802,
          11,
          46802,
          10,
          46806,
          11,
          46805,
          11,
          46805,
          11,
          46806,
          11,
          46809,
          11,
          46805,
          11,
          46808,
          11,
          46806,
          10,
          46810,
          11,
          46806,
          11,
          46813,
          11,
          46811,
          11,
          46809,
          11,
          46807,
          11,
          46812,
          11,
          46809,
          11,
          46810,
          11,
          46809,
          11,
          46806,
          11,
          46812,
          11,
          46808,
          11,
          46807,
          11,
          46811,
          11,
          46809,
          11,
          46811,
          10,
          46807,
          11,
          46808,
          11,
          46811,
          11,
          46813,
          11,
          46813,
          11,
          46812,
          11,
          46815,
          11,
          46811,
          11,
          46814,
          11,
          46812,
          11,
          46814,
          11,
          46809,
          11,
          46810,
          11,
          46811,
          11,
          46812,
          11,
          46810,
          11,
          46813,
          11,
          46810,
          11,
          46808,
          11,
          46807,
          11,
          46812,
          11,
          46809,
          11,
          46812,
          11,
          46810,
          11,
          46811,
          11,
          46811,
          11,
          46806,
          11,
          46809,
          11,
          46809,
          11,
          46809,
          11,
          46810,
          11,
          46812,
          11,
          46810,
          11,
          46810,
          11,
          46811,
          11,
          46812,
          11,
          46814,
          11,
          46810,
          11,
          46811,
          11,
          46815,
          11,
          46813,
          11,
          46812,
          11,
          46813,
          11,
          46814,
          11,
          46812,
          11,
          46812,
          11,
          46812,
          11,
          46816,
          11,
          46815,
          11,
          46813,
          11,
          46812,
          11,
          46812,
          11,
          46816,
          11,
          46811,
          11,
          46815,
          11,
          46814,
          67,
          46597,
          73,
          46546,
          71,
          46524,
          67,
          46511,
          66,
          46509,
          65,
          46506,
          64,
          46500,
          64,
          46499,
          63,
          46496,
          63,
          46496,
          64,
          46498,
          64,
          46495,
          64,
          46494,
          64,
          46494,
          64,
          46493,
          64,
          46489,
          63,
          46489,
          64,
          46490,
          63,
          46488,
          64,
          46489,
          64,
          46491,
          63,
          46486,
          63,
          46486,
          63,
          46486,
          63,
          46490,
          63,
          46484,
          63,
          46486,
          63,
          46483,
          63,
          46482,
          63,
          46482,
          63,
          46480,
          63,
          46483,
          63,
          46481,
          63,
          46480,
          63,
          46480,
          63,
          46481,
          63,
          46479,
          63,
          46474,
          63,
          46478,
          63,
          46475,
          63,
          46475,
          63,
          46478,
          63,
          46477,
          63,
          46475,
          63,
          46474,
          63,
          46474,
          63,
          46474,
          63,
          46472,
          63,
          46472,
          63,
          46470,
          63,
          46472,
          63,
          46472,
          63,
          46471,
          63,
          46469,
          63,
          46474,
          63,
          46470,
          63,
          46469,
          63,
          46470,
          63,
          46470,
          63,
          46470,
          63,
          46469,
          62,
          46469,
          63,
          46469,
          63,
          46467,
          62,
          46468,
          63,
          46469,
          63,
          46466,
          63,
          46468,
          62,
          46466,
          63,
          46466,
          63,
          46467,
          63,
          46465,
          63,
          46463,
          63,
          46464,
          63,
          46463,
          63,
          46465,
          62,
          46462,
          63,
          46462,
          63,
          46463,
          63,
          46462,
          63,
          46463,
          63,
          46464,
          63,
          46463,
          63,
          46462,
          62,
          46464,
          63,
          46463,
          63,
          46460,
          62,
          46460,
          63,
          46458,
          63,
          46458,
          63,
          46459,
          63,
          46461,
          63,
          46457,
          63,
          46458,
          63,
          46460,
          63,
          46459,
          63,
          46456,
          62,
          46458,
          62,
          46457,
          63,
          46458,
          8,
          46644,
          10,
          46678,
          10,
          46696,
          10,
          46714,
          10,
          46727,
          10,
          46738,
          10,
          46752,
          10,
          46758,
          10,
          46767,
          10,
          46771,
          10,
          46780,
          11,
          46781,
          10,
          46784,
          10,
          46787,
          11,
          46789,
          11,
          46789,
          11,
          46792,
          11,
          46787,
          11,
          46793,
          11,
          46795,
          11,
          46792,
          11,
          46794,
          11,
          46790,
          11,
          46793,
          11,
          46793,
          11,
          46795,
          11,
          46797,
          11,
          46796,
          11,
          46794,
          11,
          46793,
          11,
          46796,
          11,
          46792,
          11,
          46793,
          11,
          46796,
          11,
          46796,
          11,
          46799,
          11,
          46794,
          11,
          46796,
          11,
          46793,
          11,
          46795,
          11,
          46795,
          11,
          46798,
          11,
          46799,
          11,
          46796,
          11,
          46794,
          11,
          46795,
          11,
          46798,
          11,
          46796,
          11,
          46799,
          11,
          46802,
          11,
          46801,
          11,
          46800,
          11,
          46800,
          11,
          46801,
          11,
          46800,
          11,
          46800,
          11,
          46802,
          11,
          46801,
          11,
          46802,
          11,
          46800,
          11,
          46801,
          11,
          46801,
          11,
          46802,
          11,
          46801,
          11,
          46802,
          11,
          46800,
          11,
          46801,
          11,
          46800,
          11,
          46802,
          11,
          46802,
          11,
          46802,
          11,
          46801,
          11,
          46801,
          11,
          46803,
          11,
          46802,
          11,
          46801,
          11,
          46801,
          11,
          46801,
          11,
          46803,
          11,
          46801,
          11,
          46804,
          11,
          46802,
          11,
          46801,
          11,
          46804,
          11,
          46801,
          11,
          46800,
          12,
          46803,
          11,
          46803,
          11,
          46803,
          11,
          46802,
          11,
          46803,
          11,
          46803,
          11,
          46802,
          11,
          46802,
          11,
          46806,
          11,
          46803,
          11,
          46805,
          11,
          46804,
          11,
          46805,
          11,
          45528,
          157,
          46428,
          86,
          46437,
          76,
          46441,
          71,
          46441,
          69,
          46445,
          67,
          46447,
          66,
          46448,
          65,
          46450,
          64,
          46452,
          63,
          46455,
          63,
          46459,
          62,
          46460,
          62,
          46462,
          62,
          46463,
          62,
          46464,
          62,
          46468,
          62,
          46467,
          62,
          46468,
          62,
          46466,
          62,
          46467,
          62,
          46470,
          62,
          46471,
          62,
          46472,
          61,
          46472,
          62,
          46476,
          62,
          46472,
          62,
          46474,
          62,
          46475,
          62,
          46476,
          62,
          46478,
          62,
          46478,
          62,
          46476,
          62,
          46476,
          62,
          46477,
          62,
          46482,
          62,
          46479,
          62,
          46480,
          62,
          46480,
          62,
          46484,
          62,
          46481,
          62,
          46482,
          62,
          46482,
          62,
          46483,
          63,
          46484,
          62,
          46484,
          62,
          46485,
          62,
          46484,
          62,
          46484,
          62,
          46485,
          62,
          46482,
          63,
          46484,
          62,
          46485,
          62,
          46485,
          62,
          46487,
          62,
          46484,
          62,
          46488,
          62,
          46487,
          63,
          46485,
          63,
          46487,
          62,
          46487,
          63,
          46488,
          62,
          46487,
          62,
          46487,
          62,
          46485,
          62,
          46488,
          62,
          46487,
          63,
          46487,
          62,
          46488,
          62,
          46490,
          62,
          46487,
          62,
          46486,
          63,
          46486,
          62,
          46486,
          63,
          46486,
          63,
          46485,
          62,
          46485,
          62,
          46487,
          62,
          46491,
          63,
          46488,
          62,
          46489,
          63,
          46490,
          62,
          46488,
          62,
          46489,
          63,
          46487,
          62,
          46485,
          62,
          46487,
          62,
          46490,
          63,
          46489,
          62,
          46490,
          63,
          46491,
          63,
          46488,
          63,
          46488,
          62,
          46489,
          62,
          46490,
          62,
          46490,
          63,
          46489,
          63,
          46491,
          63,
          46488,
          63,
          46491,
          63,
          46487,
          8,
          46671,
          10,
          46701,
          10,
          46720,
          10,
          46740,
          10,
          46751,
          10,
          46765,
          10,
          46780,
          11,
          46787,
          11,
          46796,
          10,
          46802,
          11,
          46808,
          10,
          46813,
          10,
          46812,
          11,
          46818,
          11,
          46822,
          11,
          46819,
          11,
          46823,
          11,
          46824,
          11,
          46823,
          11,
          46826,
          11,
          46826,
          11,
          46829,
          11,
          46827,
          11,
          46827,
          11,
          46827,
          11,
          46827,
          11,
          46827,
          10,
          46828,
          11,
          46833,
          11,
          46830,
          11,
          46828,
          11,
          46834,
          11,
          46831,
          11,
          46833,
          11,
          46835,
          11,
          46835,
          11,
          46834,
          11,
          46832,
          11,
          46833,
          11,
          46834,
          11,
          46835,
          11,
          46834,
          11,
          46836,
          11,
          46838,
          11,
          46837,
          11,
          46837,
          11,
          46837,
          11,
          46835,
          11,
          46839,
          11,
          46841,
          11,
          46838,
          11,
          46841,
          11,
          46840,
          11,
          46841,
          11,
          46839,
          11,
          46841,
          11,
          46842,
          11,
          46841,
          11,
          46840,
          11,
          46840,
          11,
          46841,
          11,
          46843,
          11,
          46842,
          11,
          46844,
          11,
          46839,
          11,
          46843,
          11,
          46842,
          11,
          46842,
          11,
          46844,
          11,
          46845,
          11,
          46847,
          11,
          46845,
          11,
          46843,
          11,
          46847,
          11,
          46845,
          11,
          46845,
          11,
          46842,
          11,
          46847,
          11,
          46846,
          11,
          46848,
          11,
          46845,
          11,
          46846,
          11,
          46850,
          11,
          46847,
          11,
          46847,
          11,
          46847,
          11,
          46847,
          11,
          46850,
          11,
          46850,
          11,
          46852,
          11,
          46848,
          11,
          46850,
          11,
          46851,
          11,
          46850,
          11,
          46853,
          11,
          46853,
          11,
          46852,
          11,
          46849,
          11,
          46850,
          11
        ]
      }
    ]
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.3",
  "app_device": "x86-32",
  "location": [
    "42.7223688",
    "-84.4745771"
  ],
  "ConsoleMacro": "197",
  "notes": "detector off for far red measuring lights off "
}
Default avatar
Created by

Alyssa Ghose


Protocol connections:
30
Latest Update:
Jul 2016