wasp_ECS_test_2


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_ECS =[]; //transmission values before application of the WASP pulses
var WASP_ECS =[]; //apparent transmission values during application of the WASP pulses
var WASP_no_MP =[]; //apparent transmission values with WASP pulses but no measureing pulses

for (var i =0; i<json.data_raw.length; i=i+4){
  BACK_ECS.push(json.data_raw[i]);
  WASP_ECS.push(json.data_raw[i+1]);
  WASP_no_MP.push(json.data_raw[i+2]);
}

output.BACK_ECS=BACK_ECS;
output.WASP_ECS=WASP_ECS;
output.WASP_no_MP=WASP_no_MP;

var WASP_ECS_corr=[];   // WASP_transmission minus apparent transmission
  						// taken without the measuring pulses
for (var i =0; i<WASP_ECS.length; i=i+1){
	WASP_ECS_corr.push(WASP_ECS[i]-WASP_no_MP[i]); 
}
output.WASP_ECS_corr=WASP_ECS_corr;

var DELTA_WASP=[];       //  baseline transmission - WASP_transmission corrected for 
						 // WASP pulse apparent transmission 
  						
for (var i =0; i<WASP_ECS_corr.length; i=i+1){
	DELTA_WASP.push(WASP_ECS_corr[i]-BACK_ECS[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": 1507386552989,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "00:00:00:05",
  "device_battery": 86,
  "device_firmware": 1.22,
  "sample": [
    [
      {
        "time": 1507386553001,
        "protocol_id": 1,
        "label": "WASP_ECS",
        "set_led_delay": [
          0,
          2,
          0,
          1000
        ],
        "light_intensity": 23.129,
        "r": 16,
        "g": 8,
        "b": 5,
        "light_intensity_raw": 30,
        "temperature": 26.07,
        "humidity": 52.775,
        "pressure": 978.997,
        "temperature2": 26.25,
        "humidity2": 48.206,
        "pressure2": 978.024,
        "contactless_temp": 24.91,
        "thickness": 0.73,
        "data_raw": [
          10801,
          23173,
          12394,
          10779,
          10785,
          23155,
          12394,
          10785,
          10776,
          23158,
          12392,
          10770,
          10773,
          23159,
          12391,
          10783,
          10772,
          23143,
          12391,
          10767,
          10763,
          23131,
          12395,
          10776,
          10770,
          23140,
          12391,
          10773,
          10771,
          23143,
          12394,
          10776,
          10770,
          23150,
          12396,
          10768,
          10787,
          23152,
          12397,
          10761,
          10758,
          23147,
          12399,
          10765,
          10770,
          23150,
          12395,
          10763,
          10769,
          23145,
          12395,
          10760,
          10769,
          23156,
          12391,
          10771,
          10763,
          23159,
          12394,
          10763,
          10759,
          23151,
          12391,
          10770,
          10764,
          23120,
          12395,
          10770,
          10759,
          23145,
          12391,
          10762,
          10768,
          23129,
          12393,
          10765,
          10772,
          23155,
          12391,
          10773,
          10768,
          23139,
          12395,
          10774,
          10770,
          23144,
          12393,
          10769,
          10777,
          23151,
          12398,
          10770,
          10765,
          23138,
          12398,
          10766,
          10769,
          23134,
          12397,
          10778,
          10771,
          23146,
          12393,
          10774,
          10777,
          23150,
          12393,
          10770,
          10764,
          23151,
          12396,
          10762,
          10763,
          23143,
          12399,
          10775,
          10761,
          23146,
          12400,
          10775,
          10782,
          23152,
          12393,
          10768,
          10762,
          23152,
          12395,
          10765,
          10782,
          23143,
          12394,
          10777,
          10761,
          23149,
          12395,
          10771,
          10781,
          23142,
          12396,
          10762,
          10760,
          23137,
          12395,
          10772,
          10763,
          23141,
          12397,
          10770,
          10768,
          23150,
          12391,
          10769,
          10762,
          23140,
          12393,
          10764,
          10769,
          23158,
          12390,
          10781,
          10771,
          23155,
          12394,
          10773,
          10769,
          23170,
          12391,
          10783,
          10761,
          23147,
          12397,
          10773,
          10759,
          23145,
          12393,
          10778,
          10783,
          23139,
          12399,
          10764,
          10763,
          23148,
          12392,
          10768,
          10765,
          23150,
          12399,
          10767,
          10772,
          23151,
          12391,
          10771,
          10764,
          23137,
          12393,
          10770,
          10760,
          23155,
          12394,
          10782,
          10776,
          23148,
          12397,
          10787,
          10775,
          23159,
          12391,
          10770,
          10781,
          23137,
          12398,
          10774,
          10763,
          23143,
          12390,
          10778,
          10795,
          23158,
          12394,
          10762,
          10769,
          23150,
          12391,
          10778,
          10784,
          23142,
          12394,
          10775,
          10783,
          23152,
          12389,
          10781,
          10779,
          23153,
          12398,
          10781,
          10768,
          23155,
          12392,
          10781,
          10775,
          23151,
          12397,
          10770,
          10764,
          23143,
          12399,
          10774,
          10778,
          23147,
          12393,
          10775,
          10767,
          23163,
          12394,
          10775,
          10779,
          23159,
          12391,
          10779,
          10779,
          23162,
          12394,
          10783,
          10779,
          23161,
          12391,
          10787,
          10781,
          23153,
          12397,
          10776,
          10781,
          23152,
          12394,
          10784,
          10773,
          23143,
          12394,
          10760,
          10795,
          23159,
          12387,
          10779,
          10770,
          23151,
          12395,
          10764,
          10779,
          23147,
          12392,
          10769,
          10781,
          23159,
          12394,
          10774,
          10770,
          23151,
          12391,
          10781,
          10781,
          23160,
          12392,
          10768,
          10770,
          23147,
          12390,
          10782,
          10777,
          23144,
          12394,
          10779,
          10778,
          23158,
          12391,
          10777,
          10777,
          23169,
          12396,
          10773,
          10770,
          23143,
          12393,
          10775,
          10762,
          23147,
          12394,
          10772,
          10769,
          23151,
          12387,
          10765,
          10772,
          23143,
          12391,
          10765,
          10778,
          23144,
          12393,
          10770,
          10770,
          23155,
          12397,
          10753,
          10763,
          23145,
          12390,
          10775,
          10771,
          23148,
          12393,
          10771,
          10784,
          23144,
          12391,
          10781,
          10779,
          23143,
          12392,
          10779,
          10782,
          23165,
          12391,
          10772,
          10770,
          23150,
          12395,
          10781,
          10765,
          23155,
          12392,
          10779,
          10779,
          23153,
          12395,
          10780,
          10777,
          23151,
          12397,
          10765,
          10775,
          23155,
          12394,
          10779,
          10768,
          23143,
          12391,
          10780,
          10770,
          23147,
          12387,
          10771,
          10783,
          23154,
          12395,
          10771,
          10781,
          23149,
          12391,
          10776,
          10774,
          23137,
          12406,
          10739,
          10726,
          23128,
          12403,
          10727,
          10731,
          23107,
          12412,
          10727,
          10720,
          23109,
          12411,
          10719,
          10720,
          23115,
          12409,
          10726,
          10720,
          23112,
          12414,
          10712,
          10715,
          23111,
          12413,
          10723,
          10708,
          23111,
          12415,
          10709,
          10714,
          23110,
          12409,
          10718,
          10703,
          23114,
          12413,
          10707,
          10718,
          23110,
          12414,
          10707,
          10705,
          23108,
          12415,
          10700,
          10717,
          23107,
          12413,
          10715,
          10709,
          23109,
          12414,
          10705,
          10705,
          23105,
          12410,
          10703,
          10711,
          23106,
          12415,
          10704,
          10708,
          23110,
          12411,
          10709,
          10713,
          23107,
          12419,
          10703,
          10706,
          23118,
          12418,
          10709,
          10717,
          23107,
          12416,
          10711,
          10707,
          23106,
          12417,
          10699,
          10711,
          23110,
          12417,
          10712,
          10706,
          23111,
          12418,
          10698,
          10713,
          23111,
          12417,
          10696,
          10699,
          23099,
          12417,
          10698,
          10696,
          23100,
          12415,
          10695,
          10699,
          23092,
          12421,
          10706,
          10706,
          23111,
          12415,
          10717,
          10709,
          23091,
          12419,
          10698,
          10716,
          23107,
          12416,
          10703,
          10703,
          23113,
          12417,
          10707,
          10703,
          23116,
          12417,
          10699,
          10705,
          23124,
          12413,
          10711,
          10711,
          23102,
          12420,
          10720,
          10715,
          23105,
          12415,
          10715,
          10708,
          23118,
          12420,
          10712,
          10707,
          23115,
          12413,
          10713,
          10699,
          23113,
          12419,
          10714,
          10715,
          23107,
          12416,
          10707,
          10705,
          23095,
          12419,
          10717,
          10716,
          23113,
          12417,
          10710,
          10710,
          23101,
          12419,
          10719,
          10705,
          23111,
          12421,
          10701,
          10708,
          23103,
          12418,
          10703,
          10697,
          23100,
          12419,
          10706,
          10708,
          23118,
          12418,
          10708,
          10707,
          23114,
          12423,
          10716,
          10719,
          23127,
          12419,
          10713,
          10717,
          23109,
          12423,
          10704,
          10697,
          23111,
          12420,
          10715,
          10703,
          23095,
          12423,
          10707,
          10697,
          23110,
          12420,
          10700,
          10699,
          23108,
          12415,
          10708,
          10702,
          23104,
          12418,
          10703,
          10720,
          23112,
          12416,
          10707,
          10702,
          23099,
          12419,
          10707,
          10702,
          23117,
          12419,
          10695,
          10711,
          23098,
          12423,
          10712,
          10716,
          23111,
          12421,
          10707,
          10711,
          23121,
          12416,
          10706,
          10700,
          23105,
          12423,
          10698,
          10715,
          23111,
          12414,
          10703,
          10708,
          23102,
          12423,
          10712,
          10710,
          23115,
          12422,
          10695,
          10706,
          23099,
          12421,
          10699,
          10698,
          23097,
          12423,
          10695,
          10701,
          23117,
          12414,
          10700,
          10703,
          23107,
          12422,
          10707,
          10701,
          23111,
          12419,
          10701,
          10703,
          23105,
          12421,
          10699,
          10711,
          23109,
          12421,
          10697,
          10706,
          23107,
          12416,
          10697,
          10699,
          23099,
          12423,
          10697,
          10703,
          23111,
          12420,
          10697,
          10701,
          23084,
          12422,
          10706,
          10695,
          23089,
          12419,
          10700,
          10707,
          23103,
          12423,
          10699,
          10683,
          23106,
          12423,
          10689,
          10690,
          23096,
          12421,
          10693,
          10695,
          23110,
          12421,
          10693,
          10696,
          23106,
          12419,
          10715,
          10705,
          23094,
          12422,
          10701,
          10692,
          23099,
          12425,
          10695,
          10696,
          23107,
          12424,
          10703,
          10692,
          23106,
          12423,
          10695,
          10702,
          23110,
          12415,
          10707,
          10698,
          23099,
          12422,
          10705,
          10704,
          23113,
          12419,
          10695,
          10691,
          23107,
          12426,
          10691,
          10697,
          23105,
          12421,
          10701,
          10689,
          23092,
          12423,
          10703,
          10699,
          23113,
          12419,
          10688,
          10699,
          23107,
          12423,
          10699,
          10696,
          23112,
          12427,
          10697,
          10700,
          23107,
          12428,
          10702,
          10697,
          23104,
          12423,
          10693,
          10704,
          23111,
          12420,
          10698,
          10706,
          23109,
          12427,
          10699,
          10700,
          23108,
          12423,
          10702,
          10707,
          23115,
          12427,
          10695,
          10685,
          23121,
          12455,
          10685,
          10683,
          23117,
          12463,
          10695,
          10683,
          23132,
          12464,
          10690,
          10695,
          23143,
          12467,
          10695,
          10707,
          23135,
          12470,
          10695,
          10694,
          23143,
          12467,
          10691,
          10706,
          23149,
          12471,
          10710,
          10701,
          23153,
          12475,
          10710,
          10695,
          23131,
          12475,
          10714,
          10691,
          23143,
          12473,
          10698,
          10718,
          23143,
          12465,
          10704,
          10710,
          23155,
          12471,
          10694,
          10695,
          23151,
          12477,
          10691,
          10705,
          23143,
          12471,
          10698,
          10708,
          23146,
          12471,
          10709,
          10705,
          23147,
          12471,
          10707,
          10702,
          23159,
          12474,
          10695,
          10701,
          23155,
          12470,
          10695,
          10703,
          23152,
          12473,
          10718,
          10701,
          23148,
          12475,
          10703,
          10707,
          23155,
          12473,
          10697,
          10708,
          23144,
          12473,
          10698,
          10698,
          23139,
          12470,
          10695,
          10694,
          23143,
          12471,
          10699,
          10699,
          23145,
          12472,
          10703,
          10687,
          23146,
          12471,
          10707,
          10702,
          23145,
          12475,
          10703,
          10706,
          23145,
          12477,
          10710,
          10695,
          23154,
          12472,
          10706,
          10705,
          23161,
          12467,
          10713,
          10711,
          23158,
          12470,
          10713,
          10706,
          23163,
          12477,
          10711,
          10698,
          23169,
          12475,
          10705,
          10715,
          23157,
          12471,
          10729,
          10708,
          23153,
          12473,
          10709,
          10713,
          23171,
          12476,
          10718,
          10703,
          23159,
          12478,
          10717,
          10705,
          23162,
          12470,
          10707,
          10715,
          23158,
          12470,
          10703,
          10711,
          23150,
          12474,
          10720,
          10705,
          23167,
          12478,
          10713,
          10717,
          23166,
          12473,
          10721,
          10714,
          23166,
          12470,
          10711,
          10714,
          23157,
          12472,
          10715,
          10713,
          23175,
          12474,
          10726,
          10713,
          23175,
          12473,
          10721,
          10711,
          23173,
          12471,
          10721,
          10711,
          23159,
          12477,
          10722,
          10718,
          23177,
          12476,
          10724,
          10725,
          23175,
          12471,
          10735,
          10728,
          23174,
          12470,
          10730,
          10736,
          23173,
          12475,
          10715,
          10727,
          23183,
          12475,
          10717,
          10727,
          23180,
          12473,
          10725,
          10715,
          23180,
          12468,
          10730,
          10714,
          23169,
          12480,
          10743,
          10725,
          23176,
          12475,
          10735,
          10735,
          23186,
          12471,
          10731,
          10738,
          23188,
          12467,
          10740,
          10732,
          23174,
          12471,
          10739,
          10730,
          23173,
          12473,
          10741,
          10728,
          23191,
          12473,
          10743,
          10746,
          23183,
          12465,
          10743,
          10735,
          23181,
          12472,
          10744,
          10748,
          23189,
          12475,
          10749,
          10748,
          23196,
          12475,
          10743,
          10748,
          23188,
          12469,
          10757,
          10755,
          23197,
          12478,
          10744,
          10746,
          23200,
          12476,
          10761,
          10746,
          23198,
          12471,
          10742,
          10757,
          23200,
          12466,
          10762,
          10768,
          23188,
          12467,
          10751,
          10738,
          23172,
          12473,
          10747,
          10735,
          23181,
          12478,
          10743,
          10746,
          23203,
          12468,
          10750,
          10747,
          23190,
          12470,
          10743,
          10747,
          23197,
          12474,
          10755,
          10739,
          23196,
          12472,
          10755,
          10762,
          23194,
          12472,
          10747,
          10753,
          23193,
          12466,
          10759,
          10771,
          23195,
          12471,
          10758,
          10751,
          23196,
          12470,
          10755,
          10762,
          23201,
          12473,
          10770,
          10781,
          23218,
          12471,
          10759,
          10753,
          23210,
          12467,
          10761,
          10767,
          23197,
          12473,
          10763,
          10746,
          23199,
          12469,
          10757,
          10755,
          23203,
          12466,
          10766,
          10777,
          23219,
          12469,
          10761,
          10767,
          23203,
          12472,
          10765,
          10752,
          23204,
          12468,
          10759,
          10768,
          23202,
          12466,
          10754,
          10753,
          23210,
          12463,
          10767,
          10766,
          23200,
          12470,
          10752,
          10760,
          23211,
          12471,
          10757,
          10763,
          23218,
          12472,
          10765,
          10760,
          23206,
          12470,
          10762,
          10762,
          23204,
          12471,
          10765,
          10765,
          23185,
          12471,
          10771,
          10745,
          23213,
          12468,
          10763,
          10769,
          23207,
          12439,
          10797,
          10796,
          23204,
          12431,
          10805,
          10802,
          23222,
          12427,
          10804,
          10810,
          23230,
          12420,
          10825,
          10820,
          23229,
          12418,
          10839,
          10827,
          23232,
          12416,
          10831,
          10835,
          23219,
          12413,
          10841,
          10836,
          23221,
          12423,
          10831,
          10826,
          23230,
          12417,
          10834,
          10824,
          23237,
          12416,
          10846,
          10838,
          23245,
          12418,
          10835,
          10841,
          23235,
          12416,
          10837,
          10822,
          23215,
          12420,
          10843,
          10851,
          23240,
          12412,
          10839,
          10837,
          23226,
          12419,
          10834,
          10828,
          23232,
          12413,
          10831,
          10830,
          23221,
          12417,
          10829,
          10823,
          23230,
          12415,
          10829,
          10839,
          23239,
          12412,
          10828,
          10821,
          23231,
          12416,
          10831,
          10828,
          23235,
          12415,
          10840,
          10847,
          23243,
          12414,
          10841,
          10831,
          23239,
          12415,
          10828,
          10838,
          23240,
          12412,
          10846,
          10841,
          23237,
          12412,
          10835,
          10852,
          23239,
          12408,
          10836,
          10830,
          23226,
          12418,
          10840,
          10838,
          23236,
          12416,
          10843,
          10842,
          23239,
          12413,
          10841,
          10829,
          23239,
          12415,
          10839,
          10847,
          23242,
          12411,
          10847,
          10855,
          23239,
          12418,
          10848,
          10837,
          23238,
          12417,
          10838,
          10840,
          23238,
          12417,
          10839,
          10839,
          23250,
          12416,
          10835,
          10845,
          23253,
          12412,
          10844,
          10854,
          23239,
          12415,
          10838,
          10835,
          23245,
          12416,
          10852,
          10844,
          23246,
          12415,
          10846,
          10836,
          23248,
          12421,
          10847,
          10845,
          23246,
          12417,
          10843,
          10847,
          23237,
          12418,
          10835,
          10845,
          23248,
          12411,
          10850,
          10841,
          23233,
          12417,
          10835,
          10843,
          23239,
          12411,
          10835,
          10844,
          23239,
          12418,
          10834,
          10835,
          23231,
          12415,
          10848,
          10833,
          23227,
          12414,
          10836,
          10825,
          23227,
          12423,
          10835,
          10830,
          23241,
          12413,
          10826,
          10824,
          23234,
          12420,
          10846,
          10841,
          23245,
          12410,
          10840,
          10849,
          23229,
          12419,
          10836,
          10845,
          23235,
          12417,
          10843,
          10848,
          23239,
          12415,
          10845,
          10842,
          23250,
          12416,
          10840,
          10855,
          23241,
          12421,
          10853,
          10848,
          23247,
          12415,
          10844,
          10841,
          23249,
          12414,
          10844,
          10830,
          23247,
          12416,
          10832,
          10855,
          23247,
          12412,
          10855,
          10845,
          23236,
          12419,
          10842,
          10834,
          23250,
          12413,
          10835,
          10837,
          23238,
          12418,
          10837,
          10823,
          23246,
          12419,
          10846,
          10849,
          23235,
          12414,
          10841,
          10837,
          23248,
          12414,
          10841,
          10842,
          23240,
          12412,
          10843,
          10836,
          23229,
          12417,
          10844,
          10842,
          23243,
          12411,
          10847,
          10865,
          23242,
          12416,
          10849,
          10847,
          23236,
          12414,
          10850,
          10839,
          23231,
          12418,
          10855,
          10852,
          23239,
          12415,
          10847,
          10851,
          23243,
          12415,
          10850,
          10843,
          23239,
          12415,
          10849,
          10850,
          23251,
          12415,
          10855,
          10842,
          23239,
          12415,
          10846,
          10839,
          23246,
          12412,
          10851,
          10865,
          23245,
          12412,
          10847,
          10847,
          23244,
          12414,
          10848,
          10837,
          23234,
          12413,
          10852,
          10847,
          23234,
          12414,
          10837,
          10845,
          23242,
          12414,
          10845,
          10852,
          23239,
          12416,
          10851,
          10847,
          23245,
          12412,
          10849,
          10852,
          23239,
          12416,
          10846,
          10840,
          23240,
          12414,
          10836,
          10856,
          23243,
          12413,
          10845,
          10839,
          23242,
          12416,
          10833,
          10849,
          23247,
          12411,
          10848,
          10844,
          23235,
          12416,
          10837,
          10850,
          23245,
          12404,
          10856,
          10851,
          23232,
          12412,
          10850,
          10849,
          23239,
          12413,
          10851,
          10847,
          23235,
          12417,
          10852,
          10854,
          23243,
          12413,
          10854,
          10849,
          23246,
          12406,
          10845,
          10850,
          23245,
          12417,
          10829,
          10847,
          23233,
          12409,
          10856
        ]
      }
    ]
  ],
  "app_os": "darwin-16.7.0",
  "app_name": "PhotosynQ",
  "app_version": "0.0.27",
  "app_device": "x64",
  "location": false,
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
0
Latest Update:
Oct 2017