Soil_reflectance_macro_167


Macro for measuring soil reflectance using device 167
var data = json.data_raw;
var output = {};

/* Pull out average value, skipping the first and last 40 points */
var response_605 = MathROUND(MathMEAN(json.data_raw.slice(840,960)),2); 
var response_530 = MathROUND(MathMEAN(json.data_raw.slice(640,760)),2); 
var response_650 = MathROUND(MathMEAN(json.data_raw.slice(1040,1160)),2); 
var response_720 = MathROUND(MathMEAN(json.data_raw.slice(40,160)),2); 
var response_850 = MathROUND(MathMEAN(json.data_raw.slice(240,360)),2); 
var response_940 = MathROUND(MathMEAN(json.data_raw.slice(440,560)),2); 

/* Adjust wavelength responses based on calibration*/
var adj_response_605 = response_605/122.5; 
var adj_response_530 = response_530/9260.9; 
var adj_response_650 = response_650/8115.8; 
var adj_response_720 = response_720/3617.4; 
var adj_response_850 = response_850/16954.5; 
var adj_response_940 = response_940/5432.4; 

/*outputs*/
output["530nm"]=adj_response_530; 
output["605nm"]=adj_response_605; 
output["650nm"]=adj_response_650; 
output["720nm"]=adj_response_720; 
output["850nm"]=adj_response_850; 
output["940nm"]=adj_response_940; 

output["Raw 530nm"]=response_530; 
output["Raw 605nm"]=response_605; 
output["Raw 650nm"]=response_650; 
output["Raw 720nm"]=response_720; 
output["Raw 850nm"]=response_850; 
output["Raw 940nm"]=response_940; 


