baseline test macro


testing baseline
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 5/2/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;
}

var baseline0 =  MathMEAN(json.data_raw.slice(39,132));
var baselineM = MathMEAN(json.data_raw.slice(167,265));

//Return data
output['base0'] = baseline0;
output['baseM'] = baselineM;

return output;
{
  "time_offset": -120,
  "time": 1493723521012,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:39:22",
  "device_battery": 96,
  "device_firmware": 1.17,
  "sample": [
    [
      {
        "time": 1493723521028,
        "protocol_id": 1,
        "light_intensity": 6,
        "r": 4,
        "g": 2,
        "b": 1,
        "light_intensity_raw": 6,
        "recall": {
          "time": 1493723525645,
          "userdef[3]": 389.5,
          "userdef[4]": 491
        },
        "data_raw": [
          819,
          819,
          814,
          812,
          813,
          814,
          817,
          818,
          819,
          819,
          813,
          814,
          815,
          821,
          817,
          819,
          817,
          814,
          817,
          815,
          817,
          815,
          813,
          818,
          817,
          818,
          817,
          813,
          817,
          819,
          818,
          815,
          817,
          817,
          812,
          814,
          818,
          818,
          812,
          819,
          818,
          819,
          813,
          815,
          818,
          812,
          818,
          819,
          814,
          815,
          819,
          815,
          813,
          815,
          816,
          815,
          818,
          816,
          816,
          820,
          815,
          818,
          818,
          813,
          818,
          818,
          814,
          818,
          813,
          818,
          818,
          814,
          817,
          819,
          818,
          819,
          814,
          818,
          813,
          818,
          821,
          815,
          819,
          814,
          818,
          816,
          818,
          820,
          817,
          820,
          813,
          819,
          815,
          819,
          814,
          817,
          815,
          818,
          817,
          819,
          819,
          819,
          820,
          817,
          818,
          817,
          817,
          819,
          819,
          818,
          818,
          818,
          815,
          818,
          815,
          819,
          815,
          817,
          815,
          821,
          815,
          817,
          815,
          818,
          819,
          819,
          818,
          817,
          819,
          813,
          817,
          819,
          819,
          818,
          813,
          817,
          814,
          820,
          817,
          817,
          817,
          814,
          819,
          815,
          818,
          817,
          815,
          818,
          813,
          819,
          2235,
          20,
          2241,
          2237,
          2239,
          2235,
          2233,
          2236,
          2238,
          2234,
          2233,
          2235,
          2238,
          2239,
          2239,
          2237,
          2236,
          2238,
          2238,
          2235,
          2234,
          2239,
          2237,
          2234,
          2236,
          2237,
          2239,
          2235,
          2239,
          2239,
          2235,
          2237,
          2238,
          2234,
          2237,
          2238,
          2238,
          2235,
          2237,
          2239,
          2233,
          2235,
          2238,
          2237,
          2233,
          2239,
          2235,
          2235,
          2234,
          2238,
          2241,
          2233,
          2235,
          2238,
          2238,
          2234,
          2233,
          2237,
          2237,
          2238,
          2233,
          2238,
          2236,
          2236,
          2234,
          2235,
          2238,
          2236,
          2234,
          2237,
          2237,
          2237,
          2236,
          2234,
          2236,
          2238,
          2237,
          2235,
          2239,
          2237,
          2237,
          2238,
          2234,
          2234,
          2239,
          2237,
          2237,
          2231,
          2234,
          2237,
          2237,
          2237,
          2234,
          2233,
          2238,
          2237,
          2237,
          2235,
          2231,
          2235,
          2238,
          2237,
          2237,
          2235,
          2231,
          2238,
          2237,
          2236,
          2237,
          2231,
          2234,
          2239,
          2239,
          2237,
          2237,
          2234,
          2233,
          2239,
          2238,
          2239,
          2238,
          2235,
          2236,
          2235,
          2235,
          2239,
          2238,
          2236,
          2237,
          2235,
          2233,
          2236,
          2238,
          2239,
          2237,
          2237,
          2237,
          2238,
          2234,
          2234,
          2238,
          2238,
          2239,
          2237,
          2238,
          2235,
          2236,
          2232,
          2235,
          2239,
          821,
          819,
          821,
          819,
          819,
          819,
          813,
          815,
          820,
          819,
          819,
          818,
          818,
          821,
          819,
          815,
          815,
          819,
          820,
          819,
          820,
          817,
          818,
          819,
          815,
          816,
          814,
          820,
          821,
          819,
          821,
          819,
          819,
          818,
          818,
          818,
          818,
          815,
          813,
          818,
          817,
          821,
          821,
          819,
          819,
          820,
          820,
          819,
          820,
          819,
          817,
          818,
          819,
          815,
          814,
          815,
          818,
          820,
          817,
          818,
          819,
          821,
          819,
          819,
          820,
          820,
          820,
          821,
          821,
          821,
          819,
          819,
          819,
          819,
          819,
          819,
          819,
          821,
          819,
          820,
          820,
          819,
          818,
          821,
          820,
          819,
          819,
          819,
          821,
          819,
          819,
          822,
          821,
          820,
          820,
          818,
          819,
          819,
          821,
          819,
          817,
          817,
          817,
          817,
          815,
          814,
          818,
          814,
          817,
          814,
          816,
          815,
          814,
          819,
          814,
          816,
          815,
          815,
          815,
          813,
          815,
          815,
          817,
          818,
          815,
          817,
          814,
          816,
          816,
          818,
          815,
          815,
          815,
          815,
          813,
          816,
          815,
          815,
          815,
          815,
          815,
          815,
          815,
          815,
          814,
          813,
          813,
          815,
          811,
          815
        ]
      }
    ]
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.6",
  "app_device": "x86-64",
  "location": [
    "51.9807871",
    "5.6502037"
  ],
  "ConsoleMacro": "305"
}

Protocol connections:
0
Latest Update:
May 2017