wasp_940_test_1


test of ECS WASP
/**
 * Macro for data evaluation on PhotosynQ.org
 * by: David M. Kramer
 * created: 2017-07-11 @ 16:35:46
 */

// 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;
}
output.raw=json.data_raw;

var ECS_wp =[];
for (var i =0; i<json.data_raw.length; i=i+2){
  ECS_wp.push(json.data_raw[i]);
}

var BACK_850 =[];
var WASP_850 =[];
var WASP_no_850 =[];

for (var i =0; i<json.data_raw.length; i=i+4){
  BACK_850.push(json.data_raw[i]);
  WASP_850.push(json.data_raw[i+1]);
  WASP_no_850.push(json.data_raw[i+2]);
}

output.BACK_850=BACK_850;
output.WASP_850=WASP_850;
output.WASP_no_850=WASP_no_850;

var WASP_850_corr=[];
for (var i =0; i<WASP_850.length; i=i+1){
	WASP_850_corr.push(WASP_850[i]-WASP_no_850[i]);
}
output.WASP_850_corr=WASP_850_corr;

var DELTA_WASP=[];
for (var i =0; i<WASP_850_corr.length; i=i+1){
	DELTA_WASP.push(WASP_850_corr[i]-BACK_850[i]);
}
output.DELTA_WASP=DELTA_WASP;

var DELTA_WASP_offset_val=MathMEAN(DELTA_WASP.slice(0,10));

var DELTA_WASP_offset=[];
for (var i =0; i<DELTA_WASP.length; i=i+1){
	DELTA_WASP_offset.push(DELTA_WASP[i]-DELTA_WASP_offset_val);
}

output.DELTA_WASP_offset=DELTA_WASP_offset;


output.label=json.label;

//ECS_wasp[999]=ECS_wasp[998];
//ECS_wasp[1099]=ECS_wasp[998];

//output.ECS_wp=ECS_wp.slice(2,ECS_wp.length);
//output.WASP_850_sp=WASP_850_sp.slice(2,WASP_850_sp.length);

//output.ECS_wasp=ECS_wasp;

var smooth_range=5;
var DELTA_WASP_smoothed=[];
for (var i =1; i<DELTA_WASP_offset.length; i=i+smooth_range){
	DELTA_WASP_smoothed.push(MathMEAN(DELTA_WASP_offset.slice(i,i+smooth_range-1)));
}
output.DELTA_WASP_smoothed=DELTA_WASP_smoothed;

