Algae photosynthesis test 2


still testing
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 4/7/2017
//============================================

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

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

    //Add key time and value to output
    output["time"] = json.time;	
}

//recall baseline values for red MP and blue SP with medium filled cuvette in device
var baseline0 = json.recall["userdef[9]"];
var baselineM = json.recall["userdef[10]"];

var f0 = MathMEAN(json.data_raw.slice(92,124)) - baseline0;
var fm = MathMEAN(json.data_raw.slice(261,288)) - baselineM;

var phi2 = (fm-f0)/fm;
var lef = phi2 * json.light_intensity * 0.4;

output['F0'] = f0;
output['baseline0'] = baseline0;
output['baselineM'] = baselineM;
output['Fm'] = fm;
output['Phi2'] = phi2;
output['LEF'] = lef; 
output['PAR'] = json.light_intensity;

//Return data
return output;
{
  "time_offset": -120,
  "time": 1493724562526,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:39:22",
  "device_battery": 96,
  "device_firmware": 1.17,
  "sample": [
    [
      {
        "time": 1493724562541,
        "protocol_id": 1,
        "light_intensity": 6,
        "r": 3,
        "g": 2,
        "b": 1,
        "light_intensity_raw": 6,
        "recall": {
          "time": 1493724567148,
          "userdef[3]": 817.215027,
          "userdef[4]": 2235.815918
        },
        "data_raw": [
          1567,
          1578,
          1586,
          1583,
          1589,
          1591,
          1587,
          1591,
          1593,
          1594,
          1594,
          1593,
          1595,
          1597,
          1594,
          1598,
          1594,
          1598,
          1600,
          1596,
          1601,
          1597,
          1601,
          1602,
          1605,
          1605,
          1603,
          1606,
          1604,
          1606,
          1605,
          1609,
          1609,
          1610,
          1612,
          1612,
          1615,
          1611,
          1615,
          1611,
          1617,
          1613,
          1619,
          1614,
          1620,
          1614,
          1621,
          1617,
          1623,
          1616,
          1625,
          1621,
          1625,
          1626,
          1627,
          1623,
          1623,
          1629,
          1625,
          1629,
          1628,
          1630,
          1628,
          1631,
          1631,
          1628,
          1632,
          1629,
          1632,
          1634,
          1631,
          1635,
          1629,
          1635,
          1634,
          1634,
          1634,
          1631,
          1635,
          1637,
          1635,
          1635,
          1630,
          1637,
          1636,
          1629,
          1637,
          1637,
          1634,
          1636,
          1633,
          1637,
          1636,
          1631,
          1637,
          1634,
          1631,
          1637,
          1636,
          1633,
          1635,
          1636,
          1630,
          1637,
          1635,
          1630,
          1633,
          1635,
          1630,
          1637,
          1634,
          1631,
          1634,
          1635,
          1635,
          1628,
          1635,
          1631,
          1630,
          1632,
          1634,
          1633,
          1629,
          1631,
          1631,
          1627,
          1631,
          1634,
          1631,
          1627,
          1633,
          1631,
          1629,
          1628,
          1631,
          1628,
          1627,
          1627,
          1629,
          1630,
          1627,
          1626,
          1630,
          1627,
          1627,
          1625,
          1629,
          1628,
          1629,
          1623,
          5090,
          33,
          6148,
          5947,
          5849,
          5797,
          5761,
          5735,
          5715,
          5701,
          5686,
          5674,
          5665,
          5656,
          5647,
          5646,
          5637,
          5629,
          5625,
          5617,
          5614,
          5610,
          5608,
          5604,
          5603,
          5597,
          5591,
          5589,
          5589,
          5585,
          5579,
          5577,
          5573,
          5567,
          5571,
          5565,
          5563,
          5559,
          5557,
          5547,
          5546,
          5547,
          5545,
          5541,
          5539,
          5536,
          5534,
          5527,
          5527,
          5525,
          5523,
          5520,
          5515,
          5514,
          5510,
          5507,
          5505,
          5502,
          5503,
          5498,
          5496,
          5495,
          5491,
          5490,
          5487,
          5483,
          5479,
          5478,
          5479,
          5478,
          5478,
          5473,
          5471,
          5467,
          5463,
          5462,
          5463,
          5460,
          5455,
          5451,
          5450,
          5451,
          5452,
          5451,
          5446,
          5447,
          5445,
          5443,
          5441,
          5439,
          5439,
          5436,
          5435,
          5431,
          5430,
          5427,
          5427,
          5424,
          5419,
          5418,
          5415,
          5415,
          5415,
          5417,
          5415,
          5415,
          5415,
          5413,
          5411,
          5413,
          5411,
          5408,
          5407,
          5405,
          5407,
          5405,
          5402,
          5401,
          5400,
          5399,
          5399,
          5398,
          5396,
          5397,
          5393,
          5393,
          5391,
          5391,
          5390,
          5386,
          5387,
          5388,
          5385,
          5384,
          5383,
          5383,
          5383,
          5383,
          5379,
          5380,
          5379,
          5376,
          5377,
          5377,
          5373,
          5373,
          5374,
          5373,
          5372,
          5375,
          1734,
          1717,
          1702,
          1693,
          1685,
          1678,
          1671,
          1666,
          1662,
          1658,
          1653,
          1649,
          1649,
          1648,
          1643,
          1641,
          1640,
          1639,
          1638,
          1637,
          1637,
          1636,
          1635,
          1635,
          1633,
          1633,
          1630,
          1631,
          1630,
          1631,
          1628,
          1628,
          1629,
          1627,
          1627,
          1629,
          1629,
          1629,
          1626,
          1626,
          1625,
          1625,
          1624,
          1625,
          1623,
          1625,
          1620,
          1623,
          1623,
          1622,
          1623,
          1623,
          1625,
          1623,
          1622,
          1623,
          1623,
          1623,
          1623,
          1623,
          1622,
          1623,
          1623,
          1623,
          1623,
          1619,
          1617,
          1616,
          1616,
          1619,
          1617,
          1619,
          1618,
          1619,
          1621,
          1621,
          1621,
          1621,
          1622,
          1617,
          1617,
          1615,
          1615,
          1615,
          1615,
          1615,
          1621,
          1619,
          1617,
          1618,
          1618,
          1619,
          1613,
          1612,
          1614,
          1615,
          1614,
          1617,
          1617,
          1617,
          1618,
          1615,
          1615,
          1612,
          1612,
          1612,
          1612,
          1617,
          1617,
          1615,
          1617,
          1617,
          1612,
          1610,
          1612,
          1615,
          1616,
          1615,
          1615,
          1617,
          1614,
          1611,
          1610,
          1611,
          1615,
          1615,
          1613,
          1615,
          1612,
          1610,
          1611,
          1614,
          1615,
          1614,
          1615,
          1615,
          1611,
          1608,
          1613,
          1613,
          1614,
          1614,
          1614,
          1610,
          1609,
          1611,
          1613,
          1614,
          1613,
          1612
        ]
      }
    ]
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.6",
  "app_device": "x86-64",
  "location": [
    "51.9807871",
    "5.6502037"
  ],
  "ConsoleMacro": "209"
}

Protocol connections:
4
Latest Update:
May 2017