CoralspeQ all-in-one protocol AK-1


Calculate ΦII and the color for data received from the CoralspeQ. Right now, the ΦII calculation is included, but still needs to be confirmed. The color is represented as RGB. The black and white reference is extracted from measurements was not saved as a calibration protocol on the device.
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 4/17/2016
//============================================

//Define the output object here
var output = {};

// Number of pixel per spectrum 
var pixels = 256;

// Number of spectra collected
var specNum = 16;

// Background Spectrum
var bgspec = 12;

// Integration times for each spectrum
// The integration times are currently taken from the protocol
var intTimes = [256,128,64,256,128,64,32,16,8,16,256,16,256,25,50,100];

// Pixel reflecting 730 nm
var pix = 80;
var A0 = 3.2e2;
var B1 = 2.4;
var B2 = -9e-4;
var B3 = -4e-6;
var B4 = -3e-9;
var B5 = 2e-11;
output.time = json.time

var GFP_Ref = [-0.000453666,-0.002343933,-0.004782138,-0.007079998,-0.008823949,-0.009957256,-0.010321658,-0.011075738,-0.010859356,-0.010683285,-0.009910008,-0.010220661,-0.009372732,-0.008397897,-0.007867981,-0.007175326,-0.006036259,-0.005191317,-0.004867437,-0.003361087,-0.002411634,-0.001341245,-4.24249E-05,0.000851787,0.002692573,0.003403144,0.005030428,0.006865242,0.009134524,0.01122763,0.014307621,0.01665454,0.020770686,0.026130516,0.032130851,0.040991808,0.055512799,0.076065582,0.109592695,0.162608175,0.248582033,0.475371402,1,1.02126794,1.033747974,1.046319082,1.05621918,1.068676819,1.079580226,1.090609046,1.101606513,1.113623711,1.124568923,1.135131921,1.141441311,1.145021463,1.145296072,1.142220349,1.132420072,1.119909966,1.103476208,1.088299572,1.071655298,1.0598708,1.04848643,1.037299138,1.029009795,1.020638336,1.01378229,1.006675418,1.000032874,0.994866925,0.990443006,0.986956703,0.982146092,0.971308167,0.927795537,0.592327663,0.47032557,0.378274916,0.304697377,0.247087669,0.201262353,0.163933805,0.135049768,0.112316966,0.094920211,0.079144875,0.066233147,0.054984642,0.046186179,0.038437309,0.031897783,0.026427258,0.020529731,0.015305554,0.010986147,0.00666226,0.00377615,0.00066758,-0.000695651,-0.001124253,-0.001336367,-0.001899341,-0.002008437,-0.002098124,-0.002423707,-0.001889312,-0.002316421,-0.001941779,-0.001084893,-0.000958092,-0.001444921,-0.000485016,0.000313643,-0.000739041,-0.00084963,-0.000746717,-0.001149938,-0.001390419,-0.001327818,-0.000382843,-0.001698298,-0.001078801,-0.000965437,-0.001595597,-0.001358313,-0.001156861,-0.000815065,-0.001079435,-0.000988467,-0.000778057,-0.000924478,-0.000772296,-0.000539491,-0.000518694,-0.000541195,9.17388E-05,-0.000245789,-0.000540019,0.000261626,3.75675E-05,-9.39238E-05,0.000168742,0.000283598,0.00029693,-0.000231704,-9.86523E-05,3.46109E-05,-0.000238227,-0.000418498,-0.000779423,-0.000380403,-0.000760738,0.000501247,-0.000467337,-0.000752119,-0.000826386,-0.000619965,-0.001119741,-0.001249249,-0.001217511,-0.001379866,-0.001363058,0.000242321,-0.001677316,-0.001608252,-0.001661616,-0.00211063,-0.002140106,-0.002102396,-0.002542452,-0.003043721,-0.002735775,-0.002677163,-0.002891773,-0.002919756,-0.00316124,-0.003035442,-0.002857388,-0.003164565,-0.002986512,-0.003050327,-0.002846892,-0.002522522,-0.002154855,-0.002560572,-0.002858791,-0.002883787,-0.002574348,-0.002593373,-0.002884127,-0.002416427,-0.002607149,-0.002874015,-0.003243899,-0.002983729,-0.003144591,-0.002797826,-0.002507796,-0.002941879,-0.003069894,-0.002660423,-0.002798889,-0.002923918,-0.002577153,-0.002490173,-0.002664472,-0.002378921,-0.002744326,-0.002597626,-0.001985104,-0.002449048,-0.00231877,-0.001961555,-0.001958184,-0.00152781,-0.001976824,-0.001922691,-0.002247784,-0.001938345,-0.002370936,-0.002100315,-0.001487793,-0.002275722,-0.002002115,-0.001753889,-0.001714686,-0.001878534,-0.001793047,-0.002006164,-0.001780334,-0.001121528,-0.001394366,-0.001634357,-0.001233844,-0.001693309,-0.001485395,-0.00101023,-0.00116512,-0.001255809,-0.001189732,0.001078547,-0.001223302,-0.001128858,-0.00130017,-0.000698099,-0.001341205,-0.001022808,-0.000668578,-6.78645E-06,-0.000409517,-0.000232956,-0.000228092,-0.00036208,-5.26402E-05];
var fallbackBlack = [8608,8617,8623,8627,8639,8610,8639,8647,8612,8592,8593,8595,8607,8621,8606,8495,8448,8601,8629,8628,8625,8635,8638,8670,8659,8668,8688,8710,8779,8868,9053,9427,10127,11329,13053,14985,17557,19097,19563,18849,17281,15645,13600,12468,11328,10678,10112,9759,9466,9349,9301,9259,9302,9408,9454,9645,9929,10024,10085,10034,9900,9736,9600,9494,9393,9333,9272,9230,9164,9172,9172,9193,9222,9182,9149,9373,9412,9463,9504,9552,9567,9605,9613,9626,9654,9649,9673,9668,9674,9712,9753,9774,9786,9805,9985,9883,9903,9929,9955,9957,10010,10044,10098,10138,10194,10213,10247,10291,10345,10362,10418,10472,10422,10702,10593,10646,10680,10736,10748,10791,10795,10825,10852,10876,10882,10928,10947,10965,10970,10962,10968,10983,11230,10962,10951,11118,10829,10872,10822,10980,10823,10808,10773,10749,10733,10674,10614,10571,10513,10479,10430,10297,10249,10251,10262,10179,10136,10068,10028,9983,9925,9863,9836,9782,9716,9674,9616,9582,9528,9504,9460,9971,9370,9366,9331,9338,9268,9228,9185,9122,9120,9100,9069,9054,9034,9021,9005,8956,8958,8920,8800,8694,8879,8852,8854,8836,8814,8812,8798,8796,8788,8760,8766,8725,8741,8706,8717,8706,8687,8676,8333,8706,8675,8668,8676,8681,8680,8683,8664,8638,8650,8642,8646,8644,8643,8652,8639,8626,8777,8368,8643,8543,8654,8641,8623,8603,8593,8604,8590,8606,8618,8586,8611,8608,8613,8592,8623,8596,8490,8553,8616,8599,8575,8597,8612,8583];
var fallbackWhite = [8691,8698,8708,8686,8694,8688,8692,8686,8679,8662,8684,8673,8676,8714,8690,8573,8466,8684,8681,8705,8716,8711,8731,8730,8756,8753,8781,8825,8867,9005,9215,9645,10561,12433,15684,20111,25193,28943,30495,29709,27092,23935,20344,17927,15651,14162,12942,12132,11642,11418,11400,11535,11927,12612,13399,14490,15867,16858,17321,17180,16485,15577,14667,13896,13306,12850,12479,12099,11934,11789,11779,11897,12107,12283,12412,12984,13342,13648,13916,14185,14393,14569,14660,14776,14845,14908,14989,15045,15139,15274,15422,15581,15782,15872,16211,16264,16382,16547,16675,16829,17032,17278,17574,17844,18072,18322,18566,18805,19051,19322,19643,19951,20188,20728,20895,21189,21451,21649,21817,21963,22181,22391,22654,22895,23173,23421,23641,23818,23939,23971,24000,23998,24119,23967,23941,24043,23799,23836,23801,23892,23722,23611,23424,23210,22969,22685,22396,22109,21854,21618,21407,21052,20903,20679,20493,20234,19921,19587,19239,18878,18525,18210,17868,17540,17195,16867,16561,16199,15872,15579,15316,15837,14803,14592,14351,14111,13871,13587,13338,13090,12863,12628,12494,12321,12132,12016,11843,11660,11506,11319,11049,10761,10846,10720,10585,10466,10372,10253,10179,10069,9970,9884,9772,9707,9619,9577,9523,9511,9452,9397,9095,9361,9327,9324,9295,9244,9238,9226,9191,9169,9138,9126,9087,9075,9040,9034,9009,8986,9187,8659,8929,8854,8982,8915,8887,8842,8853,8844,8818,8781,8818,8799,8796,8765,8772,8780,8766,8749,8660,8577,8777,8734,8714,8716,8700,8707];
var fallbackInt = [256,128,64,256,128,64,32,16,8,16,256,16,256,100,200,400];
var fallback = false;


