v2.0 CALIBRATION: Absorbance Blanks DMKb


Blanks at 3 different blank values: 1. blank1 - (empty closed clamp) 1. blank2 - piece of white paper in clamp 1. blank 3 - three pieces of white paper in clamp 8 LEDs have blanks measured (1,2,3,4,6,8,9,10)
var data = json.data_raw;
var output = {"toDevice":"set_colorcal_blanks+"};// output to device, start 1015 to call spad calibration
var lights = [1,2,3,4,6,8,9,10];// define the lights to be calibrated
var pulses = 10;// number of pulses in a cycle

for (var i = 0;i<lights.length;i++) { // loop through and save one averaged 'point' for each of the cycles
  value1 = MathMEDIAN(json.data_raw.slice((i*pulses+2),(i*pulses+8)));
  value2 = MathMEDIAN(json.data_raw.slice((i*pulses+82),(i*pulses+88)));
  value3 = MathMEDIAN(json.data_raw.slice((i*pulses+162),(i*pulses+168)));
  output ["light".concat(lights[i].toString(),"_blank1")]  = value1;
  output ["light".concat(lights[i].toString(),"_blank2")]  = value2;
  output ["light".concat(lights[i].toString(),"_blank3")]  = value3;
  output ["toDevice"] += lights[i]; 
  output ["toDevice"] += "+";  
  output ["toDevice"] += MathMEDIAN(json.data_raw.slice((i*pulses+2),(i*pulses)+8)); 
  output ["toDevice"] += "+";    
  output ["toDevice"] += MathMEDIAN(json.data_raw.slice((i*pulses+82),(i*pulses+88))); 
  output ["toDevice"] += "+";    
  output ["toDevice"] += MathMEDIAN(json.data_raw.slice((i*pulses+162),(i*pulses+168))); 
  output ["toDevice"] += "+";
}
  /*
  // check for errors
  if (value1 < 2000 || value2 < 2000 || value3 < 2000) {
    danger("One of these values - " + value1 + "," + value2 + "," + value3 + " is less than 2000, which is too low.  Re-calibrate.",output);
  }
  if (value1 > 64000 || value2 > 64000 || value3 > 64000) {
    danger("One of these values - " + value1 + "," + value2 + "," + value3 + " is greater than 64000, which is too high.  Re-calibrate.",output);
  }
}
*/
  
output["toDevice"] += "-1+";

return output;
{
  "time_offset": 240,
  "time": 1471460340530,
  "device_version": "1",
  "device_id": "d4:f5:10:14:06:65",
  "device_battery": 84,
  "device_firmware": "1.06",
  "firmware_version": "1.06",
  "device_time": 1471442360,
  "sample": [
    [
      {
        "time": 1471460340549,
        "protocol_id": 1,
        "message": [
          [
            "alert",
            "close clamp fully with nothing inside the clamp to measure blank 1",
            "ok"
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "alert",
            "close clamp fully with a single piece of white paper inside the clamp to measure blank 2",
            "ok"
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "alert",
            "close clamp fully with a three stacked pieces of white paper inside the clamp to measure blank 2",
            "ok"
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ],
          [
            "0",
            "0",
            ""
          ]
        ],
        "data_raw": [
          7897,
          7849,
          7790,
          7830,
          7824,
          7871,
          7883,
          7849,
          7874,
          7847,
          12935,
          12932,
          12926,
          12923,
          12926,
          12928,
          12932,
          12928,
          12931,
          12929,
          12014,
          12019,
          12016,
          12029,
          12025,
          12024,
          12019,
          12027,
          12025,
          12028,
          36116,
          36101,
          36127,
          36159,
          36118,
          36079,
          36133,
          36135,
          36155,
          36109,
          26453,
          26287,
          26261,
          26268,
          26249,
          26280,
          26256,
          26266,
          26262,
          26266,
          25169,
          24954,
          24918,
          24901,
          24892,
          24891,
          24873,
          24869,
          24900,
          24888,
          20986,
          20961,
          20943,
          20949,
          20950,
          20945,
          20945,
          20948,
          20947,
          20950,
          27757,
          27725,
          27718,
          27715,
          27715,
          27707,
          27715,
          27713,
          27706,
          27709,
          17223,
          17229,
          17219,
          17225,
          17234,
          17225,
          17233,
          17228,
          17222,
          17227,
          15092,
          15097,
          15097,
          15096,
          15098,
          15095,
          15096,
          15096,
          15091,
          15098,
          12839,
          12843,
          12837,
          12837,
          12838,
          12845,
          12844,
          12845,
          12844,
          12843,
          13515,
          13513,
          13511,
          13514,
          13505,
          13510,
          13513,
          13510,
          13507,
          13510,
          35271,
          35289,
          35287,
          35291,
          35289,
          35291,
          35287,
          35287,
          35289,
          35290,
          38199,
          38211,
          38203,
          38209,
          38208,
          38218,
          38217,
          38216,
          38219,
          38215,
          36124,
          36137,
          36137,
          36141,
          36138,
          36139,
          36134,
          36138,
          36144,
          36148,
          32879,
          32879,
          32869,
          32858,
          32851,
          32841,
          32837,
          32831,
          32830,
          32823,
          16774,
          16776,
          16776,
          16777,
          16780,
          16779,
          16780,
          16779,
          16781,
          16783,
          10040,
          10041,
          10041,
          10041,
          10041,
          10041,
          10043,
          10043,
          10043,
          10045,
          15493,
          15491,
          15485,
          15486,
          15483,
          15481,
          15481,
          15475,
          15476,
          15473,
          16298,
          16305,
          16311,
          16306,
          16310,
          16311,
          16311,
          16312,
          16312,
          16315,
          30757,
          30769,
          30770,
          30771,
          30777,
          30774,
          30774,
          30775,
          30772,
          30775,
          30406,
          30417,
          30415,
          30418,
          30417,
          30420,
          30418,
          30420,
          30418,
          30416,
          20019,
          20021,
          20021,
          20022,
          20023,
          20023,
          20021,
          20023,
          20022,
          20025,
          20644,
          20629,
          20620,
          20609,
          20600,
          20595,
          20585,
          20581,
          20577,
          20568
        ]
      }
    ]
  ],
  "app_os": "linux",
  "app_name": "PhotosynQ",
  "app_version": "0.3.4",
  "app_device": "x86-64",
  "location": [
    "42.7225781",
    "-84.4746662"
  ]
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
2
Latest Update:
Jan 2019