Absorbance (one wave, different intensities)


Absorbance (one wave, different intensities)
var output = {};
var minolta_spad = 0;
var anthocyanins = 0;
var averages_spad = 0;
var averages_anth = 0;
var sample_730 = [];
var sample_850 = [];
var sample_940 = [];
var sample_530 = [];
var sample_650 = [];
var c = 0;

var calibration_730 = [34848.5375,43468.0875,63896];
var calibration_850 = [34848.5375,43468.0875,63896];
var calibration_940 = [34848.5375,43468.0875,63896];
var calibration_530 = [34848.5375,43468.0875,63896];
var calibration_650 = [34848.5375,43468.0875,63896];

//var calibration_730 = [44296.3375,8692.85,28622.925];
//var calibration_850 = [34238.225,15635.175,21588.9875];
//var calibration_940 = [30430.925,12528.4125,9843.25];
//var calibration_530 = [34848.5375,43468.0875,63896];
//var calibration_650 = [58896.225,57229.2,63896];

//16,20
//10,12,11

var set101211 = json.data_raw.slice(0,300);
set101211 = set101211.concat(json.data_raw.slice(500,800));
set101211 = set101211.concat(json.data_raw.slice(1000,1300));

for (var i=0;i<900;i++) {
  if (i%3 == 0) {
    sample_850.push(set101211[i]);
  }
  if (i%3 == 1) {
    sample_730.push(set101211[i]);
  }
  if (i%3 == 2) {
    sample_940.push(set101211[i]);
  }
}

var set1620 = json.data_raw.slice(300,500);
set1620 = set1620.concat(json.data_raw.slice(800,1000));
set1620 = set1620.concat(json.data_raw.slice(1300,1500));

for (i=0;i<600;i++) {
  if (i%2 == 0) {
    sample_530.push(set1620[i]);
  }
  if (i%2 == 1) {
    sample_650.push(set1620[i]);
  }
}

var tempslice;
var average_850 = [];
var average_730 = [];
var average_940 = [];
var average_530 = [];
var average_650 = [];
/*
average_850.push(average_850.length)
average_730.push(average_730.length)
average_940.push(average_940.length)
average_530.push(average_530.length)
average_650.push(average_650.length)
*/
var abs_850 = [];
var abs_730 = [];
var abs_940 = [];
var abs_530 = [];
var abs_650 = [];

for (i=0;i<3;i++)
	{

// take the averages for each light intensity and set them in the average_X arrays
tempslice = sample_850.slice(5+i*100,95+i*100);
tempslice.sort();
tempslice = tempslice.slice(5,85);
average_850.push(MathMEAN(tempslice));
      
abs_850.push(MathLOG(average_850[c] / calibration_850[i]));      

tempslice = sample_730.slice(5+i*100,95+i*100);
tempslice.sort();
tempslice = tempslice.slice(5,85);
average_730.push(MathMEAN(tempslice));
      
abs_730.push(MathLOG(average_730[c] / calibration_730[i]));

tempslice = sample_940.slice(5+i*100,95+i*100);
tempslice.sort();
tempslice = tempslice.slice(5,85);
average_940.push(MathMEAN(tempslice)); 

abs_940.push(MathLOG(average_940[c] / calibration_940[i])); 
      
tempslice = sample_530.slice(5+i*100,95+i*100);
tempslice.sort();
tempslice = tempslice.slice(5,85);
average_530.push(MathMEAN(tempslice));
abs_530.push(MathLOG(average_530[c] / calibration_530[i])); 

tempslice = sample_650.slice(5+i*100,95+i*100);
tempslice.sort();
tempslice = tempslice.slice(5,85);
average_650.push(MathMEAN(tempslice));
      
abs_650.push(MathLOG(average_650[c] / calibration_650[i])); 
}


/*
var spad1 = MathLOG((average_940 / calibration_940_1) / (average_650 / calibration_650_1))*100;
var spad2 = MathLOG((average_940 / calibration_940_2) / (average_650 / calibration_650_2))*100;
var spad3 = MathLOG((average_940 / calibration_940_3) / (average_650 / calibration_650_3))*100;
var anth1 = MathLOG((average_940 / calibration_940_1) / (average_650 / calibration_530_1))*100;
var anth2 = MathLOG((average_940 / calibration_940_2) / (average_650 / calibration_530_2))*100;
var anth3 = MathLOG((average_940 / calibration_940_3) / (average_650 / calibration_530_3))*100;
//spad = ((sample_940 / calibration_940) / (sample_650 / calibration_650))*100;
/*
var minolta_spad1 = (spad1-yint_spad1)/slope_spad1;
var minolta_spad2 = (spad2-yint_spad2)/slope_spad2;
var minolta_spad3 = (spad3-yint_spad3)/slope_spad3;

var minolta_anth1 = (anth1-yint_anth1)/slope_anth1;
var minolta_anth2 = (anth2-yint_anth2)/slope_anth2;
var minolta_anth3 = (anth3-yint_anth3)/slope_anth3;
*/

