LichenspeQ Photosynthesis2


This macro is for use with the LichenspeQ protocol
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 4/11/2017
//============================================

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


var fs = MathMEAN(json.data_raw.slice(2,8));
var Fs_std = MathSTDEV(json.data_raw.slice(2,8));

var fmp = MathMEDIAN(json.data_raw.slice(23,68));
var fmp_std = MathSTDEV(json.data_raw.slice(23,68));

var fop = MathMEAN(json.data_raw.slice(152,218));
var fop_std = MathSTDEV(json.data_raw.slice(152,218));

// Calculate NPQt, PhiNPQ, PhiNO, qL w/ and w/out multi-phase flash
// ----------------------------

var phi2 = MathROUND(((fmp-fs)/fmp),4);
var lef = MathROUND((phi2 * json.light_intensity * 0.4),2);
var npqt = MathROUND(((4.88 / ((fmp / fop) -1) )-1),2);
var qL = MathROUND(((fmp - fs)*fop)/((fmp - fop) * fs),4);
var PhiNO = MathROUND(1/(npqt + 1 + qL * 4.88),4); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ = MathROUND((1-phi2 - PhiNO),4); //based on equation 53 in Kramer et al., 2004 PRES 
//var response_730 = MathROUND(MathMEDIAN(json.data_raw.slice(498,512)),0); //calcuate the median reflection
var response_940 = MathROUND(MathMEDIAN(json.data_raw.slice(222,248)),0); //calcuate the median reflection

if (Fs_std > 100) {
	danger("noisy Fs", output);
}

if (fmp_std > 300) {
	danger("noisy FmPrime", output);
}

output['Fs'] = fs;
output['Fmp'] = fmp;
output['Fop'] = fop;
output['Phi2'] = phi2;
output['LEF'] = lef; 
output['NPQt'] = npqt; 
output['qL'] = qL; 
output['PhiNO'] = PhiNO; 
output['PhiNPQ'] = PhiNPQ; 
output['PAR'] = json.light_intensity;
output['Surface Temp'] = json.contactless_temp;
//output["730nm"]=response_730; 
output["940nm"]=response_940; 

output["order"] = ["Phi2","PhiNPQ","PhiNO","PAR","LEF","Surface Temp"];

//Return data
return output;

//Check if the key time exists in json
if (json.time !== undefined){

	//Add key time and value to output
	output["time"] = json.time;
}
{
  "time_offset": 240,
  "time": 1499263835376,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:06:11:92",
  "device_battery": 68,
  "device_firmware": 1.17,
  "sample": [
    {
      "time": 1499263835393,
      "protocol_id": 1,
      "light_intensity": 7,
      "r": 4,
      "g": 2,
      "b": 1,
      "light_intensity_raw": 6,
      "contactless_temp": 23.73,
      "compass_direction": "E",
      "compass": "90.00",
      "angle": 1.37,
      "angle_direction": "S",
      "pitch": 1.31,
      "roll": -0.4,
      "data_raw": [
        5759,
        5801,
        5812,
        5830,
        5833,
        5841,
        5839,
        5849,
        5849,
        5855,
        5857,
        5863,
        5868,
        5869,
        5869,
        5871,
        5877,
        5883,
        5883,
        5883,
        15300,
        16637,
        17225,
        17579,
        17842,
        18052,
        18227,
        18364,
        18471,
        18559,
        18622,
        18668,
        18708,
        18731,
        18757,
        18775,
        18783,
        18794,
        18805,
        18810,
        18816,
        18820,
        18823,
        18827,
        18827,
        18826,
        18825,
        18826,
        18823,
        18817,
        18817,
        18813,
        18799,
        18797,
        18791,
        18791,
        18789,
        18782,
        18777,
        18774,
        18770,
        18765,
        18754,
        18750,
        18745,
        18741,
        18735,
        18729,
        18727,
        18719,
        8235,
        7386,
        7030,
        6780,
        6595,
        6461,
        6363,
        6289,
        6243,
        6203,
        6174,
        6157,
        6142,
        6127,
        6126,
        6116,
        6121,
        6113,
        6119,
        6114,
        6119,
        6115,
        6119,
        6122,
        6125,
        6128,
        6123,
        6129,
        6127,
        6133,
        6137,
        6134,
        6140,
        6138,
        6142,
        6143,
        6145,
        6147,
        6145,
        6153,
        6146,
        6155,
        6153,
        6158,
        6159,
        6157,
        6161,
        6155,
        6161,
        6162,
        6164,
        6166,
        6156,
        6163,
        6159,
        6165,
        6164,
        6167,
        6165,
        6159,
        6163,
        6157,
        6163,
        6163,
        6157,
        6161,
        6157,
        6161,
        6157,
        6159,
        6161,
        6154,
        6158,
        6153,
        6156,
        6155,
        6156,
        6155,
        6145,
        6153,
        6141,
        6146,
        6144,
        6145,
        6142,
        6143,
        6141,
        6134,
        6142,
        6131,
        6135,
        6130,
        6134,
        6129,
        6131,
        6127,
        6127,
        6127,
        6119,
        6123,
        6116,
        6119,
        6111,
        6118,
        6114,
        6113,
        6113,
        6113,
        6111,
        6104,
        6107,
        6097,
        6100,
        6098,
        6100,
        6095,
        6093,
        6093,
        6093,
        6090,
        6087,
        6086,
        6083,
        6084,
        6077,
        6079,
        6076,
        6078,
        6074,
        6071,
        6069,
        6069,
        6070,
        6065,
        6063,
        6060,
        6060,
        6053,
        6057,
        6049,
        6055,
        6047,
        6051,
        6045,
        6045,
        6041,
        6043,
        6038,
        6038,
        6033,
        34835,
        34772,
        34787,
        34759,
        34756,
        34755,
        34785,
        34787,
        34759,
        34770,
        34769,
        34779,
        34773,
        34785,
        34765,
        34769,
        34722,
        34745,
        34775,
        34753,
        34735,
        34751,
        34767,
        34755,
        34751,
        34759,
        34778,
        34745,
        34747,
        34780
      ]
    }
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.8",
  "app_device": "x86-64",
  "location": [
    "42.7226219",
    "-84.4746562"
  ],
  "ConsoleMacro": "282"
}
Sam 0645   copy   copy  2
Created by

Dan TerAvest


Protocol connections:
1
Latest Update:
Jul 2017