wasp_ECS_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_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_850_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": 1507384898522,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "00:00:00:05",
  "device_battery": 90,
  "device_firmware": 1.22,
  "sample": [
    [
      {
        "time": 1507384898535,
        "protocol_id": 1,
        "label": "WASP_ECS",
        "set_led_delay": [
          0,
          2,
          0,
          1000
        ],
        "light_intensity": 21.446,
        "r": 16,
        "g": 8,
        "b": 4,
        "light_intensity_raw": 29,
        "temperature": 25.09,
        "humidity": 51.543,
        "pressure": 979.507,
        "temperature2": 25.29,
        "humidity2": 47.182,
        "pressure2": 978.546,
        "contactless_temp": 23.89,
        "thickness": 1.1,
        "data_raw": [
          7543,
          20103,
          12671,
          7538,
          7542,
          20106,
          12668,
          7539,
          7536,
          20103,
          12670,
          7534,
          7538,
          20091,
          12673,
          7536,
          7531,
          20096,
          12678,
          7535,
          7535,
          20089,
          12673,
          7535,
          7535,
          20091,
          12669,
          7537,
          7537,
          20089,
          12671,
          7531,
          7537,
          20094,
          12671,
          7535,
          7534,
          20093,
          12675,
          7530,
          7534,
          20094,
          12677,
          7535,
          7530,
          20099,
          12675,
          7529,
          7537,
          20088,
          12675,
          7537,
          7529,
          20093,
          12672,
          7532,
          7533,
          20090,
          12674,
          7529,
          7534,
          20095,
          12672,
          7534,
          7530,
          20089,
          12673,
          7527,
          7529,
          20093,
          12664,
          7535,
          7527,
          20091,
          12675,
          7527,
          7533,
          20086,
          12679,
          7532,
          7528,
          20095,
          12675,
          7535,
          7535,
          20087,
          12678,
          7532,
          7530,
          20095,
          12671,
          7532,
          7533,
          20094,
          12675,
          7528,
          7535,
          20098,
          12669,
          7535,
          7527,
          20098,
          12674,
          7527,
          7532,
          20097,
          12674,
          7533,
          7529,
          20096,
          12677,
          7530,
          7532,
          20091,
          12675,
          7533,
          7529,
          20095,
          12672,
          7535,
          7532,
          20088,
          12678,
          7530,
          7534,
          20098,
          12672,
          7533,
          7532,
          20098,
          12675,
          7527,
          7534,
          20098,
          12674,
          7531,
          7529,
          20097,
          12679,
          7529,
          7532,
          20086,
          12679,
          7532,
          7530,
          20094,
          12673,
          7534,
          7531,
          20088,
          12676,
          7531,
          7534,
          20094,
          12668,
          7535,
          7535,
          20095,
          12676,
          7530,
          7531,
          20099,
          12667,
          7529,
          7531,
          20094,
          12676,
          7529,
          7535,
          20091,
          12674,
          7532,
          7527,
          20095,
          12679,
          7531,
          7535,
          20097,
          12675,
          7535,
          7534,
          20099,
          12671,
          7533,
          7535,
          20095,
          12677,
          7529,
          7534,
          20095,
          12667,
          7535,
          7529,
          20090,
          12677,
          7529,
          7535,
          20092,
          12677,
          7535,
          7531,
          20094,
          12671,
          7533,
          7533,
          20096,
          12675,
          7534,
          7530,
          20095,
          12672,
          7533,
          7534,
          20094,
          12679,
          7530,
          7531,
          20099,
          12673,
          7532,
          7530,
          20093,
          12679,
          7531,
          7535,
          20093,
          12676,
          7533,
          7527,
          20098,
          12675,
          7529,
          7529,
          20089,
          12679,
          7537,
          7531,
          20097,
          12673,
          7537,
          7534,
          20094,
          12676,
          7529,
          7536,
          20101,
          12674,
          7534,
          7529,
          20099,
          12679,
          7527,
          7531,
          20097,
          12674,
          7534,
          7530,
          20099,
          12678,
          7532,
          7531,
          20095,
          12678,
          7534,
          7531,
          20097,
          12675,
          7537,
          7535,
          20096,
          12676,
          7531,
          7535,
          20092,
          12671,
          7536,
          7531,
          20099,
          12677,
          7527,
          7531,
          20098,
          12679,
          7533,
          7530,
          20099,
          12674,
          7531,
          7535,
          20092,
          12678,
          7534,
          7535,
          20098,
          12673,
          7532,
          7535,
          20092,
          12675,
          7528,
          7536,
          20094,
          12674,
          7533,
          7528,
          20095,
          12673,
          7535,
          7538,
          20089,
          12672,
          7532,
          7538,
          20095,
          12669,
          7535,
          7532,
          20097,
          12675,
          7529,
          7534,
          20089,
          12679,
          7535,
          7533,
          20096,
          12671,
          7533,
          7535,
          20098,
          12675,
          7529,
          7537,
          20099,
          12672,
          7536,
          7532,
          20095,
          12671,
          7530,
          7536,
          20094,
          12677,
          7535,
          7531,
          20098,
          12669,
          7533,
          7535,
          20098,
          12675,
          7530,
          7535,
          20092,
          12673,
          7535,
          7531,
          20096,
          12675,
          7537,
          7539,
          20094,
          12677,
          7533,
          7536,
          20094,
          12673,
          7535,
          7536,
          20100,
          12679,
          7533,
          7534,
          20091,
          12674,
          7532,
          7530,
          20098,
          12673,
          7540,
          7537,
          20092,
          12677,
          7531,
          7534,
          20098,
          12675,
          7536,
          7531,
          20095,
          12676,
          7531,
          7534,
          20097,
          12679,
          7535,
          7529,
          20094,
          12672,
          7534,
          7532,
          20088,
          12678,
          7516,
          7522,
          20089,
          12672,
          7516,
          7517,
          20090,
          12682,
          7517,
          7524,
          20087,
          12677,
          7522,
          7521,
          20090,
          12678,
          7524,
          7527,
          20084,
          12679,
          7529,
          7523,
          20088,
          12674,
          7529,
          7530,
          20091,
          12679,
          7526,
          7531,
          20096,
          12676,
          7528,
          7527,
          20095,
          12678,
          7527,
          7531,
          20097,
          12679,
          7531,
          7527,
          20093,
          12677,
          7530,
          7531,
          20095,
          12679,
          7530,
          7530,
          20097,
          12677,
          7532,
          7533,
          20094,
          12679,
          7525,
          7531,
          20095,
          12676,
          7529,
          7527,
          20099,
          12679,
          7523,
          7529,
          20095,
          12682,
          7527,
          7526,
          20092,
          12677,
          7531,
          7530,
          20084,
          12678,
          7529,
          7528,
          20093,
          12672,
          7527,
          7531,
          20095,
          12679,
          7526,
          7530,
          20094,
          12675,
          7530,
          7524,
          20093,
          12681,
          7526,
          7529,
          20086,
          12679,
          7531,
          7525,
          20089,
          12673,
          7527,
          7529,
          20089,
          12679,
          7527,
          7530,
          20094,
          12676,
          7525,
          7523,
          20091,
          12679,
          7525,
          7527,
          20084,
          12678,
          7525,
          7523,
          20086,
          12675,
          7527,
          7527,
          20083,
          12676,
          7523,
          7526,
          20092,
          12675,
          7522,
          7523,
          20087,
          12679,
          7519,
          7523,
          20087,
          12676,
          7525,
          7519,
          20085,
          12682,
          7519,
          7525,
          20085,
          12682,
          7523,
          7518,
          20081,
          12679,
          7526,
          7524,
          20082,
          12677,
          7515,
          7521,
          20084,
          12671,
          7521,
          7518,
          20087,
          12679,
          7516,
          7518,
          20079,
          12678,
          7520,
          7516,
          20087,
          12684,
          7517,
          7520,
          20081,
          12677,
          7519,
          7512,
          20080,
          12678,
          7519,
          7518,
          20077,
          12679,
          7512,
          7517,
          20076,
          12676,
          7519,
          7510,
          20083,
          12679,
          7514,
          7517,
          20078,
          12679,
          7514,
          7507,
          20081,
          12673,
          7517,
          7516,
          20080,
          12679,
          7508,
          7516,
          20082,
          12676,
          7513,
          7514,
          20076,
          12679,
          7512,
          7513,
          20073,
          12678,
          7511,
          7507,
          20082,
          12678,
          7507,
          7511,
          20076,
          12679,
          7516,
          7508,
          20079,
          12676,
          7511,
          7513,
          20074,
          12680,
          7507,
          7515,
          20077,
          12678,
          7510,
          7507,
          20077,
          12684,
          7505,
          7511,
          20076,
          12681,
          7511,
          7506,
          20075,
          12678,
          7511,
          7511,
          20075,
          12679,
          7508,
          7506,
          20076,
          12681,
          7506,
          7508,
          20071,
          12683,
          7503,
          7511,
          20080,
          12678,
          7506,
          7503,
          20072,
          12681,
          7503,
          7507,
          20072,
          12681,
          7504,
          7501,
          20071,
          12679,
          7506,
          7510,
          20072,
          12683,
          7499,
          7507,
          20071,
          12675,
          7506,
          7506,
          20071,
          12675,
          7499,
          7502,
          20072,
          12678,
          7502,
          7499,
          20069,
          12680,
          7498,
          7505,
          20067,
          12683,
          7502,
          7500,
          20071,
          12679,
          7504,
          7504,
          20066,
          12681,
          7498,
          7503,
          20068,
          12673,
          7499,
          7502,
          20075,
          12680,
          7497,
          7499,
          20064,
          12681,
          7502,
          7497,
          20068,
          12680,
          7497,
          7501,
          20063,
          12683,
          7503,
          7500,
          20070,
          12677,
          7500,
          7497,
          20065,
          12681,
          7497,
          7499,
          20065,
          12677,
          7499,
          7495,
          20064,
          12679,
          7495,
          7500,
          20061,
          12681,
          7497,
          7494,
          20067,
          12681,
          7499,
          7500,
          20063,
          12679,
          7495,
          7500,
          20059,
          12673,
          7498,
          7495,
          20065,
          12679,
          7493,
          7497,
          20068,
          12679,
          7497,
          7495,
          20059,
          12679,
          7493,
          7496,
          20057,
          12681,
          7497,
          7495,
          20065,
          12672,
          7495,
          7499,
          20059,
          12679,
          7492,
          7495,
          20058,
          12675,
          7495,
          7494,
          20063,
          12679,
          7490,
          7495,
          20058,
          12683,
          7495,
          7495,
          20063,
          12677,
          7494,
          7497,
          20056,
          12705,
          7478,
          7479,
          20058,
          12704,
          7475,
          7464,
          20052,
          12707,
          7471,
          7473,
          20047,
          12706,
          7469,
          7475,
          20052,
          12711,
          7478,
          7476,
          20059,
          12707,
          7481,
          7474,
          20060,
          12707,
          7479,
          7483,
          20066,
          12713,
          7480,
          7482,
          20066,
          12711,
          7479,
          7487,
          20066,
          12711,
          7484,
          7487,
          20073,
          12713,
          7489,
          7484,
          20071,
          12711,
          7485,
          7481,
          20070,
          12710,
          7485,
          7485,
          20071,
          12711,
          7483,
          7490,
          20071,
          12716,
          7484,
          7485,
          20068,
          12715,
          7483,
          7486,
          20070,
          12716,
          7487,
          7484,
          20071,
          12716,
          7484,
          7481,
          20078,
          12717,
          7483,
          7481,
          20071,
          12711,
          7482,
          7483,
          20079,
          12714,
          7478,
          7483,
          20067,
          12713,
          7476,
          7481,
          20066,
          12714,
          7480,
          7483,
          20071,
          12717,
          7482,
          7482,
          20070,
          12711,
          7478,
          7474,
          20072,
          12712,
          7482,
          7479,
          20073,
          12717,
          7483,
          7481,
          20074,
          12715,
          7476,
          7481,
          20067,
          12717,
          7474,
          7482,
          20063,
          12715,
          7474,
          7479,
          20068,
          12719,
          7481,
          7480,
          20071,
          12711,
          7477,
          7473,
          20065,
          12710,
          7477,
          7475,
          20070,
          12717,
          7483,
          7481,
          20075,
          12722,
          7474,
          7479,
          20068,
          12720,
          7473,
          7479,
          20067,
          12716,
          7473,
          7479,
          20068,
          12719,
          7479,
          7479,
          20071,
          12711,
          7475,
          7473,
          20067,
          12711,
          7479,
          7475,
          20071,
          12714,
          7475,
          7475,
          20071,
          12716,
          7475,
          7477,
          20063,
          12718,
          7473,
          7477,
          20063,
          12719,
          7471,
          7478,
          20068,
          12722,
          7478,
          7479,
          20071,
          12717,
          7477,
          7472,
          20066,
          12716,
          7475,
          7470,
          20065,
          12713,
          7476,
          7473,
          20070,
          12723,
          7478,
          7476,
          20067,
          12722,
          7472,
          7475,
          20068,
          12720,
          7472,
          7475,
          20063,
          12721,
          7471,
          7472,
          20068,
          12721,
          7475,
          7475,
          20066,
          12719,
          7476,
          7470,
          20065,
          12713,
          7473,
          7470,
          20071,
          12720,
          7475,
          7470,
          20069,
          12724,
          7474,
          7472,
          20064,
          12719,
          7470,
          7477,
          20063,
          12721,
          7470,
          7476,
          20059,
          12721,
          7469,
          7474,
          20068,
          12722,
          7473,
          7473,
          20065,
          12712,
          7473,
          7470,
          20071,
          12715,
          7472,
          7470,
          20071,
          12715,
          7473,
          7473,
          20071,
          12721,
          7470,
          7475,
          20065,
          12724,
          7466,
          7473,
          20058,
          12718,
          7467,
          7473,
          20065,
          12718,
          7474,
          7475,
          20066,
          12717,
          7472,
          7467,
          20064,
          12716,
          7474,
          7469,
          20065,
          12718,
          7473,
          7471,
          20067,
          12722,
          7473,
          7475,
          20058,
          12723,
          7469,
          7475,
          20055,
          12720,
          7471,
          7471,
          20059,
          12717,
          7470,
          7474,
          20066,
          12720,
          7474,
          7467,
          20063,
          12712,
          7470,
          7471,
          20067,
          12716,
          7472,
          7471,
          20063,
          12719,
          7475,
          7474,
          20065,
          12719,
          7465,
          7471,
          20062,
          12721,
          7469,
          7472,
          20065,
          12721,
          7468,
          7472,
          20059,
          12723,
          7472,
          7474,
          20067,
          12716,
          7471,
          7466,
          20063,
          12717,
          7471,
          7468,
          20062,
          12715,
          7474,
          7467,
          20069,
          12715,
          7473,
          7475,
          20069,
          12722,
          7469,
          7472,
          20063,
          12721,
          7466,
          7471,
          20058,
          12723,
          7467,
          7471,
          20061,
          12719,
          7469,
          7471,
          20059,
          12722,
          7471,
          7473,
          20063,
          12718,
          7475,
          7471,
          20067,
          12716,
          7472,
          7471,
          20066,
          12711,
          7473,
          7471,
          20065,
          12714,
          7472,
          7469,
          20063,
          12712,
          7474,
          7470,
          20064,
          12716,
          7474,
          7473,
          20067,
          12716,
          7472,
          7474,
          20066,
          12719,
          7467,
          7464,
          20038,
          12690,
          7463,
          7469,
          20039,
          12687,
          7467,
          7473,
          20045,
          12687,
          7469,
          7469,
          20046,
          12684,
          7476,
          7471,
          20054,
          12686,
          7474,
          7474,
          20039,
          12682,
          7473,
          7475,
          20052,
          12685,
          7476,
          7472,
          20047,
          12684,
          7479,
          7482,
          20049,
          12688,
          7475,
          7482,
          20051,
          12680,
          7483,
          7479,
          20053,
          12687,
          7483,
          7483,
          20048,
          12679,
          7487,
          7485,
          20052,
          12679,
          7490,
          7490,
          20063,
          12683,
          7489,
          7492,
          20061,
          12684,
          7495,
          7490,
          20069,
          12681,
          7500,
          7500,
          20067,
          12687,
          7494,
          7498,
          20067,
          12679,
          7503,
          7500,
          20075,
          12686,
          7501,
          7503,
          20070,
          12679,
          7499,
          7505,
          20070,
          12679,
          7506,
          7503,
          20079,
          12685,
          7506,
          7508,
          20080,
          12682,
          7506,
          7512,
          20081,
          12675,
          7511,
          7508,
          20087,
          12684,
          7508,
          7515,
          20082,
          12681,
          7514,
          7513,
          20091,
          12678,
          7516,
          7514,
          20082,
          12680,
          7513,
          7519,
          20085,
          12683,
          7520,
          7514,
          20084,
          12676,
          7518,
          7519,
          20080,
          12685,
          7515,
          7521,
          20093,
          12679,
          7519,
          7517,
          20088,
          12680,
          7524,
          7521,
          20087,
          12683,
          7519,
          7523,
          20087,
          12679,
          7523,
          7519,
          20095,
          12684,
          7522,
          7525,
          20085,
          12684,
          7523,
          7527,
          20094,
          12675,
          7524,
          7522,
          20092,
          12679,
          7523,
          7525,
          20089,
          12680,
          7527,
          7522,
          20091,
          12678,
          7526,
          7527,
          20093,
          12683,
          7523,
          7527,
          20093,
          12682,
          7525,
          7522,
          20091,
          12678,
          7527,
          7526,
          20087,
          12680,
          7521,
          7525,
          20093,
          12684,
          7528,
          7525,
          20099,
          12680,
          7528,
          7527,
          20094,
          12681,
          7526,
          7528,
          20089,
          12679,
          7527,
          7527,
          20101,
          12683,
          7523,
          7527,
          20091,
          12682,
          7526,
          7527,
          20100,
          12679,
          7529,
          7527,
          20096,
          12681,
          7525,
          7529,
          20094,
          12679,
          7530,
          7524,
          20097,
          12678,
          7528,
          7531,
          20099,
          12680,
          7527,
          7527,
          20090,
          12682,
          7531,
          7527,
          20101,
          12680,
          7530,
          7529,
          20090,
          12679,
          7525,
          7531,
          20101,
          12679,
          7530,
          7527,
          20101,
          12684,
          7525,
          7533,
          20094,
          12681,
          7529,
          7525,
          20098,
          12677,
          7529,
          7533,
          20097,
          12679,
          7527,
          7531,
          20101,
          12675,
          7530,
          7531,
          20100,
          12682,
          7527,
          7530,
          20093,
          12680,
          7530,
          7528,
          20102,
          12677,
          7529,
          7531,
          20093,
          12677,
          7527,
          7532,
          20101,
          12679,
          7530,
          7529,
          20104,
          12683,
          7528,
          7530,
          20089,
          12679,
          7531,
          7528,
          20095,
          12676,
          7530,
          7533,
          20097,
          12682,
          7527,
          7532,
          20102,
          12679,
          7532,
          7527,
          20101,
          12681,
          7527,
          7530,
          20093,
          12681,
          7532,
          7528,
          20098,
          12679,
          7534,
          7532,
          20095,
          12679,
          7528,
          7532,
          20103,
          12679,
          7531,
          7529,
          20102,
          12684,
          7530,
          7531,
          20103,
          12683,
          7534,
          7535,
          20103,
          12679,
          7531,
          7535,
          20101,
          12683,
          7527,
          7534,
          20095,
          12679,
          7529,
          7527,
          20095,
          12679,
          7534,
          7531,
          20100,
          12680,
          7531,
          7531,
          20105,
          12679,
          7534,
          7530,
          20105,
          12684,
          7530,
          7533,
          20098,
          12681,
          7533,
          7531,
          20097,
          12679,
          7531,
          7532,
          20097,
          12681,
          7527,
          7531,
          20095,
          12682,
          7537,
          7527,
          20103,
          12679,
          7533,
          7534,
          20090,
          12677,
          7528,
          7532,
          20101,
          12678,
          7535,
          7528,
          20100,
          12680,
          7527,
          7532,
          20100,
          12682,
          7533,
          7531,
          20101,
          12677,
          7530,
          7533,
          20091,
          12679,
          7527
        ]
      }
    ]
  ],
  "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