RIDES1_3_1_Kbad


This macro analyzes data from the RIDES1 protocol set.
/**
 * Macro for data evaluation of RIDES1 
 * data on PhotosynQ.org
 * by: David M. Kramer
 * created: 2017-05-09 @ 18:15:27
 */

// Note: the following variables are for fitting the ECS decay curves when the 
// procedure written by Kevin and Greg often fails. Fortunately, Sebastian added 
// a really important new feature that allows for very flexible and useful 
// nonliear curve fitting. 

// Define the output object here
var output = {}; //dictionary to hold results

// Define the protocol set numbers for each data set

output.len=json.set.length;



if (json.set.length==13){
	  json.set.unshift({});
}

var ECS_LEFdset=2;
var P700_DIRK_set=3;
var PAM_set=4;  //the json set 8 contains the PAM and P700 traces


// ECS DIRK trace definitions
var beginning_of_ECS=100; //Note the 100 pulses 
var length_of_ECS_subtrace=220; //The length of each subtrace. 
var number_of_ECS_subtraces=6; // number of ECS subtraces. There are currently 6 of them.
var length_of_ECS_baseline=100;  //there are 100 points in the baseline before the DIRK
var length_of_ECS_all_subtraces=beginning_of_ECS+(number_of_ECS_subtraces*length_of_ECS_subtrace);  
var ECS_averaged_trace=json.set[ECS_LEFdset].data_raw.slice(beginning_of_ECS,320);  
var begining_of_subtrace_for_linear_fit=75;
var end_of_subtrace_for_linear_fit=145;

var P700_begining_of_subtrace_for_linear_fit=55;
var P700_end_of_subtrace_for_linear_fit=170;

var beginning_of_LEFD=1421; //Note the 100 pulses 
var length_of_LEFd_subtrace=220; //The length of each subtrace. 
var length_of_LEFd_baseline=100;  //there are 100 points in the baseline before the DIRK
var LEFd_trace=json.set[ECS_LEFdset].data_raw.slice(beginning_of_LEFD,beginning_of_LEFD+length_of_LEFd_subtrace);  

// P700 DIRK trace definitions
var beginning_of_P700_DIRK=100; //Note the 100 pulses 
var length_of_P700_DIRK_subtrace=220; //The length of each subtrace. 
var number_of_P700_DIRK_subtraces=6; // number of ECS subtraces. There are currently 6 of them.
var length_of_P700_DIRK_baseline=100;  //there are 100 points in the baseline before the DIRK
var length_of_P700_DIRK_all_subtraces=beginning_of_P700_DIRK+(number_of_P700_DIRK_subtraces*length_of_P700_DIRK_subtrace);  
var P700_DIRK_averaged_trace=json.set[ECS_LEFdset].data_raw.slice(beginning_of_P700_DIRK,320);  


//reshape the PAM and P700 traces from alterrnating 1,2,1,2... to 1,1,1,1...2,2,2,2...

output.test_data_raw_PAM = json.set[PAM_set].data_raw.length;
var loPAM= json.set[PAM_set].data_raw.length;

var temp1= [];
for (var i=0; i<loPAM; i=i+2){
	temp1.push(json.set[PAM_set].data_raw[i]);
}

for (var i=1; i<loPAM+1; i=i+2){
	temp1.push(json.set[PAM_set].data_raw[i]);
}

json.set[PAM_set].data_raw=temp1; //replace the old values wiht temp1
               
// PAM fluorescence traces
//DEFINE THE STARTING AND ENDING POINTS TO USE FOR THE VARIOUS 
//PARAMETERS USED IN THE CALCULATIONS

var Fs_begin=1; //the first point to use for Fs 
var Fs_end =4; //the end point to use  for Fs

//The Fv/FM' results will be calculated using hte Avenson technique, wherein
//a series of different saturation pulse intensities are used and the 
//true saturation point is inferred by extrapolation to infinite
//intensities.

//The first FM value (Fm_1) is obtained with the highest intensity
var Fm_1_begin =101; //the first point to use for the FIRST Fmp
var Fm_1_end =130; //the end point to use  for the FIRST Fmp
var Fm_2_begin =131; //the first point to use for the FIRST Fmp
var Fm_2_end =145; //the end point to use  for the FIRST Fmp
var Fm_3_begin =146; //the first point to use for the FIRST Fmp
var Fm_3_end =160; //the end point to use  for the FIRST Fmp
var Fm_4_begin =161; //the first point to use for the FIRST Fmp
var Fm_4_end =175; //the end point to use  for the FIRST Fmp
var Fm_5_begin =176; //the first point to use for the FIRST Fmp
var Fm_5_end =190; //the end point to use  for the FIRST Fmp

//START AND STOP FOR F0'
var FoPrime_begin =191; //the first point to use for Fs 
var FoPrime_end =205; //the end point to use  for Fs

//SET THE INVERSE INTENSITIES FOR THE AVENSON INTENSITY RAMP
var inverse_intensity = [1/8000,1/7000,1/6000,1/5000];

output.pump="none";

//PSI saturation pulse parameters:
//Calculation of the DIRK delta_A_ECS 
  //output.data_raw_ECS_DIRK = json.set[ECS_LEFdset].data_raw.slice(0,1420);

var PSI_ss_beg=1; //beginning of the trace for P700 steady-state
var PSI_ss_end=18; //end of the trace for P700 steady-state
var PSI_sat1_beg=25; //beginning of the trace for P700 first saturation pulse
var PSI_sat1_end=170; //end of the trace for P700 first saturation pulse
var PSI_dark_beg=195; //beginning of the trace for P700 steady-state
var PSI_dark_end=200; //end of the trace for P700 steady-state
var PSI_sat2_beg=220; //beginning of the trace for P700 second saturation pulse
var PSI_sat2_end=270; //end of the trace for P700 second saturation pulse


// Start of analyses sections

//ECS trace analysis:

var i, j;
  for (i = 1; i < number_of_ECS_subtraces; i++) {
      var temp=json.set[ECS_LEFdset].data_raw.slice(i*length_of_ECS_subtrace+beginning_of_ECS,
                                         (i+1)*length_of_ECS_subtrace+beginning_of_ECS);
		for (j = 0; j < length_of_ECS_subtrace; j++) {
    		ECS_averaged_trace[j]=ECS_averaged_trace[j]+temp[j];
    }}

//make up a time axis. the assumption is that all the points are equally spaced in time.
   var fake_time_axis = [];
	for (var i = 1; i <= length_of_ECS_subtrace; i++) {
      ii=i.toFixed(4);
   	fake_time_axis.push(i);
  }
  //Find the best fit line to the baseline points.
  	var reg=MathLINREG(fake_time_axis.slice(begining_of_subtrace_for_linear_fit, end_of_subtrace_for_linear_fit),ECS_averaged_trace.slice(begining_of_subtrace_for_linear_fit, end_of_subtrace_for_linear_fit));
  
  //Generate a line based on the baseline linear regression over the range of values for the full trace.   
  var baseline_offset=[];
  for (j = 0; j < length_of_ECS_subtrace; j++) {
    	jj=j.toFixed(4);
		baseline_offset.push(jj*MathROUND(reg.m, 3) + MathROUND(reg.b));
  }
  
  //output.baseline_offset=baseline_offset;
   //Calculate the deltaI/I0 and convertto approximate delta_A 
	for (j = 0; j < length_of_ECS_subtrace; j++) {
    var rat= ECS_averaged_trace[j]/baseline_offset[j];
	ECS_averaged_trace[j]=-1*MathLOG(rat); //((rat-1)/-2.3);
    }
ECS_averaged_trace[120]=ECS_averaged_trace[119]; //eliminate the spike artifact at end of trace
output.ECS_averaged_trace=ECS_averaged_trace.slice(80,150);

var begin_trace_index=100;
var end_trace_index=120;
var number_of_points_to_fit=end_trace_index-begin_trace_index;
var expData=ECS_averaged_trace.slice(begin_trace_index,end_trace_index);

// Here I assume that the time difference between points was 

var time_per_point=1.5; //entger the delta time between points (only work with constant delta time) 

// Obtain best fit results for ECS decay using non-linear least squares fitting
var tdata=[];
for (i in expData) {
	tdata.push([i*time_per_point, expData[i]]);
}

var a = 1;
var b = 1;
var c = 1;
try{
	var fit = NonLinearRegression(tdata,{
	   equation: 'b + a * e(- x / c)',
	   initial: [ a, b, c ]
	});

	a= fit.parameters[0].value;
	b= fit.parameters[1].value;
	c = fit.parameters[2].value;

	var outdata=[];
	for (i in expData) {
		outdata.push(b + a*Math.exp(-1*i/c));
	}

	output.fitinput=expData;
	output.outdata=outdata;

	// Available for all parameters
	//output.p1_name = fit.parameters[0].name;
	output.ECSt_mAU = MathROUND(fit.parameters[0].value, 5);
	//output.offset = fit.parameters[1].value;
	output.tECS = MathROUND(0.001*fit.parameters[2].value, 4);
	output.gHplus = MathROUND(1000/fit.parameters[2].value, 3);
	var vHplus = output.ECSt_mAU *  output.gHplus;
	output.vHplus = MathROUND(vHplus, 3);

}
catch(e){}


//  ***********other possible parameters 
//output.p1_sd = fit.parameters[0].sd_error;
//output.p1_p = fit.parameters[0].p;
//output.iterations = fit.iterations;
// Some more info as text
//output.ParameterEstimates = fit.ParameterEstimates;
//output.CovarianceMatrix = fit.CovarianceMatrix;
//output.expFitArray=expFitArray;
//expReg = MathEXPINVREG(expFitArray);
//var ECS_lifetime_ms=expReg.lifetime; //the fitting procedure returns -99999 if it fails to find converge


//Calculaiton of the DIRK delta_P850 

  //output.data_raw_P700_DIRK = json.set[P700_DIRK_set].data_raw.slice(0,1420);
  //Get sum of all subtraces
  var i, j;
  for (i = 1; i < number_of_P700_DIRK_subtraces; i++) {
      var temp=json.set[P700_DIRK_set].data_raw.slice(i*length_of_P700_DIRK_subtrace+beginning_of_P700_DIRK,
                                         (i+1)*length_of_P700_DIRK_subtrace+beginning_of_P700_DIRK);
      
		for (j = 0; j < length_of_P700_DIRK_subtrace; j++) {
    		P700_DIRK_averaged_trace[j]=P700_DIRK_averaged_trace[j]+temp[j];
    }
  }

  //make up a time axis. the assumption is that all the points are equally spaced in time.
   var fake_time_axis = [];
	for (var i = 1; i <= length_of_P700_DIRK_subtrace; i++) {
      ii=i.toFixed(4);
   	fake_time_axis.push(i);
  }
  //Find the best fit line to the baseline points.
  	var reg=MathLINREG(fake_time_axis,P700_DIRK_averaged_trace);
  
  //Generate a line based on the baseline linear regression over the range of values for the full trace.   
  var baseline_offset=[];
  for (j = 0; j < length_of_P700_DIRK_subtrace; j++) {
    	jj=j.toFixed(4);
		baseline_offset.push(jj*MathROUND(reg.m, 3) + MathROUND(reg.b));
  }
  
  //output.baseline_offset=baseline_offset;
   //Calculate the deltaI/I0 and convertto approximate delta_A 
	for (j = 0; j < length_of_P700_DIRK_subtrace; j++) {
    var rat= P700_DIRK_averaged_trace[j]/baseline_offset[j];
      
	P700_DIRK_averaged_trace[j]=-1*MathLOG(rat); //((rat-1)/-2.3);
      //test=Math.LN10(rat);
    }
  //replace the artifactual data at positon 120 with the prior value
  //the point has no real valye, so this is just to better visualize the results

