wasp_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 WASP_850_sp =[];
for (var i =1; i<json.data_raw.length; i=i+2){
  WASP_850_sp.push(json.data_raw[i]);
}

var ECS_wasp=[];
for (var i =1; i<WASP_850_sp.length; i++){
	ECS_wasp.push(ECS_wp[i]/WASP_850_sp[i]);
}
//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 ECS_wasp_smoothed=[];
for (var i =1; i<WASP_850_sp.length; i=i+smooth_range){
	ECS_wasp_smoothed.push(MathMEAN(ECS_wp.slice(i,i+smooth_range-1))/MathMEAN(WASP_850_sp.slice(i,i+smooth_range-1)));
}
output.ECS_wasp_smoothed=ECS_wasp_smoothed;

// Return data
return output;
{
  "time": "1499874710050",
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "00:00:00:05",
  "device_battery": 86,
  "device_firmware": 1.2,
  "sample": [
    [
      {
        "time": "1499874710062",
        "protocol_id": 1,
        "light_intensity": 18.885,
        "r": 16,
        "g": 8,
        "b": 5,
        "light_intensity_raw": 27,
        "temperature": 25.56,
        "humidity": 54.556,
        "pressure": 985.696,
        "temperature2": 25.76,
        "humidity2": 49.328,
        "pressure2": 984.679,
        "contactless_temp": 25.32,
        "thickness": 0.97,
        "data_raw": [
          48414,
          44606,
          47911,
          48335,
          47953,
          48319,
          47957,
          48331,
          47938,
          48313,
          47913,
          48344,
          47975,
          48349,
          47911,
          48340,
          47941,
          48359,
          47931,
          48358,
          47909,
          48353,
          47907,
          48343,
          47927,
          48327,
          47907,
          48314,
          47875,
          48316,
          47903,
          48338,
          47865,
          48367,
          47943,
          48367,
          47940,
          48350,
          47891,
          48324,
          47925,
          48319,
          47871,
          48345,
          47951,
          48333,
          47945,
          48359,
          47935,
          48370,
          47902,
          48333,
          47898,
          48342,
          47908,
          48306,
          47943,
          48323,
          47932,
          48340,
          47958,
          48353,
          47920,
          48359,
          47915,
          48366,
          47899,
          48365,
          47890,
          48348,
          47865,
          48335,
          47889,
          48323,
          47882,
          48317,
          47839,
          48343,
          47885,
          48343,
          47875,
          48346,
          47866,
          48361,
          47876,
          48355,
          47903,
          48338,
          47918,
          48339,
          47894,
          48347,
          47855,
          48318,
          47875,
          48327,
          47898,
          48311,
          47900,
          48318,
          47887,
          48322,
          47851,
          48349,
          47889,
          48359,
          47896,
          48367,
          47909,
          48355,
          47887,
          48330,
          47866,
          48345,
          47885,
          48319,
          47868,
          48327,
          47878,
          48359,
          47847,
          48359,
          47880,
          48369,
          47834,
          48337,
          47827,
          48327,
          47811,
          48309,
          47841,
          48332,
          47805,
          48343,
          47807,
          48357,
          47854,
          48345,
          47898,
          48333,
          47845,
          48320,
          47811,
          48328,
          47821,
          48340,
          47832,
          48372,
          47827,
          48365,
          47810,
          48331,
          47805,
          48339,
          47801,
          48342,
          47747,
          48376,
          47786,
          48359,
          47767,
          48343,
          47783,
          48327,
          47828,
          48345,
          47805,
          48342,
          47815,
          48367,
          47848,
          48355,
          47819,
          48327,
          47852,
          48321,
          47868,
          48327,
          47856,
          48348,
          47819,
          48342,
          47840,
          48349,
          47847,
          48383,
          47852,
          48370,
          47836,
          48364,
          47795,
          48336,
          47848,
          48327,
          47762,
          48346,
          47783,
          48332,
          47808,
          48346,
          48867,
          48346,
          47750,
          48354,
          47759,
          48355,
          47703,
          48327,
          47661,
          48328,
          47623,
          48333,
          47671,
          48291,
          47583,
          48313,
          47611,
          48318,
          47593,
          48328,
          47590,
          48349,
          47575,
          48323,
          47583,
          48332,
          47613,
          48311,
          47606,
          48314,
          47592,
          48296,
          47553,
          48303,
          47553,
          48317,
          47571,
          48342,
          47529,
          48335,
          47524,
          48354,
          47539,
          48352,
          47585,
          48346,
          47543,
          48335,
          47527,
          48318,
          47577,
          48311,
          47527,
          48313,
          47491,
          48333,
          47578,
          48320,
          47526,
          48359,
          47541,
          48356,
          47501,
          48339,
          47495,
          48337,
          47529,
          48319,
          47506,
          48303,
          47516,
          48326,
          47519,
          48322,
          47532,
          48346,
          47523,
          48357,
          47514,
          48373,
          47487,
          48359,
          47475,
          48357,
          47523,
          48351,
          47445,
          48322,
          47492,
          48319,
          47503,
          48339,
          47522,
          48347,
          47461,
          48358,
          47468,
          48365,
          47463,
          48365,
          47461,
          48355,
          47446,
          48340,
          47435,
          48338,
          47431,
          48332,
          47447,
          48327,
          47445,
          48323,
          47496,
          48339,
          47493,
          48366,
          47469,
          48343,
          47481,
          48342,
          47487,
          48336,
          47460,
          48312,
          47475,
          48337,
          47445,
          48355,
          47514,
          48359,
          47452,
          48365,
          47454,
          48364,
          47460,
          48378,
          47473,
          48380,
          47459,
          48381,
          47516,
          48373,
          47491,
          48354,
          47465,
          48355,
          47481,
          48343,
          47468,
          48327,
          47494,
          48349,
          47488,
          48342,
          47508,
          48387,
          47532,
          48377,
          47492,
          48379,
          47530,
          48368,
          47504,
          48354,
          47505,
          48346,
          47492,
          48336,
          47452,
          48354,
          47463,
          48361,
          47473,
          48390,
          47461,
          48359,
          47462,
          48351,
          47503,
          48346,
          47489,
          48332,
          47495,
          48347,
          47449,
          48358,
          47463,
          48358,
          47489,
          48344,
          47455,
          48392,
          47462,
          48375,
          47437,
          48349,
          47487,
          48349,
          47482,
          48336,
          65489,
          48465,
          47355,
          48397,
          47311,
          48413,
          47298,
          48407,
          47286,
          48398,
          47283,
          48379,
          47308,
          48368,
          47297,
          48391,
          47297,
          48390,
          47293,
          48416,
          47283,
          48416,
          47286,
          48387,
          47261,
          48391,
          47231,
          48401,
          47261,
          48405,
          47309,
          48427,
          47299,
          48406,
          47271,
          48398,
          47270,
          48381,
          47282,
          48387,
          47322,
          48379,
          47292,
          48395,
          47292,
          48402,
          47285,
          48423,
          47310,
          48401,
          47303,
          48409,
          47260,
          48379,
          47265,
          48387,
          47267,
          48395,
          47277,
          48389,
          47287,
          48395,
          47303,
          48439,
          47272,
          48405,
          47277,
          48407,
          47289,
          48368,
          47261,
          48392,
          47270,
          48399,
          47244,
          48413,
          47247,
          48412,
          47303,
          48395,
          47287,
          48402,
          47258,
          48382,
          47293,
          48383,
          47306,
          48382,
          47323,
          48396,
          47246,
          48423,
          47281,
          48420,
          47285,
          48391,
          47269,
          48386,
          47303,
          48401,
          47286,
          48420,
          47289,
          48426,
          47297,
          48439,
          47286,
          48411,
          47292,
          48390,
          47227,
          48390,
          47247,
          48389,
          47247,
          48398,
          47292,
          48412,
          47271,
          48423,
          47297,
          48422,
          47276,
          48402,
          47273,
          48391,
          47292,
          48381,
          47276,
          48387,
          47307,
          48403,
          47275,
          48409,
          47271,
          48412,
          47297,
          48439,
          47307,
          48421,
          47279,
          48395,
          47322,
          48398,
          47278,
          48391,
          47294,
          48395,
          47257,
          48415,
          47288,
          48425,
          47254,
          48431,
          47263,
          48396,
          47269,
          48386,
          47275,
          48402,
          47270,
          48421,
          47261,
          48431,
          47261,
          48403,
          47273,
          48402,
          47271,
          48367,
          47265,
          48387,
          47301,
          48391,
          47289,
          48411,
          47263,
          48413,
          47282,
          48393,
          47286,
          48375,
          47276,
          48391,
          47281,
          48414,
          47298,
          48434,
          47271,
          48423,
          47282,
          48410,
          47303,
          48400,
          47286,
          48379,
          47330,
          48375,
          47294,
          48367,
          27310,
          48354,
          47363,
          48354,
          47342,
          48381,
          47385,
          48361,
          47367,
          48379,
          47392,
          48365,
          47372,
          48339,
          47378,
          48327,
          47415,
          48341,
          47418,
          48355,
          47397,
          48391,
          47399,
          48394,
          47390,
          48379,
          47465,
          48364,
          47421,
          48321,
          47469,
          48346,
          47439,
          48362,
          47431,
          48374,
          47443,
          48381,
          47453,
          48390,
          47443,
          48368,
          47405,
          48354,
          47422,
          48341,
          47475,
          48340,
          47456,
          48367,
          47461,
          48384,
          47451,
          48390,
          47467,
          48377,
          47463,
          48350,
          47439,
          48347,
          47438,
          48329,
          47443,
          48325,
          47463,
          48363,
          47479,
          48365,
          47480,
          48386,
          47535,
          48367,
          47526,
          48327,
          47483,
          48347,
          47484,
          48358,
          47478,
          48370,
          47524,
          48391,
          47478,
          48385,
          47507,
          48365,
          47495,
          48349,
          47470,
          48341,
          47467,
          48347,
          47479,
          48353,
          47490,
          48368,
          47489,
          48394,
          47467,
          48398,
          47491,
          48368,
          47506,
          48359,
          47504,
          48325,
          47528,
          48354,
          47524,
          48361,
          47555,
          48377,
          47519,
          48391,
          47519,
          48372,
          47545,
          48355,
          47519,
          48338,
          47525,
          48366,
          47543,
          48368,
          47544,
          48377,
          47570,
          48362,
          47493,
          48358,
          47534,
          48347,
          47517,
          48345,
          47549,
          48383,
          47523,
          48359,
          47504,
          48371,
          47571,
          48397,
          47521,
          48379,
          47539,
          48363,
          47516,
          48335,
          47561,
          48357,
          47518,
          48355,
          47583,
          48359,
          47554,
          48390,
          47554,
          48380,
          47561,
          48347,
          47543,
          48346,
          47575,
          48343,
          47559,
          48362,
          47571,
          48389,
          47570,
          48385,
          47591,
          48359,
          47587,
          48342,
          47575,
          48330,
          47586,
          48349,
          47564,
          48354,
          47559,
          48386,
          47566,
          48368,
          47574,
          48357,
          47607,
          48342,
          47563,
          48349,
          47638,
          48364,
          47559,
          48389,
          47577,
          48359,
          47576,
          48339,
          47567,
          48330
        ]
      }
    ]
  ],
  "app_os": "darwin-x64",
  "app_name": "PhotosynQ",
  "app_version": "0.0.11-DMK",
  "app_device": "x64",
  "location": [
    "42.7223315",
    "-84.4746536"
  ],
  "time_offset": "America/Detroit",
  "ConsoleMacro": "372"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
1
Latest Update:
Jul 2017