output["average_850"] = average_850;
output["average_730"] = average_730;
output["average_940"] = average_940;
output["average_530"] = average_530;
output["average_650"] = average_650;

output["abs_530"] = abs_530
output["abs_650"] = abs_650
output["abs_730"] = abs_730
output["abs_850"] = abs_850
output["abs_940"] = abs_940

//output["730_length"] = 730_length
/*
//output["first set"] = set101211;
//output["second set"] = set1620;

output["sample_850"] = sample_850;
output["sample_730"] = sample_730;
output["sample_940"] = sample_940;
output["sample_530"] = sample_530;
output["sample_650"] = sample_650;
output["test"] = set101211.length;
*/
return output;
{
  "time_offset": -120,
  "time": 1512322473392,
  "device_id": 137,
  "firmware_version": "0.450",
  "sample": [
    {
      "time": 1512322473392,
      "protocol_id": 1,
      "data_raw": [
        64456,
        37893,
        18526,
        188,
        149,
        116,
        107,
        124,
        109,
        103,
        91,
        87,
        92,
        82,
        67,
        88,
        78,
        93,
        102,
        79,
        101,
        94,
        90,
        102,
        112,
        92,
        97,
        95,
        100,
        79,
        111,
        112,
        96,
        116,
        98,
        96,
        97,
        113,
        72,
        94,
        73,
        95,
        85,
        116,
        91,
        89,
        75,
        98,
        95,
        79,
        72,
        88,
        118,
        70,
        99,
        107,
        81,
        106,
        96,
        103,
        112,
        94,
        82,
        92,
        92,
        83,
        104,
        84,
        69,
        83,
        74,
        110,
        113,
        92,
        95,
        95,
        88,
        75,
        73,
        93,
        74,
        102,
        101,
        93,
        104,
        66,
        86,
        78,
        69,
        80,
        48,
        106,
        86,
        113,
        72,
        82,
        80,
        92,
        103,
        96,
        94,
        80,
        85,
        74,
        105,
        61,
        83,
        83,
        88,
        116,
        82,
        116,
        71,
        78,
        102,
        97,
        101,
        125,
        100,
        99,
        77,
        101,
        94,
        98,
        103,
        67,
        103,
        109,
        101,
        96,
        99,
        70,
        65,
        92,
        67,
        78,
        76,
        108,
        88,
        94,
        108,
        72,
        66,
        79,
        93,
        72,
        91,
        113,
        75,
        85,
        69,
        100,
        98,
        113,
        98,
        78,
        110,
        100,
        83,
        108,
        107,
        89,
        99,
        100,
        84,
        100,
        85,
        104,
        81,
        117,
        113,
        111,
        89,
        108,
        94,
        71,
        94,
        107,
        94,
        86,
        111,
        118,
        113,
        91,
        90,
        94,
        124,
        117,
        137,
        78,
        81,
        85,
        68,
        108,
        79,
        83,
        111,
        62,
        75,
        76,
        98,
        71,
        69,
        83,
        92,
        95,
        68,
        68,
        75,
        57,
        74,
        77,
        73,
        89,
        63,
        62,
        39,
        95,
        107,
        93,
        115,
        98,
        94,
        69,
        99,
        110,
        94,
        97,
        85,
        83,
        83,
        72,
        67,
        96,
        99,
        98,
        80,
        121,
        77,
        92,
        96,
        54,
        78,
        99,
        93,
        101,
        108,
        85,
        75,
        55,
        81,
        85,
        80,
        57,
        66,
        70,
        87,
        80,
        82,
        90,
        85,
        77,
        75,
        90,
        87,
        83,
        63,
        104,
        82,
        77,
        104,
        93,
        96,
        81,
        67,
        85,
        85,
        81,
        47,
        62,
        57,
        113,
        78,
        105,
        113,
        117,
        92,
        83,
        122,
        90,
        65,
        95,
        103,
        67,
        82,
        69,
        81,
        63,
        90,
        62,
        24330,
        21499,
        102,
        98,
        85,
        70,
        101,
        100,
        100,
        123,
        115,
        121,
        98,
        103,
        106,
        85,
        109,
        108,
        98,
        99,
        99,
        102,
        122,
        110,
        83,
        99,
        95,
        99,
        90,
        83,
        98,
        102,
        103,
        45,
        53,
        51,
        48,
        108,
        100,
        101,
        82,
        95,
        99,
        75,
        71,
        56,
        85,
        108,
        76,
        78,
        56,
        88,
        86,
        73,
        77,
        60,
        89,
        72,
        71,
        81,
        131,
        108,
        93,
        109,
        65,
        85,
        94,
        53,
        85,
        61,
        64,
        74,
        89,
        85,
        77,
        61,
        57,
        123,
        104,
        88,
        98,
        94,
        72,
        75,
        88,
        81,
        86,
        103,
        79,
        80,
        65,
        71,
        103,
        73,
        100,
        77,
        65,
        117,
        88,
        103,
        98,
        77,
        130,
        83,
        105,
        112,
        101,
        88,
        111,
        121,
        108,
        87,
        84,
        116,
        115,
        130,
        132,
        96,
        121,
        125,
        94,
        94,
        97,
        77,
        97,
        72,
        110,
        104,
        85,
        109,
        87,
        81,
        86,
        83,
        83,
        118,
        72,
        73,
        68,
        97,
        71,
        123,
        109,
        91,
        99,
        92,
        79,
        68,
        62,
        73,
        114,
        90,
        86,
        101,
        121,
        124,
        84,
        113,
        103,
        94,
        108,
        98,
        92,
        94,
        109,
        107,
        74,
        88,
        99,
        94,
        82,
        80,
        119,
        93,
        79,
        89,
        90,
        114,
        80,
        75,
        87,
        77,
        77,
        72,
        109,
        60,
        68,
        62,
        81,
        88,
        76,
        64,
        85,
        82,
        83,
        47,
        91,
        95,
        94,
        78,
        24986,
        22002,
        19143,
        120,
        115,
        81,
        110,
        114,
        99,
        87,
        103,
        124,
        99,
        105,
        99,
        110,
        105,
        91,
        88,
        100,
        92,
        123,
        110,
        112,
        101,
        60,
        68,
        88,
        95,
        62,
        99,
        109,
        112,
        96,
        120,
        129,
        95,
        112,
        113,
        138,
        121,
        151,
        105,
        124,
        124,
        62,
        101,
        103,
        98,
        121,
        116,
        148,
        117,
        127,
        92,
        132,
        116,
        148,
        123,
        141,
        113,
        118,
        140,
        93,
        145,
        146,
        124,
        136,
        143,
        123,
        128,
        115,
        128,
        134,
        106,
        136,
        128,
        109,
        147,
        131,
        125,
        113,
        81,
        108,
        95,
        138,
        121,
        115,
        121,
        105,
        113,
        106,
        115,
        96,
        99,
        107,
        131,
        108,
        119,
        109,
        125,
        122,
        123,
        135,
        152,
        126,
        150,
        152,
        131,
        131,
        140,
        136,
        122,
        153,
        126,
        96,
        104,
        111,
        137,
        129,
        124,
        137,
        107,
        109,
        116,
        129,
        126,
        109,
        115,
        101,
        148,
        121,
        102,
        115,
        134,
        112,
        120,
        70,
        92,
        113,
        96,
        84,
        65,
        102,
        119,
        115,
        103,
        125,
        114,
        140,
        98,
        103,
        101,
        85,
        113,
        127,
        87,
        76,
        108,
        128,
        74,
        98,
        98,
        110,
        89,
        81,
        80,
        81,
        88,
        83,
        121,
        96,
        122,
        130,
        85,
        120,
        118,
        91,
        120,
        132,
        78,
        83,
        116,
        114,
        103,
        119,
        155,
        99,
        123,
        115,
        114,
        124,
        126,
        122,
        108,
        113,
        120,
        104,
        110,
        77,
        96,
        96,
        92,
        127,
        109,
        126,
        112,
        119,
        109,
        95,
        124,
        103,
        111,
        133,
        105,
        136,
        111,
        132,
        101,
        119,
        133,
        130,
        90,
        102,
        115,
        122,
        94,
        90,
        102,
        117,
        145,
        138,
        109,
        114,
        103,
        117,
        140,
        94,
        106,
        108,
        104,
        94,
        128,
        95,
        119,
        91,
        90,
        82,
        115,
        116,
        93,
        137,
        83,
        76,
        130,
        103,
        100,
        54,
        116,
        134,
        122,
        125,
        102,
        95,
        92,
        129,
        122,
        116,
        73,
        94,
        122,
        103,
        138,
        100,
        119,
        120,
        106,
        96,
        131,
        114,
        110,
        120,
        102,
        99,
        99,
        120,
        137,
        120,
        119,
        118,
        122,
        97,
        98,
        129,
        133,
        124,
        119,
        104,
        89,
        111,
        25530,
        22912,
        450,
        445,
        445,
        437,
        461,
        477,
        452,
        468,
        456,
        469,
        465,
        463,
        449,
        461,
        452,
        470,
        475,
        429,
        480,
        459,
        472,
        483,
        469,
        438,
        453,
        456,
        446,
        447,
        463,
        454,
        455,
        459,
        454,
        444,
        468,
        470,
        456,
        469,
        461,
        471,
        488,
        439,
        447,
        489,
        439,
        422,
        426,
        443,
        415,
        429,
        430,
        412,
        464,
        448,
        458,
        450,
        474,
        462,
        453,
        461,
        464,
        460,
        450,
        440,
        443,
        439,
        440,
        438,
        455,
        467,
        439,
        466,
        428,
        447,
        437,
        445,
        452,
        440,
        445,
        446,
        460,
        476,
        449,
        448,
        442,
        461,
        429,
        456,
        457,
        439,
        478,
        461,
        422,
        418,
        443,
        451,
        443,
        454,
        457,
        463,
        437,
        448,
        462,
        448,
        424,
        421,
        424,
        435,
        450,
        471,
        459,
        454,
        442,
        423,
        459,
        453,
        478,
        443,
        431,
        414,
        437,
        465,
        448,
        449,
        440,
        414,
        445,
        463,
        446,
        429,
        449,
        411,
        463,
        477,
        443,
        415,
        423,
        432,
        449,
        449,
        440,
        455,
        447,
        416,
        444,
        435,
        437,
        463,
        445,
        450,
        433,
        483,
        470,
        477,
        437,
        468,
        441,
        446,
        473,
        474,
        484,
        442,
        453,
        441,
        475,
        453,
        477,
        445,
        438,
        434,
        459,
        461,
        442,
        450,
        455,
        475,
        464,
        465,
        469,
        461,
        447,
        445,
        446,
        490,
        491,
        458,
        477,
        462,
        441,
        466,
        459,
        406,
        427,
        466,
        439,
        424,
        461,
        450,
        27245,
        26158,
        23437,
        5215,
        5241,
        5261,
        5245,
        5265,
        5258,
        5216,
        5241,
        5150,
        5262,
        5211,
        5239,
        5234,
        5266,
        5238,
        5231,
        5268,
        5244,
        5293,
        5250,
        5221,
        5221,
        5230,
        5238,
        5218,
        5205,
        5246,
        5269,
        5259,
        5271,
        5250,
        5203,
        5282,
        5237,
        5233,
        5181,
        5251,
        5254,
        5220,
        5226,
        5257,
        5281,
        5252,
        5273,
        5241,
        5283,
        5268,
        5254,
        5246,
        5255,
        5176,
        5229,
        5252,
        5215,
        5244,
        5260,
        5236,
        5312,
        5229,
        5268,
        5244,
        5230,
        5242,
        5247,
        5271,
        5191,
        5220,
        5243,
        5264,
        5264,
        5239,
        5237,
        5255,
        5266,
        5247,
        5247,
        5226,
        5196,
        5307,
        5209,
        5242,
        5238,
        5220,
        5280,
        5263,
        5257,
        5254,
        5229,
        5196,
        5230,
        5215,
        5269,
        5213,
        5244,
        5270,
        5245,
        5205,
        5222,
        5255,
        5285,
        5259,
        5227,
        5192,
        5215,
        5231,
        5228,
        5217,
        5271,
        5218,
        5236,
        5189,
        5284,
        5186,
        5247,
        5283,
        5246,
        5265,
        5231,
        5176,
        5242,
        5266,
        5211,
        5204,
        5255,
        5179,
        5221,
        5232,
        5249,
        5192,
        5273,
        5251,
        5253,
        5207,
        5232,
        5232,
        5226,
        5243,
        5246,
        5316,
        5198,
        5271,
        5221,
        5208,
        5239,
        5235,
        5248,
        5259,
        5220,
        5235,
        5265,
        5255,
        5205,
        5237,
        5272,
        5260,
        5280,
        5160,
        5237,
        5272,
        5262,
        5250,
        5299,
        5243,
        5254,
        5221,
        5234,
        5240,
        5205,
        5258,
        5273,
        5260,
        5233,
        5224,
        5219,
        5177,
        5265,
        5288,
        5244,
        5221,
        5210,
        5228,
        5224,
        5223,
        5243,
        5141,
        5238,
        5206,
        5256,
        5274,
        5247,
        5247,
        5237,
        5313,
        5265,
        5187,
        5239,
        5258,
        5216,
        5294,
        5279,
        5257,
        5194,
        5270,
        5227,
        5228,
        5244,
        5233,
        5227,
        5242,
        5248,
        5218,
        5241,
        5183,
        5214,
        5237,
        5290,
        5204,
        5157,
        5236,
        5251,
        5185,
        5200,
        5246,
        5269,
        5244,
        5240,
        5298,
        5266,
        5264,
        5242,
        5200,
        5252,
        5257,
        5208,
        5222,
        5256,
        5257,
        5276,
        5250,
        5240,
        5304,
        5233,
        5245,
        5175,
        5239,
        5238,
        5229,
        5206,
        5286,
        5212,
        5259,
        5237,
        5237,
        5231,
        5247,
        5200,
        5179,
        5259,
        5267,
        5257,
        5244,
        5239,
        5258,
        5213,
        5291,
        5226,
        5198,
        5212,
        5229,
        5217,
        5296,
        5164,
        5248,
        5280,
        5212,
        5248,
        5242,
        5264,
        5285,
        5269,
        5192,
        5255,
        5284,
        5269,
        5268,
        5196,
        5245,
        5244,
        5235,
        5249,
        5277,
        5308,
        5259,
        5338,
        5267,
        5333,
        5317,
        64456,
        64456,
        56519,
        56568,
        56703,
        56740,
        56599,
        56492,
        56720,
        56581,
        56436,
        56655,
        56591,
        56595,
        56637,
        56618,
        56596,
        56535,
        56617,
        56754,
        56795,
        56662,
        56591,
        56718,
        56422,
        56643,
        56663,
        56615,
        56535,
        56671,
        56661,
        56698,
        56823,
        56706,
        56478,
        56517,
        56374,
        56700,
        56426,
        56663,
        56514,
        56493,
        56638,
        56526,
        56457,
        56481,
        56736,
        56491,
        56616,
        56610,
        56523,
        56787,
        56508,
        56814,
        56597,
        56734,
        56627,
        56694,
        56608,
        56667,
        56770,
        56645,
        56603,
        56783,
        56755,
        56655,
        56767,
        56775,
        56664,
        56580,
        56763,
        56696,
        56666,
        56738,
        56649,
        56755,
        56777,
        56790,
        56563,
        56683,
        56560,
        56796,
        56649,
        56728,
        56787,
        56713,
        56683,
        56714,
        56558,
        56728,
        56736,
        56643,
        56657,
        56744,
        56736,
        56663,
        56730,
        56666,
        56491,
        56643,
        56774,
        56703,
        56741,
        56701,
        56787,
        56742,
        56711,
        56731,
        56782,
        56696,
        56594,
        56802,
        56780,
        56658,
        56723,
        56755,
        56680,
        56816,
        56756,
        56677,
        56631,
        56622,
        56783,
        56758,
        56756,
        56750,
        56753,
        56783,
        56821,
        56779,
        56664,
        56799,
        56767,
        56758,
        56704,
        56744,
        56689,
        56759,
        56755,
        56763,
        56683,
        56628,
        56659,
        56661,
        56744,
        56774,
        56756,
        56608,
        56623,
        56676,
        56796,
        56767,
        56703,
        56718,
        56724,
        56737,
        56723,
        56679,
        56651,
        56698,
        56856,
        56692,
        56706,
        56712,
        56816,
        56735,
        56799,
        56777,
        56756,
        56779,
        56667,
        56755,
        56725,
        56665,
        56699,
        56560,
        56613,
        56819,
        56734,
        56764,
        56635,
        56689,
        56709,
        56786,
        56760,
        56726,
        56672,
        56655,
        56745,
        56823,
        56743,
        56653,
        56691,
        56661,
        56797,
        56659,
        56662,
        56825,
        56890,
        56622
      ]
    }
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.9",
  "app_device": "x86-32",
  "location": [
    "49.5480094",
    "25.6082565"
  ],
  "ConsoleMacro": "452"
}

Protocol connections:
1
Latest Update:
Dec 2017