// Return data
return output;
{
  "time": "1501188961275",
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:53:13",
  "device_battery": 95,
  "device_firmware": 1.2,
  "sample": [
    [
      {
        "time": "1501188961287",
        "protocol_id": 1,
        "label": "wasp=5us int=4000",
        "set_led_delay": [
          0,
          2,
          0,
          1000
        ],
        "light_intensity": 25.72,
        "r": 19,
        "g": 9,
        "b": 5,
        "light_intensity_raw": 33,
        "temperature": 28.55,
        "humidity": 51.215,
        "pressure": 982.962,
        "temperature2": 28.3,
        "humidity2": 51.35,
        "pressure2": 983.327,
        "contactless_temp": 26.93,
        "thickness": 0.36,
        "data_raw": [
          49515,
          49882,
          403,
          49510,
          49495,
          49886,
          410,
          49511,
          49507,
          49888,
          413,
          49501,
          49497,
          49889,
          414,
          49523,
          49507,
          49893,
          419,
          49509,
          49487,
          49901,
          419,
          49496,
          49495,
          49895,
          420,
          49495,
          49497,
          49903,
          423,
          49509,
          49505,
          49903,
          423,
          49509,
          49486,
          49904,
          427,
          49499,
          49497,
          49922,
          426,
          49500,
          49500,
          49898,
          429,
          49500,
          49508,
          49923,
          432,
          49493,
          49505,
          49899,
          430,
          49492,
          49496,
          49911,
          432,
          49508,
          49517,
          49924,
          435,
          49497,
          49501,
          49907,
          433,
          49495,
          49503,
          49919,
          433,
          49506,
          49505,
          49921,
          433,
          49499,
          49505,
          49914,
          434,
          49503,
          49489,
          49918,
          433,
          49505,
          49511,
          49921,
          435,
          49503,
          49510,
          49912,
          440,
          49505,
          49491,
          49915,
          443,
          49505,
          49506,
          49918,
          441,
          49499,
          49487,
          49914,
          445,
          49506,
          49493,
          49926,
          443,
          49506,
          49493,
          49923,
          443,
          49487,
          49497,
          49932,
          446,
          49506,
          49503,
          49916,
          445,
          49490,
          49503,
          49931,
          447,
          49493,
          49496,
          49917,
          445,
          49493,
          49505,
          49935,
          441,
          49492,
          49492,
          49919,
          441,
          49506,
          49518,
          49933,
          439,
          49504,
          49496,
          49920,
          442,
          49519,
          49508,
          49926,
          443,
          49503,
          49493,
          49923,
          447,
          49503,
          49501,
          49930,
          447,
          49511,
          49515,
          49927,
          447,
          49509,
          49495,
          49923,
          448,
          49520,
          49507,
          49944,
          447,
          49496,
          49498,
          49927,
          449,
          49497,
          49504,
          49936,
          446,
          49510,
          49518,
          49929,
          444,
          49499,
          49501,
          49940,
          442,
          49501,
          49508,
          49931,
          444,
          49510,
          49513,
          49927,
          445,
          49498,
          49502,
          49930,
          446,
          49506,
          49490,
          49919,
          447,
          49498,
          49491,
          49919,
          447,
          49514,
          49499,
          49933,
          449,
          49496,
          49495,
          49928,
          449,
          49496,
          49500,
          49918,
          447,
          49489,
          49498,
          49924,
          446,
          49491,
          49494,
          49925,
          442,
          49513,
          49508,
          49925,
          440,
          49495,
          49494,
          49920,
          444,
          49499,
          49500,
          49923,
          449,
          49513,
          49503,
          49934,
          448,
          49509,
          49490,
          49926,
          447,
          49487,
          49493,
          49925,
          450,
          49501,
          49500,
          49919,
          448,
          49501,
          49504,
          49930,
          443,
          49500,
          49494,
          49915,
          442,
          49503,
          49506,
          49924,
          446,
          49495,
          49503,
          49932,
          448,
          49496,
          49487,
          49923,
          444,
          49506,
          49501,
          49928,
          446,
          49497,
          49497,
          49930,
          446,
          49495,
          49503,
          49918,
          442,
          49511,
          49515,
          49932,
          443,
          49501,
          49490,
          49920,
          443,
          49497,
          49515,
          49922,
          450,
          49487,
          49490,
          49920,
          447,
          49497,
          49487,
          49917,
          448,
          49502,
          49495,
          49920,
          448,
          49499,
          49511,
          49930,
          449,
          49499,
          49496,
          49918,
          443,
          49498,
          49495,
          49915,
          443,
          49510,
          49502,
          49919,
          449,
          49495,
          49483,
          49907,
          446,
          49492,
          49495,
          49932,
          447,
          49493,
          49487,
          49915,
          445,
          49499,
          49507,
          49919,
          445,
          49487,
          49497,
          49931,
          440,
          49501,
          49495,
          49913,
          443,
          49509,
          49503,
          49927,
          445,
          49489,
          49486,
          49921,
          446,
          49500,
          49493,
          49919,
          446,
          49501,
          49499,
          49934,
          448,
          49500,
          49501,
          49911,
          441,
          49517,
          49501,
          49914,
          439,
          49505,
          49506,
          49913,
          444,
          49499,
          49497,
          49926,
          445,
          49497,
          49489,
          49918,
          443,
          49498,
          49495,
          49914,
          441,
          49495,
          49506,
          49919,
          441,
          49502,
          49505,
          49916,
          440,
          49499,
          49506,
          49924,
          444,
          49501,
          49488,
          49973,
          548,
          49472,
          49453,
          49997,
          579,
          49445,
          49450,
          50000,
          575,
          49454,
          49471,
          50018,
          569,
          49472,
          49462,
          50006,
          574,
          49479,
          49476,
          50030,
          574,
          49493,
          49476,
          50026,
          579,
          49490,
          49491,
          50038,
          580,
          49491,
          49489,
          50072,
          591,
          49495,
          49487,
          50062,
          603,
          49495,
          49509,
          50090,
          614,
          49496,
          49503,
          50099,
          623,
          49514,
          49509,
          50100,
          629,
          49507,
          49510,
          50137,
          642,
          49513,
          49510,
          50121,
          657,
          49506,
          49503,
          50150,
          668,
          49503,
          49503,
          50146,
          679,
          49509,
          49521,
          50167,
          680,
          49509,
          49518,
          50185,
          694,
          49511,
          49506,
          50184,
          707,
          49524,
          49503,
          50201,
          715,
          49494,
          49510,
          50208,
          720,
          49508,
          49516,
          50235,
          729,
          49522,
          49529,
          50225,
          745,
          49507,
          49507,
          50241,
          751,
          49524,
          49512,
          50253,
          765,
          49512,
          49520,
          50271,
          768,
          49516,
          49509,
          50260,
          782,
          49523,
          49529,
          50289,
          793,
          49522,
          49515,
          50281,
          801,
          49509,
          49524,
          50303,
          806,
          49525,
          49527,
          50306,
          812,
          49505,
          49516,
          50310,
          830,
          49525,
          49514,
          50319,
          835,
          49510,
          49504,
          50331,
          842,
          49512,
          49524,
          50346,
          849,
          49529,
          49515,
          50342,
          860,
          49508,
          49515,
          50356,
          869,
          49533,
          49515,
          50371,
          874,
          49507,
          49514,
          50367,
          880,
          49518,
          49514,
          50376,
          890,
          49522,
          49527,
          50387,
          901,
          49519,
          49514,
          50399,
          906,
          49508,
          49520,
          50402,
          910,
          49519,
          49519,
          50416,
          920,
          49515,
          49503,
          50414,
          929,
          49513,
          49520,
          50424,
          935,
          49510,
          49507,
          50424,
          935,
          49527,
          49519,
          50435,
          948,
          49519,
          49503,
          50439,
          953,
          49515,
          49508,
          50441,
          962,
          49519,
          49525,
          50463,
          963,
          49507,
          49512,
          50455,
          973,
          49513,
          49516,
          50481,
          976,
          49515,
          49505,
          50470,
          982,
          49518,
          49517,
          50485,
          985,
          49512,
          49511,
          50477,
          998,
          49514,
          49521,
          50500,
          1001,
          49504,
          49510,
          50491,
          1002,
          49526,
          49518,
          50491,
          1007,
          49513,
          49512,
          50501,
          1013,
          49514,
          49499,
          50500,
          1020,
          49510,
          49518,
          50526,
          1019,
          49516,
          49511,
          50508,
          1026,
          49530,
          49511,
          50519,
          1030,
          49512,
          49528,
          50522,
          1035,
          49511,
          49510,
          50522,
          1036,
          49526,
          49522,
          50535,
          1046,
          49518,
          49512,
          50529,
          1050,
          49521,
          49521,
          50545,
          1050,
          49531,
          49523,
          50543,
          1057,
          49524,
          49521,
          50563,
          1061,
          49527,
          49518,
          50554,
          1062,
          49508,
          49510,
          50549,
          1061,
          49517,
          49525,
          50566,
          1069,
          49521,
          49516,
          50549,
          1071,
          49507,
          49519,
          50558,
          1067,
          49527,
          49525,
          50562,
          1076,
          49506,
          49503,
          50569,
          1077,
          49518,
          49518,
          50563,
          1076,
          49516,
          49528,
          50565,
          1077,
          49516,
          49525,
          50575,
          1083,
          49523,
          49509,
          50567,
          1086,
          49509,
          49517,
          50577,
          1081,
          49521,
          49522,
          50572,
          1089,
          49508,
          49503,
          50582,
          1091,
          49519,
          49516,
          50569,
          1086,
          49509,
          49507,
          50571,
          1091,
          49519,
          49520,
          50580,
          1092,
          49505,
          49490,
          50576,
          1093,
          49515,
          49519,
          50573,
          1091,
          49511,
          49502,
          50563,
          1097,
          49509,
          49515,
          50577,
          1097,
          49498,
          49507,
          50577,
          1092,
          49526,
          49510,
          50567,
          1099,
          49506,
          49508,
          50589,
          1099,
          49503,
          49510,
          50573,
          1094,
          49515,
          49506,
          50587,
          1096,
          49511,
          49497,
          50585,
          1101,
          49515,
          49504,
          50587,
          1096,
          49494,
          49546,
          50827,
          1333,
          49549,
          49547,
          50859,
          1350,
          49542,
          49549,
          50877,
          1359,
          49551,
          49551,
          50875,
          1380,
          49543,
          49560,
          50901,
          1383,
          49546,
          49547,
          50898,
          1395,
          49541,
          49544,
          50902,
          1395,
          49541,
          49535,
          50903,
          1404,
          49549,
          49541,
          50887,
          1407,
          49557,
          49535,
          50905,
          1405,
          49551,
          49553,
          50910,
          1409,
          49541,
          49541,
          50898,
          1408,
          49533,
          49535,
          50911,
          1410,
          49524,
          49525,
          50895,
          1410,
          49536,
          49540,
          50911,
          1401,
          49530,
          49531,
          50896,
          1406,
          49520,
          49531,
          50890,
          1404,
          49519,
          49519,
          50902,
          1405,
          49519,
          49522,
          50872,
          1404,
          49525,
          49521,
          50882,
          1399,
          49506,
          49509,
          50866,
          1401,
          49515,
          49525,
          50875,
          1398,
          49504,
          49498,
          50869,
          1400,
          49515,
          49503,
          50860,
          1399,
          49499,
          49510,
          50854,
          1393,
          49503,
          49496,
          50853,
          1400,
          49495,
          49507,
          50861,
          1399,
          49505,
          49493,
          50844,
          1393,
          49488,
          49480,
          50854,
          1395,
          49487,
          49489,
          50832,
          1394,
          49495,
          49487,
          50834,
          1393,
          49481,
          49487,
          50831,
          1391,
          49471,
          49487,
          50836,
          1383,
          49482,
          49467,
          50809,
          1390,
          49468,
          49478,
          50819,
          1389,
          49477,
          49479,
          50822,
          1380,
          49469,
          49467,
          50809,
          1384,
          49476,
          49477,
          50803,
          1384,
          49460,
          49470,
          50821,
          1377,
          49460,
          49457,
          50797,
          1384,
          49448,
          49449,
          50790,
          1382,
          49467,
          49451,
          50791,
          1375,
          49463,
          49458,
          50796,
          1381,
          49444,
          49443,
          50782,
          1375,
          49449,
          49439,
          50769,
          1373,
          49446,
          49446,
          50770,
          1374,
          49423,
          49443,
          50784,
          1370,
          49447,
          49427,
          50758,
          1371,
          49433,
          49431,
          50755,
          1373,
          49423,
          49437,
          50756,
          1364,
          49426,
          49415,
          50747,
          1369,
          49433,
          49427,
          50747,
          1366,
          49412,
          49426,
          50745,
          1360,
          49422,
          49413,
          50736,
          1362,
          49417,
          49406,
          50718,
          1360,
          49411,
          49418,
          50725,
          1355,
          49403,
          49395,
          50725,
          1359,
          49409,
          49398,
          50711,
          1359,
          49402,
          49403,
          50712,
          1351,
          49408,
          49391,
          50697,
          1352,
          49403,
          49409,
          50705,
          1351,
          49375,
          49392,
          50709,
          1346,
          49377,
          49379,
          50701,
          1349,
          49379,
          49375,
          50676,
          1349,
          49369,
          49378,
          50679,
          1343,
          49379,
          49365,
          50673,
          1347,
          49379,
          49372,
          50661,
          1346,
          49372,
          49381,
          50663,
          1339,
          49366,
          49366,
          50663,
          1340,
          49369,
          49358,
          50654,
          1341,
          49352,
          49355,
          50659,
          1337,
          49366,
          49352,
          50647,
          1332,
          49367,
          49359,
          50631,
          1338,
          49357,
          49350,
          50622,
          1333,
          49352,
          49343,
          50631,
          1327,
          49340,
          49347,
          50626,
          1330,
          49323,
          49339,
          50619,
          1329,
          49328,
          49325,
          50618,
          1325,
          49326,
          49341,
          50621,
          1325,
          49315,
          49328,
          50610,
          1322,
          49315,
          49320,
          50602,
          1318,
          49315,
          49326,
          50593,
          1320,
          49319,
          49320,
          50584,
          1321,
          49310,
          49308,
          50581,
          1314,
          49314,
          49303,
          50570,
          1320,
          49309,
          49307,
          50567,
          1318,
          49302,
          49299,
          50575,
          1309,
          49287,
          49298,
          50578,
          1313,
          49291,
          49291,
          50554,
          1312,
          49291,
          49282,
          50549,
          1307,
          49289,
          49285,
          50550,
          1306,
          49283,
          49282,
          50550,
          1306,
          49271,
          49276,
          50532,
          1298,
          49287,
          49280,
          50530,
          1301,
          49275,
          49278,
          50523,
          1301,
          49263,
          49277,
          50529,
          1295,
          49263,
          49262,
          50518,
          1293,
          49259,
          49252,
          50504,
          1296,
          49257,
          49258,
          50487,
          1295,
          49265,
          49251,
          50499,
          1289,
          49250,
          49223,
          50267,
          983,
          49251,
          49261,
          50104,
          829,
          49295,
          49269,
          50028,
          769,
          49281,
          49286,
          50013,
          750,
          49274,
          49278,
          49996,
          742,
          49279,
          49281,
          49982,
          743,
          49278,
          49270,
          50002,
          744,
          49271,
          49271,
          49987,
          748,
          49271,
          49263,
          50002,
          751,
          49252,
          49253,
          49995,
          746,
          49264,
          49248,
          49989,
          754,
          49259,
          49267,
          49991,
          751,
          49253,
          49262,
          49995,
          758,
          49264,
          49254,
          49983,
          757,
          49251,
          49259,
          49991,
          761,
          49255,
          49241,
          49977,
          762,
          49249,
          49253,
          49979,
          759,
          49253,
          49249,
          49986,
          765,
          49233,
          49254,
          49988,
          757,
          49240,
          49249,
          49977,
          767,
          49237,
          49237,
          49983,
          765,
          49237,
          49228,
          49964,
          766,
          49243,
          49223,
          49965,
          764,
          49231,
          49244,
          49967,
          760,
          49223,
          49223,
          49979,
          766,
          49218,
          49235,
          49982,
          760,
          49217,
          49223,
          49969,
          764,
          49219,
          49217,
          49975,
          765,
          49221,
          49232,
          49969,
          765,
          49223,
          49229,
          49965,
          766,
          49230,
          49231,
          49951,
          758,
          49235,
          49223,
          49951,
          763,
          49222,
          49231,
          49945,
          754,
          49221,
          49221,
          49935,
          760,
          49221,
          49220,
          49947,
          758,
          49225,
          49219,
          49941,
          759,
          49231,
          49217,
          49942,
          757,
          49221,
          49215,
          49947,
          752,
          49222,
          49211,
          49935,
          754,
          49218,
          49218,
          49930,
          750,
          49212,
          49208,
          49927,
          755,
          49202,
          49201,
          49932,
          747,
          49206,
          49195,
          49927,
          753,
          49205,
          49197,
          49935,
          749,
          49186,
          49211,
          49922,
          748,
          49197,
          49188,
          49925,
          748,
          49198,
          49194,
          49917,
          740,
          49193,
          49182,
          49917,
          744,
          49195,
          49209,
          49915,
          737,
          49201,
          49207,
          49905,
          740,
          49193,
          49201,
          49903,
          733,
          49200,
          49198,
          49894,
          737,
          49209,
          49191,
          49887,
          733,
          49203,
          49201,
          49878,
          734,
          49193,
          49181,
          49887,
          732,
          49195,
          49181,
          49879,
          733,
          49191,
          49176,
          49887,
          730,
          49190,
          49183,
          49891,
          726,
          49180,
          49179,
          49897,
          728,
          49174,
          49193,
          49890,
          720,
          49179,
          49187,
          49881,
          722,
          49181,
          49191,
          49879,
          717,
          49196,
          49188,
          49871,
          719,
          49196,
          49180,
          49871,
          714,
          49193,
          49175,
          49863,
          718,
          49183,
          49163,
          49871,
          714,
          49172,
          49168,
          49862,
          713,
          49185,
          49172,
          49872,
          710,
          49163,
          49175,
          49867,
          706,
          49177,
          49175,
          49863,
          706,
          49183,
          49186,
          49858,
          703,
          49186,
          49175,
          49849,
          704,
          49172,
          49172,
          49854,
          699,
          49175,
          49175,
          49853,
          701,
          49167,
          49169,
          49845,
          696,
          49185,
          49179,
          49836,
          700,
          49189,
          49159,
          49844,
          696,
          49164,
          49171,
          49841,
          694,
          49173,
          49158,
          49838,
          695,
          49166,
          49169,
          49824,
          692,
          49175,
          49155,
          49829,
          691,
          49171,
          49175,
          49826,
          686,
          49182,
          49172,
          49829,
          688,
          49163,
          49171,
          49837,
          679,
          49151,
          49151,
          49820,
          682,
          49165,
          49174,
          49824,
          676,
          49166,
          49162,
          49823,
          679,
          49152,
          49165,
          49823,
          676,
          49170,
          49159,
          49813,
          677,
          49154,
          49171,
          49815,
          670,
          49176,
          49165,
          49801,
          676,
          49166,
          49173,
          49824,
          669,
          49171,
          49175,
          49807,
          671,
          49168,
          49165,
          49807,
          665,
          49165,
          49173,
          49807,
          670,
          49159,
          49162,
          49817,
          663,
          49158,
          49160,
          49794,
          666,
          49167,
          49148,
          49790,
          663,
          49151,
          49166,
          49791,
          664,
          49161,
          49158,
          49796,
          662,
          49147
        ]
      }
    ]
  ],
  "app_os": "darwin-x64",
  "app_name": "PhotosynQ",
  "app_version": "0.0.11-DMK",
  "app_device": "x64",
  "location": [
    "42.7223812",
    "-84.4746593"
  ],
  "time_offset": "America/Detroit",
  "ConsoleMacro": "377"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
0
Latest Update:
Jul 2017