reflectanceOne


Saves the 'blackbody' reflection at each wavelength
var data = json.data_raw;
var output = {};

var wavelengths = [420, 530, 605, 650, 730, 850, 880, 940];
var pulses = 20;
var raw_array = [];
var tester = wavelengths.length;
output["toDevice"] = "set_user_defined+";
for (i = 0; i < wavelengths.length; i++) {
  // pull out average value from however many pulses, skipping first and last 2 points (they can be noisy)
  var raw = MathROUND(MathMEDIAN(json.data_raw.slice(2 + pulses*i,8 + pulses*i)),0);
  output["raw_"+wavelengths[i]] = MathROUND(raw,2);
  raw_array[i] = raw;
  output["toDevice"] += i + "+" + raw_array[i]+"+";
 }

output["toDevice"] += "-1+";
output["raw_array"] = raw_array;

//output["tester"] = tester;

// = "set_user_defined+1+"+shinybody_530+"+2+"+shinybody_650+"+3+"+shinybody_605+"+4+"+shinybody_420+"+5+"+shinybody_940+"+6+"+shinybody_850+"+7+"+shinybody_730+"+8+"+shinybody_880+"+-1+";

return output;
{
  "time_offset": 240,
  "time": 1504108354496,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "00:00:00:0f",
  "device_battery": 40,
  "device_firmware": 1.2021,
  "sample": [
    {
      "time": 1504108354511,
      "protocol_id": 1,
      "label": "",
      "data_raw": [
        52929,
        51451,
        50674,
        49888,
        49579,
        49346,
        48851,
        48588,
        48323,
        47576,
        46699,
        46551,
        46253,
        46040,
        45960,
        45983,
        45695,
        45419,
        45255,
        44941,
        47978,
        48003,
        47960,
        47932,
        47939,
        47936,
        47971,
        47901,
        47898,
        47850,
        47909,
        47928,
        47935,
        47991,
        47875,
        47941,
        47942,
        47975,
        47983,
        47951,
        44565,
        44548,
        44522,
        44524,
        44517,
        44527,
        44525,
        44535,
        44526,
        44532,
        44518,
        44515,
        44541,
        44513,
        44526,
        44536,
        44520,
        44506,
        44518,
        44524,
        48846,
        48827,
        48838,
        48838,
        48822,
        48838,
        48816,
        48840,
        48823,
        48834,
        48815,
        48834,
        48831,
        48837,
        48825,
        48823,
        48836,
        48839,
        48821,
        48827,
        52230,
        52167,
        52171,
        52151,
        52168,
        52149,
        52167,
        52146,
        52167,
        52155,
        52164,
        52155,
        52161,
        52162,
        52163,
        52151,
        52159,
        52158,
        52155,
        52143,
        46133,
        45559,
        45541,
        45506,
        45504,
        45490,
        45492,
        45475,
        45484,
        45487,
        45479,
        45477,
        45499,
        45489,
        45487,
        45481,
        45486,
        45467,
        45478,
        45485,
        41074,
        41056,
        41069,
        41057,
        41060,
        41045,
        41058,
        41045,
        41053,
        41039,
        41055,
        41047,
        41049,
        41043,
        41045,
        41048,
        41043,
        41040,
        41040,
        41044,
        42014,
        41695,
        41669,
        41657,
        41659,
        41653,
        41643,
        41655,
        41647,
        41647,
        41621,
        41643,
        41631,
        41656,
        41632,
        41655,
        41641,
        41657,
        41630,
        41639
      ]
    }
  ],
  "app_os": "linux",
  "app_name": "PhotosynQ",
  "app_version": "0.3.8",
  "app_device": "x86-64",
  "location": [
    "42.5951865",
    "-76.6932325"
  ],
  "ConsoleMacro": "403"
}
Default avatar
Created by

Jon S


Protocol connections:
4
Latest Update:
Aug 2017