P700_DIRK_averaged_trace[120]=P700_DIRK_averaged_trace[119]; 
output.P700_DIRK_averaged_trace=P700_DIRK_averaged_trace.slice(P700_begining_of_subtrace_for_linear_fit, P700_end_of_subtrace_for_linear_fit);

var begin_trace_index=100;
var end_trace_index=120;
var number_of_points_to_fit=end_trace_index-begin_trace_index;
var P700expData=P700_DIRK_averaged_trace.slice(begin_trace_index,end_trace_index);

var P700_time_per_point=1.5; //entger the delta time between points (only work with constant delta time) 

// Obtain best fit results for ECS decay using non-linear least squares fitting
var P700tdata=[];
for (i in expData) {
	P700tdata.push([i*time_per_point, P700expData[i]]);
}

var a = 1;
var b = 1;
var c = 1;

try{
	var fit = NonLinearRegression(P700tdata,{
	   equation: 'b + a * e(- x / c)',
	   initial: [ a, b, c ]
	});

	a= fit.parameters[0].value;
	b= fit.parameters[1].value;
	c = fit.parameters[2].value;

	var P700_outdata=[];
	for (i in expData) {
		P700_outdata.push(b + a*Math.exp(-1*i/c));
	}

	output.P700_fitinput=P700_outdata;
	output.P700_outdata=outdata;

	// Available for all parameters
	output.P700_DIRK_ampl = MathROUND(a, 5);

	output.tP700 = MathROUND(0.001*c, 4);
	output.kP700 = MathROUND(1000/c, 4);
	var v_initial_P700 = output.P700_DIRK_ampl *  output.kP700;
	output.v_initial_P700 = MathROUND(v_initial_P700, 7);
}
catch(e){}

// Display the DIRKf results and calculate LEFd

  output.LEFd_trace = LEFd_trace;

  // Display of PAM result and calculation of the fluorescence parameters
//************************************************************************************************
  //Calculate the PAM fluorescence paramters
  
  output.data_raw_PAM = json.set[PAM_set].data_raw.slice(0,310);
  data=json.set[PAM_set].data_raw.slice(0,310);
  
// Set our Apparent FmPrime, 3 FmPrime steps, and Fs to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------

//get the values for representative Fs 
var baseline=0; //for the time being, do not use baseline