if(json.time > 1464739200000){
    json.get_userdef1 = [400,200];
	fallbackBlack = [9023,9039,9023,9026,9033,9031,9022,9028,9016,9007,9033,9024,9023,9032,9033,8968,8924,9002,9021,9035,9046,9071,9059,9016,9035,9028,9040,9057,9074,9114,9228,9481,10047,11259,13452,16497,18836,19925,19465,17888,16052,14488,13370,12488,11889,11527,11372,11315,11378,11495,11722,12165,12842,13864,15080,16612,18106,18991,19168,18588,17522,16383,15453,14778,14273,13860,13459,13152,12960,12901,13018,13230,13545,13813,14156,14620,15029,15505,15687,15968,16168,16420,16535,16635,16687,16800,16908,17025,17165,17367,17608,17818,18081,18535,18577,18696,18887,19044,19189,19370,19593,19903,20244,20607,20936,21213,21525,21821,22074,22395,22732,23097,23423,23821,24258,24602,24900,25114,25339,25526,25734,25920,26190,26502,26788,27091,27356,27533,27660,27675,27634,27492,27393,27358,27293,27210,27159,27082,27035,26928,26861,26660,26428,26122,25808,25439,25097,24759,24424,24121,23809,23801,23288,22957,22688,22312,21992,21597,21149,20717,20275,19826,19466,19074,18724,18368,18016,17580,17194,16853,16422,16166,15926,15628,15327,15078,14760,14502,14231,14149,13586,13415,13162,13046,12809,12582,12405,12247,12079,11808,11604,11479,11320,11179,11000,10862,10747,10656,10546,10449,10369,10283,10196,10130,10075,10014,9948,9908,9886,9966,9839,9767,9746,9741,9714,9675,9633,9603,9576,9562,9505,9505,9478,9432,9437,9401,9384,9369,9266,9212,9320,9295,9302,9260,9242,9226,9228,9204,9201,9154,9150,9159,9127,9115,9113,9113,9106,9063,8942,9057,9069,9072,9088,9061,9068,9068];
	fallbackWhite = [9066,9079,9085,9067,9061,9057,9065,9064,9066,9060,9054,9061,9058,9038,9059,9048,9060,9070,8980,9050,9041,9068,9087,9071,9068,9082,9059,9088,9121,9123,9209,9352,9880,11098,13611,17312,20843,22798,23068,21077,18779,16784,15220,14095,13273,12812,12618,12654,12792,13025,13485,14201,15393,17115,19323,21817,24153,25598,25937,25014,23321,21471,19904,18821,17989,17290,16631,16127,15783,15667,15917,16346,16841,17427,18120,18779,19337,20016,20596,21123,21534,21810,22046,22199,22360,22506,22684,22920,23206,23488,23836,24247,24679,25060,25486,25926,26337,26351,26597,27001,27387,27927,28521,29110,29674,30191,30676,31161,31658,32211,32786,33450,34124,34850,35480,35953,36420,36961,37298,37648,38055,38445,38953,39507,40104,40631,41068,41487,41675,41712,41720,41565,41442,41335,41135,40996,41060,41005,40982,40841,40653,40318,39924,39423,38867,38257,37683,37123,36563,36126,35653,35248,34809,34366,33993,33291,32646,31923,31158,30355,29620,28839,28169,27505,26842,26181,25505,24821,24168,23539,22958,22367,21838,21218,20674,20302,19765,19238,18749,18215,17729,17298,16892,16514,16133,15774,15435,15069,14740,14375,14036,13672,13299,12889,12745,12494,12263,12229,11773,11680,11466,11426,11248,11095,10996,10891,10781,10703,10637,10578,10509,10466,10521,10426,10351,10294,10247,10167,10113,10039,9995,9938,9883,9836,9819,9770,9749,9696,9659,9652,9608,9494,9425,9505,9499,9445,9431,9422,9380,9357,9336,9329,9274,9277,9242,9234,9215,9211,9212,9201,9182,9099,9141,9156,9157,9137];
}

if(json.get_userdef1 === undefined){
  json.get_userdef1 = [100,100];
  intTimes = fallbackInt;
  fallback = true;
}
if(json.get_userdef51 === undefined)
  json.get_userdef51 = fallbackBlack;
if(json.get_userdef52 === undefined)
  json.get_userdef52 = fallbackWhite;

//output.pixel = A0 + B1*pix + B2*Math.pow(pix,2) + B3*Math.pow(pix,3) + B4*Math.pow(pix,4) + B5*Math.pow(pix,5);

var nm = {};
var nms = [];
var pixel = {};
for(i=0;i<256;i++){
   var pix = i+1;
   var wl = A0 + B1*pix + B2*Math.pow(pix,2) + B3*Math.pow(pix,3) + B4*Math.pow(pix,4) + B5*Math.pow(pix,5);
   nm[MathROUND(wl,0)] = pix;
   nms.push(MathROUND(wl,0));
   pixel[pix] = [MathROUND(wl,0)];
}

// Now we fill up the array to make sure the is no undefiend when we enter a wavelength
var min = MathMIN(nms);
var max = MathMAX(nms);
var nms = {};
var tmp = 0;
for(var i = min;i<max;i++){
	if(nm[i] !== undefined){
      nms[i] = nm[i];
		tmp	= i;
    }
    else{
		nms[i] = nm[tmp];
    }
}
var nm = nms;

// Split the rawtrace up into separate spectra
// The number of spectra is set in specNum.
// The traces gets devided by the number of pixels for a spectrum
// defined by pixels
var spectra = [];
for (i=0,j=json.data_raw.length; i<j; i+=pixels) {
    spectra.push(json.data_raw.slice(i,i+pixels));   
}


// Normalize spectra to integration times
for(var i=0;i<bgspec+1;i++){
  for(var j=0;j<pixels;j++){
	spectra[i][j] = spectra[i][j] / intTimes[i];
  }
}

// Substract background spectrum from all other spectra
for(var i=0;i<bgspec;i++){
  for(var j=0;j<pixels;j++){
	spectra[i][j] -= spectra[bgspec][j]; 
  }
}

var ms = [];
//Substract drift
for(var i=0;i<bgspec;i++){
  var len = spectra[i].length;
  var m = (spectra[i][nm[650]] - spectra[i][0]) / (nm[650] - 0);
  var b = spectra[i][nm[650]] - (m * nm[650]);
  for(var j=0;j<len;j++){
	spectra[i][j] -= (m * j) + b;
  }
}


//Substract drift
for(var i=0;i<bgspec;i++){
  var len = spectra[i].length;
  var m = (spectra[i][len-1] - spectra[i][nm[650]]) / (len - nm[650]);
  var b = spectra[i][nm[650]] - (m * nm[650]);
  for(var j=nm[650];j<len;j++){
	spectra[i][j] -= (m * j) + b;
  }
}


var m = spectra[11].slice(nm[420],nm[525]);
var min = MathMIN( m );
var max = MathMAX( m );

var lower = 420;
for(i=420;i<525;i++){
	var IntInPercent = ((spectra[11][nm[i]] - min) / max)  * 100;
	if(IntInPercent < 15)
		lower = i;
    else
		break;
}


var higher = 525;
for(i=525;i>420;i--){
	var IntInPercent = ((spectra[11][nm[i]] - min) / max)  * 100;
	if(IntInPercent < 15)
		higher = i;
    else
		break;
}

//Normalize to 410-490 better 510-530
for(var i=0;i<bgspec;i++){
  var n = spectra[i].slice(nm[425],nm[430]);
  var m = spectra[i].slice(nm[495],nm[505]);
  var o = spectra[i].slice(nm[425],nm[505]);
  var norm = MathMEAN(n) + MathMEAN(m);
  var norm = spectra[i][nm[420]];
  //var norm = intTimes[i];
  //var norm = MathMEAN(o);
  //var norm = spectra[i][nm[lower]] + spectra[i][nm[higher]];
  for(var j=0;j<pixels;j++){
	spectra[i][j] = spectra[i][j] / norm;
  }
}

var nmMin = 700;
var nmMax = 780;

var x = [];
var y = [];

for(var i=3;i<bgspec-1;i++){
  x.push( json.tcs_dac_values[i] );
  y.push( MathSUM(spectra[i].slice(nm[nmMin],nm[nmMax])) );
}
var reg = MathLINREG(x.slice(1,4), y.slice(1,4));

// Debug
for (i=0; i<pixels; i++){
	var tmp = [];
    tmp.push(pixel[i+1]);
	for(j=0;j<specNum;j++){
		tmp.push(spectra[j][i]);
	}
	//output[pixel[i+1]] = tmp.join('=');
}

// Fm' is derived from the last spectrum 
output.Fmp = MathSUM(spectra[11].slice(nm[nmMin],nm[nmMax]));

// Fs extrapolated and r^2
output.Fs = reg.b;
output.r2 = MathROUND(reg.r2, 3);

for (i=0; i<pixels; i++){
	var tmp = [];
    tmp.push(pixel[i+1]);
	
	tmp.push( (spectra[11][i] - spectra[0][i]) / spectra[11][i]);
	//output[pixel[i+1]] = tmp.join('=');
}

output.Fs = MathROUND(output.Fs,3);
output.Fmp = MathROUND(output.Fmp,3);
output['ΦII'] = MathROUND( (output.Fmp - output.Fs)/output.Fmp, 3);

if(output.Fs < 0 || output.Fmp < 0 || output['ΦII'] < 0)
  output['ΦII'] = 'NaN';


// In case the number of spectra in specNum and the number after the
// trace got split didn't match up, a warning is triggered
if(spectra.length != specNum)
	danger('Insufficent number of spectra collected!',output);


/*
///////////////////////////////////////////////////////////////
/
/				Trying to extract the GFP signal
/
///////////////////////////////////////////////////////////////
*/

var GFP_REF_R = GFP_Ref.slice(100,120);
var GFP_REF_G = GFP_Ref.slice(80,100);
var GFP_REF_B = GFP_Ref.slice(80,88);

var GFP_R = spectra[11].slice(100,120);
var GFP_G = spectra[11].slice(80,100);
var GFP_B = spectra[11].slice(80,88);

var GFP_Red = MathMEAN(GFP_R) - MathMEAN(GFP_REF_R);
var GFP_Green = MathMEAN(GFP_G) - MathMEAN(GFP_REF_G);
var GFP_Blue = MathMEAN(GFP_B) - MathMEAN(GFP_REF_B);

var gfp_gamma = 1.5;

var GFP_Red = Math.pow( GFP_Red,(1/gfp_gamma) ) * 255     || 0;
var GFP_Green = Math.pow( GFP_Green,(1/gfp_gamma) ) * 255 || 0;
var GFP_Blue = Math.pow( GFP_Blue,(1/gfp_gamma) ) * 255   || 0;

