Soil NIR/Vis v1.0 (II)


For Soil NIR/Vis reflectometry measurements with a MultispeQ v1.0 and the device has been calibrated against a blackbody
var data = json.data_raw;
var output = {};

/* Pull out average value, skipping the first and last 2 points */
var response_530 = MathROUND(MathMEDIAN(json.data_raw.slice(22,38)),0); 
var response_650 = MathROUND(MathMEDIAN(json.data_raw.slice(42,58)),0); 
var response_605 = MathROUND(MathMEDIAN(json.data_raw.slice(62,78)),0); 
var response_420 = MathROUND(MathMEDIAN(json.data_raw.slice(82,98)),0); 
var response_940 = MathROUND(MathMEDIAN(json.data_raw.slice(122,138)),0); 
var response_850 = MathROUND(MathMEDIAN(json.data_raw.slice(142,158)),0); 
var response_730 = MathROUND(MathMEDIAN(json.data_raw.slice(162,178)),0); 
var response_880 = MathROUND(MathMEDIAN(json.data_raw.slice(182,198)),0); 

/* Pull out average value, skipping the first and last 2 points */
var normalized_530 = MathROUND((response_530 / json.recall["userdef[1]"]),4);
var normalized_650 = MathROUND((response_650 / json.recall["userdef[2]"]),4);
var normalized_605 = MathROUND((response_605 / json.recall["userdef[3]"]),4);
var normalized_420 = MathROUND((response_420 / json.recall["userdef[4]"]),4);
var normalized_940 = MathROUND((response_940 / json.recall["userdef[5]"]),4);
var normalized_850 = MathROUND((response_850 / json.recall["userdef[6]"]),4);
var normalized_730 = MathROUND((response_730 / json.recall["userdef[7]"]),4);
var normalized_880 = MathROUND((response_880 / json.recall["userdef[8]"]),4);



/*outputs*/
output["raw530nm"]=response_530; 
output["raw650nm"]=response_650; 
output["raw605nm"]=response_605; 
output["raw420nm"]=response_420; 
output["raw940nm"]=response_940;
output["raw850nm"]=response_850; 
output["raw730nm"]=response_730; 
output["raw880nm"]=response_880; 

output["530nm"]=normalized_530; 
output["650nm"]=normalized_650; 
output["605nm"]=normalized_605; 
output["420nm"]=normalized_420; 
output["940nm"]=normalized_940;
output["850nm"]=normalized_850; 
output["730nm"]=normalized_730; 
output["880nm"]=normalized_880; 

output["userdef1"]=json.recall["userdef[1]"]; 
output["userdef2"]=json.recall["userdef[2]"]; 
output["userdef3"]=json.recall["userdef[3]"]; 
output["userdef4"]=json.recall["userdef[4]"]; 
output["userdef5"]=json.recall["userdef[5]"]; 
output["userdef6"]=json.recall["userdef[6]"]; 
output["userdef7"]=json.recall["userdef[7]"]; 
output["userdef8"]=json.recall["userdef[8]"]; 


return output;
{
  "time_offset": 300,
  "time": 1485459392665,
  "device_version": "1",
  "device_id": "d4:f5:00:00:00:02",
  "device_battery": 85,
  "device_firmware": "1.14",
  "firmware_version": "1.14",
  "device_time": 1484316799,
  "sample": [
    [
      {
        "time": 1485459392677,
        "protocol_id": 1,
        "message": [
          [
            "alert",
            " Place main body lights over the soil",
            "ok"
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "alert",
            " Switch to clamp side",
            "ok"
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ]
        ],
        "recall": {
          "time": 1485459397191,
          "userdef[1]": 365,
          "userdef[2]": 368.5,
          "userdef[3]": 413.5,
          "userdef[4]": 486,
          "userdef[5]": 564,
          "userdef[6]": 655.5,
          "userdef[7]": 727.5,
          "userdef[8]": 809
        },
        "data_raw": [
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          6981,
          12349,
          12386,
          12377,
          12393,
          12396,
          12379,
          12383,
          12388,
          12359,
          12375,
          12393,
          12391,
          12424,
          12402,
          12385,
          12392,
          12425,
          12402,
          12388,
          9724,
          14256,
          14295,
          14303,
          14294,
          14307,
          14295,
          14303,
          14305,
          14297,
          14306,
          14299,
          14301,
          14304,
          14299,
          14300,
          14298,
          14304,
          14300,
          14308,
          8921,
          12494,
          12520,
          12517,
          12521,
          12519,
          12520,
          12521,
          12516,
          12521,
          12523,
          12512,
          12515,
          12506,
          12503,
          12501,
          12491,
          12495,
          12486,
          12487,
          3201,
          16910,
          16946,
          16908,
          16857,
          16823,
          16802,
          16771,
          16765,
          16742,
          16726,
          16717,
          16711,
          16692,
          16690,
          16687,
          16683,
          16683,
          16672,
          16677,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          36494,
          13438,
          13200,
          13176,
          13166,
          13155,
          13145,
          13135,
          13131,
          13125,
          13111,
          13109,
          13106,
          13100,
          13107,
          13091,
          13096,
          13095,
          13087,
          13084,
          41137,
          12308,
          11928,
          11882,
          11868,
          11855,
          11845,
          11846,
          11834,
          11834,
          11830,
          11818,
          11819,
          11814,
          11813,
          11812,
          11798,
          11803,
          11800,
          11789,
          25683,
          15175,
          15042,
          15030,
          15014,
          15020,
          15014,
          15017,
          15019,
          15011,
          15017,
          15015,
          15011,
          15015,
          15010,
          15013,
          15017,
          15009,
          15017,
          15015,
          24320,
          19330,
          19263,
          19264,
          19263,
          19255,
          19259,
          19253,
          19255,
          19262,
          19255,
          19260,
          19259,
          19264,
          19264,
          19260,
          19265,
          19267,
          19259,
          19268
        ]
      }
    ]
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.6",
  "app_device": "x86-32",
  "location": [
    "42.7225858",
    "-84.4746622"
  ],
  "ConsoleMacro": "269"
}
Sam 0645   copy   copy  2
Created by

Dan TerAvest


Protocol connections:
4
Latest Update:
Jan 2017