//GET THE VALUES FOR Fs
var Fs = MathMEAN(data.slice(Fs_begin,Fs_end)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_std = MathSTDEV(data.slice(Fs_begin,Fs_end)); // create standard deviation for this value for error checking
//output.Fs=Fs;

//GET THE VALUES FOR THE 5 Fm' ILLUMINATION CONDITIONS

var sat_vals = data.slice(Fm_1_begin,Fm_1_end).sort();  // sort the saturating light values from low to high
var AFmP = MathMEAN(sat_vals.slice(2,20)) - baseline; // take the 18 largest values and average them
var AFmP_std = MathSTDEV(sat_vals); // create standard deviation for this value for error checking
//output.AFmP=AFmP;
  
sat_vals = data.slice(Fm_5_begin,Fm_5_end).sort();  // sort the saturating light values from low to high
var FmP_end = MathMEAN(sat_vals.slice(2,23)) - baseline; // take the 21 largest values and average them
var FmP_end_std = MathSTDEV(sat_vals); // create standard deviation for this value for error checking
//output.FmP_end=FmP_end;
  
sat_vals = data.slice(Fm_2_begin,Fm_2_end).sort();  // sort the saturating light values from low to high
var FmP_step1 = MathMEAN(sat_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var FmP_step1_std = MathSTDEV(sat_vals); // create standard deviation for this value for error checking
//output.FmP_step1=FmP_step1;
  
sat_vals = data.slice(Fm_3_begin,Fm_3_end).sort();  // sort the saturating light values from low to high
var FmP_step2 = MathMEAN(sat_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var FmP_step2_std = MathSTDEV(sat_vals); // create standard deviation for this value for error checking
//output.FmP_step2=FmP_step2;
  
sat_vals = data.slice(Fm_4_begin,Fm_4_end).sort();  // sort the saturating light values from low to high
var FmP_step3 = MathMEAN(sat_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var FmP_step3_std = MathSTDEV(sat_vals); // create standard deviation for this value for error checking
//output.FmP_ste32=FmP_step3;
  
// Calculations for F0'
// ----------------------------
var FoPrime_values =   data.slice(FoPrime_begin,FoPrime_end).sort();
  
//var FoPrime = MathMEAN(FoPrime_values.slice(5,10)) - baseline;
var FoPrime = MathMIN(FoPrime_values);
var FoPrime_std = MathSTDEV(FoPrime_values); // create standard deviation for this value for error checking

//output.FoPrime_values=FoPrime_values;
  
// Calculations for corrected FmPrime using multi-phase flash
// ----------------------------
var reg = MathLINREG(inverse_intensity, [AFmP,FmP_step1,FmP_step2,FmP_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fvfm_noMPF = (AFmP-Fs)/AFmP;
var fvfm_MPF = (reg.b-Fs)/reg.b;


// Calculate NPQt, PhiNPQ, PhiNO, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_MPF = (4.88 / ((reg.b / FoPrime) -1) )-1;
var npqt_noMPF = (4.88 / ((AFmP / FoPrime) -1) )-1;
var qL_MPF = ((reg.b - Fs)*FoPrime)/((reg.b-FoPrime)*Fs);
var qL_noMPF = ((AFmP - Fs)*FoPrime)/((AFmP-FoPrime)*Fs);
var PhiNO_MPF = 1/(npqt_MPF + 1 + qL_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_noMPF = 1/(npqt_noMPF + 1 + qL_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_MPF = 1-fvfm_MPF-PhiNO_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_noMPF = 1-fvfm_noMPF-PhiNO_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 
var qP_MPF = (reg.b - Fs)/(reg.b - FoPrime);
var qP_noMPF = (FmPrime - Fs)/(FmPrime - FoPrime);
var FvP_FmP_MPF = (reg.b-FoPrime)/reg.b;
var FvP_FmP_noMPF = (AFmP-FoPrime)/AFmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fvfm = fvfm_MPF;
var npqt = npqt_MPF;
var PhiNO = PhiNO_MPF;
var PhiNPQ = PhiNPQ_MPF;
var qL = qL_MPF;
var FmPrime = reg.b;
var qP = qP_MPF;
var FvP_FmP = FvP_FmP_MPF;

//  ****************OUTPUT VALUES FROM MACRO ******************
// if any of the flag conditions are true, then create the 'flag' object.  Otherwise, do not create the flag object.
// for now since flag system isn't fully implemented, also create as separate objects so they will be displayed
// ----------------------------

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ, PhiNO... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
if (reg.m > 0) {
  fvfm = fvfm_noMPF;
  npqt = npqt_noMPF;
  PhiNO = PhiNO_noMPF;
  PhiNPQ = PhiNPQ_noMPF;
  qL = qL_noMPF;
  FmPrime = AFmP;
  qP = qP_noMPF;
  FvP_FmP = FvP_FmP_noMPF;
  
  if (fvfm <= 0) {
    output.Phi2= 0;
  //  	output.flag.warning.push("Phi2 is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see Phi2_noMPF variable");
    output["warning 2"] = "Phi2 is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see Phi2_noMPF variable";
  }
  if (fvfm >=0.85) {
//  	output.flag.danger.push("Phi2 above the normal range (0 - 0.85).  Please check the raw trace and consider excluding this point.");
	output["danger 5"] = "Phi2 above the normal range (0 - 0.85).  Please check the raw trace and consider excluding this point.";
  }
  else {
	  outputPhi2 		= MathROUND(fvfm,3);
  }
  
  if (npqt <= 0) {
    output.NPQt= 0;
//  	output.flag.warning.push("NPQt is negative (should be positive)!  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative NPQt value, see NPQt_noMPF variable");
	output["warning 1"] = "NPQt is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see NPQt_noMPF variable";
  }
  else {
	  output.NPQt= MathROUND(npqt,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.PhiNPQ= MathROUND(PhiNPQ,3);
	  output.PhiNO= MathROUND(PhiNO,3);
	  output.FvP_over_FmP = MathROUND(FvP_FmP,3);
	  outputqP = MathROUND(qP,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
else {
  if (fvfm <= 0) {
    output.Phi2 = 0;
//  	output.flag.warning.push("Phi2 is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see Phi2_MPF variable");
	output["warning 2"] = "Phi2 is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see Phi2_MPF variable";
  }
  if (fvfm >=0.85) {
//  	output.flag.danger.push("Phi2 above the normal range (0 - 0.85).  Please check the raw trace and consider excluding this point.");
	output["danger 5"] = "Phi2 above the normal range (0 - 0.85).  Please check the raw trace and consider excluding this point.";
  }
  else {
  	output.Phi2= MathROUND(fvfm,3);
  }
  if (npqt <= 0) {
    output.NPQt= 0;
//  	output.flag.warning.push("NPQt is negative (should be positive)!  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative NPQt value, see NPQt_MPF variable");
	output["warning 3"] = "NPQt value is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see NPQt_MPF variable";
  }
  else {
	  output.NPQt= MathROUND(npqt,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.PhiNPQ = MathROUND(PhiNPQ,3);
	  output.PhiNO= MathROUND(PhiNO,3);
	  output.FvP_over_FmP= MathROUND(FvP_FmP,3);
	  output.qP= MathROUND(qP,3);
}

// only display LEF if there is a light intensity measurement > 0 
// ----------------------------

var light_intensity=json.set[ECS_LEFdset].light_intensity;

//if (typeof output.light_intensity != "undefined" && output.light_intensity > 0) {
output.LEF= MathROUND((output.Phi2 * 0.45 * light_intensity),3);
//}

//}

// Calculate Standard Deviation for Warning or Danger flags (out of bounds measurement)
// ----------------------------

if (Fs_std > 100	) {
//  	output.flag.danger.push("noisy Fs");
	output["danger 1"] = "noisy Fs";
}
if (AFmP_std > 200) {
//  	output.flag.danger.push("noisy FmPrime");
	output["danger 2"] = "noisy FmPrime";
}
if (FmP_step1_std > 60 | FmP_step2_std > 60 | FmP_step3_std > 60 | FmP_end_std > 200) {
//  	output.flag.danger.push("noisy multi-phase flash steps");
	output["danger 3"] = "noisy  multi-phase flash steps";
}
if (FoPrime_std > 150) {
//  	output.flag.danger.push("noisy FoPrime");
	output["danger 4"] = "noisy FoPrime";
}
  
 //ANALYZE THE PHI-PSI DATA  

var ctrace=json.set[PAM_set].data_raw;
var PSI_trace_beg=310;
var PSI_trace_end=615;
var PSI_trace_length=PSI_trace_end-PSI_trace_beg;
var PSI_data=json.set[PAM_set].data_raw.slice(PSI_trace_beg,PSI_trace_end);
var PSI_dark_raw=MathMEAN(PSI_data.slice(PSI_dark_beg,PSI_dark_end));
var PSI_data_absorbance=[];

for (var i=0; i<PSI_trace_length; i++){
  	  PSI_data_absorbance.push(MathLOG(PSI_dark_raw/PSI_data[i]));
  }
  var PSI_dark=MathMEAN(PSI_data_absorbance.slice(PSI_dark_beg,PSI_dark_end));
  var PSI_ss=MathMEAN(PSI_data_absorbance.slice(PSI_ss_beg,PSI_ss_end));
  var PSI_sat1=MathMEAN(PSI_data_absorbance.slice(PSI_sat1_beg,PSI_sat1_end));
  var PSI_sat2=MathMEAN(PSI_data_absorbance.slice(PSI_sat2_beg,PSI_sat2_end));
  var PSI_ss=1000*MathMEAN(PSI_data_absorbance.slice(PSI_ss_beg,PSI_ss_end));
  var PSI_sat1_vals = PSI_data_absorbance.slice(PSI_sat1_beg,PSI_sat1_end).sort();  // sort the saturating light values from low to high
  var length_of_sat1=PSI_sat1_end-PSI_sat1_beg;
  var top_20_percent=(length_of_sat1*0.8);
  var PSI_sat1 = 1000*MathMEAN(PSI_sat1_vals.slice(top_20_percent,length_of_sat1)); // take the top 20% largest values and average them
  var PSI_sat2_vals = PSI_data_absorbance.slice(PSI_sat2_beg,PSI_sat2_end).sort();  // sort the saturating light values from low to high
  var length_of_sat2=PSI_sat2_end-PSI_sat2_beg;
  var top_20_percent=(length_of_sat2*0.8);
  var PSI_sat2 = 1000*MathMEAN(PSI_sat2_vals.slice(top_20_percent,length_of_sat2)); // take the top 20% largest values and average them
  var PSI_ox=PSI_ss/PSI_sat2;
  var PSI_act=PSI_sat2;
  var PSI_open=(PSI_sat1-PSI_ss)/PSI_sat2;
  var PSI_or=1-PSI_sat1/PSI_sat2;
  output.PSI_data_absorbance=PSI_data_absorbance;

  output.PSI_act=MathROUND(PSI_act, 3);
  output.PSI_open =MathROUND(PSI_open, 3);
  output.PSI_or =MathROUND(PSI_or, 3);
  output.PSI_ox =MathROUND(PSI_ox, 3);


   // changes in leaf contactless_temp
  
  
  


//var light_intensity=json.set[ECS_LEFdset].light_intensity;
  output.light_intensity= light_intensity;                       
  var ambient_RH=json.set[5].humidity2;
  output.ambient_RH=MathROUND(ambient_RH,3);
  var ambient_temperature=json.set[4].temperature;
  output.ambient_temperature=ambient_temperature;
  var leaf_RH=json.set[5].humidity2;
  output.leaf_RH=MathROUND(leaf_RH, 2);
  leaf_temperature = json.set[ECS_LEFdset].contactless_temp;
  output.leaf_temperature=leaf_temperature;

  var leaf_air_difference_temperature = leaf_temperature-ambient_temperature;
  output.leaf_air_difference_temperature=MathROUND(leaf_air_difference_temperature,3);
  var leaf_air_difference_temperature_norm = leaf_temperature-ambient_temperature;
  output.leaf_air_difference_temperature_norm=MathROUND(1000*leaf_air_difference_temperature/(273.3+leaf_temperature),3);



// CALCULATIONS FOR ABSORBANCE / SPAD PORTION OF THE TRACE
//----------------------------
var SPAD_set=5;
var calib_set=5;

var abs_starts = 0; //1180; // when does the Phi2 measurement start
var data = json.set[SPAD_set].data_raw;
var lights = [1,2,3,4,6,8,9,10];// define the lights to have absorbance measured
var wavelengths = ["530","650","605","420","940","850","730","880"];// define the lights to have absorbance measured
var raw_at_blank1 = [0,0,0,0,0,0,0,0];
var raw_at_blank2 = [0,0,0,0,0,0,0,0];
var raw_at_blank3 = [0,0,0,0,0,0,0,0];
var abs_at_blank1 = [0,0,0,0,0,0,0,0];
var abs_at_blank2 = [0,0,0,0,0,0,0,0];
var abs_at_blank3 = [0,0,0,0,0,0,0,0];
var trans_at_blank1 = [0,0,0,0,0,0,0,0];
var trans_at_blank2 = [0,0,0,0,0,0,0,0];
var trans_at_blank3 = [0,0,0,0,0,0,0,0];
var spad_at_blank1 = [0,0,0,0,0,0,0,0];
var spad_at_blank2 = [0,0,0,0,0,0,0,0];
var spad_at_blank3 = [0,0,0,0,0,0,0,0];
var minolta_spad1 = 0;
var minolta_spad2 = 0;
var minolta_spad3 = 0;
var minolta_spad = 0;
var minolta_spad_averages = 0;
var choose = 0;
var light;
var wavelengthString;
var pulses = 10;// number of pulses in a cycle

// Loop through the lights.  If it's zero, skip it.  If it's not in the acceptable range (>500 but <65534 (max)) skip it.// Then choose the first blank (starting with 1 moving to 3) which fulfills this criteria
// Otherwise, calculate absorbance and transmittance and a 'spad'-like value using LED 6 (940 on clamp) to calibrate thickness

//----------------------------

for (var i = 0;i<lights.length;i++) { // loop through and save one averaged 'point' for each of the cycles
  light = lights[i]; //json.set[PAM_set].data_raw[1];
  wavelengthString = wavelengths[i];                                                    
  //var value1 = MathMEDIAN(json.set[PAM_set].data_raw.slice((abs_starts + i*pulses+2),(abs_starts + i*pulses+8)));
  var value1 = MathMEDIAN(json.set[SPAD_set].data_raw.slice((abs_starts + i*pulses+2),(abs_starts + i*pulses+8)));
  var value2 = MathMEDIAN(json.set[SPAD_set].data_raw.slice((abs_starts + i*pulses+82),(abs_starts + i*pulses+88)));
  var value3 = MathMEDIAN(json.set[SPAD_set].data_raw.slice((abs_starts + i*pulses+162),(abs_starts + i*pulses+168)));
  raw_at_blank1[light] = value1;
  raw_at_blank2[light] = value2;
  raw_at_blank3[light] = value3;
  
 output.value1=value1;
 output.value2=value2;
 output.value3=value3;
  
 output.lights_length=lights.length;
 raw_at_blank1[light] = value1;
 raw_at_blank2[light] = value2;
 raw_at_blank3[light] = value3;
  
  if (json.set[calib_set].recall["colorcal_blank1["+light+"]"] != 0 && raw_at_blank1[light] > 500 && raw_at_blank1[light] < 65534) {
    abs_at_blank1[light] = MathROUND(-1*MathLOG(raw_at_blank1[light]/json.set[calib_set].recall["colorcal_blank1["+light+"]"]),3);
//    trans_at_blank1[light] = MathROUND(raw_at_blank1[light]/json.set[calib_set].recall["colorcal_blank1["+light+"]"],3);
//	output ["light".concat(light.toString(),"_transmittance")]  = trans_at_blank1[light];
    output ["absorbance_".concat(wavelengthString)]  = abs_at_blank1[light];
//	output ["light".concat(light.toString(),"_blank1")]  = json.set[calib_set].recall["colorcal_blank1["+light+"]"];
  }
  
}

//output.test= json.set[12].data_raw; //MathMEAN(json.set[PAM_set].data_raw.slice(10,20)); //(abs_starts + i*pulses+2),(abs_starts + i*pulses+8)));

// so the raw value needs to be >~2000, while the 940 needs to be greater than ~5000, otherwise it's out of range
// the acceptable range is different for each blank (1,2,3) thus a separate if statement for each blank.
// once you hit an intensity which is within the acceptable range, then keep that value and skip the rest


for (var i = 0;i<8;i++) { // loop through and save one averaged SPAD value for each of the cycles.  If we have additional calibration values (like minolta spad) use those and output that value
  light = lights[i];
  wavelengthString = wavelengths[i];
  spad_at_blank2[light] = MathROUND(100*MathLOG((raw_at_blank2[6] / json.set[calib_set].recall["colorcal_blank2[6]"])/(raw_at_blank2[light] / json.set[calib_set].recall["colorcal_blank2["+light+"]"])),2);
  spad_at_blank1[light] = MathROUND(100*MathLOG((raw_at_blank1[6] / json.set[calib_set].recall["colorcal_blank1[6]"])/(raw_at_blank1[light] / json.set[calib_set].recall["colorcal_blank1["+light+"]"])),2);
  spad_at_blank3[light] = MathROUND(100*MathLOG((raw_at_blank3[6] / json.set[calib_set].recall["colorcal_blank3[6]"])/(raw_at_blank3[light] / json.set[calib_set].recall["colorcal_blank3["+light+"]"])),2);
  if (light == 2) { // if it's the red light, the also calculate minolta spad
    //output ["light".concat(light.toString(),"_raw1")]  = raw_at_blank1[light];
    //output ["light6_raw1"]  = raw_at_blank1[6];
    //output ["spad_raw1"]  = spad_at_blank1[2];
    //output ["light".concat(light.toString(),"_raw2")]  = raw_at_blank2[light];
    //output ["light6_raw2"]  = raw_at_blank2[6];
    //output ["spad_raw2"]  = spad_at_blank2[2];
    //output ["light".concat(light.toString(),"_raw3")]  = raw_at_blank3[light];
    //output ["light6_raw3"]  = raw_at_blank3[6];
    //output ["spad_raw3"]  = spad_at_blank3[2];
  }
  if (json.set[calib_set].recall["colorcal_blank1["+light+"]"] != 0 && raw_at_blank1[light] > 30 && raw_at_blank1[light] < 65534 
      && raw_at_blank1[6] > 4500 && raw_at_blank1[6] < 65534) {
    if (light == 2) { // if it's the red light, the also calculate minolta spad
      minolta_spad = (spad_at_blank1[2] - json.set[calib_set].recall["colorcal_intensity1_yint[2]"]) / json.set[calib_set].recall["colorcal_intensity1_slope[2]"];	
      output ["SPAD_".concat(wavelengthString)]  = MathROUND(minolta_spad,2);
      //output ["SPAD_".concat(wavelengthString,"_intensity")]  = 1;
        choose = 1;
      continue;
    }
    else if (light != 6) {
      //output ["SPAD_".concat(wavelengthString)] = MathROUND(spad_at_blank1[light],2);
      //output ["SPAD_".concat(wavelengthString,"_intensity")] = 1;
//      output ["SPAD1_".concat(wavelengthString)] = MathROUND(spad_at_blank1[light],2);
//      output ["SPAD1_".concat(wavelengthString,"_intensity")] = 1;
      continue;
    }
  }
  if (json.set[calib_set].recall["colorcal_blank2["+light+"]"] != 0 && raw_at_blank2[light] > 500 && raw_at_blank2[light] < 65534 
      && raw_at_blank2[6] > 3000 && raw_at_blank2[6] < 65534) {
    if (light == 2) { // if it's the red light, the also calculate minolta spad
      minolta_spad = (spad_at_blank2[2] - json.set[calib_set].recall["colorcal_intensity2_yint[2]"]) / json.set[calib_set].recall["colorcal_intensity2_slope[2]"];
      output ["SPAD_".concat(wavelengthString)] = MathROUND(minolta_spad,2);
      output ["SPAD_".concat(wavelengthString,"_intensity")] = 2;
        choose = 2;
      continue;
    }
    else if (light != 6) {
      //output ["SPAD_".concat(wavelengthString)] = MathROUND(spad_at_blank2[light],2);
      output ["SPAD_".concat(wavelengthString,"_intensity")] = 2;
//      output ["SPAD2_".concat(wavelengthString)] = MathROUND(spad_at_blank2[light],2);
//      output ["SPAD2_".concat(wavelengthString,"_intensity")] = 2;
      continue;
    }
  }

  output.SPAD=MathROUND(minolta_spad, 2);
  if (json.set[calib_set].recall["colorcal_blank3["+light+"]"] != 0 && raw_at_blank3[light] > 750 && raw_at_blank3[light] < 65534 
      && raw_at_blank3[6] > 3000 && raw_at_blank3[6] < 65534) {
    if (light == 2) { // if it's the red light, the also calculate minolta spad
      minolta_spad = (spad_at_blank3[2] - json.set[calib_set].recall["colorcal_intensity3_yint[2]"]) / json.set[calib_set].recall["colorcal_intensity3_slope[2]"];
      output ["SPAD_".concat(wavelengthString)]  = MathROUND(minolta_spad,2);
      output ["SPAD_".concat(wavelengthString,"_intensity")]  = 3;
      choose = 3;
      continue;
    }
    else if (light != 6) {
      output ["SPAD_".concat(wavelengthString)] = MathROUND(spad_at_blank3[light],2);
      output ["SPAD_".concat(wavelengthString,"_intensity")] = 3;
//      output ["SPAD3_".concat(wavelengthString)] = MathROUND(spad_at_blank3[light],2);
//      output ["SPAD3_".concat(wavelengthString,"_intensity")] = 3;
      continue;
    }
  }
}

if (choose == 0) {
  output ["SPAD_650"]  = 0;
  danger("Chlorophyll content SPAD is outside the acceptable range.  The leaf may be too thick, too thin, or have holes in it.", output);
}
else if (minolta_spad <= 2) {
  danger("Chlorophyll Content SPAD is very low.  If leaf is visibly green, ensure leaf completely covers the light guide and retry.  If still too low, consider recalibrating device.", output);
}
else if (minolta_spad >= 100) {
  danger("Chlorophyll Content SPAD is very high.  If this value is associated with a typical leaf, consider recalibrating device.", output);
}


output.thick1=json.set[2].thickness;
output.thick2=json.set[ECS_LEFdset].thickness;
output.thick3=json.set[PAM_set].thickness;
output.thick4=json.set[calib_set].thickness;


// Return data

return output;
{
  "time": 1502199398239,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "00:00:00:05",
  "device_battery": 96,
  "device_firmware": 1.2021,
  "sample": [
    [
      {
        "time": 1502199398239,
        "light_intensity_raw": 0,
        "data_raw": [

        ],
        "protocol_id": 1,
        "set": [
          {
            "time": 1502199398239,
            "blank:": "blank"
          },
          {
            "time": 1502199398249,
            "label": "",
            "light_intensity": 1119.395,
            "r": 1447,
            "g": 464,
            "b": 338,
            "light_intensity_raw": 2121,
            "temperature": 25.38,
            "humidity": 48.405,
            "pressure": 990.892,
            "temperature2": 25.56,
            "humidity2": 43.665,
            "pressure2": 989.866,
            "contactless_temp": 24.74,
            "data_raw": [

            ]
          },
          {
            "time": 1502199399753,
            "label": "",
            "light_intensity": 1362.756,
            "r": 1762,
            "g": 565,
            "b": 412,
            "light_intensity_raw": 2583,
            "temperature": 25.42,
            "humidity": 48.354,
            "pressure": 990.886,
            "temperature2": 25.61,
            "humidity2": 43.627,
            "pressure2": 989.834,
            "contactless_temp": 26.38,
            "compass_direction": "W",
            "compass": 270,
            "angle": 7.331,
            "angle_direction": "NE",
            "pitch": 3.89,
            "roll": -6.22,
            "thickness": 0.32,
            "data_raw": [
              56005,
              55367,
              55357,
              55349,
              55354,
              55342,
              55345,
              55342,
              55337,
              55358,
              55343,
              55341,
              55336,
              55347,
              55349,
              55343,
              55341,
              55349,
              55341,
              55351,
              55334,
              55355,
              55343,
              55347,
              55344,
              55335,
              55350,
              55346,
              55340,
              55348,
              55352,
              55347,
              55341,
              55358,
              55360,
              55359,
              55356,
              55354,
              55357,
              55354,
              55345,
              55359,
              55351,
              55350,
              55345,
              55360,
              55359,
              55359,
              55359,
              55351,
              55367,
              55365,
              55356,
              55366,
              55359,
              55366,
              55357,
              55367,
              55367,
              55366,
              55362,
              55353,
              55366,
              55375,
              55365,
              55369,
              55365,
              55366,
              55377,
              55367,
              55379,
              55371,
              55364,
              55377,
              55375,
              55387,
              55370,
              55389,
              55381,
              55375,
              55377,
              55371,
              55381,
              55399,
              55379,
              55388,
              55391,
              55385,
              55371,
              55390,
              55379,
              55393,
              55383,
              55381,
              55389,
              55386,
              55387,
              55398,
              55385,
              55396,
              55389,
              55395,
              55383,
              55395,
              55391,
              55386,
              55393,
              55388,
              55387,
              55391,
              55399,
              55406,
              55391,
              55398,
              55400,
              55399,
              55399,
              55388,
              55398,
              55399,
              55387,
              55392,
              55399,
              55394,
              55398,
              55387,
              55399,
              55403,
              55383,
              55401,
              55398,
              55403,
              55385,
              55391,
              55392,
              55399,
              55399,
              55394,
              55411,
              55402,
              55404,
              55395,
              55395,
              55399,
              55399,
              55396,
              55404,
              55405,
              55391,
              55396,
              55399,
              55414,
              55394,
              55403,
              55411,
              55409,
              55405,
              55396,
              55407,
              55410,
              55407,
              55406,
              55399,
              55416,
              55399,
              55409,
              55407,
              55414,
              55406,
              55399,
              55410,
              55409,
              55412,
              55405,
              55402,
              55415,
              55419,
              55407,
              55419,
              55417,
              55409,
              55405,
              55415,
              55428,
              55411,
              55413,
              55411,
              55414,
              55423,
              55399,
              55423,
              55418,
              55407,
              55425,
              55421,
              55425,
              55410,
              55407,
              55422,
              55417,
              55435,
              55450,
              55477,
              55477,
              55493,
              55488,
              55511,
              55524,
              55522,
              55528,
              55531,
              55541,
              55551,
              55550,
              55570,
              55559,
              55569,
              55579,
              55580,
              55593,
              55571,
              55525,
              55509,
              55485,
              55489,
              55469,
              55479,
              55456,
              55466,
              55453,
              55461,
              55462,
              55457,
              55457,
              55455,
              55457,
              55435,
              55457,
              55447,
              55455,
              55444,
              55447,
              55447,
              55450,
              55435,
              55435,
              55439,
              55437,
              55439,
              55439,
              55434,
              55431,
              55436,
              55435,
              55445,
              55438,
              55431,
              55439,
              55437,
              55438,
              55431,
              55437,
              55431,
              55441,
              55427,
              55430,
              55439,
              55437,
              55430,
              55436,
              55441,
              55443,
              55443,
              55429,
              55439,
              55433,
              55436,
              55430,
              55439,
              55447,
              55436,
              55445,
              55431,
              55445,
              55436,
              55435,
              55446,
              55446,
              55441,
              55438,
              55447,
              55435,
              55440,
              55443,
              55440,
              55447,
              55431,
              55437,
              55450,
              55444,
              55435,
              55439,
              55443,
              55453,
              55441,
              55442,
              55441,
              55446,
              55447,
              55439,
              55452,
              55441,
              55437,
              55459,
              55455,
              55447,
              55447,
              55438,
              55454,
              55453,
              55455,
              55435,
              55447,
              55441,
              55447,
              55458,
              55454,
              55464,
              55437,
              55455,
              55461,
              55457,
              55457,
              55455,
              55462,
              55457,
              55446,
              55455,
              55449,
              55459,
              55456,
              55442,
              55454,
              55459,
              55459,
              55457,
              55449,
              55455,
              55463,
              55447,
              55463,
              55451,
              55455,
              55462,
              55455,
              55458,
              55465,
              55461,
              55466,
              55454,
              55463,
              55463,
              55459,
              55471,
              55462,
              55455,
              55457,
              55462,
              55455,
              55454,
              55459,
              55461,
              55458,
              55454,
              55465,
              55463,
              55462,
              55454,
              55462,
              55457,
              55467,
              55466,
              55475,
              55465,
              55465,
              55466,
              55465,
              55462,
              55466,
              55459,
              55471,
              55463,
              55466,
              55471,
              55474,
              55475,
              55463,
              55463,
              55462,
              55482,
              55466,
              55467,
              55474,
              55474,
              55470,
              55458,
              55473,
              55462,
              55470,
              55471,
              55471,
              55473,
              55466,
              55467,
              55476,
              55476,
              55471,
              55461,
              55472,
              55475,
              55495,
              55504,
              55523,
              55543,
              55542,
              55550,
              55563,
              55569,
              55581,
              55578,
              55598,
              55598,
              55615,
              55604,
              55614,
              55618,
              55625,
              55625,
              55637,
              55631,
              55631,
              55569,
              55543,
              55545,
              55546,
              55519,
              55519,
              55520,
              55513,
              55503,
              55513,
              55504,
              55507,
              55490,
              55495,
              55499,
              55501,
              55498,
              55497,
              55500,
              55495,
              55487,
              55487,
              55497,
              55487,
              55491,
              55477,
              55495,
              55492,
              55478,
              55484,
              55476,
              55484,
              55491,
              55479,
              55486,
              55489,
              55467,
              55481,
              55495,
              55488,
              55483,
              55485,
              55482,
              55492,
              55467,
              55489,
              55482,
              55487,
              55478,
              55479,
              55481,
              55487,
              55481,
              55490,
              55495,
              55487,
              55487,
              55474,
              55494,
              55491,
              55479,
              55489,
              55487,
              55487,
              55487,
              55498,
              55489,
              55487,
              55486,
              55490,
              55493,
              55473,
              55484,
              55493,
              55480,
              55491,
              55489,
              55482,
              55493,
              55495,
              55489,
              55494,
              55498,
              55492,
              55491,
              55489,
              55489,
              55495,
              55484,
              55490,
              55487,
              55490,
              55487,
              55490,
              55491,
              55496,
              55487,
              55497,
              55493,
              55491,
              55491,
              55487,
              55495,
              55495,
              55480,
              55492,
              55497,
              55489,
              55481,
              55486,
              55490,
              55494,
              55491,
              55489,
              55503,
              55489,
              55492,
              55492,
              55497,
              55499,
              55498,
              55486,
              55497,
              55483,
              55488,
              55491,
              55507,
              55497,
              55492,
              55495,
              55511,
              55495,
              55502,
              55490,
              55495,
              55519,
              55485,
              55506,
              55509,
              55501,
              55515,
              55487,
              55498,
              55509,
              55491,
              55495,
              55503,
              55502,
              55499,
              55494,
              55503,
              55504,
              55506,
              55495,
              55495,
              55503,
              55510,
              55487,
              55505,
              55503,
              55489,
              55501,
              55510,
              55504,
              55515,
              55503,
              55505,
              55502,
              55504,
              55495,
              55503,
              55509,
              55501,
              55495,
              55495,
              55511,
              55516,
              55495,
              55510,
              55504,
              55503,
              55505,
              55514,
              55505,
              55511,
              55510,
              55507,
              55519,
              55505,
              55502,
              55514,
              55513,
              55518,
              55490,
              55506,
              55521,
              55512,
              55513,
              55510,
              55523,
              55556,
              55558,
              55572,
              55591,
              55591,
              55602,
              55597,
              55607,
              55623,
              55613,
              55636,
              55625,
              55639,
              55641,
              55645,
              55655,
              55655,
              55659,
              55663,
              55666,
              55607,
              55578,
              55574,
              55565,
              55559,
              55563,
              55544,
              55548,
              55548,
              55531,
              55540,
              55531,
              55541,
              55534,
              55535,
              55531,
              55529,
              55527,
              55520,
              55527,
              55532,
              55524,
              55530,
              55516,
              55534,
              55522,
              55525,
              55526,
              55527,
              55517,
              55531,
              55512,
              55521,
              55507,
              55521,
              55530,
              55531,
              55510,
              55515,
              55517,
              55524,
              55511,
              55517,
              55512,
              55513,
              55514,
              55511,
              55515,
              55522,
              55513,
              55518,
              55529,
              55510,
              55517,
              55518,
              55524,
              55522,
              55509,
              55518,
              55515,
              55508,
              55511,
              55518,
              55512,
              55516,
              55523,
              55519,
              55517,
              55516,
              55519,
              55514,
              55516,
              55520,
              55518,
              55521,
              55527,
              55522,
              55519,
              55509,
              55521,
              55527,
              55518,
              55513,
              55522,
              55520,
              55527,
              55513,
              55525,
              55519,
              55524,
              55526,
              55522,
              55528,
              55518,
              55511,
              55519,
              55519,
              55526,
              55526,
              55525,
              55527,
              55528,
              55519,
              55529,
              55515,
              55519,
              55515,
              55525,
              55527,
              55527,
              55525,
              55519,
              55524,
              55527,
              55515,
              55529,
              55520,
              55529,
              55527,
              55528,
              55527,
              55530,
              55522,
              55527,
              55527,
              55535,
              55519,
              55533,
              55525,
              55531,
              55537,
              55532,
              55537,
              55534,
              55529,
              55529,
              55527,
              55532,
              55528,
              55527,
              55532,
              55533,
              55529,
              55519,
              55537,
              55539,
              55532,
              55537,
              55527,
              55526,
              55537,
              55527,
              55526,
              55539,
              55531,
              55533,
              55530,
              55531,
              55529,
              55531,
              55533,
              55535,
              55524,
              55538,
              55530,
              55539,
              55535,
              55533,
              55539,
              55529,
              55527,
              55529,
              55527,
              55541,
              55534,
              55527,
              55535,
              55545,
              55521,
              55528,
              55541,
              55535,
              55538,
              55534,
              55530,
              55529,
              55537,
              55526,
              55530,
              55538,
              55527,
              55531,
              55545,
              55531,
              55541,
              55527,
              55540,
              55539,
              55533,
              55543,
              55585,
              55585,
              55601,
              55609,
              55622,
              55623,
              55638,
              55635,
              55647,
              55656,
              55659,
              55665,
              55663,
              55675,
              55678,
              55681,
              55686,
              55681,
              55700,
              55687,
              55631,
              55611,
              55591,
              55587,
              55585,
              55574,
              55583,
              55559,
              55571,
              55563,
              55563,
              55565,
              55557,
              55555,
              55569,
              55539,
              55556,
              55543,
              55558,
              55542,
              55543,
              55547,
              55556,
              55542,
              55551,
              55551,
              55539,
              55546,
              55543,
              55533,
              55546,
              55539,
              55533,
              55541,
              55550,
              55545,
              55539,
              55546,
              55543,
              55551,
              55539,
              55548,
              55542,
              55542,
              55535,
              55551,
              55534,
              55554,
              55547,
              55539,
              55548,
              55555,
              55542,
              55546,
              55551,
              55534,
              55543,
              55546,
              55543,
              55545,
              55542,
              55539,
              55540,
              55542,
              55546,
              55539,
              55547,
              55542,
              55551,
              55527,
              55547,
              55547,
              55540,
              55543,
              55535,
              55547,
              55547,
              55546,
              55544,
              55538,
              55549,
              55541,
              55547,
              55536,
              55543,
              55556,
              55547,
              55545,
              55543,
              55550,
              55559,
              55548,
              55551,
              55540,
              55547,
              55549,
              55545,
              55549,
              55547,
              55538,
              55551,
              55558,
              55541,
              55543,
              55552,
              55545,
              55550,
              55551,
              55550,
              55550,
              55541,
              55553,
              55552,
              55553,
              55554,
              55551,
              55554,
              55563,
              55548,
              55543,
              55558,
              55549,
              55547,
              55557,
              55540,
              55559,
              55547,
              55545,
              55548,
              55563,
              55543,
              55550,
              55557,
              55541,
              55559,
              55551,
              55545,
              55556,
              55563,
              55551,
              55552,
              55555,
              55545,
              55551,
              55556,
              55547,
              55566,
              55551,
              55552,
              55558,
              55550,
              55558,
              55557,
              55559,
              55557,
              55548,
              55557,
              55548,
              55557,
              55555,
              55551,
              55553,
              55543,
              55554,
              55559,
              55558,
              55559,
              55563,
              55547,
              55566,
              55546,
              55559,
              55545,
              55557,
              55559,
              55546,
              55559,
              55551,
              55559,
              55567,
              55549,
              55552,
              55554,
              55564,
              55567,
              55557,
              55564,
              55556,
              55557,
              55552,
              55558,
              55558,
              55569,
              55551,
              55557,
              55561,
              55562,
              55558,
              55557,
              55571,
              55604,
              55611,
              55625,
              55634,
              55643,
              55645,
              55647,
              55662,
              55678,
              55671,
              55673,
              55678,
              55687,
              55686,
              55693,
              55710,
              55698,
              55710,
              55705,
              55719,
              55640,
              55619,
              55603,
              55591,
              55596,
              55591,
              55586,
              55585,
              55586,
              55583,
              55589,
              55578,
              55577,
              55566,
              55575,
              55571,
              55569,
              55575,
              55566,
              55578,
              55573,
              55564,
              55558,
              55567,
              55566,
              55572,
              55559,
              55557,
              55567,
              55559,
              55555,
              55559,
              55561,
              55569,
              55553,
              55559,
              55567,
              55569,
              55559,
              55558,
              55561,
              55565,
              55563,
              55559,
              55559,
              55559,
              55563,
              55566,
              55559,
              55566,
              55564,
              55558,
              55567,
              55563,
              55567,
              55565,
              55554,
              55567,
              55564,
              55566,
              55567,
              55561,
              55559,
              55563,
              55555,
              55558,
              55553,
              55562,
              55559,
              55559,
              55567,
              55554,
              55564,
              55563,
              55559,
              55573,
              55558,
              55565,
              55556,
              55566,
              55559,
              55559,
              55566,
              55570,
              55563,
              55551,
              55555,
              55575,
              55553,
              55565,
              55558,
              55563,
              55571,
              55559,
              55562,
              55565,
              55559,
              55561,
              55569,
              55571,
              55559,
              55556,
              55567,
              55565,
              55577,
              55548,
              55565,
              55556,
              55573,
              55563,
              55569,
              55571,
              55566,
              55567,
              55565,
              55559,
              55566,
              55565,
              55566,
              55577,
              55559,
              55570,
              55568,
              55563,
              55573,
              55575,
              55563,
              55575,
              55575,
              55569,
              55557,
              55569,
              55570,
              55574,
              55565,
              55565,
              55572,
              55585,
              55562,
              55575,
              55570,
              55576,
              55556,
              55564,
              55571,
              55571,
              55565,
              55567,
              55579,
              55570,
              55569,
              55565,
              55578,
              55559,
              55559,
              55577,
              55563,
              55571,
              55578,
              55556,
              55579,
              55577,
              55570,
              55566,
              55572,
              55575,
              55582,
              55565,
              55567,
              55572,
              55575,
              55571,
              55581,
              55575,
              55579,
              55563,
              55568,
              55583,
              55567,
              55569,
              55569,
              55577,
              55575,
              55564,
              55571,
              55584,
              55577,
              55575,
              55556,
              55574,
              55574,
              55569,
              55566,
              55566,
              55570,
              55576,
              55562,
              55577,
              55578,
              55587,
              55599,
              55623,
              55638,
              55648,
              55657,
              55654,
              55666,
              55681,
              55680,
              55687,
              55686,
              55698,
              55706,
              55704,
              55720,
              55719,
              55725,
              55719,
              55722,
              55751,
              55657,
              55634,
              55623,
              55620,
              55616,
              55595,
              55599,
              55606,
              55606,
              55590,
              55599,
              55591,
              55595,
              55597,
              55587,
              55590,
              55582,
              55573,
              55583,
              55585,
              55586,
              55575,
              55582,
              55577,
              55577,
              55574,
              55565,
              55575,
              55584,
              55574,
              55577,
              55579,
              55578,
              55582,
              55566,
              55581,
              55583,
              55571,
              55569,
              55583,
              55577,
              55578,
              55573,
              55566,
              55575,
              55583,
              55569,
              55574,
              55570,
              55580,
              55574,
              55572,
              55581,
              55582,
              55569,
              55575,
              55572,
              55581,
              55579,
              55570,
              55583,
              55574,
              55583,
              55577,
              55573,
              55575,
              55573,
              55573,
              55584,
              55577,
              55583,
              55570,
              55583,
              55581,
              55577,
              55577,
              55572,
              55581,
              55567,
              55579,
              55573,
              55580,
              55583,
              55571,
              55562,
              55586,
              55575,
              55582,
              55572,
              55584,
              55577,
              55578,
              55575,
              55575,
              55586,
              55581,
              55579,
              55582,
              55571,
              697,
              290,
              278,
              281,
              287,
              277,
              283,
              291,
              290,
              280,
              279,
              273,
              278,
              281,
              284,
              279,
              282,
              278,
              287,
              282,
              194,
              273,
              265,
              269,
              264,
              265,
              255,
              251,
              251,
              239,
              251,
              241,
              241,
              232,
              243,
              243,
              233,
              229,
              229,
              234,
              1537,
              283,
              274,
              277,
              273,
              271,
              267,
              269,
              280,
              279,
              274,
              282,
              275,
              276,
              280,
              275,
              283,
              274,
              274,
              280,
              276,
              275,
              274,
              279,
              279,
              276,
              280,
              279,
              288,
              275,
              283,
              281,
              275,
              275,
              284,
              288,
              283,
              280,
              273,
              288,
              287,
              285,
              276,
              278,
              289,
              288,
              277,
              280,
              283,
              287,
              273,
              283,
              281,
              283,
              276,
              273,
              283,
              280,
              283,
              280,
              276,
              287,
              275,
              279,
              281,
              276,
              281,
              280,
              276,
              275,
              279,
              275,
              287,
              275,
              281,
              282,
              287,
              287,
              273,
              273,
              283,
              281,
              275,
              269,
              276,
              286,
              282,
              283,
              275,
              288,
              276,
              283,
              277,
              277,
              282,
              290,
              273,
              279,
              280,
              276
            ]
          },
          {
            "time": 1502199409007,
            "label": "",
            "light_intensity": 1362.8,
            "r": 1762,
            "g": 565,
            "b": 412,
            "light_intensity_raw": 2583,
            "temperature": 25.44,
            "humidity": 48.39,
            "pressure": 990.884,
            "temperature2": 25.63,
            "humidity2": 43.629,
            "pressure2": 989.847,
            "contactless_temp": 25.15,
            "thickness": 0.31,
            "data_raw": [
              52879,
              52950,
              52821,
              52801,
              52763,
              52734,
              52687,
              52728,
              52727,
              52720,
              52739,
              52708,
              52746,
              52738,
              52743,
              52734,
              52749,
              52727,
              52738,
              52711,
              52728,
              52751,
              52763,
              52750,
              52741,
              52750,
              52713,
              52751,
              52724,
              52709,
              52740,
              52726,
              52748,
              52751,
              52754,
              52743,
              52727,
              52733,
              52740,
              52747,
              52721,
              52737,
              52743,
              52727,
              52725,
              52724,
              52749,
              52755,
              52747,
              52758,
              52735,
              52755,
              52733,
              52744,
              52737,
              52743,
              52719,
              52752,
              52732,
              52765,
              52715,
              52747,
              52731,
              52727,
              52746,
              52735,
              52726,
              52722,
              52735,
              52730,
              52751,
              52759,
              52755,
              52731,
              52738,
              52739,
              52735,
              52719,
              52737,
              52711,
              52719,
              52720,
              52715,
              52713,
              52727,
              52734,
              52741,
              52756,
              52728,
              52754,
              52766,
              52747,
              52739,
              52761,
              52719,
              52721,
              52741,
              52741,
              52708,
              52715,
              52719,
              52747,
              52759,
              52756,
              52767,
              52767,
              52739,
              52754,
              52763,
              52749,
              52759,
              52749,
              52769,
              52755,
              52761,
              52783,
              52759,
              52765,
              52747,
              52765,
              52756,
              52763,
              52770,
              52748,
              52785,
              52751,
              52745,
              52731,
              52734,
              52738,
              52727,
              52737,
              52756,
              52765,
              52755,
              52765,
              52719,
              52775,
              52743,
              52751,
              52746,
              52734,
              52747,
              52764,
              52743,
              52721,
              52695,
              52771,
              52729,
              52755,
              52733,
              52740,
              52750,
              52754,
              52729,
              52751,
              52763,
              52758,
              52733,
              52721,
              52726,
              52735,
              52722,
              52724,
              52731,
              52765,
              52749,
              52743,
              52737,
              52731,
              52727,
              52749,
              52760,
              52775,
              52759,
              52743,
              52727,
              52748,
              52762,
              52731,
              52734,
              52745,
              52739,
              52743,
              52743,
              52749,
              52730,
              52751,
              52771,
              52734,
              52749,
              52745,
              52721,
              52711,
              52756,
              52758,
              52727,
              52695,
              52731,
              52728,
              52601,
              52735,
              52758,
              52762,
              52749,
              52780,
              52776,
              52775,
              52759,
              52771,
              52783,
              52787,
              52787,
              52790,
              52814,
              52831,
              52829,
              52818,
              52823,
              52815,
              54221,
              52839,
              52773,
              52799,
              52772,
              52742,
              52753,
              52745,
              52721,
              52701,
              52749,
              52738,
              52731,
              52724,
              52754,
              52744,
              52727,
              52738,
              52756,
              52739,
              52714,
              52725,
              52721,
              52739,
              52703,
              52723,
              52767,
              52703,
              52717,
              52734,
              52746,
              52749,
              52749,
              52742,
              52758,
              52723,
              52761,
              52746,
              52769,
              52711,
              52739,
              52735,
              52763,
              52747,
              52753,
              52751,
              52742,
              52771,
              52740,
              52771,
              52760,
              52720,
              52751,
              52714,
              52737,
              52764,
              52751,
              52743,
              52752,
              52743,
              52795,
              52732,
              52749,
              52773,
              52769,
              52749,
              52731,
              52742,
              52749,
              52730,
              52739,
              52750,
              52751,
              52731,
              52731,
              52738,
              52737,
              52725,
              52711,
              52708,
              52716,
              52719,
              52711,
              52750,
              52723,
              52731,
              52709,
              52723,
              52751,
              52743,
              52740,
              52761,
              52764,
              52751,
              52755,
              52753,
              52724,
              52723,
              52714,
              52739,
              52718,
              52711,
              52711,
              52723,
              52728,
              52717,
              52734,
              52750,
              52726,
              52726,
              52747,
              52737,
              52703,
              52711,
              52739,
              52732,
              52715,
              52741,
              52723,
              52726,
              52737,
              52727,
              52713,
              52721,
              52745,
              52722,
              52746,
              52751,
              52749,
              52725,
              52749,
              52731,
              52785,
              52768,
              52716,
              52730,
              52711,
              52731,
              52750,
              52733,
              52718,
              52698,
              52717,
              52692,
              52731,
              52715,
              52719,
              52745,
              52696,
              52699,
              52721,
              52779,
              52747,
              52700,
              52702,
              52711,
              52715,
              52713,
              52711,
              52706,
              52730,
              52708,
              52723,
              52757,
              52751,
              52734,
              52717,
              52764,
              52753,
              52747,
              52754,
              52773,
              52763,
              52769,
              52733,
              52765,
              52749,
              52730,
              52710,
              52734,
              52748,
              52764,
              52733,
              52711,
              52722,
              52734,
              52756,
              52711,
              52714,
              52702,
              52735,
              52707,
              52721,
              52722,
              52730,
              52749,
              52726,
              52711,
              52745,
              52755,
              52581,
              52772,
              52719,
              52757,
              52781,
              52807,
              52774,
              52790,
              52792,
              52777,
              52771,
              52771,
              52802,
              52776,
              52774,
              52778,
              52801,
              52800,
              52814,
              52816,
              54391,
              52829,
              52780,
              52783,
              52761,
              52752,
              52755,
              52758,
              52738,
              52737,
              52750,
              52733,
              52749,
              52754,
              52752,
              52755,
              52726,
              52734,
              52730,
              52739,
              52734,
              52747,
              52759,
              52752,
              52731,
              52727,
              52750,
              52747,
              52737,
              52727,
              52708,
              52731,
              52749,
              52750,
              52751,
              52737,
              52727,
              52762,
              52754,
              52720,
              52723,
              52734,
              52742,
              52775,
              52735,
              52694,
              52746,
              52751,
              52768,
              52740,
              52742,
              52762,
              52775,
              52776,
              52769,
              52779,
              52766,
              52731,
              52738,
              52798,
              52749,
              52753,
              52734,
              52748,
              52751,
              52745,
              52745,
              52767,
              52760,
              52737,
              52746,
              52735,
              52731,
              52729,
              52735,
              52752,
              52727,
              52735,
              52755,
              52753,
              52731,
              52732,
              52721,
              52714,
              52746,
              52709,
              52737,
              52743,
              52722,
              52725,
              52747,
              52779,
              52738,
              52740,
              52745,
              52717,
              52719,
              52716,
              52715,
              52723,
              52734,
              52748,
              52760,
              52719,
              52709,
              52708,
              52749,
              52727,
              52748,
              52755,
              52728,
              52741,
              52771,
              52743,
              52724,
              52768,
              52755,
              52763,
              52745,
              52775,
              52760,
              52754,
              52784,
              52762,
              52747,
              52779,
              52770,
              52757,
              52763,
              52749,
              52775,
              52745,
              52725,
              52718,
              52739,
              52743,
              52721,
              52733,
              52708,
              52759,
              52761,
              52759,
              52768,
              52745,
              52734,
              52777,
              52767,
              52745,
              52752,
              52748,
              52766,
              52750,
              52741,
              52730,
              52734,
              52762,
              52753,
              52728,
              52763,
              52752,
              52738,
              52750,
              52753,
              52755,
              52751,
              52751,
              52777,
              52742,
              52719,
              52725,
              52731,
              52722,
              52736,
              52763,
              52713,
              52711,
              52743,
              52711,
              52735,
              52728,
              52712,
              52749,
              52711,
              52727,
              52746,
              52711,
              52699,
              52718,
              52721,
              52697,
              52699,
              52687,
              52733,
              52723,
              52702,
              52752,
              52716,
              52735,
              52717,
              52742,
              52512,
              52731,
              52769,
              52761,
              52758,
              52775,
              52749,
              52799,
              52799,
              52786,
              52767,
              52763,
              52775,
              52762,
              52759,
              52751,
              52775,
              52743,
              52763,
              52743,
              54447,
              52788,
              52767,
              52749,
              52734,
              52748,
              52721,
              52751,
              52723,
              52746,
              52753,
              52765,
              52725,
              52729,
              52719,
              52710,
              52711,
              52709,
              52737,
              52784,
              52751,
              52775,
              52720,
              52713,
              52752,
              52725,
              52735,
              52699,
              52742,
              52722,
              52733,
              52727,
              52733,
              52715,
              52777,
              52764,
              52731,
              52744,
              52756,
              52764,
              52742,
              52758,
              52718,
              52737,
              52711,
              52718,
              52711,
              52721,
              52715,
              52750,
              52724,
              52737,
              52733,
              52763,
              52736,
              52714,
              52747,
              52731,
              52743,
              52733,
              52719,
              52725,
              52735,
              52739,
              52711,
              52728,
              52752,
              52741,
              52735,
              52703,
              52714,
              52731,
              52767,
              52764,
              52752,
              52739,
              52753,
              52758,
              52725,
              52716,
              52739,
              52733,
              52751,
              52731,
              52709,
              52732,
              52713,
              52729,
              52726,
              52711,
              52739,
              52705,
              52729,
              52730,
              52766,
              52729,
              52730,
              52758,
              52724,
              52731,
              52736,
              52723,
              52767,
              52759,
              52767,
              52761,
              52737,
              52741,
              52710,
              52718,
              52711,
              52706,
              52703,
              52731,
              52739,
              52740,
              52732,
              52763,
              52715,
              52713,
              52735,
              52726,
              52711,
              52715,
              52721,
              52698,
              52711,
              52709,
              52679,
              52728,
              52714,
              52733,
              52727,
              52727,
              52755,
              52730,
              52758,
              52755,
              52737,
              52757,
              52732,
              52719,
              52754,
              52737,
              52733,
              52721,
              52723,
              52741,
              52762,
              52762,
              52737,
              52749,
              52716,
              52727,
              52715,
              52718,
              52711,
              52698,
              52714,
              52733,
              52704,
              52722,
              52709,
              52719,
              52728,
              52695,
              52731,
              52717,
              52704,
              52661,
              52703,
              52713,
              52711,
              52706,
              52707,
              52733,
              52720,
              52697,
              52702,
              52704,
              52698,
              52707,
              52735,
              52730,
              52716,
              52752,
              52731,
              52747,
              52743,
              52707,
              52733,
              52701,
              52702,
              52711,
              52699,
              52719,
              52704,
              52703,
              52731,
              52737,
              52434,
              52719,
              52736,
              52767,
              52728,
              52772,
              52771,
              52787,
              52751,
              52781,
              52779,
              52805,
              52749,
              52794,
              52780,
              52786,
              52801,
              52790,
              52793,
              52789,
              54593,
              52817,
              52761,
              52771,
              52723,
              52743,
              52750,
              52708,
              52718,
              52714,
              52695,
              52752,
              52690,
              52751,
              52753,
              52731,
              52735,
              52738,
              52738,
              52711,
              52742,
              52735,
              52735,
              52763,
              52757,
              52728,
              52756,
              52723,
              52756,
              52751,
              52747,
              52718,
              52747,
              52728,
              52762,
              52735,
              52761,
              52759,
              52743,
              52749,
              52775,
              52759,
              52747,
              52739,
              52751,
              52730,
              52742,
              52751,
              52749,
              52716,
              52732,
              52707,
              52715,
              52724,
              52719,
              52711,
              52723,
              52718,
              52739,
              52711,
              52703,
              52732,
              52734,
              52733,
              52727,
              52737,
              52701,
              52734,
              52720,
              52719,
              52719,
              52709,
              52747,
              52723,
              52718,
              52725,
              52733,
              52686,
              52694,
              52712,
              52708,
              52681,
              52687,
              52700,
              52711,
              52717,
              52703,
              52715,
              52705,
              52725,
              52729,
              52721,
              52738,
              52751,
              52746,
              52746,
              52793,
              52753,
              52747,
              52755,
              52769,
              52749,
              52783,
              52732,
              52739,
              52755,
              52715,
              52755,
              52753,
              52735,
              52737,
              52739,
              52745,
              52732,
              52732,
              52731,
              52731,
              52703,
              52745,
              52747,
              52732,
              52736,
              52735,
              52738,
              52748,
              52735,
              52698,
              52723,
              52720,
              52735,
              52750,
              52735,
              52738,
              52751,
              52745,
              52761,
              52752,
              52731,
              52729,
              52724,
              52770,
              52751,
              52751,
              52777,
              52751,
              52750,
              52746,
              52727,
              52747,
              52735,
              52759,
              52735,
              52715,
              52698,
              52749,
              52753,
              52768,
              52743,
              52709,
              52742,
              52728,
              52735,
              52729,
              52733,
              52713,
              52728,
              52745,
              52753,
              52743,
              52778,
              52767,
              52743,
              52739,
              52754,
              52747,
              52719,
              52753,
              52743,
              52750,
              52748,
              52734,
              52725,
              52757,
              52733,
              52725,
              52751,
              52713,
              52701,
              52737,
              52728,
              52735,
              52740,
              52736,
              52770,
              52730,
              52771,
              52751,
              52716,
              52713,
              52722,
              52229,
              52751,
              52760,
              52740,
              52740,
              52763,
              52798,
              52763,
              52779,
              52770,
              52755,
              52767,
              52782,
              52765,
              52784,
              52785,
              52773,
              52775,
              52807,
              52813,
              54814,
              52825,
              52793,
              52763,
              52783,
              52749,
              52757,
              52703,
              52711,
              52745,
              52734,
              52743,
              52754,
              52729,
              52722,
              52751,
              52773,
              52744,
              52722,
              52746,
              52727,
              52749,
              52727,
              52731,
              52716,
              52738,
              52719,
              52735,
              52761,
              52751,
              52762,
              52759,
              52748,
              52743,
              52744,
              52745,
              52738,
              52767,
              52750,
              52771,
              52738,
              52767,
              52747,
              52747,
              52763,
              52749,
              52746,
              52755,
              52723,
              52725,
              52735,
              52727,
              52745,
              52727,
              52733,
              52735,
              52725,
              52707,
              52757,
              52724,
              52738,
              52741,
              52724,
              52742,
              52755,
              52723,
              52725,
              52732,
              52755,
              52715,
              52724,
              52712,
              52698,
              52714,
              52723,
              52700,
              52717,
              52715,
              52728,
              52727,
              52707,
              52720,
              52732,
              52719,
              52745,
              52704,
              52698,
              52736,
              52714,
              52727,
              52739,
              52731,
              52740,
              52719,
              52755,
              52763,
              52743,
              52765,
              52762,
              52730,
              52720,
              52703,
              52730,
              52721,
              52762,
              52748,
              52757,
              52709,
              52713,
              52719,
              52727,
              52743,
              52715,
              52713,
              52740,
              52723,
              52702,
              52738,
              52726,
              52727,
              52730,
              52711,
              52707,
              52708,
              52732,
              52741,
              52704,
              52703,
              52698,
              52714,
              52713,
              52701,
              52710,
              52726,
              52711,
              52697,
              52685,
              52700,
              52711,
              52694,
              52689,
              52697,
              52710,
              52692,
              52725,
              52727,
              52712,
              52725,
              52715,
              52711,
              52700,
              52706,
              52719,
              52718,
              52707,
              52678,
              52681,
              52705,
              52683,
              52725,
              52721,
              52699,
              52717,
              52719,
              52715,
              52711,
              52714,
              52725,
              52719,
              52701,
              52719,
              52707,
              52717,
              52725,
              52713,
              52711,
              52713,
              52723,
              52754,
              52759,
              52759,
              52743,
              52747,
              52737,
              52726,
              52729,
              52726,
              52736,
              52761,
              52750,
              52731,
              52727,
              52727,
              52730,
              52723,
              52743,
              52735,
              52718,
              52711,
              52727,
              52231,
              52739,
              52732,
              52745,
              52763,
              52770,
              52787,
              52783,
              52743,
              52803,
              52765,
              52759,
              52783,
              52806,
              52801,
              52819,
              52799,
              52775,
              52797,
              52734,
              54906,
              52816,
              52779,
              52753,
              52743,
              52749,
              52721,
              52725,
              52731,
              52742,
              52715,
              52707,
              52705,
              52727,
              52709,
              52699,
              52699,
              52713,
              52719,
              52755,
              52767,
              52746,
              52758,
              52765,
              52790,
              52734,
              52745,
              52740,
              52726,
              52715,
              52758,
              52711,
              52695,
              52699,
              52737,
              52722,
              52727,
              52721,
              52740,
              52705,
              52737,
              52735,
              52735,
              52731,
              52723,
              52726,
              52747,
              52737,
              52734,
              52753,
              52745,
              52758,
              52740,
              52732,
              52707,
              52714,
              52706,
              52703,
              52707,
              52715,
              52728,
              52737,
              52707,
              52723,
              52731,
              52714,
              52679,
              52711,
              52681,
              52687,
              52689,
              52722,
              52723,
              52723,
              52691,
              52686,
              52711,
              52685,
              52711,
              52721,
              52705,
              52698,
              52716,
              52703,
              52715,
              52712,
              52757,
              52705,
              52738,
              52745,
              52713,
              52737,
              52714,
              52751,
              52735,
              52742,
              52715,
              52739,
              52755,
              52719,
              52717,
              52705,
              52721,
              52707,
              52699,
              52701,
              52703,
              52697,
              52711,
              52712,
              52738,
              52725,
              52718,
              52740,
              52731,
              52703,
              52713,
              52687,
              52719,
              52725,
              52703,
              52679,
              52730,
              52720,
              52705,
              52689,
              52743,
              52706,
              52714,
              52713,
              52734,
              52717,
              52706,
              52706,
              52719,
              52746,
              52751,
              52719,
              52724,
              52755,
              52721,
              52727,
              52714,
              52698,
              52729,
              52764,
              52763,
              52727,
              52723,
              52703,
              52747,
              52703,
              52718,
              52719,
              52703,
              52713,
              52734,
              52711,
              52743,
              52751,
              52759,
              52735,
              52766,
              52742,
              52730,
              52711,
              52731,
              52727,
              52732,
              52750,
              52711,
              52719,
              52715,
              52711,
              52710,
              52746,
              52725,
              52728,
              52739,
              52712,
              52711,
              52716,
              52699,
              52718,
              52718,
              52705,
              52711,
              52711,
              52743,
              52703,
              52745,
              52721,
              52722,
              52746,
              52723,
              52749,
              52715,
              52691,
              52696,
              52715,
              52146,
              52735,
              52759,
              52731,
              52775,
              52740,
              52795,
              52757,
              52756,
              52766,
              52803,
              52766,
              52767,
              52787,
              52767,
              52785,
              52804,
              52782,
              52769,
              52799,
              55093,
              52788,
              52742,
              52733,
              52710,
              52749,
              52739,
              52734,
              52710,
              52753,
              52721,
              52752,
              52719,
              52730,
              52721,
              52741,
              52754,
              52701,
              52711,
              52748,
              52735,
              52725,
              52754,
              52737,
              52726,
              52732,
              52710,
              52717,
              52713,
              52722,
              52722,
              52711,
              52695,
              52729,
              52718,
              52696,
              52706,
              52696,
              52690,
              52711,
              52731,
              52711,
              52681,
              52715,
              52678,
              52694,
              52689,
              52676,
              52711,
              52722,
              52695,
              52732,
              52741,
              52697,
              52742,
              52737,
              52733,
              52710,
              52729,
              52746,
              52703,
              52705,
              52745,
              52742,
              52732,
              52739,
              52721,
              52739,
              52769,
              52724,
              52711,
              52743,
              52757,
              52751,
              52765,
              52750,
              52735,
              52747,
              52778,
              52756,
              52787,
              52726,
              52724,
              52730,
              52717,
              52722,
              52699,
              52711,
              52697,
              52723,
              52718,
              52748,
              52745,
              52718,
              52723,
              52752,
              52715,
              52740,
              52716,
              52711
            ]
          },
          {
            "time": 1502199411611,
            "label": "",
            "light_intensity": 1362.8,
            "r": 1762,
            "g": 565,
            "b": 412,
            "light_intensity_raw": 2583,
            "temperature": 25.47,
            "humidity": 48.382,
            "pressure": 990.842,
            "temperature2": 25.65,
            "humidity2": 43.685,
            "pressure2": 989.854,
            "contactless_temp": 24.95,
            "thickness": 0.31,
            "compass_direction": "W",
            "compass": 270,
            "angle": 10.068,
            "angle_direction": "NE",
            "pitch": 6.9,
            "roll": -7.35,
            "data_raw": [
              2085,
              52775,
              3011,
              52718,
              3062,
              52689,
              3085,
              52707,
              3103,
              52708,
              3110,
              52697,
              3122,
              52691,
              3131,
              52679,
              3130,
              52695,
              3126,
              52717,
              3133,
              52737,
              3138,
              52747,
              3139,
              52730,
              3144,
              52728,
              3142,
              52735,
              3143,
              52715,
              3150,
              52711,
              3150,
              52707,
              3145,
              52725,
              3145,
              52754,
              3139,
              52749,
              3143,
              52719,
              3140,
              52703,
              3144,
              52735,
              3138,
              52711,
              3137,
              52759,
              3137,
              52711,
              3147,
              52723,
              3143,
              52723,
              3143,
              52715,
              3137,
              52718,
              3133,
              52731,
              3134,
              52749,
              3134,
              52715,
              3134,
              52717,
              3128,
              52731,
              3131,
              52713,
              3129,
              52748,
              3127,
              52737,
              3131,
              52751,
              3131,
              52719,
              3128,
              52729,
              3123,
              52707,
              3119,
              52717,
              3120,
              52713,
              3131,
              52735,
              3121,
              52719,
              3116,
              52750,
              3118,
              52757,
              3110,
              52746,
              3115,
              52722,
              3123,
              52708,
              3114,
              52717,
              3111,
              52678,
              3116,
              52723,
              3111,
              52694,
              3105,
              52727,
              3109,
              52718,
              3110,
              52711,
              3107,
              52733,
              3104,
              52685,
              3102,
              52737,
              3100,
              52671,
              3104,
              52679,
              3103,
              52695,
              3104,
              52697,
              3099,
              52689,
              3100,
              52682,
              3098,
              52713,
              3097,
              52719,
              3106,
              52685,
              3095,
              52681,
              3087,
              52711,
              3094,
              52679,
              3083,
              52747,
              3094,
              52738,
              3095,
              52713,
              3086,
              52738,
              3085,
              52739,
              3082,
              52728,
              3083,
              52729,
              3076,
              52740,
              3089,
              52729,
              3081,
              52710,
              3079,
              52720,
              3076,
              52751,
              3072,
              52736,
              3073,
              52750,
              3076,
              52773,
              3075,
              52737,
              3069,
              52718,
              3057,
              52735,
              3072,
              52697,
              3069,
              52731,
              3072,
              52704,
              3064,
              52758,
              3071,
              52775,
              3059,
              52727,
              3059,
              52715,
              3064,
              52727,
              3109,
              52740,
              3121,
              52721,
              3124,
              52726,
              3121,
              52729,
              3124,
              52735,
              3119,
              52721,
              3129,
              52737,
              3121,
              52691,
              3118,
              52687,
              3114,
              52711,
              3114,
              52719,
              3111,
              52693,
              3110,
              52717,
              3111,
              52677,
              3109,
              52715,
              3106,
              52679,
              3106,
              52674,
              3103,
              52703,
              3106,
              52684,
              3102,
              52681,
              3101,
              52669,
              3094,
              52684,
              3094,
              52732,
              3095,
              52685,
              3092,
              52705,
              3092,
              52689,
              3090,
              52724,
              3093,
              52725,
              3091,
              52724,
              3083,
              52712,
              3088,
              52689,
              3085,
              52695,
              3088,
              52709,
              3078,
              52701,
              3079,
              52748,
              3077,
              52721,
              3078,
              52731,
              3075,
              52711,
              3078,
              52739,
              3071,
              52755,
              3071,
              52735,
              3073,
              52731,
              3068,
              52717,
              3068,
              52737,
              3071,
              52711,
              3068,
              52684,
              3059,
              52733,
              3060,
              52710,
              3057,
              52726,
              3055,
              52735,
              3055,
              52723,
              3047,
              52711,
              3047,
              52709,
              3047,
              52711,
              3047,
              52710,
              3045,
              52711,
              3041,
              52708,
              3037,
              52733,
              3043,
              52705,
              3043,
              52705,
              3043,
              52684,
              3042,
              52727,
              3038,
              52724,
              3039,
              52695,
              3042,
              52721,
              3033,
              52737,
              3030,
              52727,
              3032,
              52722,
              3024,
              52708,
              3023,
              52703,
              3022,
              52703,
              3021,
              52699,
              3015,
              52679,
              3021,
              52679,
              3020,
              52673,
              3020,
              52657,
              3016,
              52679,
              3013,
              52648,
              3014,
              52689,
              3009,
              52666,
              3008,
              52679,
              3001,
              52677,
              3006,
              52652,
              3003,
              52679,
              3001,
              52672,
              3001,
              52666,
              3002,
              52651,
              2998,
              52684,
              2997,
              52701,
              2992,
              52709,
              2868,
              52727,
              2671,
              52789,
              2509,
              52795,
              2365,
              52775,
              2247,
              52806,
              2151,
              52810,
              2076,
              52824,
              2022,
              52827,
              1979,
              52853,
              1937,
              52809,
              1914,
              52826,
              1895,
              52827,
              1885,
              52810,
              1869,
              52762,
              1863,
              52815,
              1123,
              52519,
              1091,
              52495,
              1081,
              52515,
              1063,
              52543,
              1051,
              52536,
              1036,
              52585,
              1030,
              52594,
              1015,
              52607,
              1012,
              52622,
              1000,
              52639,
              995,
              52619,
              984,
              52639,
              976,
              52679,
              973,
              52663,
              969,
              52671,
              964,
              52884,
              2312,
              52589,
              2525,
              52526,
              2627,
              52483,
              2675,
              52471,
              2707,
              52494,
              2722,
              52484,
              2734,
              52484,
              2740,
              52481,
              2747,
              52455,
              2744,
              52449,
              2751,
              52468,
              2751,
              52429,
              2759,
              52428,
              2753,
              52454,
              2753,
              52462,
              2751,
              52455,
              2755,
              52494,
              2747,
              52462,
              2751,
              52482,
              2745,
              52479,
              2750,
              52460,
              2748,
              52487,
              2757,
              52486,
              2746,
              52477,
              2748,
              52465,
              2744,
              52483,
              2743,
              52467,
              2744,
              52482,
              2745,
              52480,
              2744,
              52463,
              2741,
              52483,
              2740,
              52455,
              2744,
              52505,
              2740,
              52494,
              2741,
              52503,
              2743,
              52463,
              2739,
              52481,
              2747,
              52501,
              2738,
              52487,
              2747,
              52495,
              2741,
              52481,
              2741,
              52476,
              2742,
              52521,
              2737,
              52507,
              2735,
              52448,
              2731,
              52454,
              2731,
              52462,
              2730,
              52477,
              2729,
              52456,
              2728,
              52458,
              2727,
              52465,
              2722,
              52483,
              2729,
              52478,
              2715,
              52495,
              2724,
              52499,
              2723,
              52485,
              2727,
              52509,
              2725,
              52473,
              2727,
              52470,
              2722,
              52478,
              2711,
              52469,
              2713,
              52494,
              2711,
              52516,
              2718,
              52471,
              2717,
              52477,
              2711,
              52514,
              2711,
              52478,
              2711,
              52444,
              2711,
              52476,
              2701,
              52492,
              2706,
              52495,
              2707,
              52469,
              2708,
              52448,
              2710,
              52455,
              2688,
              52474,
              2677,
              52494,
              2663,
              52465,
              2659,
              52483,
              2644,
              52475,
              2649,
              52474,
              2646,
              52482,
              2648,
              52481,
              2649,
              52505,
              2648,
              52497,
              2642,
              52475,
              2637,
              52500,
              2641,
              52515,
              2645,
              52523,
              2646,
              52525
            ]
          },
          {
            "time": 1502199417777,
            "label": "",
            "light_intensity": 1246.731,
            "r": 1616,
            "g": 514,
            "b": 377,
            "light_intensity_raw": 2364,
            "temperature": 25.54,
            "humidity": 48.333,
            "pressure": 990.856,
            "temperature2": 25.72,
            "humidity2": 43.607,
            "pressure2": 989.871,
            "contactless_temp": 26.46,
            "thickness": 0.31,
            "compass_direction": "W",
            "compass": 270,
            "angle": 11.693,
            "angle_direction": "NE",
            "pitch": 8,
            "roll": -8.56,
            "data_raw": [

            ]
          },
          {
            "time": 1502199418100,
            "label": "",
            "light_intensity": 1164.604,
            "r": 1512,
            "g": 482,
            "b": 353,
            "light_intensity_raw": 2211,
            "temperature": 25.54,
            "humidity": 48.323,
            "pressure": 990.856,
            "temperature2": 25.72,
            "humidity2": 43.712,
            "pressure2": 989.86,
            "contactless_temp": 25.56,
            "thickness": 0.31,
            "compass_direction": "W",
            "compass": 270,
            "angle": 11.073,
            "angle_direction": "NE",
            "pitch": 6.84,
            "roll": -8.73,
            "data_raw": [

            ]
          },
          {
            "time": 1502199418418,
            "label": "",
            "light_intensity": 1164.604,
            "r": 1512,
            "g": 482,
            "b": 353,
            "light_intensity_raw": 2211,
            "temperature": 25.54,
            "humidity": 48.323,
            "pressure": 990.843,
            "temperature2": 25.73,
            "humidity2": 43.639,
            "pressure2": 989.85,
            "contactless_temp": 24.71,
            "thickness": 0.31,
            "compass_direction": "W",
            "compass": 270,
            "angle": 11.197,
            "angle_direction": "NE",
            "pitch": 7.66,
            "roll": -8.2,
            "data_raw": [

            ]
          },
          {
            "time": 1502199418737,
            "label": "",
            "detector_read1": 13253,
            "detector_read2": 65535,
            "light_intensity": 1146.184,
            "r": 1487,
            "g": 474,
            "b": 347,
            "light_intensity_raw": 2175,
            "temperature": 25.54,
            "humidity": 48.346,
            "pressure": 990.869,
            "temperature2": 25.73,
            "humidity2": 43.724,
            "pressure2": 989.89,
            "contactless_temp": 25.6,
            "thickness": 0.31,
            "compass_direction": "W",
            "compass": 270,
            "angle": 11.193,
            "angle_direction": "NE",
            "pitch": 7.89,
            "roll": -7.96,
            "recall": {
              "time": 1502199419026,
              "colorcal_blank1[1]": 21983,
              "colorcal_blank1[2]": 28172.5,
              "colorcal_blank1[3]": 29489,
              "colorcal_blank1[4]": 37150,
              "colorcal_blank1[6]": 30644.5,
              "colorcal_blank1[8]": 31670,
              "colorcal_blank1[9]": 25601.5,
              "colorcal_blank1[10]": 30224.5,
              "colorcal_blank2[1]": 23637,
              "colorcal_blank2[2]": 23502.5,
              "colorcal_blank2[3]": 24913.5,
              "colorcal_blank2[4]": 22816.5,
              "colorcal_blank2[6]": 16437.5,
              "colorcal_blank2[8]": 17945.5,
              "colorcal_blank2[9]": 18201,
              "colorcal_blank2[10]": 16425.5,
              "colorcal_blank3[1]": 20336.5,
              "colorcal_blank3[2]": 11211.5,
              "colorcal_blank3[3]": 18805.5,
              "colorcal_blank3[4]": 14531.5,
              "colorcal_blank3[6]": 5275,
              "colorcal_blank3[8]": 5942,
              "colorcal_blank3[9]": 4925.5,
              "colorcal_blank3[10]": 5376,
              "colorcal_intensity1_slope[2]": 2.631,
              "colorcal_intensity1_yint[2]": -0.1,
              "colorcal_intensity2_slope[2]": 2.01,
              "colorcal_intensity2_yint[2]": 21.9,
              "colorcal_intensity3_slope[2]": 1.457,
              "colorcal_intensity3_yint[2]": 9.7,
              "ir_baseline_slope[5]": 13995,
              "ir_baseline_yint[5]": 20427.5,
              "ir_baseline_slope[3]": 516,
              "ir_baseline_yint[3]": 669
            },
            "data_raw": [
              29897,
              7527,
              7133,
              7054,
              7021,
              7007,
              6994,
              6985,
              6978,
              6986,
              374,
              289,
              288,
              289,
              287,
              291,
              291,
              285,
              290,
              295,
              2114,
              1260,
              1255,
              1252,
              1257,
              1255,
              1264,
              1251,
              1251,
              1253,
              180,
              60,
              58,
              61,
              63,
              60,
              65,
              67,
              58,
              66,
              46341,
              12450,
              12150,
              12095,
              12086,
              12076,
              12071,
              12067,
              12077,
              12074,
              14950,
              14269,
              14291,
              14285,
              14283,
              14280,
              14291,
              14282,
              14285,
              14288,
              18167,
              12035,
              11953,
              11943,
              11938,
              11938,
              11938,
              11931,
              11926,
              11943,
              21679,
              14089,
              14005,
              13983,
              13980,
              13975,
              13971,
              13987,
              13977,
              13973,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              1407,
              1703,
              1703,
              1710,
              1707,
              1709,
              1711,
              1702,
              1707,
              1714,
              7283,
              9213,
              9214,
              9216,
              9211,
              9218,
              9217,
              9215,
              9207,
              9220,
              153,
              193,
              195,
              194,
              191,
              195,
              199,
              196,
              201,
              189,
              35118,
              43484,
              43552,
              43550,
              43546,
              43550,
              43541,
              43567,
              43549,
              43554,
              40391,
              50661,
              50719,
              50738,
              50719,
              50727,
              50735,
              50735,
              50727,
              50727,
              31434,
              41283,
              41385,
              41388,
              41388,
              41392,
              41396,
              41399,
              41393,
              41395,
              35411,
              46246,
              46339,
              46346,
              46342,
              46340,
              46330,
              46328,
              46322,
              46327,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              3061,
              3687,
              3693,
              3697,
              3700,
              3702,
              3708,
              3706,
              3713,
              3711,
              31454,
              43903,
              43990,
              43982,
              43981,
              43974,
              43958,
              43952,
              43958,
              43951,
              483,
              662,
              656,
              646,
              657,
              652,
              651,
              659,
              651,
              654,
              43545,
              43540,
              43552,
              43540,
              43537,
              43539,
              43539,
              43531,
              43552,
              43537,
              50721,
              50719,
              50715,
              50720,
              50715,
              50735,
              50714,
              50709,
              50710,
              50731,
              41420,
              41413,
              41407,
              41397,
              41402,
              41411,
              41402,
              41413,
              41403,
              41401,
              46365,
              46354,
              46357,
              46347,
              46341,
              46331,
              46333,
              46327,
              46325,
              46325
            ]
          }
        ]
      }
    ]
  ],
  "app_os": "darwin-16.6.0",
  "app_name": "PhotosynQ",
  "app_version": "0.0.19",
  "app_device": "x64",
  "location": [
    "42.7224280",
    "-84.4746400"
  ],
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
1
Latest Update:
Aug 2017