if(GFP_Red > 255 || GFP_Green > 255 || GFP_Blue > 255){

  var F_max = MathMAX([GFP_Blue,GFP_Green,GFP_Red]);
  
  GFP_Red *= (255/F_max) || 0;
  GFP_Green *= (255/F_max) || 0;
  GFP_Blue *= (255/F_max) || 0; 
}

GFP_Red = MathROUND(GFP_Red,0);
GFP_Green = MathROUND(GFP_Green,0);
GFP_Blue = MathROUND(GFP_Blue,0);


GFP_Red = (GFP_Red < 0 || isNaN(GFP_Red)) ? 0 : GFP_Red;
GFP_Green = (GFP_Green < 0 || isNaN(GFP_Green)) ? 0 : GFP_Green;
GFP_Blue = 0;//(GFP_Blue < 0 || isNaN(GFP_Blue)) ? 0 : GFP_Blue;


output.GFP = 'rgb('+GFP_Red+','+GFP_Green+','+GFP_Blue+')';

output.GFP_Spectrum = spectra[11].slice(80,150);


//output.GFP_Red = GFP_Red;
//output.GFP_Green = GFP_Green;
//output.GFP_Blue = GFP_Blue;

/*
///////////////////////////////////////////////////////////////
/
/			Spectral shifts in the chlorophyll
/
///////////////////////////////////////////////////////////////
*/

f_ratio_spectrum = spectra[11].slice(0);

var f_ratio_a = f_ratio_spectrum.slice(160,190);
var f_ratio_b = f_ratio_spectrum.slice(200,230);

var f_ratio_a_max = MathMEAN(f_ratio_a.sort().slice(27,30));
var f_ratio_b_max = MathMEAN(f_ratio_b.sort().slice(27,30));

output['A/B ratio'] = MathROUND( (f_ratio_a_max/f_ratio_b_max), 3);

var f_red = f_ratio_spectrum.slice(160,190);
var f_green = f_ratio_spectrum.slice(200,230);
var f_blue = f_ratio_spectrum.slice(160,190);

var fredcolor = spectra[11].slice(157,170);
var fgreencolor = spectra[11].slice(170,190);
var fbluecolor = spectra[11].slice(190,230);

for(i=0;i<pixels;i++){
  if(fredcolor[i] !== undefined)
      fredcolor[i] = fredcolor[i] / spectra[11][nm[690]];
  if(fgreencolor[i] !== undefined)
      fgreencolor[i] = fgreencolor[i] / spectra[11][nm[690]];
  if(fbluecolor[i] !== undefined)
      fbluecolor[i] = fbluecolor[i] / spectra[11][nm[690]];
}

var f_gamma = 1;

var F_Red = MathMEAN(fredcolor);
var F_Green = MathMEAN(fgreencolor);
var F_Blue = MathMEAN(fbluecolor);

F_Red = Math.pow(F_Red,(1/f_gamma) ) * 255      || 0;
F_Green = Math.pow(F_Green,(1/f_gamma) ) * 255  || 0;
F_Blue = Math.pow(F_Blue,(1/f_gamma) ) * 255    || 0;

if(F_Red > 255 || F_Green > 255 || F_Blue > 255){

  var F_max = MathMAX([F_Blue,F_Green,F_Red]);
  
  F_Red *= (255/F_max);
  F_Green *= (255/F_max);
  F_Blue *= (255/F_max);
}

F_Red = MathROUND(F_Red,0);
F_Green = MathROUND(F_Green,0);
F_Blue = MathROUND(F_Blue,0);
  

F_Red = (F_Red < 0 || isNaN(F_Red)) ? 0 : F_Red;
F_Green = (F_Green < 0 || isNaN(F_Green)) ? 0 : F_Green;
F_Blue = (F_Blue < 0 || isNaN(F_Blue)) ? 0 : F_Blue;


output.Fluorescence = 'rgb('+F_Red+','+F_Green+','+F_Blue+')';

output.F_Red = F_Red;
output.F_Green = F_Green;
output.F_Blue = F_Blue;

var test = f_ratio_spectrum.slice(150,230);
var test_n = test[14];
for(i=0;i<test.length;i++){
	test[i] = test[i] / test_n;
}

output.F_Spectrum = test;

/*
/	Estimation of the color from a reflectance spectrum
*/


// Spectrum used to determine RGB color
var SpectrumForRGB = 15;

// Pick a non saturated spectrum
if(MathMAX(spectra[SpectrumForRGB]) > 40000)
	SpectrumForRGB = 14;

if(MathMAX(spectra[SpectrumForRGB]) > 40000)
	SpectrumForRGB = 13;

if(fallback)
  SpectrumForRGB = 13;

var Sample = [];
var Black = [];
var White = [];


var SampleInt = intTimes[SpectrumForRGB];
var BlackInt = json.get_userdef1[0];
var WhiteInt = json.get_userdef1[1];

var SampleRef = [];
var ReferenceRef = [];

for(i=0;i<pixels;i++){
	// intTimes[SpectrumForRGB];
    Sample.push(spectra[SpectrumForRGB][i]);
    // /BlackInt;
    Black.push(json.get_userdef51[i]);
    // /WhiteInt;
    White.push(json.get_userdef52[i]);
}

var sample_off = MathMEAN(Sample.slice(10,20));
var black_off = MathMEAN(Black.slice(10,20));
var white_off = MathMEAN(White.slice(10,20));
    
    
// Let's substract the offset here
for(i=0;i<pixels;i++){
  Sample[i] -= sample_off;
  Black[i] -= black_off;
  White[i] -= white_off;
}

for(i=0;i<pixels;i++){
    SampleRef.push( ((Sample[i] / SampleInt) - (Black[i]  / BlackInt) ) );
	ReferenceRef.push( ((White[i] / WhiteInt) - (Black[i]  / BlackInt) ) );
}

// Calculate reflectance spectra
var ReflectanceSpectrum = [];


for(i=0;i<pixels;i++){
    ReflectanceSpectrum.push(SampleRef[i] / ReferenceRef[i]);
}

//var offset = MathMEAN(ReflectanceSpectrum.slice(32,42)); // 32,42
//var ReflectanceSpectrumOffset = [];


//for(i=0;i<pixels;i++){
    //var value = (ReflectanceSpectrum[i] - offset) < 0 ? 0 : (ReflectanceSpectrum[i] - offset);
    //var value = (ReflectanceSpectrum[i] - offset);
    //ReflectanceSpectrumOffset.push(value);
//}

// Calculate corrected relectance spectrum against 730nm
var ReflectanceSpectrumOffsetNorm = [];

for(i=0;i<pixels;i++){
	ReflectanceSpectrumOffsetNorm.push( (ReflectanceSpectrum[i] / ReflectanceSpectrum[nm[730]]) );
}

// Calculate the RGB color
//var redSpec = ReflectanceSpectrumOffsetNorm.slice(nm[630],nm[730]);
//var greenSpec = ReflectanceSpectrumOffsetNorm.slice(nm[530],nm[580]);
//var blueSpec = ReflectanceSpectrumOffsetNorm.slice(nm[440],nm[475]);

var redSpec = ReflectanceSpectrumOffsetNorm.slice(142,199);
var greenSpec = ReflectanceSpectrumOffsetNorm.slice(93,117);
var blueSpec = ReflectanceSpectrumOffsetNorm.slice(51,67);

// Devide by number of pixels
var Red   = MathMEAN( redSpec )   || 0;  // (nm[681] - nm[631]) || 0;
var Green = MathMEAN( greenSpec ) || 0;  // (nm[580] - nm[530]) || 0;
var Blue  = MathMEAN( blueSpec )  || 0;  // (nm[475] - nm[437]) || 0;

var gamma = 2;

Red = Math.pow(Red,(1/gamma) ) * 255     || 0;
Green = Math.pow(Green,(1/gamma) ) * 255 || 0;
Blue = Math.pow(Blue,(1/gamma) ) * 255   || 0;


if(Red > 255 || Green > 255 || Blue > 255){

  var F_max = MathMAX([Red,Green,Blue]);
  
  Red *= (255/F_max);
  Green *= (255/F_max);
  Blue *= (255/F_max);
 
}


Red = MathROUND(Red,0);
Green = MathROUND(Green,0);
Blue = MathROUND(Blue,0);
  

Red = (Red < 0 || isNaN(Red)) ? 0 : Red;
Green = (Green < 0 || isNaN(Green)) ? 0 : Green;
Blue = (Blue < 0 || isNaN(Blue)) ? 0 : Blue;


// Start outputting spectra here
output.Color = [Red,Green,Blue];
output.Reflectance = 'rgb('+Red+','+Green+','+Blue+')';
output.Reflectance_Spectrum = ReflectanceSpectrumOffsetNorm.slice(51,225);
output.Red = Red;
output.Green = Green;
output.Blue = Blue;

