RIDES1_3


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 fails (which is often). 
// The simple procedure takes the relative changes in the amplitues of the curves
// during the first two and the last two points and compares this ratio to 
// values from simulated curves. It then calculates the ECSt from the gH+ and
// the change in amplitude at the final point. 

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

// Define the protocol set numbers for each data set

var ECS_LEFdset=6;
var P700_DIRK_set=7;
var PAM_set=8;

// 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);  

// 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 
// ----------------------------
if (typeof json.light_intensity != "undefined" && json.light_intensity > 0) {
	output.LEF= MathROUND((fvfm  * 0.45 * json.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);
    //output.PSI_dark=PSI_dark;
  //output.PSI_ss = PSI_ss; //MathROUND(PSI_ss, 3);
  //output.PSI_sat1 =MathROUND(PSI_sat1, 3);
  //output.PSI_sat2 =MathROUND(PSI_sat2, 3);

	//output.data_raw_PSI =PSI_data;
   //output.PSI_dark_beg=PSI_dark_beg;
   //output.PSI_dark_end=PSI_dark_end;

// Humidity changes
    var humidity_kinetics=[json.set[4].humidity,json.set[5].humidity,
                        json.set[ECS_LEFdset].humidity,json.set[P700_DIRK_set].humidity,
                        json.set[PAM_set].humidity,json.set[9].humidity,
                        json.set[10].humidity,json.set[11].humidity
                       ];
  	output.humidity_kinetics=humidity_kinetics;
  
   // changes in leaf contactless_temp
  
    var air_temp_kinetics=[json.set[4].temperature,
                                json.set[5].temperature, 
                                json.set[ECS_LEFdset].temperature, 
                                json.set[P700_DIRK_set].temperature, 
                                json.set[PAM_set].temperature, 
                                json.set[9].temperature, 
                                json.set[10].temperature, 
                       ];
    
     var contactless_temp_kinetics=[json.set[4].contactless_temp,
                                json.set[5].contactless_temp,
                                json.set[ECS_LEFdset].contactless_temp,
                                json.set[P700_DIRK_set].contactless_temp,
                                json.set[PAM_set].contactless_temp,
                                json.set[9].contactless_temp,
                                json.set[10].contactless_temp
                       ];
  
  output.air_temp_kinetics=air_temp_kinetics;
  
  output.contactless_temp_kinetics=contactless_temp_kinetics;

 var light_intensity=json.set[ECS_LEFdset].light_intensity;
  output.light_intensity= light_intensity;                       
  var ambient_RH=json.set[4].humidity;
  output.ambient_RH=MathROUND(ambient_RH,3);
  var ambient_temperature=json.set[4].temperature;
  output.ambient_temperature=ambient_temperature;
  var leaf_RH=json.set[9].humidity;
  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);



/*
///////////////////////////////

// CALCULATIONS FOR ABSORBANCE / SPAD PORTION OF THE TRACE
//----------------------------

var abs_starts = 0; // when does the Phi2 measurement start
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




/* // this is what the recall object looks like --> 
"recall":{"colorcal_blank1[1]":0.000000,"colorcal_blank1[2]":0.000000,"colorcal_blank1[3]":0.000000,"colorcal_blank1[4]":0.00000
0,"colorcal_blank1[6]":0.000000,"colorcal_blank1[8]":0.000000,"colorcal_blank1[9]":0.000000,"colorcal_blank1[10]":0.000000,"colo
rcal_blank2[1]":0.000000,"colorcal_blank2[2]":0.000000,"colorcal_blank2[3]":0.000000,"colorcal_blank2[4]":0.000000,"colorcal_bla
nk2[6]":0.000000,"colorcal_blank2[8]":0.000000,"colorcal_blank2[9]":0.000000,"colorcal_blank2[10]":0.000000,"colorcal_blank3[1]"
:0.000000,"colorcal_blank3[2]":0.000000,"colorcal_blank3[3]":0.000000,"colorcal_blank3[4]":0.000000,"colorcal_blank3[6]":0.00000
0,"colorcal_blank3[8]":0.000000,"colorcal_blank3[9]":0.000000,"colorcal_blank3[10]":0.000000},
*/

/*
** 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
*/
//----------------------------
//output.absLength = json.set[calib_set].data_raw.length;
/*
for (var i = 0;i<lights.length;i++) { // loop through and save one averaged 'point' for each of the cycles
 light = lights[i];
 wavelengthString = wavelengths[i];
 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)));
 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+"]"];
 }
}

// 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;
   }
 }
 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;
   }
 }
}

output.Minolta_SPAD=minolta_spad;

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);
}


   if (minolta_spad <= 2) {
     info("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_spad1 >= 100) {
     info("Chlorophyll Content SPAD is very high.  If this value is associated with a typical leaf, consider recalibrating device.", output);
   }

// calculate chlorophyll content SPAD values with Minolta SPAD calibration -->


if (choose == 0) {
   output ["SPAD"]  = 0;
   output ["SPAD intensity"]  = 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 (choose == 1) {
   output ["SPAD"]  = MathROUND(minolta_spad1,2);
   output ["SPAD intensity"]  = 1;
   if (minolta_spad1 <= 2) {
     info("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_spad1 >= 100) {
     info("Chlorophyll Content SPAD is very high.  If this value is associated with a typical leaf, consider recalibrating device.", output);
   }
}
else if (choose == 2) {
   output ["SPAD"]  = MathROUND(minolta_spad2,2);
   output ["SPAD intensity"]  = 2;
	if (minolta_spad2 <= 2) {
     info("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_spad2 >= 100) {
     info("Chlorophyll Content SPAD is very high.  If this value is associated with a typical leaf, consider recalibrating device.", output);
   }
}
else if (choose == 3) {
   output ["SPAD"]  = MathROUND(minolta_spad3,2);
   output ["SPAD intensity"]  = 3;
	if (minolta_spad3 <= 2) {
     info("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_spad3 >= 100) {
     info("Chlorophyll Content SPAD is very high.  If this value is associated with a typical leaf, consider recalibrating device.", output);
   }
}

*/





// CALCULATIONS FOR ABSORBANCE / SPAD PORTION OF THE TRACE
//----------------------------
var SPAD_set=12;
var calib_set=12;
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

/* // this is what the recall object looks like --> 
"recall":{"colorcal_blank1[1]":0.000000,"colorcal_blank1[2]":0.000000,"colorcal_blank1[3]":0.000000,"colorcal_blank1[4]":0.00000
0,"colorcal_blank1[6]":0.000000,"colorcal_blank1[8]":0.000000,"colorcal_blank1[9]":0.000000,"colorcal_blank1[10]":0.000000,"colo
rcal_blank2[1]":0.000000,"colorcal_blank2[2]":0.000000,"colorcal_blank2[3]":0.000000,"colorcal_blank2[4]":0.000000,"colorcal_bla
nk2[6]":0.000000,"colorcal_blank2[8]":0.000000,"colorcal_blank2[9]":0.000000,"colorcal_blank2[10]":0.000000,"colorcal_blank3[1]"
:0.000000,"colorcal_blank3[2]":0.000000,"colorcal_blank3[3]":0.000000,"colorcal_blank3[4]":0.000000,"colorcal_blank3[6]":0.00000
0,"colorcal_blank3[8]":0.000000,"colorcal_blank3[9]":0.000000,"colorcal_blank3[10]":0.000000},
*/

/*
** 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": "1498408710718",
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:53:21",
  "device_battery": 94,
  "device_firmware": 1.18,
  "sample": [
    [
      {
        "time": "1498408710718",
        "light_intensity_raw": 0,
        "data_raw": [

        ],
        "protocol_id": 1,
        "set": [
          {
            "time": "1498408710718",
            "blank:": "blank"
          },
          {
            "time": "1498408710727",
            "air_flow": 0,
            "data_raw": [

            ]
          },
          {
            "time": "1498408712395",
            "air_flow": 50,
            "data_raw": [

            ]
          },
          {
            "time": "1498408713563",
            "air_flow": 180,
            "data_raw": [

            ]
          },
          {
            "time": "1498408714732",
            "light_intensity": 83.756,
            "r": 113,
            "g": 37,
            "b": 26,
            "light_intensity_raw": 170,
            "temperature": 24.73,
            "humidity": 41.062,
            "pressure": 985.743,
            "temperature2": 24.85,
            "humidity2": 40.454,
            "pressure2": 986.198,
            "contactless_temp": 25.12,
            "compass_direction": "E",
            "compass": 90,
            "angle": 19.116,
            "angle_direction": "E",
            "pitch": -3.07,
            "roll": 18.88,
            "air_flow": 390,
            "data_raw": [

            ]
          },
          {
            "time": "1498408716632",
            "light_intensity": 169.014,
            "r": 231,
            "g": 74,
            "b": 53,
            "light_intensity_raw": 348,
            "temperature": 24.73,
            "humidity": 41.096,
            "pressure": 985.748,
            "temperature2": 24.85,
            "humidity2": 40.465,
            "pressure2": 986.183,
            "contactless_temp": 24.88,
            "thickness": 5.14,
            "compass_direction": "E",
            "compass": 90,
            "angle": 6.237,
            "angle_direction": "E",
            "pitch": 1.55,
            "roll": 6.04,
            "air_flow": 370,
            "data_raw": [

            ]
          },
          {
            "time": "1498408717216",
            "light_intensity": 988.19,
            "r": 1415,
            "g": 446,
            "b": 318,
            "light_intensity_raw": 2109,
            "temperature": 24.72,
            "humidity": 41.312,
            "pressure": 985.734,
            "temperature2": 24.86,
            "humidity2": 40.866,
            "pressure2": 986.187,
            "contactless_temp": 20.44,
            "thickness": 0.74,
            "air_flow": 370,
            "data_raw": [
              49766,
              49427,
              49427,
              49427,
              49431,
              49423,
              49431,
              49437,
              49423,
              49427,
              49431,
              49439,
              49437,
              49444,
              49442,
              49431,
              49434,
              49447,
              49446,
              49445,
              49444,
              49451,
              49451,
              49451,
              49456,
              49443,
              49451,
              49447,
              49451,
              49455,
              49439,
              49453,
              49440,
              49447,
              49463,
              49443,
              49447,
              49442,
              49441,
              49449,
              49443,
              49449,
              49441,
              49443,
              49446,
              49446,
              49444,
              49438,
              49442,
              49439,
              49431,
              49433,
              49438,
              49431,
              49438,
              49434,
              49435,
              49437,
              49432,
              49434,
              49421,
              49427,
              49431,
              49430,
              49432,
              49418,
              49430,
              49425,
              49426,
              49434,
              49429,
              49419,
              49423,
              49430,
              49427,
              49419,
              49422,
              49423,
              49431,
              49430,
              49423,
              49435,
              49426,
              49435,
              49445,
              49431,
              49440,
              49441,
              49433,
              49430,
              49433,
              49434,
              49435,
              49436,
              49442,
              49435,
              49423,
              49427,
              49435,
              49423,
              49419,
              49435,
              49426,
              49435,
              49431,
              49433,
              49440,
              49434,
              49431,
              49433,
              49429,
              49420,
              49424,
              49431,
              49428,
              49433,
              49427,
              49435,
              49426,
              49429,
              49428,
              49431,
              49420,
              49431,
              49437,
              49420,
              49426,
              49412,
              49433,
              49427,
              49421,
              49425,
              49422,
              49429,
              49435,
              49424,
              49425,
              49423,
              49429,
              49435,
              49425,
              49418,
              49420,
              49431,
              49436,
              49432,
              49425,
              49416,
              49429,
              49417,
              49422,
              49423,
              49409,
              49415,
              49419,
              49429,
              49431,
              49418,
              49427,
              49433,
              49420,
              49418,
              49427,
              49419,
              49415,
              49413,
              49419,
              49420,
              49414,
              49419,
              49415,
              49410,
              49414,
              49423,
              49416,
              49404,
              49411,
              49401,
              49429,
              49410,
              49410,
              49413,
              49405,
              49405,
              49411,
              49404,
              49416,
              49401,
              49409,
              49412,
              49407,
              49403,
              49398,
              49403,
              49399,
              49402,
              49398,
              49407,
              49409,
              49402,
              49396,
              49435,
              49435,
              49458,
              49462,
              49476,
              49482,
              49487,
              49498,
              49509,
              49509,
              49520,
              49541,
              49546,
              49545,
              49554,
              49571,
              49573,
              49576,
              49582,
              49639,
              49543,
              49491,
              49488,
              49467,
              49442,
              49433,
              49414,
              49422,
              49418,
              49385,
              49389,
              49378,
              49379,
              49385,
              49381,
              49375,
              49362,
              49381,
              49377,
              49378,
              49375,
              49371,
              49386,
              49371,
              49381,
              49379,
              49378,
              49380,
              49383,
              49393,
              49388,
              49380,
              49387,
              49391,
              49395,
              49395,
              49389,
              49391,
              49398,
              49383,
              49398,
              49401,
              49400,
              49394,
              49400,
              49410,
              49407,
              49401,
              49407,
              49409,
              49405,
              49402,
              49402,
              49409,
              49407,
              49407,
              49405,
              49397,
              49415,
              49406,
              49406,
              49407,
              49404,
              49415,
              49401,
              49409,
              49405,
              49406,
              49417,
              49406,
              49403,
              49403,
              49413,
              49402,
              49397,
              49402,
              49405,
              49405,
              49407,
              49409,
              49405,
              49401,
              49407,
              49403,
              49397,
              49397,
              49394,
              49413,
              49411,
              49401,
              49406,
              49403,
              49407,
              49407,
              49404,
              49409,
              49395,
              49412,
              49407,
              49402,
              49400,
              49403,
              49407,
              49411,
              49402,
              49415,
              49409,
              49407,
              49412,
              49403,
              49399,
              49402,
              49407,
              49404,
              49403,
              49414,
              49401,
              49408,
              49413,
              49405,
              49399,
              49406,
              49403,
              49405,
              49400,
              49407,
              49397,
              49402,
              49401,
              49403,
              49397,
              49399,
              49397,
              49403,
              49389,
              49403,
              49395,
              49407,
              49403,
              49403,
              49397,
              49399,
              49399,
              49401,
              49391,
              49399,
              49391,
              49397,
              49400,
              49383,
              49391,
              49397,
              49395,
              49399,
              49386,
              49395,
              49402,
              49391,
              49403,
              49387,
              49400,
              49403,
              49394,
              49389,
              49393,
              49399,
              49391,
              49395,
              49398,
              49393,
              49403,
              49390,
              49389,
              49394,
              49391,
              49398,
              49403,
              49390,
              49399,
              49399,
              49391,
              49394,
              49394,
              49386,
              49395,
              49396,
              49393,
              49389,
              49399,
              49391,
              49398,
              49397,
              49386,
              49397,
              49403,
              49397,
              49410,
              49399,
              49393,
              49393,
              49420,
              49438,
              49440,
              49460,
              49471,
              49479,
              49499,
              49506,
              49513,
              49519,
              49527,
              49531,
              49537,
              49534,
              49544,
              49552,
              49559,
              49555,
              49585,
              49655,
              49529,
              49507,
              49481,
              49455,
              49435,
              49435,
              49418,
              49395,
              49399,
              49397,
              49380,
              49382,
              49374,
              49365,
              49367,
              49375,
              49365,
              49364,
              49367,
              49361,
              49365,
              49368,
              49359,
              49366,
              49376,
              49372,
              49374,
              49364,
              49374,
              49382,
              49368,
              49373,
              49375,
              49380,
              49383,
              49371,
              49385,
              49379,
              49383,
              49386,
              49370,
              49380,
              49367,
              49374,
              49375,
              49367,
              49377,
              49375,
              49384,
              49379,
              49377,
              49381,
              49373,
              49380,
              49379,
              49380,
              49381,
              49381,
              49385,
              49391,
              49376,
              49386,
              49386,
              49383,
              49383,
              49371,
              49383,
              49385,
              49385,
              49385,
              49379,
              49383,
              49383,
              49381,
              49395,
              49386,
              49384,
              49392,
              49391,
              49389,
              49382,
              49393,
              49382,
              49389,
              49391,
              49387,
              49396,
              49383,
              49387,
              49391,
              49387,
              49395,
              49394,
              49383,
              49390,
              49388,
              49393,
              49405,
              49387,
              49399,
              49390,
              49395,
              49402,
              49387,
              49391,
              49385,
              49401,
              49398,
              49395,
              49395,
              49389,
              49389,
              49387,
              49384,
              49380,
              49382,
              49386,
              49397,
              49385,
              49399,
              49395,
              49390,
              49395,
              49382,
              49388,
              49391,
              49389,
              49397,
              49385,
              49400,
              49398,
              49383,
              49382,
              49382,
              49383,
              49386,
              49391,
              49397,
              49384,
              49387,
              49390,
              49390,
              49392,
              49379,
              49390,
              49401,
              49383,
              49394,
              49387,
              49393,
              49393,
              49388,
              49381,
              49385,
              49384,
              49391,
              49385,
              49385,
              49395,
              49388,
              49382,
              49383,
              49383,
              49381,
              49381,
              49385,
              49385,
              49392,
              49389,
              49390,
              49387,
              49375,
              49385,
              49389,
              49394,
              49392,
              49382,
              49386,
              49383,
              49379,
              49391,
              49383,
              49382,
              49388,
              49383,
              49386,
              49386,
              49391,
              49391,
              49383,
              49392,
              49379,
              49386,
              49391,
              49381,
              49383,
              49376,
              49390,
              49384,
              49373,
              49397,
              49415,
              49435,
              49443,
              49451,
              49471,
              49473,
              49487,
              49500,
              49497,
              49498,
              49513,
              49521,
              49537,
              49525,
              49528,
              49543,
              49544,
              49561,
              49653,
              49517,
              49497,
              49476,
              49445,
              49415,
              49401,
              49399,
              49387,
              49379,
              49374,
              49372,
              49372,
              49350,
              49359,
              49354,
              49359,
              49354,
              49339,
              49349,
              49350,
              49358,
              49361,
              49350,
              49357,
              49351,
              49362,
              49365,
              49358,
              49362,
              49354,
              49364,
              49360,
              49346,
              49362,
              49355,
              49365,
              49369,
              49361,
              49377,
              49368,
              49371,
              49368,
              49363,
              49369,
              49363,
              49359,
              49379,
              49363,
              49375,
              49378,
              49372,
              49373,
              49369,
              49371,
              49381,
              49369,
              49370,
              49369,
              49372,
              49368,
              49375,
              49379,
              49367,
              49382,
              49379,
              49374,
              49369,
              49373,
              49378,
              49382,
              49371,
              49376,
              49379,
              49381,
              49378,
              49377,
              49376,
              49365,
              49375,
              49383,
              49376,
              49377,
              49379,
              49377,
              49379,
              49371,
              49371,
              49366,
              49367,
              49361,
              49355,
              49363,
              49365,
              49361,
              49359,
              49365,
              49368,
              49364,
              49355,
              49365,
              49360,
              49362,
              49373,
              49360,
              49363,
              49357,
              49366,
              49374,
              49370,
              49367,
              49363,
              49371,
              49381,
              49359,
              49367,
              49373,
              49359,
              49355,
              49357,
              49363,
              49361,
              49358,
              49359,
              49358,
              49359,
              49367,
              49358,
              49354,
              49352,
              49355,
              49359,
              49366,
              49370,
              49370,
              49375,
              49372,
              49363,
              49363,
              49355,
              49362,
              49374,
              49358,
              49365,
              49372,
              49372,
              49369,
              49359,
              49362,
              49365,
              49357,
              49363,
              49367,
              49371,
              49364,
              49371,
              49367,
              49366,
              49361,
              49372,
              49356,
              49352,
              49359,
              49371,
              49367,
              49364,
              49367,
              49358,
              49363,
              49376,
              49357,
              49359,
              49359,
              49359,
              49361,
              49353,
              49364,
              49359,
              49364,
              49363,
              49366,
              49361,
              49365,
              49366,
              49364,
              49353,
              49361,
              49366,
              49359,
              49365,
              49359,
              49361,
              49371,
              49357,
              49356,
              49356,
              49363,
              49355,
              49355,
              49355,
              49351,
              49375,
              49399,
              49391,
              49417,
              49433,
              49446,
              49450,
              49457,
              49464,
              49470,
              49470,
              49482,
              49487,
              49501,
              49508,
              49518,
              49532,
              49527,
              49539,
              49647,
              49487,
              49471,
              49429,
              49418,
              49399,
              49373,
              49367,
              49355,
              49353,
              49352,
              49335,
              49341,
              49330,
              49326,
              49322,
              49323,
              49323,
              49330,
              49327,
              49331,
              49317,
              49330,
              49326,
              49319,
              49329,
              49339,
              49332,
              49337,
              49323,
              49341,
              49329,
              49335,
              49329,
              49331,
              49339,
              49345,
              49346,
              49341,
              49346,
              49343,
              49342,
              49335,
              49337,
              49337,
              49338,
              49337,
              49343,
              49351,
              49341,
              49348,
              49345,
              49341,
              49349,
              49338,
              49349,
              49353,
              49347,
              49358,
              49352,
              49345,
              49354,
              49344,
              49356,
              49349,
              49342,
              49344,
              49347,
              49346,
              49351,
              49347,
              49350,
              49349,
              49349,
              49350,
              49340,
              49349,
              49350,
              49350,
              49351,
              49348,
              49362,
              49346,
              49350,
              49354,
              49349,
              49345,
              49350,
              49354,
              49351,
              49342,
              49359,
              49351,
              49348,
              49351,
              49350,
              49351,
              49359,
              49343,
              49351,
              49343,
              49353,
              49354,
              49351,
              49350,
              49358,
              49363,
              49364,
              49353,
              49355,
              49353,
              49363,
              49359,
              49336,
              49359,
              49353,
              49355,
              49353,
              49357,
              49358,
              49361,
              49350,
              49359,
              49341,
              49350,
              49356,
              49339,
              49350,
              49349,
              49347,
              49351,
              49344,
              49349,
              49351,
              49347,
              49343,
              49336,
              49339,
              49350,
              49338,
              49342,
              49339,
              49351,
              49339,
              49330,
              49348,
              49338,
              49343,
              49334,
              49338,
              49342,
              49328,
              49343,
              49351,
              49335,
              49351,
              49347,
              49345,
              49333,
              49333,
              49344,
              49337,
              49345,
              49343,
              49328,
              49344,
              49343,
              49337,
              49338,
              49337,
              49340,
              49339,
              49337,
              49339,
              49339,
              49337,
              49343,
              49333,
              49344,
              49342,
              49339,
              49338,
              49337,
              49334,
              49338,
              49331,
              49333,
              49333,
              49339,
              49343,
              49334,
              49330,
              49332,
              49338,
              49335,
              49321,
              49342,
              49331,
              49334,
              49333,
              49325,
              49356,
              49367,
              49383,
              49395,
              49408,
              49415,
              49430,
              49425,
              49438,
              49451,
              49464,
              49476,
              49477,
              49487,
              49491,
              49501,
              49499,
              49502,
              49506,
              49622,
              49477,
              49447,
              49415,
              49394,
              49379,
              49365,
              49351,
              49331,
              49339,
              49319,
              49308,
              49318,
              49301,
              49308,
              49309,
              49300,
              49317,
              49299,
              49303,
              49305,
              49291,
              49290,
              49303,
              49301,
              49302,
              49297,
              49304,
              49314,
              49307,
              49303,
              49307,
              49313,
              49312,
              49310,
              49313,
              49304,
              49306,
              49303,
              49309,
              49316,
              49308,
              49318,
              49323,
              49315,
              49321,
              49319,
              49317,
              49319,
              49309,
              49314,
              49319,
              49318,
              49323,
              49319,
              49323,
              49327,
              49319,
              49321,
              49324,
              49319,
              49323,
              49324,
              49318,
              49319,
              49318,
              49326,
              49317,
              49319,
              49321,
              49322,
              49318,
              49311,
              49322,
              49327,
              49317,
              49320,
              49320,
              49331,
              49321,
              49311,
              49323,
              49321,
              49321,
              49330,
              49321,
              49317,
              49322,
              49329,
              49330,
              49328,
              49329,
              49319,
              49329,
              49324,
              49316,
              49327,
              49329,
              49322,
              49324,
              49320,
              49322,
              49330,
              49315,
              49321,
              49306,
              49321,
              49322,
              49311,
              49319,
              49313,
              49317,
              49318,
              49309,
              49320,
              49325,
              49323,
              49310,
              49318,
              49318,
              49318,
              49316,
              49320,
              49317,
              49324,
              49318,
              49319,
              49323,
              49320,
              49317,
              49315,
              49325,
              49322,
              49316,
              49323,
              49316,
              49315,
              49311,
              49322,
              49317,
              49314,
              49321,
              49319,
              49318,
              49309,
              49320,
              49318,
              49318,
              49323,
              49315,
              49329,
              49317,
              49326,
              49315,
              49308,
              49319,
              49323,
              49317,
              49311,
              49315,
              49325,
              49327,
              49313,
              49322,
              49314,
              49318,
              49324,
              49312,
              49323,
              49317,
              49323,
              49322,
              49326,
              49315,
              49317,
              49310,
              49314,
              49321,
              49314,
              49311,
              49309,
              49317,
              49318,
              49317,
              49311,
              49312,
              49317,
              49319,
              49317,
              49317,
              49311,
              49314,
              49318,
              49308,
              49309,
              49301,
              49311,
              49314,
              49309,
              49316,
              49301,
              49332,
              49349,
              49353,
              49377,
              49378,
              49387,
              49414,
              49411,
              49419,
              49439,
              49446,
              49443,
              49449,
              49461,
              49467,
              49459,
              49473,
              49479,
              49493,
              49638,
              49460,
              49427,
              49391,
              49373,
              49357,
              49340,
              49343,
              49321,
              49318,
              49318,
              49307,
              49306,
              49306,
              49283,
              49295,
              49284,
              49295,
              49287,
              49277,
              49279,
              49287,
              49283,
              49273,
              49281,
              49285,
              49282,
              49281,
              49287,
              49299,
              49290,
              49296,
              49291,
              49287,
              49286,
              49288,
              49295,
              49300,
              49304,
              49290,
              49305,
              49308,
              49295,
              49310,
              49306,
              49297,
              49304,
              49300,
              49303,
              49308,
              49302,
              49314,
              49303,
              49311,
              49310,
              49301,
              49311,
              49308,
              49305,
              49311,
              49311,
              49315,
              49307,
              49314,
              49319,
              49298,
              49313,
              49319,
              49310,
              49316,
              49319,
              49317,
              49315,
              49303,
              49320,
              49327,
              49313,
              49314,
              49308,
              49311,
              49315,
              49314,
              49315,
              49308,
              49313,
              49323,
              49313,
              49301,
              49306,
              49317,
              49318,
              49300,
              49318,
              49319,
              49314,
              49317,
              49317,
              49315,
              49316,
              49317,
              1571,
              1669,
              1676,
              1681,
              1672,
              1675,
              1680,
              1675,
              1675,
              1674,
              1672,
              1676,
              1672,
              1673,
              1678,
              1670,
              1671,
              1667,
              1668,
              1669,
              1635,
              1589,
              1552,
              1529,
              1510,
              1485,
              1471,
              1443,
              1427,
              1406,
              1393,
              1385,
              1363,
              1355,
              1335,
              1330,
              1324,
              1300,
              1299,
              1289,
              1410,
              1433,
              1481,
              1488,
              1506,
              1516,
              1534,
              1548,
              1545,
              1562,
              1562,
              1568,
              1572,
              1583,
              1594,
              1595,
              1601,
              1603,
              1611,
              1613,
              1615,
              1614,
              1618,
              1621,
              1632,
              1620,
              1625,
              1630,
              1631,
              1638,
              1643,
              1637,
              1639,
              1647,
              1646,
              1647,
              1643,
              1645,
              1645,
              1634,
              1646,
              1646,
              1644,
              1648,
              1642,
              1653,
              1656,
              1644,
              1649,
              1649,
              1649,
              1651,
              1649,
              1655,
              1647,
              1657,
              1661,
              1656,
              1653,
              1652,
              1654,
              1655,
              1643,
              1656,
              1657,
              1654,
              1656,
              1657,
              1664,
              1657,
              1651,
              1656,
              1657,
              1647,
              1656,
              1652,
              1652,
              1653,
              1653,
              1661,
              1656,
              1655,
              1653,
              1655,
              1654,
              1655,
              1661,
              1653,
              1649,
              1654,
              1650,
              1660,
              1653,
              1651,
              1653,
              1659,
              1655,
              1650,
              1651,
              1655
            ]
          },
          {
            "time": "1498408723243",
            "light_intensity": 988.2,
            "r": 1415,
            "g": 446,
            "b": 318,
            "light_intensity_raw": 2109,
            "temperature": 24.74,
            "humidity": 42.425,
            "pressure": 985.751,
            "temperature2": 24.88,
            "humidity2": 43.767,
            "pressure2": 986.224,
            "contactless_temp": 20.81,
            "air_flow": 370,
            "data_raw": [
              55141,
              55114,
              55092,
              55061,
              55057,
              55029,
              54998,
              55002,
              55001,
              54992,
              54976,
              54983,
              54992,
              54963,
              54984,
              54980,
              54963,
              54967,
              54975,
              54961,
              54961,
              54952,
              54967,
              54974,
              54981,
              54987,
              54964,
              54974,
              54970,
              54982,
              54991,
              54963,
              54995,
              54981,
              54980,
              54997,
              54976,
              54990,
              54993,
              54988,
              54984,
              54982,
              54985,
              54972,
              54975,
              54973,
              54972,
              54978,
              54995,
              54982,
              54999,
              54988,
              54983,
              54982,
              54979,
              54976,
              54959,
              54970,
              54975,
              54963,
              54975,
              54967,
              54972,
              54984,
              54982,
              54998,
              54986,
              54972,
              54979,
              54993,
              54992,
              54983,
              54985,
              54962,
              54973,
              54983,
              54987,
              54972,
              54976,
              54983,
              54987,
              54979,
              54963,
              54982,
              54966,
              54972,
              54987,
              54972,
              54994,
              54982,
              54971,
              54981,
              54954,
              54951,
              54983,
              54971,
              54964,
              54954,
              54958,
              54979,
              54952,
              54951,
              54959,
              54945,
              54962,
              54954,
              54972,
              54956,
              54966,
              54966,
              54966,
              54969,
              54966,
              54967,
              54957,
              54938,
              54942,
              54959,
              54978,
              54965,
              54959,
              54963,
              54940,
              54940,
              54930,
              54938,
              54939,
              54954,
              54933,
              54938,
              54951,
              54959,
              54955,
              54951,
              54951,
              54923,
              54950,
              54933,
              54929,
              54946,
              54950,
              54943,
              54948,
              54948,
              54948,
              54938,
              54939,
              54954,
              54938,
              54965,
              54949,
              54949,
              54963,
              54919,
              54943,
              54927,
              54927,
              54930,
              54928,
              54949,
              54947,
              54917,
              54931,
              54928,
              54931,
              54945,
              54922,
              54920,
              54910,
              54943,
              54943,
              54936,
              54946,
              54946,
              54950,
              54958,
              54922,
              54929,
              54921,
              54914,
              54942,
              54933,
              54946,
              54946,
              54911,
              54920,
              54915,
              54922,
              54943,
              54915,
              54926,
              54923,
              54932,
              54935,
              54927,
              54940,
              54949,
              54918,
              54947,
              54950,
              54949,
              54970,
              54994,
              54999,
              55019,
              55031,
              55028,
              55045,
              55059,
              55081,
              55086,
              55087,
              55084,
              55103,
              55105,
              55111,
              55118,
              55109,
              55109,
              55115,
              55280,
              55099,
              55091,
              55063,
              55047,
              55021,
              55024,
              54981,
              54990,
              54983,
              54982,
              54961,
              54951,
              54966,
              54972,
              54958,
              54933,
              54913,
              54948,
              54947,
              54955,
              54934,
              54938,
              54950,
              54927,
              54935,
              54941,
              54947,
              54935,
              54943,
              54950,
              54924,
              54930,
              54930,
              54925,
              54935,
              54944,
              54929,
              54921,
              54919,
              54941,
              54927,
              54929,
              54923,
              54909,
              54927,
              54931,
              54905,
              54909,
              54921,
              54923,
              54923,
              54931,
              54899,
              54917,
              54927,
              54919,
              54924,
              54915,
              54899,
              54919,
              54918,
              54934,
              54923,
              54926,
              54920,
              54917,
              54926,
              54923,
              54924,
              54930,
              54920,
              54927,
              54926,
              54918,
              54900,
              54924,
              54933,
              54946,
              54947,
              54967,
              54919,
              54931,
              54938,
              54929,
              54909,
              54907,
              54948,
              54931,
              54911,
              54931,
              54909,
              54929,
              54921,
              54915,
              54919,
              54924,
              54917,
              54934,
              54951,
              54943,
              54929,
              54928,
              54927,
              54914,
              54939,
              54946,
              54935,
              54944,
              54929,
              54961,
              54923,
              54937,
              54969,
              54935,
              54955,
              54951,
              54941,
              54945,
              54928,
              54927,
              54947,
              54919,
              54943,
              54929,
              54934,
              54939,
              54947,
              54945,
              54929,
              54907,
              54930,
              54919,
              54943,
              54939,
              54959,
              54948,
              54945,
              54935,
              54955,
              54961,
              54935,
              54945,
              54943,
              54947,
              54950,
              54955,
              54933,
              54935,
              54934,
              54927,
              54935,
              54925,
              54945,
              54935,
              54931,
              54925,
              54931,
              54925,
              54917,
              54914,
              54903,
              54917,
              54931,
              54920,
              54937,
              54922,
              54909,
              54926,
              54917,
              54910,
              54916,
              54935,
              54919,
              54927,
              54944,
              54913,
              54938,
              54920,
              54931,
              54911,
              54927,
              54931,
              54924,
              54927,
              54918,
              54913,
              54916,
              54918,
              54887,
              54908,
              54894,
              54903,
              54903,
              54918,
              54918,
              54913,
              54911,
              54914,
              54927,
              54877,
              54959,
              54971,
              54978,
              55005,
              55012,
              55019,
              55007,
              55073,
              55052,
              55058,
              55058,
              55054,
              55090,
              55094,
              55065,
              55107,
              55108,
              55105,
              55139,
              55282,
              55108,
              55087,
              55060,
              55033,
              55003,
              55012,
              55003,
              54986,
              54985,
              54969,
              54969,
              54962,
              54959,
              54957,
              54953,
              54939,
              54923,
              54931,
              54953,
              54935,
              54914,
              54929,
              54927,
              54939,
              54931,
              54915,
              54929,
              54912,
              54914,
              54922,
              54897,
              54915,
              54897,
              54901,
              54923,
              54903,
              54916,
              54924,
              54923,
              54931,
              54920,
              54917,
              54918,
              54899,
              54917,
              54909,
              54928,
              54936,
              54917,
              54918,
              54915,
              54903,
              54935,
              54914,
              54936,
              54929,
              54911,
              54938,
              54903,
              54918,
              54927,
              54915,
              54949,
              54927,
              54935,
              54939,
              54948,
              54943,
              54940,
              54921,
              54907,
              54903,
              54904,
              54905,
              54923,
              54917,
              54926,
              54930,
              54939,
              54926,
              54939,
              54905,
              54963,
              54931,
              54935,
              54932,
              54921,
              54927,
              54915,
              54951,
              54946,
              54935,
              54930,
              54955,
              54934,
              54943,
              54927,
              54911,
              54930,
              54921,
              54927,
              54931,
              54911,
              54933,
              54919,
              54935,
              54942,
              54918,
              54950,
              54931,
              54917,
              54927,
              54947,
              54954,
              54951,
              54945,
              54946,
              54961,
              54948,
              54948,
              54946,
              54950,
              54948,
              54939,
              54943,
              54940,
              54945,
              54939,
              54946,
              54933,
              54938,
              54942,
              54929,
              54946,
              54949,
              54939,
              54930,
              54961,
              54950,
              54951,
              54956,
              54953,
              54950,
              54955,
              54947,
              54959,
              54942,
              54959,
              54938,
              54945,
              54949,
              54945,
              54944,
              54913,
              54948,
              54941,
              54943,
              54952,
              54955,
              54948,
              54951,
              54941,
              54951,
              54934,
              54940,
              54911,
              54934,
              54940,
              54936,
              54943,
              54957,
              54919,
              54951,
              54940,
              54945,
              54943,
              54933,
              54939,
              54955,
              54924,
              54926,
              54939,
              54950,
              54951,
              54944,
              54978,
              54955,
              54950,
              54939,
              54966,
              54950,
              54952,
              54937,
              54935,
              54953,
              54921,
              54951,
              54932,
              54954,
              54927,
              54955,
              54994,
              55010,
              54999,
              55021,
              55039,
              55057,
              55062,
              55071,
              55081,
              55089,
              55111,
              55111,
              55113,
              55110,
              55105,
              55144,
              55142,
              55123,
              55351,
              55129,
              55091,
              55078,
              55046,
              55059,
              55036,
              54993,
              55009,
              54984,
              55007,
              54982,
              54983,
              54962,
              54960,
              54977,
              54957,
              54962,
              54957,
              54971,
              54956,
              54949,
              54934,
              54958,
              54949,
              54952,
              54930,
              54928,
              54943,
              54913,
              54919,
              54938,
              54931,
              54945,
              54947,
              54929,
              54935,
              54945,
              54923,
              54943,
              54936,
              54931,
              54943,
              54931,
              54936,
              54937,
              54943,
              54943,
              54946,
              54934,
              54935,
              54918,
              54946,
              54937,
              54929,
              54924,
              54933,
              54925,
              54925,
              54931,
              54927,
              54943,
              54945,
              54933,
              54935,
              54937,
              54946,
              54939,
              54942,
              54933,
              54931,
              54928,
              54943,
              54923,
              54917,
              54913,
              54920,
              54925,
              54932,
              54919,
              54930,
              54935,
              54941,
              54925,
              54935,
              54938,
              54948,
              54924,
              54916,
              54917,
              54950,
              54912,
              54931,
              54939,
              54934,
              54949,
              54933,
              54917,
              54963,
              54955,
              54962,
              54959,
              54954,
              54975,
              54957,
              54951,
              54951,
              54945,
              54974,
              54968,
              54955,
              54938,
              54945,
              54960,
              54943,
              54939,
              54951,
              54952,
              54965,
              54952,
              54948,
              54939,
              54937,
              54942,
              54962,
              54948,
              54940,
              54939,
              54919,
              54943,
              54929,
              54942,
              54963,
              54961,
              54969,
              54964,
              54947,
              54951,
              54937,
              54941,
              54938,
              54925,
              54947,
              54949,
              54940,
              54950,
              54939,
              54933,
              54920,
              54954,
              54943,
              54941,
              54953,
              54937,
              54943,
              54931,
              54957,
              54944,
              54947,
              54931,
              54941,
              54935,
              54938,
              54931,
              54931,
              54938,
              54942,
              54928,
              54932,
              54954,
              54947,
              54950,
              54965,
              54931,
              54966,
              54951,
              54948,
              54941,
              54936,
              54948,
              54930,
              54934,
              54955,
              54953,
              54951,
              54950,
              54947,
              54949,
              54919,
              54925,
              54928,
              54933,
              54943,
              54939,
              54946,
              54950,
              54980,
              54946,
              54943,
              54944,
              54917,
              54966,
              54983,
              55003,
              55022,
              55055,
              55069,
              55070,
              55097,
              55111,
              55110,
              55105,
              55127,
              55111,
              55129,
              55121,
              55147,
              55150,
              55147,
              55175,
              55382,
              55138,
              55125,
              55107,
              55082,
              55079,
              55040,
              55048,
              55007,
              54996,
              54982,
              55007,
              55001,
              54983,
              54975,
              54980,
              54988,
              54974,
              54959,
              54959,
              54979,
              54959,
              54965,
              54965,
              54955,
              54973,
              54962,
              54938,
              54946,
              54958,
              54961,
              54946,
              54949,
              54956,
              54972,
              54955,
              54972,
              54954,
              54959,
              54965,
              54955,
              54967,
              54951,
              54968,
              54944,
              54957,
              54951,
              54962,
              54950,
              54949,
              54971,
              54955,
              54955,
              54951,
              54960,
              54966,
              54967,
              54954,
              54951,
              54960,
              54980,
              54952,
              54958,
              54954,
              54965,
              54954,
              54959,
              54973,
              54964,
              54977,
              54963,
              54959,
              54979,
              54950,
              54970,
              54985,
              54947,
              54957,
              54962,
              54944,
              54946,
              54951,
              54954,
              54948,
              54951,
              54945,
              54972,
              54940,
              54950,
              54944,
              54951,
              54967,
              54942,
              54983,
              54951,
              54968,
              54967,
              54986,
              54975,
              54973,
              54970,
              54974,
              54959,
              54939,
              54942,
              54958,
              54974,
              54960,
              54968,
              54967,
              54947,
              54989,
              54980,
              54955,
              54949,
              54955,
              54951,
              54962,
              54950,
              54981,
              54945,
              54935,
              54954,
              54925,
              54950,
              54970,
              54942,
              54961,
              54959,
              54966,
              54943,
              54940,
              54967,
              54961,
              54963,
              54954,
              54938,
              54936,
              54957,
              54977,
              54983,
              54962,
              54961,
              54955,
              54945,
              54949,
              54939,
              54936,
              54944,
              54954,
              54943,
              54926,
              54961,
              54959,
              54951,
              54949,
              54967,
              54966,
              54990,
              54966,
              54962,
              54967,
              54951,
              54951,
              54974,
              54946,
              54955,
              54943,
              54938,
              54944,
              54918,
              54944,
              54940,
              54922,
              54945,
              54920,
              54939,
              54928,
              54934,
              54943,
              54937,
              54968,
              54958,
              54954,
              54946,
              54955,
              54951,
              54931,
              54932,
              54933,
              54943,
              54951,
              54948,
              54935,
              54945,
              54944,
              54931,
              54951,
              54947,
              54963,
              54913,
              54967,
              55004,
              54985,
              55007,
              55017,
              55035,
              55046,
              55059,
              55065,
              55079,
              55073,
              55079,
              55118,
              55090,
              55118,
              55097,
              55111,
              55142,
              55119,
              55367,
              55118,
              55081,
              55065,
              55061,
              55011,
              55016,
              54990,
              55013,
              55008,
              54983,
              55001,
              54980,
              54961,
              54971,
              54969,
              54986,
              54968,
              54957,
              54949,
              54935,
              54945,
              54941,
              54954,
              54957,
              54953,
              54962,
              54947,
              54949,
              54922,
              54935,
              54919,
              54947,
              54931,
              54930,
              54925,
              54916,
              54925,
              54916,
              54930,
              54921,
              54919,
              54927,
              54927,
              54945,
              54919,
              54931,
              54923,
              54931,
              54910,
              54916,
              54929,
              54943,
              54925,
              54927,
              54918,
              54902,
              54919,
              54897,
              54902,
              54919,
              54923,
              54903,
              54913,
              54938,
              54931,
              54929,
              54921,
              54915,
              54940,
              54926,
              54917,
              54926,
              54926,
              54933,
              54909,
              54926,
              54927,
              54925,
              54927,
              54923,
              54920,
              54930,
              54909,
              54928,
              54927,
              54923,
              54929,
              54941,
              54947,
              54942,
              54937,
              54933,
              54937,
              54948,
              54926,
              54949,
              54946,
              54956,
              54957,
              54959,
              54956,
              54937,
              54955,
              54935,
              54955,
              54943,
              54969,
              54956,
              54961,
              54946,
              54972,
              54967,
              54961,
              54973,
              54978,
              54975,
              54975,
              54983,
              54967,
              54962,
              54970,
              54932,
              54935,
              54950,
              54950,
              54943,
              54945,
              54968,
              54963,
              54975,
              54973,
              54963,
              54980,
              54976,
              54971,
              54989,
              54961,
              54969,
              54951,
              54967,
              54964,
              54961,
              54956,
              54980,
              54969,
              54959,
              54972,
              54981,
              54984,
              54961,
              54964,
              54961,
              54953,
              54980,
              54983,
              54973,
              54977,
              54941,
              54982,
              54967,
              54947,
              54963,
              54974,
              54962,
              54953,
              54962,
              54961,
              54951,
              54959,
              54957,
              54959,
              54961,
              54965,
              54973,
              54959,
              54941,
              54950,
              54940,
              54965,
              54932,
              54934,
              54933,
              54955,
              54951,
              54935,
              54961,
              54950,
              54955,
              54949,
              54929,
              54953,
              54946,
              54953,
              54949,
              54939,
              54937,
              54965,
              54949,
              54947,
              54893,
              54958,
              54984,
              54999,
              55026,
              55031,
              55045,
              55062,
              55061,
              55079,
              55095,
              55095,
              55130,
              55123,
              55145,
              55144,
              55150,
              55143,
              55149,
              55151,
              55427,
              55159,
              55127,
              55095,
              55074,
              55078,
              55058,
              55042,
              55033,
              55008,
              54988,
              54993,
              54972,
              54981,
              54947,
              54980,
              54981,
              54948,
              54954,
              54956,
              54950,
              54942,
              54945,
              54954,
              54967,
              54942,
              54937,
              54938,
              54937,
              54935,
              54923,
              54933,
              54943,
              54967,
              54935,
              54935,
              54929,
              54923,
              54927,
              54950,
              54949,
              54949,
              54946,
              54938,
              54942,
              54951,
              54938,
              54943,
              54935,
              54944,
              54952,
              54955,
              54941,
              54914,
              54925,
              54947,
              54952,
              54919,
              54938,
              54926,
              54950,
              54942,
              54957,
              54947,
              54926,
              54951,
              54950,
              54930,
              54928,
              54905,
              54932,
              54929,
              54929,
              54946,
              54931,
              54924,
              54920,
              54910,
              54927,
              54933,
              54940,
              54908,
              54919,
              54921,
              54945,
              54927,
              54918,
              54938,
              54951,
              54934,
              54914,
              54920,
              54930,
              54927,
              54923,
              54937,
              54939,
              54943,
              54919,
              54951,
              54943,
              54950,
              54948,
              54917,
              54939,
              54933,
              54937,
              54943,
              54944,
              54933,
              54942,
              54925,
              54949,
              54949,
              54921,
              54940,
              54947,
              54931,
              54956,
              54940,
              54967,
              54944,
              54928,
              54951,
              54950,
              54944,
              54967,
              54947,
              54959,
              54941,
              54943,
              54958,
              54975,
              54953,
              54947,
              54957,
              54968,
              54953,
              54937,
              54943,
              54919,
              54943,
              54947,
              54952,
              54959,
              54928,
              54933,
              54926,
              54962,
              54955,
              54917,
              54951,
              54951,
              54945,
              54951,
              54959,
              54951,
              54949,
              54947,
              54939,
              54949,
              54955,
              54962,
              54936,
              54943,
              54950,
              54954,
              54971,
              54935,
              54936,
              54947,
              54942,
              54934,
              54923,
              54939,
              54932,
              54927,
              54943,
              54951,
              54921,
              54925,
              54927,
              54932,
              54956,
              54952,
              54942,
              54944,
              54939,
              54935,
              54945,
              54944,
              54964,
              54940,
              54959,
              54941,
              54949,
              54951,
              54960,
              54950,
              54961,
              54892,
              54970,
              54978,
              54983,
              55014,
              55027,
              55050,
              55055,
              55067,
              55108,
              55107,
              55093,
              55122,
              55122,
              55133,
              55143,
              55127,
              55173,
              55145,
              55142,
              55445,
              55148,
              55114,
              55087,
              55058,
              55067,
              55058,
              55052,
              55042,
              55012,
              55013,
              55010,
              55002,
              55014,
              54973,
              55000,
              54995,
              54999,
              54993,
              54969,
              54953,
              54978,
              54975,
              54978,
              54958,
              54955,
              54974,
              54953,
              54946,
              54962,
              54970,
              54948,
              54959,
              54964,
              54960,
              54953,
              54961,
              54955,
              54945,
              54961,
              54955,
              54950,
              54955,
              54950,
              54951,
              54947,
              54957,
              54943,
              54935,
              54954,
              54952,
              54937,
              54940,
              54948,
              54951,
              54943,
              54960,
              54946,
              54949,
              54951,
              54961,
              54959,
              54955,
              54951,
              54949,
              54960,
              54967,
              54943,
              54957,
              54948,
              54943,
              54959,
              54958,
              54971,
              54945,
              54951,
              54978,
              54967,
              54987,
              54964,
              54957,
              54950,
              54951,
              54954,
              54966,
              54979,
              54969,
              54970,
              54949,
              54950,
              54965,
              54969,
              54993,
              54961,
              54983,
              54964,
              54965,
              54991,
              54979,
              54997
            ]
          },
          {
            "time": "1498408726394",
            "light_intensity": 988.2,
            "r": 1415,
            "g": 446,
            "b": 318,
            "light_intensity_raw": 2109,
            "temperature": 24.76,
            "humidity": 43.852,
            "pressure": 985.74,
            "temperature2": 24.9,
            "humidity2": 46.57,
            "pressure2": 986.272,
            "contactless_temp": 21.67,
            "thickness": 0.69,
            "compass_direction": "E",
            "compass": 90,
            "angle": 3.37,
            "angle_direction": "S",
            "pitch": 3.35,
            "roll": 0.4,
            "air_flow": 390,
            "data_raw": [
              415,
              526,
              525,
              529,
              535,
              544,
              551,
              555,
              557,
              559,
              571,
              566,
              567,
              566,
              568,
              566,
              566,
              569,
              568,
              567,
              565,
              568,
              568,
              566,
              564,
              569,
              569,
              569,
              567,
              570,
              570,
              562,
              570,
              568,
              574,
              568,
              568,
              568,
              569,
              567,
              568,
              568,
              567,
              571,
              565,
              565,
              576,
              570,
              570,
              567,
              568,
              577,
              570,
              569,
              566,
              570,
              570,
              566,
              568,
              568,
              569,
              560,
              569,
              569,
              572,
              575,
              565,
              568,
              571,
              572,
              574,
              568,
              570,
              569,
              568,
              569,
              564,
              565,
              563,
              567,
              569,
              567,
              567,
              566,
              566,
              568,
              569,
              567,
              565,
              564,
              562,
              562,
              563,
              566,
              569,
              564,
              566,
              568,
              564,
              568,
              641,
              645,
              654,
              656,
              651,
              657,
              651,
              651,
              654,
              651,
              653,
              651,
              651,
              655,
              654,
              650,
              647,
              651,
              652,
              649,
              648,
              650,
              646,
              649,
              651,
              646,
              649,
              646,
              655,
              648,
              644,
              639,
              642,
              649,
              642,
              639,
              640,
              639,
              642,
              639,
              631,
              642,
              641,
              640,
              640,
              627,
              638,
              634,
              623,
              633,
              635,
              631,
              633,
              626,
              638,
              635,
              625,
              632,
              629,
              625,
              626,
              624,
              621,
              625,
              621,
              622,
              616,
              623,
              626,
              623,
              619,
              623,
              622,
              623,
              618,
              616,
              608,
              615,
              615,
              609,
              611,
              613,
              611,
              617,
              614,
              606,
              616,
              613,
              612,
              608,
              524,
              458,
              422,
              421,
              423,
              417,
              418,
              416,
              421,
              421,
              421,
              417,
              417,
              426,
              423,
              393,
              391,
              388,
              387,
              385,
              384,
              382,
              386,
              379,
              383,
              380,
              384,
              378,
              389,
              373,
              383,
              743,
              785,
              801,
              808,
              816,
              831,
              832,
              834,
              831,
              837,
              836,
              837,
              839,
              838,
              842,
              839,
              838,
              834,
              846,
              836,
              835,
              844,
              839,
              841,
              839,
              843,
              844,
              841,
              842,
              833,
              833,
              833,
              835,
              831,
              834,
              833,
              831,
              827,
              837,
              833,
              830,
              831,
              835,
              833,
              818,
              809,
              815,
              812,
              810,
              814,
              812,
              811,
              811,
              807,
              816,
              812,
              807,
              812,
              808,
              794,
              792,
              793,
              787,
              793,
              791,
              786,
              789,
              793,
              790,
              788,
              792,
              789,
              788,
              790,
              730,
              693,
              687,
              682,
              675,
              679,
              673,
              675,
              676,
              671,
              675,
              673,
              673,
              668,
              667,
              55163,
              55121,
              55078,
              55106,
              55061,
              55061,
              55041,
              55026,
              55012,
              55018,
              55009,
              54994,
              55003,
              55005,
              55011,
              54985,
              54996,
              54986,
              54988,
              54985,
              55000,
              54993,
              54987,
              54977,
              54977,
              54990,
              54969,
              54989,
              55005,
              55012,
              55011,
              55012,
              54994,
              55007,
              55022,
              54983,
              55007,
              55019,
              55015,
              55023,
              55007,
              55033,
              55011,
              54997,
              55017,
              55029,
              55012,
              55025,
              55010,
              54998,
              55032,
              54994,
              55012,
              54999,
              55029,
              55049,
              55017,
              55005,
              55018,
              55006,
              55010,
              55002,
              55034,
              55053,
              55010,
              54997,
              55019,
              55005,
              55015,
              55007,
              55022,
              55021,
              55023,
              55031,
              55026,
              55002,
              55020,
              55017,
              55029,
              55003,
              55004,
              55008,
              54984,
              54977,
              55002,
              55006,
              54996,
              54999,
              55007,
              55006,
              55050,
              55015,
              55014,
              55003,
              55014,
              54999,
              54999,
              55014,
              55018,
              54999,
              54975,
              54995,
              54963,
              54972,
              54959,
              54982,
              55007,
              54993,
              54977,
              54982,
              55009,
              54987,
              55004,
              54981,
              55007,
              54995,
              55015,
              55007,
              55011,
              55027,
              55011,
              55010,
              54999,
              54994,
              55021,
              55001,
              55001,
              54997,
              54999,
              55013,
              54990,
              54995,
              55021,
              54998,
              55025,
              55019,
              55018,
              55028,
              55001,
              55010,
              55014,
              55020,
              55039,
              54987,
              54998,
              55011,
              55001,
              54973,
              55013,
              55006,
              55017,
              55005,
              54999,
              54993,
              54999,
              55025,
              55055,
              55030,
              55051,
              55047,
              55029,
              55031,
              55018,
              55024,
              55014,
              55013,
              55007,
              55009,
              55006,
              55001,
              55003,
              54996,
              55024,
              55009,
              55015,
              55014,
              55019,
              54986,
              54985,
              55014,
              55014,
              55024,
              55023,
              54998,
              55010,
              55007,
              55015,
              55020,
              55012,
              55031,
              55243,
              55296,
              55310,
              55268,
              55297,
              55297,
              55335,
              55325,
              55311,
              55289,
              55281,
              55303,
              55311,
              55318,
              55325,
              55149,
              55187,
              55212,
              55210,
              55195,
              55234,
              55232,
              55245,
              55231,
              55239,
              55259,
              55289,
              55268,
              55258,
              55303,
              55201,
              55131,
              55175,
              55176,
              55209,
              55224,
              55261,
              55253,
              55239,
              55254,
              55264,
              55235,
              55266,
              55251,
              55260,
              55240,
              55215,
              55214,
              55213,
              55221,
              55215,
              55213,
              55223,
              55207,
              55200,
              55198,
              55202,
              55209,
              55192,
              55199,
              55199,
              55189,
              55196,
              55191,
              55187,
              55174,
              55172,
              55175,
              55175,
              55171,
              55176,
              55184,
              55182,
              55174,
              55161,
              55166,
              55135,
              55157,
              55173,
              55158,
              55173,
              55164,
              55168,
              55134,
              55147,
              55147,
              55145,
              55131,
              55131,
              55118,
              55135,
              55131,
              55171,
              55154,
              55175,
              55149,
              55161,
              55164,
              55172,
              55148,
              55149,
              55140,
              55143,
              55167,
              55164,
              55203,
              55219,
              55229,
              55244,
              55220,
              55228,
              55212,
              55223,
              55208,
              55211,
              55254,
              55229,
              55221,
              55211,
              55218
            ]
          },
          {
            "time": "1498408739231",
            "light_intensity": 599.962,
            "r": 853,
            "g": 270,
            "b": 193,
            "light_intensity_raw": 1274,
            "temperature": 24.9,
            "humidity": 46.485,
            "pressure": 985.786,
            "temperature2": 25.06,
            "humidity2": 51.469,
            "pressure2": 986.307,
            "contactless_temp": 23.01,
            "thickness": 0.65,
            "compass_direction": "W",
            "compass": 270,
            "angle": 4.37,
            "angle_direction": "NE",
            "pitch": 3.62,
            "roll": -2.45,
            "air_flow": 390,
            "data_raw": [

            ]
          },
          {
            "time": "1498408740115",
            "light_intensity": 631.014,
            "r": 897,
            "g": 284,
            "b": 203,
            "light_intensity_raw": 1340,
            "temperature": 24.91,
            "humidity": 46.661,
            "pressure": 985.815,
            "temperature2": 25.07,
            "humidity2": 51.718,
            "pressure2": 986.297,
            "contactless_temp": 23.01,
            "thickness": 0.65,
            "compass_direction": "W",
            "compass": 270,
            "angle": 4.84,
            "angle_direction": "NE",
            "pitch": 4.15,
            "roll": -2.49,
            "air_flow": 390,
            "data_raw": [

            ]
          },
          {
            "time": "1498408740999",
            "light_intensity": 690.024,
            "r": 981,
            "g": 311,
            "b": 222,
            "light_intensity_raw": 1466,
            "temperature": 24.92,
            "humidity": 46.847,
            "pressure": 985.787,
            "temperature2": 25.07,
            "humidity2": 51.967,
            "pressure2": 986.258,
            "contactless_temp": 23.05,
            "thickness": 0.65,
            "compass_direction": "W",
            "compass": 270,
            "angle": 3.855,
            "angle_direction": "NE",
            "pitch": 3.4,
            "roll": -1.82,
            "air_flow": 390,
            "data_raw": [

            ]
          },
          {
            "time": "1498408741884",
            "detector_read1": 12511,
            "detector_read2": 5758,
            "light_intensity": 677.69,
            "r": 963,
            "g": 305,
            "b": 217,
            "light_intensity_raw": 1439,
            "temperature": 24.94,
            "humidity": 47.021,
            "pressure": 985.808,
            "temperature2": 25.09,
            "humidity2": 52.185,
            "pressure2": 986.268,
            "contactless_temp": 23.05,
            "thickness": 0.65,
            "compass_direction": "W",
            "compass": 270,
            "angle": 3.918,
            "angle_direction": "NE",
            "pitch": 2.88,
            "roll": -2.65,
            "air_flow": 370,
            "recall": {
              "time": "1498408742739",
              "colorcal_blank1[1]": 16826,
              "colorcal_blank1[2]": 19729.5,
              "colorcal_blank1[3]": 24585.5,
              "colorcal_blank1[4]": 29640,
              "colorcal_blank1[6]": 36999,
              "colorcal_blank1[8]": 33748,
              "colorcal_blank1[9]": 31350,
              "colorcal_blank1[10]": 35757.5,
              "colorcal_blank2[1]": 17431,
              "colorcal_blank2[2]": 15587,
              "colorcal_blank2[3]": 18940,
              "colorcal_blank2[4]": 15523,
              "colorcal_blank2[6]": 16951,
              "colorcal_blank2[8]": 18034,
              "colorcal_blank2[9]": 18921.5,
              "colorcal_blank2[10]": 16579.5,
              "colorcal_blank3[1]": 16103,
              "colorcal_blank3[2]": 8851,
              "colorcal_blank3[3]": 15891,
              "colorcal_blank3[4]": 11097.5,
              "colorcal_blank3[6]": 6018.5,
              "colorcal_blank3[8]": 6577.5,
              "colorcal_blank3[9]": 5627.5,
              "colorcal_blank3[10]": 6014.5,
              "colorcal_intensity1_slope[2]": 2.25,
              "colorcal_intensity1_yint[2]": 4.8,
              "colorcal_intensity2_slope[2]": 2.378,
              "colorcal_intensity2_yint[2]": 3.4,
              "colorcal_intensity3_slope[2]": 2.58,
              "colorcal_intensity3_yint[2]": -18,
              "ir_baseline_slope[5]": 11764.5,
              "ir_baseline_yint[5]": 17895,
              "ir_baseline_slope[3]": 457.5,
              "ir_baseline_yint[3]": 599
            },
            "data_raw": [
              2114,
              1914,
              1911,
              1911,
              1913,
              1118,
              951,
              949,
              950,
              953,
              3636,
              2014,
              2008,
              2010,
              2006,
              140,
              495,
              499,
              503,
              495,
              41371,
              11384,
              11328,
              11323,
              11319,
              13226,
              11902,
              11915,
              11908,
              11912,
              20367,
              13259,
              13250,
              13244,
              13238,
              17957,
              11996,
              11985,
              11984,
              11969,
              14214,
              16880,
              16871,
              16879,
              16887,
              5019,
              6130,
              6136,
              6138,
              6136,
              11720,
              15259,
              15265,
              15261,
              15259,
              2041,
              2597,
              2591,
              2587,
              2595,
              31233,
              39749,
              39765,
              39771,
              39769,
              34661,
              44206,
              44226,
              44227,
              44235,
              33431,
              44262,
              44290,
              44295,
              44283,
              30222,
              39955,
              39951,
              39943,
              39922,
              53517,
              65535,
              65535,
              65535,
              65535,
              11797,
              14153,
              14153,
              14158,
              14157,
              52025,
              65535,
              65535,
              65535,
              65535,
              7371,
              9877,
              9880,
              9881,
              9874,
              39782,
              39780,
              39781,
              39775,
              39776,
              44232,
              44230,
              44227,
              44225,
              44233,
              44293,
              44287,
              44285,
              44288,
              44289,
              39979,
              39950,
              39941,
              39930,
              39916,
              1914,
              1915,
              1907,
              1923,
              1911,
              961,
              958,
              952,
              951,
              954,
              2025,
              2008,
              2013,
              2007,
              2016,
              493,
              500,
              500,
              495,
              496,
              11775,
              11340,
              11321,
              11313,
              11313,
              11912,
              11900,
              11907,
              11911,
              11913,
              13384,
              13252,
              13248,
              13245,
              13244,
              12087,
              11991,
              11983,
              11973,
              11985,
              16855,
              16878,
              16869,
              16880,
              16873,
              6127,
              6127,
              6137,
              6134,
              6137,
              15230,
              15257,
              15268,
              15263,
              15263,
              2588,
              2593,
              2588,
              2590,
              2596,
              39675,
              39767,
              39763,
              39774,
              39784,
              44132,
              44209,
              44216,
              44230,
              44219,
              44117,
              44273,
              44283,
              44281,
              44285,
              39854,
              39956,
              39951,
              39931,
              39929,
              65535,
              65535,
              65535,
              65535,
              65535,
              14140,
              14155,
              14153,
              14163,
              14158,
              65535,
              65535,
              65535,
              65535,
              65535,
              9844,
              9885,
              9885,
              9876,
              9877,
              39779,
              39772,
              39778,
              39771,
              39781,
              44223,
              44229,
              44229,
              44223,
              44229,
              44283,
              44277,
              44287,
              44293,
              44285,
              39965,
              39939,
              39946,
              39917,
              39920
            ]
          },
          {
            "time": "1498408742765",
            "air_flow": 370,
            "data_raw": [

            ]
          }
        ]
      }
    ]
  ],
  "app_os": "darwin-x64",
  "app_name": "PhotosynQ",
  "app_version": "0.0.11-DMK",
  "app_device": "x64",
  "location": [
    "42.7223811",
    "-84.4746529"
  ],
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
0
Latest Update:
Jun 2017