return output;
{
  "time_offset": 240,
  "time": 1495646116728,
  "device_id": 170,
  "firmware_version": "0.450",
  "sample": [
    {
      "time": 1495646122581,
      "protocol_id": 1,
      "data_raw": [
        3398,
        200,
        175,
        187,
        212,
        195,
        205,
        209,
        205,
        211,
        147,
        195,
        179,
        189,
        187,
        184,
        212,
        187,
        208,
        174,
        174,
        176,
        188,
        182,
        225,
        203,
        191,
        204,
        197,
        205,
        176,
        184,
        184,
        193,
        223,
        201,
        218,
        213,
        179,
        179,
        192,
        184,
        197,
        205,
        181,
        177,
        214,
        193,
        186,
        198,
        179,
        216,
        209,
        206,
        165,
        151,
        216,
        223,
        199,
        176,
        189,
        155,
        191,
        169,
        202,
        193,
        180,
        166,
        182,
        194,
        179,
        163,
        175,
        176,
        197,
        183,
        170,
        200,
        168,
        184,
        180,
        193,
        206,
        171,
        175,
        189,
        188,
        171,
        201,
        202,
        201,
        177,
        191,
        147,
        180,
        177,
        202,
        170,
        178,
        188,
        169,
        168,
        192,
        175,
        182,
        174,
        186,
        197,
        195,
        179,
        188,
        179,
        198,
        206,
        209,
        169,
        196,
        206,
        172,
        186,
        155,
        188,
        188,
        169,
        184,
        136,
        200,
        187,
        217,
        215,
        172,
        177,
        183,
        181,
        179,
        173,
        149,
        183,
        199,
        182,
        179,
        173,
        199,
        184,
        175,
        194,
        173,
        197,
        187,
        228,
        186,
        207,
        207,
        196,
        206,
        213,
        180,
        195,
        196,
        223,
        218,
        234,
        210,
        219,
        196,
        198,
        180,
        186,
        194,
        191,
        168,
        212,
        202,
        224,
        189,
        212,
        206,
        219,
        189,
        199,
        227,
        174,
        176,
        212,
        200,
        187,
        230,
        193,
        183,
        213,
        194,
        224,
        226,
        206,
        230,
        224,
        224,
        168,
        217,
        206,
        36350,
        36571,
        36558,
        36441,
        36539,
        36520,
        36596,
        36547,
        36531,
        36550,
        36382,
        36547,
        36522,
        36618,
        36489,
        36376,
        36595,
        36523,
        36579,
        36515,
        36620,
        36510,
        36358,
        36586,
        36591,
        36572,
        36544,
        36416,
        36510,
        36496,
        36364,
        36580,
        36544,
        36403,
        36560,
        36548,
        36453,
        36563,
        36523,
        36525,
        36511,
        36532,
        36344,
        36587,
        36546,
        36524,
        36574,
        36472,
        36602,
        36546,
        36514,
        36618,
        36528,
        36555,
        36569,
        36394,
        36580,
        36526,
        36587,
        36527,
        36518,
        36575,
        36362,
        36595,
        36516,
        36525,
        36573,
        36599,
        36590,
        36529,
        36403,
        36552,
        36602,
        36612,
        36524,
        36600,
        36400,
        36534,
        36473,
        36520,
        36495,
        36338,
        36567,
        36360,
        36562,
        36428,
        36564,
        36588,
        36534,
        36376,
        36571,
        36573,
        36363,
        36554,
        36593,
        36537,
        36376,
        36622,
        36538,
        36577,
        36533,
        36573,
        36534,
        36556,
        36542,
        36527,
        36564,
        36429,
        36545,
        36589,
        36382,
        36601,
        36371,
        36512,
        36605,
        36476,
        36600,
        36563,
        36530,
        36544,
        36587,
        36501,
        36574,
        36581,
        36469,
        36574,
        36540,
        36584,
        36588,
        36514,
        36550,
        36582,
        36435,
        36473,
        36311,
        36322,
        36131,
        36380,
        36366,
        36332,
        36348,
        36275,
        36232,
        36274,
        36334,
        36375,
        36258,
        36335,
        36310,
        36380,
        36233,
        36325,
        36282,
        36328,
        36374,
        36300,
        36379,
        36267,
        36370,
        36386,
        36327,
        36352,
        36347,
        36267,
        36303,
        36240,
        36383,
        36365,
        36322,
        36192,
        36377,
        36260,
        36356,
        36356,
        36276,
        36377,
        36199,
        36380,
        36237,
        36283,
        36385,
        36328,
        36157,
        36369,
        36332,
        36288,
        36296,
        36311,
        36302,
        36360,
        36308,
        36373,
        36365,
        36362,
        36187,
        36351,
        36326,
        36341,
        36352,
        36332,
        1574,
        1029,
        1014,
        1048,
        1019,
        1072,
        1027,
        984,
        1034,
        1032,
        1026,
        1031,
        1041,
        1008,
        1034,
        1030,
        1028,
        1008,
        1043,
        1004,
        1033,
        1028,
        1006,
        1025,
        1007,
        984,
        1028,
        1053,
        1018,
        1028,
        1020,
        1030,
        1034,
        1069,
        1016,
        1006,
        1003,
        1006,
        1021,
        1031,
        1018,
        1039,
        1034,
        1053,
        1010,
        1026,
        1043,
        1074,
        1046,
        1020,
        1054,
        1026,
        1036,
        1044,
        1026,
        1032,
        1036,
        1046,
        1069,
        1053,
        1064,
        1057,
        1031,
        1020,
        1047,
        1057,
        1022,
        1017,
        1018,
        1061,
        1002,
        992,
        1019,
        1033,
        1021,
        1022,
        1042,
        1041,
        1048,
        1049,
        1050,
        1043,
        1047,
        1024,
        1045,
        1017,
        1030,
        1037,
        1040,
        1068,
        1044,
        1048,
        1044,
        1041,
        1033,
        1048,
        1087,
        1050,
        1034,
        1060,
        1045,
        1027,
        1041,
        1053,
        1045,
        1051,
        1026,
        1022,
        1019,
        1045,
        1025,
        1028,
        1038,
        1038,
        1045,
        1020,
        1062,
        1040,
        1022,
        997,
        1046,
        1038,
        1045,
        1017,
        1039,
        1019,
        1025,
        1033,
        1066,
        1066,
        1038,
        1056,
        1060,
        1008,
        1036,
        1057,
        1047,
        1018,
        1034,
        1049,
        1058,
        1050,
        1054,
        1035,
        1046,
        1053,
        1060,
        1041,
        1030,
        1067,
        1057,
        1041,
        1046,
        1056,
        1048,
        1061,
        1073,
        1058,
        1023,
        1023,
        1055,
        1047,
        1039,
        1027,
        1058,
        1019,
        1037,
        1012,
        1019,
        1032,
        1047,
        1068,
        1041,
        1069,
        1060,
        1055,
        1042,
        1036,
        1018,
        1033,
        1047,
        1030,
        1033,
        1040,
        1019,
        1053,
        1085,
        1061,
        1054,
        1018,
        1048,
        1060,
        1055,
        1021,
        1035,
        1027,
        1052,
        1078,
        1032,
        1043,
        0,
        7373,
        7409,
        7420,
        7434,
        7469,
        7427,
        7462,
        7407,
        7431,
        7430,
        7420,
        7411,
        7441,
        7424,
        7450,
        7467,
        7417,
        7461,
        7431,
        7433,
        7419,
        7438,
        7447,
        7430,
        7460,
        7426,
        7427,
        7409,
        7445,
        7460,
        7451,
        7462,
        7444,
        7418,
        7439,
        7434,
        7427,
        7449,
        7469,
        7457,
        7462,
        7444,
        7440,
        7467,
        7442,
        7444,
        7427,
        7473,
        7473,
        7476,
        7458,
        7406,
        7409,
        7421,
        7428,
        7435,
        7415,
        7424,
        7391,
        7440,
        7423,
        7410,
        7438,
        7396,
        7448,
        7418,
        7423,
        7424,
        7406,
        7421,
        7416,
        7399,
        7427,
        7411,
        7452,
        7424,
        7436,
        7422,
        7416,
        7422,
        7440,
        7412,
        7426,
        7422,
        7405,
        7418,
        7409,
        7395,
        7440,
        7435,
        7423,
        7423,
        7408,
        7441,
        7411,
        7413,
        7433,
        7411,
        7418,
        7403,
        7419,
        7446,
        7410,
        7410,
        7428,
        7434,
        7400,
        7424,
        7407,
        7427,
        7410,
        7426,
        7412,
        7438,
        7430,
        7410,
        7421,
        7442,
        7400,
        7423,
        7427,
        7448,
        7426,
        7411,
        7429,
        7413,
        7439,
        7427,
        7436,
        7452,
        7406,
        7434,
        7413,
        7420,
        7420,
        7417,
        7435,
        7409,
        7423,
        7424,
        7422,
        7413,
        7436,
        7415,
        7414,
        7422,
        7420,
        7386,
        7401,
        7402,
        7391,
        7399,
        7426,
        7421,
        7401,
        7411,
        7383,
        7418,
        7425,
        7393,
        7410,
        7400,
        7428,
        7433,
        7412,
        7425,
        7423,
        7396,
        7412,
        7394,
        7406,
        7382,
        7408,
        7450,
        7415,
        7444,
        7427,
        7442,
        7451,
        7415,
        7426,
        7417,
        7412,
        7406,
        7419,
        7411,
        7388,
        7400,
        7438,
        7431,
        7431,
        7420,
        7405,
        7407,
        7438,
        7394,
        7428,
        7428,
        7450,
        0,
        0,
        1,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        8,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        4,
        0,
        0,
        0,
        0,
        2,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        4,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        2,
        0,
        0,
        0,
        1,
        0,
        1,
        0,
        2,
        7,
        0,
        3,
        6,
        0,
        0,
        2,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        3,
        3,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        2,
        0,
        0,
        2,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        1,
        0,
        0,
        0,
        0,
        0,
        1,
        0,
        1,
        2,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        5,
        0,
        0,
        0,
        1,
        0,
        0,
        3,
        0,
        2,
        0,
        0,
        0,
        1,
        0,
        1,
        0,
        2,
        0,
        0,
        0,
        0,
        0,
        1,
        1,
        0,
        4,
        0,
        0,
        2,
        0,
        2,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        1,
        4,
        1,
        0,
        0,
        0,
        0,
        0,
        1,
        2,
        7,
        0,
        6,
        0,
        0,
        5,
        3,
        0,
        0,
        0,
        0,
        0,
        4315,
        4327,
        4215,
        4150,
        4198,
        4197,
        4077,
        4100,
        4116,
        4279,
        4286,
        4254,
        4331,
        4427,
        4331,
        4496,
        4420,
        4332,
        4455,
        4374,
        4497,
        4425,
        4449,
        4430,
        4482,
        4433,
        4520,
        4565,
        4531,
        4497,
        4541,
        4456,
        4594,
        4514,
        4440,
        4532,
        4438,
        4567,
        4407,
        4572,
        4734,
        4725,
        4692,
        4706,
        4731,
        4728,
        4593,
        4706,
        4706,
        4743,
        4739,
        4672,
        4800,
        4734,
        4610,
        4800,
        4649,
        4675,
        4610,
        4682,
        4651,
        4811,
        4731,
        4685,
        4684,
        4737,
        4742,
        4671,
        4642,
        4683,
        4635,
        4696,
        4801,
        4781,
        4661,
        4726,
        4703,
        4739,
        4768,
        4790,
        4786,
        4738,
        4670,
        4697,
        4612,
        4711,
        4695,
        4716,
        4749,
        4751,
        4757,
        4628,
        4691,
        4737,
        4757,
        4758,
        4681,
        4738,
        4709,
        4767,
        4739,
        4699,
        4781,
        4660,
        4761,
        4565,
        4704,
        4730,
        4780,
        4705,
        4683,
        4724,
        4673,
        4747,
        4716,
        4671,
        4733,
        4688,
        4721,
        4711,
        4763,
        4725,
        4790,
        4774,
        4646,
        4729,
        4735,
        4718,
        4709,
        4775,
        4709,
        4677,
        4644,
        4740,
        4748,
        4813,
        4876,
        4793,
        4827,
        4822,
        4792,
        4703,
        4770,
        4775,
        4743,
        4799,
        4831,
        4731,
        4838,
        4622,
        4830,
        4734,
        4802,
        4853,
        4755,
        4780,
        4906,
        4758,
        4827,
        4735,
        4796,
        4732,
        4777,
        4807,
        4828,
        4757,
        4839,
        4746,
        4837,
        4791,
        4782,
        4792,
        4877,
        4671,
        4866,
        4761,
        4833,
        4797,
        4837,
        4835,
        4788,
        4813,
        4849,
        4821,
        4893,
        4808,
        4715,
        4803,
        4825,
        4791,
        4828,
        4873,
        4725,
        4855,
        4786,
        4835,
        4800,
        4777,
        4824,
        4754
      ]
    }
  ],
  "app_os": "mac",
  "app_name": "PhotosynQ",
  "app_version": "0.3.7",
  "app_device": "x86-64",
  "location": [
    "41.3219398",
    "-72.9244086"
  ],
  "ConsoleMacro": "209",
  "notes": "add-on"
}
Default avatar
Created by

Daniel Kane


Protocol connections:
0
Latest Update:
May 2017