//Return data
return output;
{
  "id": 262235,
  "datum_url": "https://photosynq.org/projects/seychelles-coralspeq-2874da73-9a9e-4375-98f6-e881a5b82485/explore/262235",
  "user_id": 335,
  "status": "submitted",
  "api_version": "3",
  "user_answers": {
    "11034": "13b"
  },
  "sample": [
    [
      {
        "protocol_id": 1,
        "tcs_dac_values": [
          0,
          0,
          0,
          7,
          23,
          55,
          119,
          247,
          503,
          1015,
          2039,
          2039,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0
        ],
        "g": -5.15,
        "time": 1460732842160,
        "b": -5.15,
        "r": -4.74,
        "data_raw": [
          8793,
          8779,
          8779,
          8793,
          8788,
          8779,
          8788,
          8792,
          8802,
          8785,
          8791,
          8794,
          8785,
          8771,
          8775,
          8772,
          8784,
          8790,
          8799,
          8778,
          8793,
          8787,
          8782,
          8783,
          8788,
          8779,
          8786,
          8780,
          8788,
          8791,
          8799,
          8790,
          8793,
          8794,
          8796,
          8799,
          8803,
          8770,
          8800,
          8793,
          8782,
          8802,
          8786,
          8795,
          8807,
          8795,
          8803,
          8801,
          8800,
          8798,
          8803,
          8799,
          8778,
          8804,
          8787,
          8799,
          8784,
          8790,
          8798,
          8789,
          8809,
          8786,
          8795,
          8786,
          8794,
          8782,
          8762,
          8799,
          8789,
          8787,
          8790,
          8785,
          8775,
          8795,
          8798,
          8794,
          8797,
          8790,
          8800,
          8797,
          8814,
          8801,
          8808,
          8798,
          8800,
          8784,
          8795,
          8773,
          8781,
          8774,
          8778,
          8794,
          8774,
          8788,
          8797,
          8781,
          8796,
          8791,
          8798,
          8800,
          8785,
          8796,
          8794,
          8790,
          8806,
          8803,
          8797,
          8800,
          8791,
          8818,
          8781,
          8778,
          8783,
          8788,
          8787,
          8775,
          8787,
          8797,
          8802,
          8796,
          8778,
          8777,
          8783,
          8781,
          8785,
          8792,
          8793,
          8798,
          8783,
          8805,
          8794,
          8793,
          8796,
          8798,
          8779,
          8794,
          8790,
          8775,
          8767,
          8777,
          8787,
          8787,
          8779,
          8791,
          8784,
          8789,
          8785,
          8786,
          8798,
          8775,
          8775,
          8772,
          8786,
          8798,
          8783,
          8797,
          8807,
          8784,
          8803,
          8780,
          8791,
          8792,
          8792,
          8788,
          8800,
          8792,
          8819,
          8800,
          8792,
          8789,
          8796,
          8784,
          8803,
          8807,
          8809,
          8798,
          8779,
          8802,
          8807,
          8802,
          8785,
          8800,
          8816,
          8790,
          8801,
          8788,
          8797,
          8791,
          8792,
          8803,
          8803,
          8793,
          8817,
          8789,
          8800,
          8796,
          8804,
          8800,
          8800,
          8803,
          8801,
          8798,
          8812,
          8808,
          8814,
          8807,
          8804,
          8790,
          8806,
          8802,
          8804,
          8785,
          8786,
          8812,
          8810,
          8803,
          8811,
          8798,
          8797,
          8819,
          8822,
          8814,
          8816,
          8820,
          8799,
          8823,
          8818,
          8825,
          8825,
          8824,
          8809,
          8823,
          8803,
          8812,
          8804,
          8805,
          8791,
          8813,
          8801,
          8813,
          8829,
          8800,
          8815,
          8826,
          8828,
          8818,
          8819,
          8810,
          8820,
          8790,
          8796,
          8795,
          8810,
          8809,
          8816,
          8814,
          8727,
          8729,
          8726,
          8732,
          8729,
          8721,
          8729,
          8733,
          8710,
          8730,
          8711,
          8703,
          8721,
          8718,
          8729,
          8727,
          8718,
          8717,
          8720,
          8728,
          8727,
          8723,
          8737,
          8743,
          8748,
          8742,
          8742,
          8735,
          8743,
          8737,
          8753,
          8753,
          8746,
          8745,
          8729,
          8738,
          8728,
          8734,
          8744,
          8734,
          8734,
          8748,
          8724,
          8727,
          8766,
          8742,
          8740,
          8743,
          8749,
          8733,
          8739,
          8742,
          8745,
          8739,
          8731,
          8762,
          8732,
          8732,
          8728,
          8731,
          8737,
          8724,
          8737,
          8727,
          8744,
          8733,
          8724,
          8735,
          8743,
          8732,
          8746,
          8742,
          8743,
          8739,
          8746,
          8737,
          8759,
          8742,
          8749,
          8751,
          8747,
          8719,
          8722,
          8718,
          8721,
          8720,
          8723,
          8724,
          8749,
          8743,
          8721,
          8739,
          8733,
          8738,
          8735,
          8751,
          8731,
          8738,
          8736,
          8746,
          8745,
          8735,
          8742,
          8747,
          8745,
          8719,
          8736,
          8722,
          8720,
          8719,
          8725,
          8732,
          8722,
          8736,
          8724,
          8716,
          8731,
          8729,
          8738,
          8729,
          8731,
          8728,
          8730,
          8742,
          8740,
          8734,
          8742,
          8741,
          8734,
          8732,
          8734,
          8724,
          8728,
          8718,
          8729,
          8729,
          8721,
          8722,
          8728,
          8719,
          8732,
          8732,
          8751,
          8745,
          8740,
          8745,
          8745,
          8744,
          8752,
          8752,
          8753,
          8761,
          8753,
          8758,
          8725,
          8734,
          8738,
          8736,
          8745,
          8741,
          8744,
          8753,
          8755,
          8748,
          8735,
          8744,
          8745,
          8743,
          8746,
          8734,
          8756,
          8742,
          8762,
          8775,
          8757,
          8748,
          8756,
          8736,
          8734,
          8736,
          8723,
          8727,
          8732,
          8729,
          8750,
          8725,
          8735,
          8749,
          8743,
          8749,
          8749,
          8745,
          8752,
          8746,
          8735,
          8746,
          8748,
          8732,
          8751,
          8746,
          8742,
          8740,
          8740,
          8738,
          8736,
          8739,
          8735,
          8736,
          8755,
          8731,
          8740,
          8730,
          8734,
          8736,
          8746,
          8744,
          8737,
          8740,
          8752,
          8743,
          8750,
          8742,
          8748,
          8757,
          8751,
          8742,
          8748,
          8724,
          8745,
          8724,
          8741,
          8734,
          8749,
          8730,
          8744,
          8727,
          8747,
          8737,
          8750,
          8738,
          8739,
          8743,
          8733,
          8762,
          8744,
          8739,
          8743,
          8741,
          8741,
          8740,
          8753,
          8727,
          8739,
          8734,
          8731,
          8727,
          8688,
          8700,
          8683,
          8709,
          8685,
          8696,
          8702,
          8722,
          8710,
          8714,
          8713,
          8713,
          8712,
          8708,
          8684,
          8692,
          8697,
          8680,
          8695,
          8718,
          8698,
          8715,
          8709,
          8703,
          8695,
          8719,
          8710,
          8701,
          8702,
          8704,
          8695,
          8698,
          8716,
          8706,
          8715,
          8705,
          8718,
          8705,
          8692,
          8692,
          8695,
          8690,
          8688,
          8691,
          8696,
          8697,
          8697,
          8700,
          8701,
          8708,
          8713,
          8712,
          8690,
          8702,
          8687,
          8703,
          8694,
          8700,
          8701,
          8707,
          8711,
          8718,
          8698,
          8703,
          8691,
          8701,
          8692,
          8686,
          8716,
          8692,
          8706,
          8695,
          8698,
          8691,
          8720,
          8713,
          8705,
          8706,
          8711,
          8703,
          8699,
          8704,
          8683,
          8709,
          8695,
          8706,
          8713,
          8686,
          8691,
          8692,
          8685,
          8686,
          8695,
          8662,
          8710,
          8703,
          8701,
          8697,
          8704,
          8703,
          8700,
          8702,
          8691,
          8700,
          8703,
          8699,
          8712,
          8702,
          8697,
          8695,
          8714,
          8693,
          8698,
          8683,
          8687,
          8697,
          8710,
          8691,
          8709,
          8711,
          8712,
          8712,
          8705,
          8713,
          8704,
          8717,
          8717,
          8711,
          8712,
          8722,
          8705,
          8716,
          8716,
          8716,
          8713,
          8715,
          8705,
          8710,
          8703,
          8701,
          8705,
          8717,
          8704,
          8705,
          8728,
          8689,
          8691,
          8706,
          8701,
          8717,
          8705,
          8715,
          8714,
          8720,
          8703,
          8709,
          8716,
          8702,
          8716,
          8714,
          8713,
          8693,
          8706,
          8698,
          8692,
          8727,
          8708,
          8725,
          8743,
          8705,
          8705,
          8718,
          8706,
          8711,
          8693,
          8715,
          8706,
          8684,
          8717,
          8701,
          8719,
          8713,
          8710,
          8722,
          8695,
          8696,
          8698,
          8696,
          8717,
          8702,
          8707,
          8712,
          8713,
          8712,
          8709,
          8721,
          8704,
          8730,
          8714,
          8703,
          8711,
          8702,
          8714,
          8718,
          8717,
          8714,
          8716,
          8716,
          8694,
          8698,
          8690,
          8701,
          8694,
          8696,
          8712,
          8709,
          8709,
          8716,
          8692,
          8689,
          8707,
          8704,
          8715,
          8703,
          8707,
          8706,
          8717,
          8698,
          8704,
          8714,
          8698,
          8714,
          8697,
          8706,
          8701,
          8710,
          8702,
          8698,
          8716,
          8706,
          8715,
          8708,
          8710,
          8699,
          8713,
          8725,
          8725,
          8724,
          8718,
          8715,
          8728,
          8712,
          8723,
          8739,
          8729,
          8721,
          8797,
          8800,
          8796,
          8798,
          8794,
          8781,
          8803,
          8798,
          8804,
          8799,
          8804,
          8798,
          8782,
          8793,
          8779,
          8782,
          8799,
          8795,
          8790,
          8811,
          8807,
          8796,
          8804,
          8806,
          8810,
          8817,
          8820,
          8806,
          8821,
          8801,
          8807,
          8816,
          8813,
          8817,
          8822,
          8820,
          8802,
          8830,
          8812,
          8829,
          8830,
          8856,
          8895,
          8928,
          9012,
          9107,
          9233,
          9458,
          9685,
          10032,
          10411,
          10896,
          11454,
          12188,
          13103,
          14163,
          15273,
          16155,
          16613,
          16472,
          15724,
          14646,
          13452,
          12409,
          11574,
          10946,
          10494,
          10123,
          9834,
          9622,
          9434,
          9346,
          9225,
          9132,
          9076,
          9024,
          8977,
          8948,
          8917,
          8893,
          8886,
          8853,
          8858,
          8850,
          8846,
          8820,
          8840,
          8809,
          8811,
          8804,
          8818,
          8794,
          8817,
          8819,
          8814,
          8800,
          8822,
          8809,
          8808,
          8805,
          8800,
          8806,
          8805,
          8812,
          8814,
          8811,
          8800,
          8816,
          8813,
          8788,
          8796,
          8791,
          8794,
          8792,
          8796,
          8802,
          8795,
          8802,
          8792,
          8795,
          8800,
          8791,
          8805,
          8804,
          8799,
          8801,
          8806,
          8802,
          8820,
          8807,
          8809,
          8794,
          8804,
          8787,
          8815,
          8793,
          8791,
          8795,
          8784,
          8812,
          8788,
          8803,
          8819,
          8802,
          8802,
          8819,
          8798,
          8815,
          8808,
          8800,
          8811,
          8812,
          8818,
          8862,
          8818,
          8826,
          8815,
          8819,
          8805,
          8795,
          8807,
          8791,
          8818,
          8819,
          8795,
          8826,
          8822,
          8808,
          8804,
          8801,
          8824,
          8808,
          8821,
          8827,
          8822,
          8826,
          8832,
          8822,
          8815,
          8812,
          8825,
          8826,
          8786,
          8808,
          8811,
          8803,
          8812,
          8815,
          8824,
          8826,
          8828,
          8825,
          8805,
          8813,
          8827,
          8829,
          8808,
          8806,
          8806,
          8807,
          8824,
          8828,
          8834,
          8823,
          8836,
          8832,
          8808,
          8796,
          8821,
          8798,
          8809,
          8818,
          8817,
          8813,
          8826,
          8816,
          8806,
          8806,
          8802,
          8818,
          8814,
          8808,
          8822,
          8811,
          8809,
          8819,
          8821,
          8817,
          8824,
          8812,
          8811,
          8800,
          8797,
          8812,
          8800,
          8798,
          8802,
          8788,
          8788,
          8805,
          8809,
          8799,
          8804,
          8815,
          8804,
          8804,
          8799,
          8814,
          8804,
          8811,
          8817,
          8809,
          8813,
          8832,
          8810,
          8795,
          8829,
          8837,
          8819,
          8822,
          8821,
          8813,
          8804,
          8791,
          8794,
          8808,
          8794,
          8783,
          8806,
          8772,
          8817,
          8804,
          8802,
          8827,
          8824,
          8813,
          8816,
          8816,
          8813,
          8834,
          8828,
          8840,
          8839,
          8854,
          8849,
          8858,
          8861,
          8843,
          8855,
          8880,
          8872,
          8883,
          8920,
          8935,
          8996,
          9055,
          9143,
          9301,
          9573,
          9974,
          10606,
          11546,
          12900,
          14795,
          17326,
          20520,
          24460,
          29206,
          36182,
          48045,
          48825,
          49175,
          49376,
          49534,
          49566,
          49550,
          49359,
          49172,
          48755,
          48004,
          35619,
          28583,
          24282,
          20938,
          18304,
          16189,
          14567,
          13357,
          12420,
          11683,
          11116,
          10643,
          10252,
          9948,
          9699,
          9489,
          9358,
          9248,
          9155,
          9095,
          9044,
          9007,
          8988,
          8939,
          8925,
          8897,
          8876,
          8864,
          8857,
          8845,
          8832,
          8832,
          8822,
          8811,
          8804,
          8805,
          8795,
          8803,
          8792,
          8791,
          8781,
          8789,
          8769,
          8778,
          8778,
          8776,
          8780,
          8787,
          8785,
          8781,
          8775,
          8786,
          8781,
          8781,
          8787,
          8784,
          8779,
          8771,
          8794,
          8782,
          8787,
          8788,
          8771,
          8772,
          8755,
          8768,
          8763,
          8763,
          8769,
          8770,
          8793,
          8766,
          8778,
          8777,
          8759,
          8777,
          8786,
          8784,
          8771,
          8783,
          8777,
          8778,
          8769,
          8782,
          8786,
          8794,
          8777,
          8789,
          8777,
          8772,
          8764,
          8766,
          8780,
          8769,
          8770,
          8775,
          8775,
          8777,
          8795,
          8812,
          8826,
          8835,
          8848,
          8852,
          8867,
          8865,
          8883,
          8913,
          8904,
          8933,
          8931,
          8921,
          8928,
          8909,
          8907,
          8898,
          8893,
          8887,
          8899,
          8879,
          8899,
          8888,
          8860,
          8869,
          8876,
          8860,
          8844,
          8842,
          8852,
          8836,
          8843,
          8870,
          8842,
          8838,
          8842,
          8843,
          8847,
          8829,
          8840,
          8838,
          8834,
          8820,
          8831,
          8839,
          8847,
          8821,
          8834,
          8829,
          8832,
          8819,
          8822,
          8823,
          8816,
          8825,
          8840,
          8811,
          8810,
          8801,
          8794,
          8801,
          8799,
          8768,
          8779,
          8763,
          8773,
          8749,
          8761,
          8768,
          8762,
          8763,
          8758,
          8755,
          8760,
          8752,
          8752,
          8753,
          8771,
          8760,
          8760,
          8766,
          8759,
          8756,
          8793,
          8761,
          8767,
          8768,
          8751,
          8738,
          8754,
          8744,
          8755,
          8760,
          8866,
          8858,
          8847,
          8849,
          8852,
          8846,
          8846,
          8825,
          8841,
          8835,
          8782,
          8810,
          8795,
          8809,
          8822,
          8823,
          8842,
          8840,
          8840,
          8829,
          8835,
          8859,
          8839,
          8853,
          8851,
          8852,
          8868,
          8871,
          8871,
          8890,
          8891,
          8900,
          8912,
          8933,
          8937,
          8961,
          8974,
          9017,
          9086,
          9187,
          9353,
          9603,
          10031,
          10683,
          11677,
          13149,
          15323,
          18312,
          22283,
          27401,
          35441,
          49114,
          49808,
          50271,
          50574,
          50771,
          50887,
          51008,
          51002,
          50959,
          50786,
          50630,
          50319,
          49919,
          49291,
          45953,
          31919,
          26778,
          22831,
          19699,
          17344,
          15527,
          14166,
          13073,
          12235,
          11510,
          10942,
          10483,
          10138,
          9861,
          9629,
          9475,
          9359,
          9236,
          9171,
          9104,
          9047,
          9003,
          9019,
          8960,
          8930,
          8915,
          8886,
          8870,
          8849,
          8813,
          8837,
          8790,
          8792,
          8800,
          8791,
          8795,
          8806,
          8789,
          8798,
          8801,
          8790,
          8766,
          8775,
          8767,
          8782,
          8779,
          8779,
          8783,
          8804,
          8792,
          8783,
          8770,
          8770,
          8776,
          8786,
          8768,
          8770,
          8777,
          8771,
          8780,
          8772,
          8770,
          8770,
          8764,
          8778,
          8771,
          8758,
          8746,
          8753,
          8747,
          8743,
          8743,
          8752,
          8733,
          8735,
          8753,
          8747,
          8741,
          8746,
          8738,
          8749,
          8741,
          8747,
          8740,
          8767,
          8742,
          8762,
          8753,
          8763,
          8764,
          8762,
          8749,
          8777,
          8768,
          8776,
          8796,
          8826,
          8838,
          8857,
          8892,
          8898,
          8920,
          8958,
          8992,
          9004,
          9025,
          9058,
          9056,
          9057,
          9059,
          9052,
          9033,
          9039,
          9027,
          9001,
          8987,
          8972,
          8964,
          8943,
          8944,
          8935,
          8920,
          8953,
          8902,
          8895,
          8885,
          8884,
          8878,
          8881,
          8884,
          8881,
          8890,
          8893,
          8893,
          8896,
          8901,
          8890,
          8900,
          8879,
          8859,
          8865,
          8864,
          8864,
          8863,
          8872,
          8859,
          8875,
          8855,
          8843,
          8841,
          8850,
          8836,
          8837,
          8819,
          8821,
          8793,
          8808,
          8810,
          8799,
          8796,
          8799,
          8789,
          8790,
          8772,
          8764,
          8751,
          8757,
          8752,
          8756,
          8745,
          8749,
          8742,
          8743,
          8737,
          8767,
          8745,
          8756,
          8740,
          8737,
          8738,
          8744,
          8739,
          8744,
          8750,
          8746,
          8742,
          8734,
          8728,
          8729,
          8734,
          8881,
          8859,
          8882,
          8868,
          8851,
          8836,
          8843,
          8844,
          8851,
          8855,
          8853,
          8861,
          8842,
          8868,
          8864,
          8848,
          8868,
          8859,
          8875,
          8850,
          8858,
          8883,
          8866,
          8870,
          8878,
          8872,
          8901,
          8884,
          8892,
          8893,
          8910,
          8923,
          8949,
          8955,
          8984,
          9001,
          9019,
          9070,
          9160,
          9265,
          9445,
          9729,
          10194,
          10901,
          12031,
          13684,
          16104,
          19433,
          23887,
          29624,
          42205,
          50270,
          50907,
          51311,
          51593,
          51782,
          51897,
          51956,
          51950,
          51910,
          51697,
          51539,
          51201,
          50819,
          50226,
          48386,
          33106,
          27524,
          23369,
          20143,
          17679,
          15802,
          14398,
          13290,
          12380,
          11646,
          11040,
          10548,
          10195,
          9905,
          9693,
          9515,
          9384,
          9271,
          9216,
          9138,
          9081,
          9045,
          9013,
          8983,
          8948,
          8923,
          8886,
          8884,
          8840,
          8844,
          8811,
          8816,
          8789,
          8799,
          8787,
          8768,
          8763,
          8758,
          8778,
          8772,
          8771,
          8779,
          8780,
          8763,
          8785,
          8777,
          8775,
          8780,
          8788,
          8780,
          8760,
          8771,
          8766,
          8757,
          8750,
          8757,
          8754,
          8755,
          8753,
          8763,
          8751,
          8771,
          8759,
          8765,
          8764,
          8764,
          8766,
          8770,
          8760,
          8763,
          8770,
          8752,
          8758,
          8756,
          8741,
          8754,
          8736,
          8743,
          8730,
          8734,
          8736,
          8729,
          8744,
          8748,
          8742,
          8733,
          8763,
          8739,
          8766,
          8752,
          8764,
          8782,
          8769,
          8790,
          8823,
          8815,
          8836,
          8865,
          8882,
          8920,
          8936,
          8976,
          8998,
          9031,
          9060,
          9073,
          9112,
          9121,
          9120,
          9120,
          9130,
          9098,
          9087,
          9076,
          9062,
          9039,
          9037,
          9027,
          9008,
          8997,
          8994,
          8984,
          8979,
          8936,
          8943,
          8924,
          8929,
          8913,
          8909,
          8915,
          8916,
          8919,
          8917,
          8910,
          8919,
          8921,
          8915,
          8901,
          8920,
          8910,
          8923,
          8916,
          8902,
          8914,
          8929,
          8901,
          8900,
          8878,
          8855,
          8853,
          8844,
          8844,
          8836,
          8842,
          8812,
          8818,
          8809,
          8790,
          8781,
          8792,
          8779,
          8762,
          8768,
          8757,
          8768,
          8752,
          8770,
          8763,
          8756,
          8758,
          8750,
          8748,
          8738,
          8726,
          8732,
          8721,
          8749,
          8734,
          8724,
          8746,
          8746,
          8722,
          8731,
          8724,
          8731,
          8734,
          8733,
          8727,
          8724,
          8726,
          8943,
          8933,
          8918,
          8929,
          8909,
          8912,
          8887,
          8885,
          8887,
          8893,
          8890,
          8894,
          8916,
          8909,
          8900,
          8881,
          8896,
          8891,
          8899,
          8921,
          8916,
          8909,
          8926,
          8919,
          8928,
          8938,
          8945,
          8951,
          8963,
          8953,
          8962,
          8975,
          8978,
          9005,
          9027,
          9045,
          9091,
          9135,
          9233,
          9343,
          9541,
          9861,
          10377,
          11183,
          12412,
          14236,
          16866,
          20526,
          25347,
          31661,
          47798,
          51337,
          51966,
          52345,
          52600,
          52763,
          52822,
          52878,
          52842,
          52741,
          52531,
          52318,
          51979,
          51559,
          50913,
          48432,
          33070,
          27576,
          23397,
          20165,
          17743,
          15883,
          14486,
          13358,
          12478,
          11707,
          11107,
          10611,
          10260,
          9925,
          9735,
          9547,
          9418,
          9303,
          9231,
          9156,
          9101,
          9056,
          9019,
          8998,
          8972,
          8939,
          8918,
          8904,
          8887,
          8865,
          8846,
          8824,
          8808,
          8812,
          8803,
          8805,
          8795,
          8782,
          8784,
          8773,
          8782,
          8779,
          8769,
          8778,
          8783,
          8782,
          8772,
          8791,
          8785,
          8781,
          8772,
          8779,
          8764,
          8770,
          8769,
          8771,
          8774,
          8777,
          8775,
          8773,
          8766,
          8769,
          8757,
          8750,
          8754,
          8774,
          8758,
          8749,
          8743,
          8740,
          8748,
          8732,
          8745,
          8751,
          8749,
          8753,
          8746,
          8742,
          8737,
          8739,
          8751,
          8737,
          8752,
          8743,
          8748,
          8755,
          8747,
          8735,
          8746,
          8742,
          8735,
          8757,
          8754,
          8786,
          8807,
          8831,
          8855,
          8889,
          8905,
          8944,
          8987,
          9023,
          9067,
          9106,
          9129,
          9168,
          9187,
          9216,
          9221,
          9208,
          9186,
          9185,
          9159,
          9155,
          9127,
          9109,
          9107,
          9085,
          9077,
          9062,
          9049,
          9021,
          9010,
          9010,
          9012,
          8973,
          8993,
          8977,
          8973,
          8968,
          8968,
          8969,
          8975,
          8966,
          8967,
          8950,
          8974,
          8964,
          8951,
          8944,
          8979,
          8951,
          8970,
          8949,
          8949,
          8936,
          8942,
          8918,
          8914,
          8903,
          8886,
          8892,
          8888,
          8878,
          8867,
          8849,
          8844,
          8836,
          8840,
          8802,
          8794,
          8782,
          8777,
          8779,
          8768,
          8771,
          8757,
          8765,
          8766,
          8757,
          8778,
          8749,
          8749,
          8744,
          8752,
          8735,
          8745,
          8776,
          8740,
          8748,
          8756,
          8755,
          8750,
          8718,
          8737,
          8736,
          8730,
          8743,
          8743,
          8755,
          9035,
          9028,
          9036,
          9019,
          9013,
          9005,
          9005,
          9000,
          8988,
          8994,
          8995,
          8993,
          9006,
          9008,
          9025,
          9013,
          8999,
          9001,
          9027,
          9032,
          9040,
          9045,
          9045,
          9053,
          9056,
          9063,
          9069,
          9082,
          9089,
          9099,
          9111,
          9100,
          9112,
          9134,
          9149,
          9172,
          9228,
          9272,
          9400,
          9543,
          9764,
          10122,
          10722,
          11623,
          13047,
          15145,
          18158,
          22278,
          27826,
          37400,
          52072,
          52759,
          53143,
          53453,
          53679,
          53784,
          53848,
          53851,
          53759,
          53610,
          53316,
          53067,
          52673,
          52258,
          51613,
          49870,
          33865,
          28089,
          23808,
          20523,
          18058,
          16191,
          14747,
          13590,
          12646,
          11865,
          11228,
          10741,
          10359,
          10039,
          9810,
          9609,
          9478,
          9370,
          9270,
          9256,
          9146,
          9099,
          9060,
          9027,
          9001,
          8973,
          8963,
          8912,
          8913,
          8885,
          8879,
          8867,
          8861,
          8835,
          8844,
          8826,
          8833,
          8824,
          8814,
          8799,
          8810,
          8801,
          8797,
          8803,
          8808,
          8818,
          8803,
          8793,
          8804,
          8806,
          8797,
          8811,
          8810,
          8803,
          8803,
          8789,
          8800,
          8797,
          8790,
          8790,
          8798,
          8794,
          8768,
          8774,
          8783,
          8757,
          8768,
          8765,
          8773,
          8772,
          8766,
          8768,
          8759,
          8766,
          8769,
          8777,
          8769,
          8774,
          8770,
          8778,
          8786,
          8785,
          8782,
          8818,
          8794,
          8800,
          8799,
          8814,
          8799,
          8813,
          8831,
          8840,
          8864,
          8872,
          8907,
          8926,
          8961,
          8981,
          9035,
          9090,
          9144,
          9186,
          9247,
          9285,
          9327,
          9395,
          9408,
          9445,
          9443,
          9442,
          9438,
          9424,
          9402,
          9393,
          9379,
          9359,
          9344,
          9316,
          9316,
          9303,
          9271,
          9259,
          9254,
          9244,
          9230,
          9226,
          9210,
          9211,
          9203,
          9197,
          9197,
          9182,
          9213,
          9209,
          9220,
          9188,
          9205,
          9191,
          9200,
          9192,
          9192,
          9199,
          9188,
          9217,
          9189,
          9175,
          9171,
          9181,
          9164,
          9144,
          9130,
          9114,
          9098,
          9090,
          9112,
          9067,
          9066,
          9060,
          9059,
          9030,
          9015,
          9007,
          9004,
          8986,
          8988,
          8997,
          8977,
          8979,
          8980,
          8957,
          8966,
          8965,
          8955,
          8968,
          8960,
          8954,
          8959,
          8947,
          8955,
          8977,
          8962,
          8955,
          8953,
          8947,
          8949,
          8929,
          8934,
          8932,
          8937,
          8941,
          9738,
          9737,
          9692,
          9653,
          9631,
          9636,
          9627,
          9628,
          9617,
          9605,
          9623,
          9621,
          9635,
          9649,
          9657,
          9649,
          9657,
          9668,
          9669,
          9677,
          9678,
          9693,
          9720,
          9735,
          9742,
          9770,
          9801,
          9814,
          9834,
          9889,
          9913,
          9963,
          10013,
          10074,
          10163,
          10262,
          10451,
          10695,
          11097,
          11698,
          12693,
          14273,
          16797,
          20800,
          27262,
          50347,
          51909,
          52606,
          53089,
          53480,
          53819,
          54165,
          54451,
          54758,
          54952,
          55089,
          55075,
          55040,
          54861,
          54619,
          54254,
          53956,
          53573,
          53254,
          52971,
          52668,
          52356,
          52047,
          51689,
          51241,
          50429,
          36003,
          29489,
          25501,
          22269,
          19585,
          17423,
          15731,
          14401,
          13369,
          12575,
          11927,
          11430,
          11032,
          10730,
          10496,
          10292,
          10117,
          9980,
          9853,
          9737,
          9634,
          9543,
          9465,
          9415,
          9339,
          9283,
          9215,
          9180,
          9131,
          9095,
          9122,
          9112,
          9088,
          9082,
          9093,
          9097,
          9102,
          9112,
          9131,
          9157,
          9161,
          9170,
          9184,
          9187,
          9193,
          9204,
          9199,
          9211,
          9192,
          9246,
          9206,
          9222,
          9222,
          9215,
          9221,
          9242,
          9231,
          9241,
          9231,
          9235,
          9232,
          9231,
          9228,
          9231,
          9243,
          9229,
          9254,
          9226,
          9224,
          9237,
          9237,
          9242,
          9233,
          9241,
          9241,
          9244,
          9242,
          9246,
          9247,
          9255,
          9279,
          9280,
          9283,
          9308,
          9322,
          9355,
          9374,
          9428,
          9470,
          9529,
          9596,
          9685,
          9786,
          9905,
          10038,
          10188,
          10330,
          10500,
          10652,
          10786,
          10915,
          11021,
          11099,
          11107,
          11127,
          11103,
          11059,
          11002,
          10950,
          10875,
          10813,
          10767,
          10704,
          10655,
          10602,
          10533,
          10482,
          10424,
          10366,
          10328,
          10293,
          10247,
          10242,
          10209,
          10226,
          10208,
          10198,
          10213,
          10204,
          10257,
          10219,
          10231,
          10217,
          10212,
          10213,
          10204,
          10194,
          10186,
          10173,
          10171,
          10152,
          10083,
          10073,
          10046,
          10027,
          9966,
          9927,
          9877,
          9831,
          9798,
          9756,
          9705,
          9690,
          9652,
          9610,
          9586,
          9558,
          9533,
          9504,
          9483,
          9470,
          9445,
          9439,
          9419,
          9395,
          9370,
          9361,
          9340,
          9340,
          9338,
          9317,
          9330,
          9304,
          9349,
          9318,
          9305,
          9307,
          9318,
          9314,
          9303,
          9297,
          9295,
          9296,
          9301,
          9289,
          24544,
          23753,
          22850,
          22077,
          21489,
          21085,
          20845,
          20737,
          20638,
          20636,
          20686,
          20762,
          20893,
          21038,
          21191,
          21391,
          21629,
          21828,
          22093,
          22377,
          22699,
          23051,
          23416,
          23842,
          24280,
          24793,
          25370,
          26006,
          26729,
          27593,
          28597,
          29815,
          31353,
          33409,
          37859,
          48041,
          48777,
          49300,
          49681,
          50109,
          50514,
          51002,
          51539,
          52026,
          52505,
          52943,
          53328,
          53784,
          54185,
          54573,
          54951,
          55354,
          55698,
          56037,
          56269,
          56379,
          56380,
          56322,
          56070,
          55747,
          55284,
          54874,
          54379,
          53987,
          53665,
          53313,
          53028,
          52760,
          52494,
          52221,
          51956,
          51713,
          51483,
          51220,
          50952,
          50684,
          50458,
          50222,
          49970,
          49752,
          49461,
          49250,
          49053,
          48844,
          48625,
          48407,
          48189,
          47816,
          47108,
          40848,
          36557,
          33753,
          31373,
          29273,
          27346,
          25548,
          23781,
          22126,
          20681,
          19511,
          18852,
          18539,
          18288,
          18132,
          17947,
          17789,
          17664,
          17522,
          17443,
          17318,
          17253,
          17133,
          17054,
          16953,
          16827,
          16673,
          16507,
          16338,
          16143,
          15964,
          15783,
          15592,
          15441,
          15332,
          15196,
          15086,
          14980,
          14859,
          14774,
          14629,
          14552,
          14408,
          14311,
          14191,
          14088,
          13984,
          13878,
          13786,
          13710,
          13623,
          13538,
          13480,
          13400,
          13367,
          13321,
          13252,
          13245,
          13254,
          13284,
          13346,
          13455,
          13582,
          13752,
          14024,
          14312,
          14703,
          15194,
          15795,
          16585,
          17577,
          18856,
          20491,
          22513,
          24932,
          27742,
          30870,
          34243,
          37779,
          41436,
          45760,
          48043,
          48632,
          48901,
          49053,
          49068,
          49073,
          49039,
          48944,
          48764,
          48554,
          48215,
          47572,
          46246,
          44729,
          43354,
          42043,
          40770,
          39502,
          38292,
          37136,
          36080,
          35185,
          34445,
          33920,
          33537,
          33305,
          33221,
          33240,
          33288,
          33360,
          33421,
          33366,
          33314,
          33187,
          32989,
          32758,
          32503,
          32216,
          31899,
          31546,
          31154,
          30670,
          30099,
          29430,
          28662,
          27751,
          26791,
          25803,
          24772,
          23771,
          22806,
          21890,
          21014,
          20212,
          19450,
          18744,
          18091,
          17446,
          16869,
          16311,
          15777,
          15280,
          14822,
          14401,
          14015,
          13664,
          13360,
          13121,
          12895,
          12715,
          12567,
          12422,
          12280,
          12174,
          12086,
          11988,
          11917,
          11856,
          11754,
          11678,
          11615,
          11553,
          11489,
          11427,
          11378,
          11320,
          10544,
          10464,
          10439,
          10395,
          10353,
          10336,
          10333,
          10314,
          10329,
          10310,
          10326,
          10322,
          10338,
          10345,
          10365,
          10371,
          10378,
          10408,
          10427,
          10455,
          10479,
          10494,
          10537,
          10549,
          10576,
          10587,
          10630,
          10649,
          10722,
          10758,
          10837,
          10908,
          10995,
          11117,
          11272,
          11459,
          11770,
          12232,
          12955,
          14035,
          15795,
          18648,
          23088,
          36927,
          51986,
          52800,
          53250,
          53732,
          54163,
          54540,
          54926,
          55308,
          55639,
          55996,
          56221,
          56343,
          56336,
          56288,
          56039,
          55713,
          55252,
          54853,
          54367,
          53983,
          53671,
          53306,
          53011,
          52732,
          52456,
          52173,
          51839,
          51485,
          50959,
          49899,
          35510,
          29731,
          25590,
          22346,
          19778,
          17779,
          16222,
          14965,
          13983,
          13188,
          12574,
          12089,
          11716,
          11404,
          11153,
          10966,
          10793,
          10661,
          10560,
          10444,
          10347,
          10257,
          10161,
          10072,
          9973,
          9923,
          9892,
          9889,
          9905,
          9885,
          9900,
          9905,
          9885,
          9882,
          9894,
          9891,
          9897,
          9906,
          9903,
          9904,
          9911,
          9903,
          9890,
          9898,
          9895,
          9899,
          9883,
          9877,
          9850,
          9848,
          9834,
          9837,
          9839,
          9840,
          9853,
          9826,
          9834,
          9828,
          9854,
          9827,
          9825,
          9822,
          9818,
          9811,
          9806,
          9809,
          9800,
          9808,
          9793,
          9803,
          9808,
          9797,
          9806,
          9790,
          9809,
          9819,
          9830,
          9842,
          9863,
          9875,
          9921,
          9948,
          9969,
          10007,
          10084,
          10163,
          10257,
          10390,
          10525,
          10708,
          10916,
          11173,
          11428,
          11696,
          11986,
          12244,
          12506,
          12708,
          12889,
          13002,
          13065,
          13066,
          13046,
          12966,
          12873,
          12765,
          12638,
          12522,
          12441,
          12363,
          12233,
          12121,
          12035,
          11933,
          11843,
          11735,
          11683,
          11598,
          11560,
          11504,
          11486,
          11464,
          11463,
          11439,
          11470,
          11450,
          11487,
          11489,
          11490,
          11476,
          11454,
          11437,
          11421,
          11414,
          11393,
          11380,
          11344,
          11309,
          11265,
          11217,
          11156,
          11094,
          11011,
          10927,
          10869,
          10765,
          10685,
          10617,
          10536,
          10469,
          10414,
          10360,
          10306,
          10254,
          10208,
          10160,
          10153,
          10097,
          10047,
          10020,
          9981,
          9969,
          9936,
          9913,
          9915,
          9894,
          9878,
          9862,
          9856,
          9842,
          9829,
          9820,
          9811,
          9801,
          9800,
          9808,
          9798,
          9807,
          9804,
          9801,
          9778,
          9801,
          8768,
          8753,
          8763,
          8751,
          8758,
          8755,
          8754,
          8762,
          8771,
          8761,
          8782,
          8768,
          8778,
          8766,
          8760,
          8766,
          8770,
          8758,
          8783,
          8780,
          8781,
          8769,
          8772,
          8775,
          8765,
          8760,
          8758,
          8766,
          8758,
          8793,
          8759,
          8765,
          8772,
          8757,
          8763,
          8765,
          8755,
          8764,
          8765,
          8781,
          8762,
          8758,
          8777,
          8771,
          8783,
          8776,
          8780,
          8801,
          8789,
          8790,
          8775,
          8783,
          8776,
          8803,
          8792,
          8813,
          8806,
          8809,
          8796,
          8788,
          8799,
          8779,
          8802,
          8784,
          8785,
          8784,
          8790,
          8793,
          8795,
          8784,
          8796,
          8780,
          8756,
          8782,
          8748,
          8761,
          8741,
          8765,
          8795,
          8788,
          8777,
          8787,
          8779,
          8796,
          8787,
          8778,
          8783,
          8779,
          8785,
          8782,
          8790,
          8790,
          8791,
          8766,
          8804,
          8798,
          8777,
          8772,
          8780,
          8767,
          8780,
          8769,
          8799,
          8765,
          8783,
          8781,
          8769,
          8771,
          8786,
          8790,
          8770,
          8785,
          8778,
          8785,
          8778,
          8790,
          8782,
          8790,
          8789,
          8788,
          8777,
          8774,
          8773,
          8768,
          8771,
          8763,
          8776,
          8786,
          8788,
          8776,
          8784,
          8768,
          8797,
          8785,
          8768,
          8769,
          8784,
          8774,
          8778,
          8778,
          8790,
          8782,
          8792,
          8786,
          8797,
          8778,
          8774,
          8771,
          8783,
          8772,
          8766,
          8776,
          8786,
          8776,
          8783,
          8765,
          8801,
          8773,
          8792,
          8789,
          8788,
          8781,
          8785,
          8790,
          8801,
          8799,
          8802,
          8793,
          8794,
          8777,
          8783,
          8747,
          8776,
          8770,
          8783,
          8795,
          8790,
          8773,
          8778,
          8780,
          8811,
          8780,
          8782,
          8785,
          8787,
          8784,
          8785,
          8776,
          8797,
          8800,
          8792,
          8788,
          8787,
          8766,
          8797,
          8778,
          8791,
          8773,
          8793,
          8805,
          8784,
          8794,
          8798,
          8777,
          8795,
          8798,
          8801,
          8790,
          8795,
          8795,
          8807,
          8788,
          8816,
          8813,
          8814,
          8811,
          8810,
          8817,
          8800,
          8791,
          8794,
          8791,
          8796,
          8795,
          8778,
          8804,
          8799,
          8801,
          8793,
          8805,
          8792,
          8774,
          8802,
          8792,
          8798,
          8795,
          8794,
          8797,
          8797,
          8798,
          8814,
          8802,
          8785,
          8796,
          8787,
          8788,
          8786,
          8795,
          8802,
          8795,
          8802,
          8791,
          8786,
          8791,
          8809,
          8799,
          8808,
          8808,
          8793,
          8808,
          8799,
          8809,
          8807,
          8806,
          8825,
          8812,
          8790,
          8794,
          8803,
          8799,
          8822,
          8681,
          8623,
          8820,
          8814,
          8816,
          8830,
          8825,
          8847,
          8824,
          8837,
          8852,
          8878,
          8897,
          8955,
          9051,
          9255,
          9612,
          10383,
          11727,
          13859,
          16388,
          19526,
          21481,
          22097,
          21294,
          19603,
          17719,
          15389,
          14014,
          12615,
          11769,
          11012,
          10542,
          10234,
          10074,
          10013,
          10040,
          10168,
          10431,
          10665,
          11042,
          11680,
          11966,
          12121,
          12010,
          11769,
          11403,
          11064,
          10798,
          10598,
          10413,
          10253,
          10137,
          10100,
          10046,
          10021,
          10091,
          10150,
          10160,
          10148,
          10491,
          10589,
          10706,
          10825,
          10884,
          11001,
          11006,
          11072,
          11103,
          11139,
          11183,
          11220,
          11282,
          11322,
          11379,
          11440,
          11525,
          11610,
          11632,
          11864,
          11847,
          11901,
          11956,
          12055,
          12127,
          12257,
          12400,
          12536,
          12668,
          12818,
          12944,
          13105,
          13246,
          13445,
          13644,
          13847,
          14068,
          14177,
          14620,
          14660,
          14831,
          14997,
          15094,
          15208,
          15300,
          15396,
          15479,
          15612,
          15731,
          15869,
          15996,
          16139,
          16237,
          16332,
          16364,
          16345,
          16345,
          16544,
          16318,
          16257,
          16394,
          15993,
          16055,
          15929,
          16011,
          15832,
          15731,
          15597,
          15473,
          15311,
          15130,
          14995,
          14840,
          14669,
          14553,
          14403,
          14184,
          14082,
          13997,
          13875,
          13706,
          13533,
          13342,
          13131,
          12938,
          12755,
          12538,
          12389,
          12184,
          12025,
          11857,
          11735,
          11601,
          11488,
          11400,
          11332,
          11884,
          11201,
          11198,
          11173,
          11131,
          11127,
          11094,
          11071,
          11073,
          11066,
          11073,
          11070,
          11050,
          11057,
          11049,
          10985,
          10917,
          10833,
          10739,
          10556,
          10343,
          10480,
          10392,
          10330,
          10230,
          10159,
          10091,
          10067,
          9999,
          9916,
          9844,
          9782,
          9726,
          9676,
          9620,
          9592,
          9549,
          9527,
          9471,
          9157,
          9484,
          9449,
          9441,
          9411,
          9385,
          9339,
          9346,
          9306,
          9291,
          9284,
          9253,
          9253,
          9215,
          9196,
          9154,
          9156,
          9123,
          9281,
          8836,
          9064,
          9000,
          9093,
          9055,
          9019,
          8970,
          8987,
          8954,
          8970,
          8946,
          8954,
          8936,
          8926,
          8916,
          8897,
          8914,
          8895,
          8898,
          8798,
          8787,
          8912,
          8880,
          8861,
          8869,
          8849,
          8841,
          8968,
          8957,
          8868,
          9085,
          8936,
          8964,
          8952,
          8967,
          8978,
          8983,
          8970,
          8963,
          8967,
          8960,
          8989,
          8962,
          8978,
          8962,
          8984,
          8988,
          9007,
          8972,
          9139,
          9044,
          9014,
          9027,
          9086,
          9132,
          9224,
          9411,
          9810,
          10612,
          12166,
          14958,
          19339,
          24940,
          30507,
          34462,
          35636,
          34090,
          30718,
          26387,
          22738,
          19437,
          16914,
          14989,
          13445,
          12458,
          11849,
          11495,
          11370,
          11426,
          11720,
          12238,
          12954,
          13859,
          14757,
          15433,
          15733,
          15556,
          15023,
          15096,
          13573,
          13015,
          12563,
          12217,
          11889,
          11664,
          11510,
          11400,
          11413,
          11527,
          11651,
          11858,
          12083,
          12322,
          12574,
          12812,
          13000,
          13197,
          13218,
          13236,
          13582,
          13677,
          13751,
          13827,
          13894,
          13968,
          14094,
          14213,
          14364,
          14506,
          14676,
          14825,
          14998,
          15122,
          15255,
          15386,
          15561,
          15706,
          15623,
          16236,
          16498,
          16788,
          17105,
          17405,
          17729,
          18037,
          18399,
          18806,
          19197,
          19636,
          20096,
          20515,
          20879,
          21194,
          21468,
          21693,
          21893,
          21944,
          22168,
          22445,
          22692,
          22941,
          23197,
          23457,
          23698,
          23890,
          24049,
          24153,
          24173,
          24143,
          24099,
          23990,
          24318,
          23600,
          23710,
          23460,
          23418,
          23058,
          23140,
          22871,
          22625,
          22361,
          22047,
          21699,
          21382,
          21101,
          20779,
          20537,
          20238,
          19970,
          19702,
          19455,
          19134,
          18847,
          18513,
          18101,
          17755,
          17381,
          16900,
          16525,
          16140,
          15772,
          15427,
          15155,
          14813,
          14562,
          14336,
          14152,
          14017,
          13885,
          13820,
          13748,
          13693,
          13649,
          13583,
          13510,
          13684,
          13530,
          13551,
          13543,
          13545,
          13528,
          13486,
          13426,
          13365,
          13209,
          13063,
          12889,
          12683,
          12474,
          12284,
          12111,
          11949,
          11799,
          11680,
          11807,
          11470,
          11276,
          11148,
          11021,
          10902,
          10797,
          10702,
          10617,
          10541,
          10462,
          10411,
          10365,
          10330,
          10293,
          10252,
          10195,
          10153,
          10106,
          9950,
          9897,
          9924,
          9891,
          9847,
          9780,
          9748,
          9719,
          9659,
          9629,
          9605,
          9647,
          9528,
          9491,
          9407,
          9436,
          9463,
          9374,
          9344,
          9318,
          9891,
          9245,
          9246,
          9200,
          9208,
          9188,
          9164,
          9136,
          9140,
          9117,
          9139,
          9107,
          9085,
          9082,
          9069,
          9062,
          9045,
          9050,
          9047,
          8905,
          9265,
          9279,
          9260,
          9252,
          9265,
          9355,
          9359,
          9257,
          9258,
          9258,
          9254,
          9247,
          9248,
          9255,
          9242,
          9246,
          9261,
          9244,
          9265,
          9289,
          9276,
          9306,
          9315,
          9342,
          9285,
          9391,
          9488,
          9604,
          9806,
          10199,
          11036,
          12665,
          15901,
          21679,
          32035,
          46527,
          47199,
          47516,
          47559,
          47465,
          47183,
          46590,
          40367,
          30989,
          26503,
          21582,
          18598,
          16563,
          15289,
          14538,
          14258,
          14445,
          14993,
          16067,
          17562,
          19387,
          21223,
          22610,
          23207,
          22865,
          21746,
          20301,
          18827,
          17482,
          16487,
          15989,
          15359,
          14886,
          14539,
          14355,
          14389,
          14585,
          14889,
          15304,
          15769,
          16254,
          16722,
          17190,
          17617,
          18001,
          18563,
          18398,
          18818,
          18593,
          19148,
          19280,
          19409,
          19534,
          19772,
          20063,
          20340,
          20658,
          21022,
          21331,
          21651,
          21925,
          22169,
          22487,
          22797,
          23158,
          23598,
          24113,
          24540,
          25160,
          25941,
          26503,
          27163,
          27826,
          28542,
          29328,
          30168,
          31031,
          31899,
          32739,
          33525,
          34156,
          34721,
          35192,
          35575,
          35948,
          36290,
          36592,
          36973,
          37662,
          38185,
          38708,
          39190,
          39612,
          39923,
          40087,
          40149,
          40120,
          39959,
          39808,
          39581,
          39338,
          39097,
          38868,
          38613,
          38279,
          37953,
          37458,
          37145,
          36501,
          35832,
          35158,
          34561,
          33913,
          33337,
          32792,
          32221,
          31688,
          31157,
          30614,
          30021,
          29382,
          28698,
          27883,
          27109,
          26237,
          25352,
          24775,
          23879,
          23179,
          22486,
          21904,
          21294,
          20789,
          20359,
          19998,
          19710,
          19485,
          19304,
          19189,
          19307,
          18885,
          18873,
          18783,
          18889,
          18781,
          19039,
          18905,
          18793,
          18734,
          18646,
          18543,
          18343,
          18061,
          17738,
          17399,
          16978,
          16587,
          16215,
          15822,
          15487,
          15169,
          14879,
          14566,
          14316,
          13931,
          13683,
          13506,
          13310,
          13034,
          12845,
          12638,
          12498,
          12355,
          12228,
          12126,
          12040,
          11935,
          11862,
          11776,
          11702,
          11596,
          11483,
          11374,
          11263,
          11757,
          11045,
          10941,
          10865,
          10757,
          10688,
          10617,
          10572,
          10485,
          10435,
          10368,
          10300,
          10238,
          10164,
          10087,
          10017,
          9950,
          9901,
          9863,
          9693,
          9566,
          9739,
          9708,
          9658,
          9631,
          9616,
          9596,
          9565,
          9537,
          9518,
          9457,
          9466,
          9438,
          9441,
          9422,
          9423,
          9385
        ],
        "light_intensity": -4.54
      }
    ]
  ],
  "firmware_version": "0.455",
  "time": 1460732842049,
  "device_id": 198,
  "notes": ""
}
Sebastian kuhlgert square
Created by

Sebastian


Protocol connections:
1
Latest Update:
Jun 2016