RIDES1_2_macro_1_c


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

        ],
        "protocol_id": 1,
        "set": [
          {
            "time": "1498407769972",
            "blank:": "blank"
          },
          {
            "time": "1498407769982",
            "air_flow": 340,
            "data_raw": [

            ]
          },
          {
            "time": "1498407771650",
            "air_flow": 560,
            "data_raw": [

            ]
          },
          {
            "time": "1498407772818",
            "air_flow": 590,
            "data_raw": [

            ]
          },
          {
            "time": "1498407773986",
            "light_intensity": 15.591,
            "r": 14,
            "g": 6,
            "b": 3,
            "light_intensity_raw": 23,
            "temperature": 24.27,
            "humidity": 40.141,
            "pressure": 985.708,
            "temperature2": 24.42,
            "humidity2": 39.507,
            "pressure2": 986.203,
            "contactless_temp": 22.81,
            "compass_direction": "E",
            "compass": 90,
            "angle": 97.034,
            "angle_direction": "NW",
            "pitch": 80.27,
            "roll": -136.43,
            "air_flow": 540,
            "data_raw": [

            ]
          },
          {
            "time": "1498407774594",
            "light_intensity": 15.95,
            "r": 12,
            "g": 5,
            "b": 3,
            "light_intensity_raw": 21,
            "temperature": 24.28,
            "humidity": 40.142,
            "pressure": 985.756,
            "temperature2": 24.43,
            "humidity2": 39.507,
            "pressure2": 986.201,
            "contactless_temp": 22.71,
            "thickness": 5.12,
            "compass_direction": "E",
            "compass": 90,
            "angle": 35.145,
            "angle_direction": "S",
            "pitch": 35.11,
            "roll": 1.61,
            "air_flow": 470,
            "data_raw": [

            ]
          },
          {
            "time": "1498407775177",
            "light_intensity": 11.747,
            "r": 9,
            "g": 4,
            "b": 2,
            "light_intensity_raw": 15,
            "temperature": 24.31,
            "humidity": 40.264,
            "pressure": 985.78,
            "temperature2": 24.46,
            "humidity2": 39.618,
            "pressure2": 986.228,
            "contactless_temp": 21.67,
            "thickness": 0.62,
            "air_flow": 370,
            "data_raw": [
              48416,
              48408,
              48394,
              48399,
              48399,
              48399,
              48400,
              48392,
              48399,
              48392,
              48395,
              48399,
              48387,
              48396,
              48385,
              48397,
              48395,
              48389,
              48390,
              48381,
              48394,
              48393,
              48389,
              48390,
              48385,
              48389,
              48387,
              48389,
              48390,
              48382,
              48391,
              48388,
              48391,
              48388,
              48379,
              48385,
              48380,
              48382,
              48385,
              48380,
              48382,
              48377,
              48383,
              48386,
              48377,
              48382,
              48377,
              48378,
              48381,
              48371,
              48380,
              48367,
              48375,
              48381,
              48375,
              48381,
              48376,
              48374,
              48375,
              48370,
              48380,
              48373,
              48369,
              48378,
              48377,
              48384,
              48377,
              48377,
              48372,
              48379,
              48375,
              48375,
              48377,
              48371,
              48383,
              48381,
              48383,
              48379,
              48368,
              48383,
              48385,
              48376,
              48383,
              48375,
              48385,
              48382,
              48381,
              48391,
              48367,
              48383,
              48383,
              48381,
              48372,
              48371,
              48379,
              48374,
              48377,
              48376,
              48378,
              48378,
              48375,
              48375,
              48383,
              48377,
              48385,
              48381,
              48380,
              48383,
              48379,
              48383,
              48374,
              48384,
              48384,
              48379,
              48380,
              48379,
              48387,
              48385,
              48386,
              48386,
              48383,
              48387,
              48387,
              48386,
              48383,
              48378,
              48385,
              48385,
              48388,
              48387,
              48383,
              48390,
              48381,
              48384,
              48389,
              48383,
              48377,
              48377,
              48384,
              48386,
              48379,
              48376,
              48377,
              48381,
              48387,
              48381,
              48375,
              48373,
              48378,
              48382,
              48385,
              48388,
              48370,
              48383,
              48383,
              48386,
              48383,
              48378,
              48384,
              48379,
              48383,
              48381,
              48377,
              48383,
              48387,
              48387,
              48386,
              48381,
              48387,
              48383,
              48383,
              48387,
              48387,
              48391,
              48379,
              48385,
              48394,
              48384,
              48392,
              48379,
              48387,
              48389,
              48389,
              48395,
              48381,
              48385,
              48386,
              48395,
              48395,
              48386,
              48389,
              48388,
              48390,
              48395,
              48385,
              48387,
              48385,
              48391,
              48398,
              48385,
              48388,
              48385,
              48394,
              48391,
              48391,
              48395,
              48395,
              48395,
              48395,
              48402,
              48407,
              48394,
              48400,
              48397,
              48401,
              48408,
              48399,
              48400,
              48399,
              48407,
              48411,
              48403,
              48403,
              48400,
              48396,
              48402,
              48398,
              48402,
              48399,
              48393,
              48402,
              48393,
              48402,
              48392,
              48395,
              48399,
              48399,
              48403,
              48390,
              48397,
              48398,
              48399,
              48401,
              48395,
              48399,
              48390,
              48399,
              48395,
              48389,
              48397,
              48392,
              48396,
              48403,
              48387,
              48397,
              48392,
              48397,
              48394,
              48389,
              48392,
              48389,
              48392,
              48395,
              48399,
              48399,
              48386,
              48392,
              48390,
              48394,
              48392,
              48387,
              48389,
              48387,
              48387,
              48395,
              48391,
              48395,
              48381,
              48393,
              48399,
              48394,
              48392,
              48385,
              48391,
              48391,
              48393,
              48390,
              48394,
              48397,
              48393,
              48393,
              48392,
              48393,
              48394,
              48396,
              48387,
              48398,
              48390,
              48401,
              48389,
              48397,
              48397,
              48389,
              48393,
              48393,
              48399,
              48394,
              48392,
              48395,
              48397,
              48391,
              48395,
              48394,
              48398,
              48391,
              48391,
              48399,
              48395,
              48395,
              48393,
              48390,
              48390,
              48395,
              48399,
              48383,
              48393,
              48391,
              48399,
              48390,
              48388,
              48394,
              48400,
              48395,
              48394,
              48388,
              48396,
              48387,
              48397,
              48401,
              48391,
              48394,
              48399,
              48406,
              48393,
              48395,
              48400,
              48385,
              48399,
              48396,
              48398,
              48391,
              48392,
              48400,
              48398,
              48398,
              48401,
              48394,
              48401,
              48397,
              48400,
              48401,
              48393,
              48401,
              48399,
              48407,
              48403,
              48399,
              48401,
              48399,
              48395,
              48401,
              48398,
              48397,
              48397,
              48396,
              48403,
              48398,
              48403,
              48397,
              48400,
              48391,
              48397,
              48400,
              48393,
              48398,
              48395,
              48403,
              48401,
              48397,
              48397,
              48395,
              48400,
              48402,
              48397,
              48403,
              48392,
              48402,
              48401,
              48403,
              48398,
              48396,
              48403,
              48404,
              48396,
              48399,
              48399,
              48404,
              48401,
              48400,
              48404,
              48399,
              48401,
              48399,
              48405,
              48406,
              48393,
              48403,
              48400,
              48403,
              48407,
              48403,
              48405,
              48398,
              48409,
              48411,
              48399,
              48411,
              48407,
              48421,
              48415,
              48415,
              48423,
              48407,
              48418,
              48422,
              48423,
              48423,
              48418,
              48426,
              48421,
              48431,
              48426,
              48423,
              48424,
              48417,
              48425,
              48422,
              48416,
              48420,
              48417,
              48421,
              48418,
              48412,
              48419,
              48406,
              48416,
              48411,
              48414,
              48411,
              48408,
              48413,
              48413,
              48413,
              48410,
              48413,
              48417,
              48404,
              48410,
              48410,
              48409,
              48412,
              48403,
              48411,
              48412,
              48407,
              48417,
              48404,
              48416,
              48410,
              48406,
              48410,
              48402,
              48413,
              48409,
              48408,
              48414,
              48403,
              48413,
              48414,
              48408,
              48410,
              48405,
              48409,
              48407,
              48412,
              48411,
              48408,
              48411,
              48407,
              48408,
              48412,
              48406,
              48412,
              48399,
              48414,
              48415,
              48409,
              48410,
              48408,
              48411,
              48410,
              48409,
              48407,
              48411,
              48410,
              48415,
              48409,
              48410,
              48408,
              48404,
              48406,
              48410,
              48413,
              48401,
              48412,
              48415,
              48416,
              48414,
              48407,
              48413,
              48403,
              48415,
              48414,
              48405,
              48408,
              48406,
              48416,
              48417,
              48406,
              48411,
              48407,
              48413,
              48415,
              48405,
              48411,
              48411,
              48413,
              48415,
              48415,
              48414,
              48407,
              48408,
              48415,
              48410,
              48408,
              48403,
              48415,
              48409,
              48415,
              48417,
              48405,
              48414,
              48407,
              48417,
              48420,
              48407,
              48418,
              48409,
              48415,
              48419,
              48410,
              48415,
              48410,
              48417,
              48411,
              48411,
              48413,
              48415,
              48418,
              48416,
              48408,
              48422,
              48414,
              48415,
              48417,
              48421,
              48420,
              48415,
              48415,
              48413,
              48416,
              48420,
              48408,
              48417,
              48413,
              48419,
              48418,
              48407,
              48415,
              48415,
              48415,
              48417,
              48413,
              48415,
              48411,
              48419,
              48414,
              48411,
              48420,
              48414,
              48415,
              48415,
              48411,
              48415,
              48415,
              48415,
              48419,
              48415,
              48420,
              48415,
              48411,
              48413,
              48418,
              48425,
              48413,
              48416,
              48421,
              48421,
              48420,
              48411,
              48416,
              48418,
              48416,
              48420,
              48409,
              48419,
              48419,
              48414,
              48423,
              48419,
              48423,
              48414,
              48423,
              48427,
              48421,
              48430,
              48422,
              48425,
              48433,
              48439,
              48425,
              48429,
              48436,
              48436,
              48439,
              48437,
              48439,
              48436,
              48441,
              48443,
              48450,
              48435,
              48443,
              48438,
              48441,
              48429,
              48435,
              48440,
              48432,
              48439,
              48441,
              48438,
              48438,
              48432,
              48430,
              48435,
              48431,
              48440,
              48424,
              48430,
              48439,
              48435,
              48431,
              48426,
              48433,
              48430,
              48425,
              48425,
              48420,
              48431,
              48426,
              48427,
              48425,
              48429,
              48425,
              48421,
              48430,
              48432,
              48422,
              48425,
              48423,
              48432,
              48430,
              48427,
              48429,
              48425,
              48424,
              48424,
              48426,
              48426,
              48421,
              48424,
              48434,
              48425,
              48429,
              48423,
              48427,
              48434,
              48426,
              48432,
              48422,
              48424,
              48433,
              48423,
              48431,
              48427,
              48431,
              48432,
              48431,
              48431,
              48427,
              48434,
              48426,
              48429,
              48439,
              48433,
              48432,
              48433,
              48436,
              48444,
              48437,
              48434,
              48435,
              48435,
              48438,
              48436,
              48435,
              48435,
              48443,
              48444,
              48445,
              48445,
              48441,
              48439,
              48439,
              48440,
              48447,
              48441,
              48446,
              48445,
              48443,
              48448,
              48443,
              48450,
              48443,
              48450,
              48455,
              48446,
              48450,
              48446,
              48449,
              48448,
              48444,
              48449,
              48438,
              48450,
              48451,
              48449,
              48448,
              48451,
              48452,
              48457,
              48451,
              48455,
              48447,
              48453,
              48454,
              48445,
              48454,
              48449,
              48454,
              48453,
              48453,
              48451,
              48443,
              48452,
              48443,
              48455,
              48451,
              48449,
              48451,
              48447,
              48454,
              48455,
              48452,
              48445,
              48445,
              48450,
              48454,
              48446,
              48443,
              48446,
              48451,
              48455,
              48452,
              48451,
              48443,
              48453,
              48455,
              48450,
              48450,
              48446,
              48448,
              48453,
              48453,
              48453,
              48447,
              48455,
              48451,
              48457,
              48453,
              48450,
              48453,
              48453,
              48460,
              48453,
              48447,
              48456,
              48449,
              48454,
              48453,
              48452,
              48454,
              48453,
              48450,
              48455,
              48455,
              48455,
              48455,
              48459,
              48458,
              48455,
              48458,
              48453,
              48455,
              48461,
              48454,
              48463,
              48454,
              48461,
              48461,
              48459,
              48465,
              48455,
              48461,
              48463,
              48472,
              48467,
              48462,
              48468,
              48471,
              48475,
              48471,
              48464,
              48471,
              48465,
              48478,
              48479,
              48470,
              48474,
              48481,
              48477,
              48476,
              48474,
              48471,
              48471,
              48473,
              48467,
              48469,
              48472,
              48470,
              48470,
              48472,
              48471,
              48475,
              48465,
              48466,
              48467,
              48466,
              48472,
              48466,
              48462,
              48465,
              48471,
              48473,
              48459,
              48470,
              48463,
              48470,
              48472,
              48463,
              48467,
              48468,
              48470,
              48477,
              48463,
              48465,
              48465,
              48469,
              48475,
              48465,
              48463,
              48462,
              48471,
              48468,
              48461,
              48468,
              48467,
              48472,
              48471,
              48466,
              48471,
              48463,
              48473,
              48471,
              48462,
              48465,
              48463,
              48469,
              48468,
              48475,
              48462,
              48462,
              48467,
              48471,
              48469,
              48467,
              48462,
              48478,
              48468,
              48471,
              48473,
              48467,
              48471,
              48465,
              48470,
              48472,
              48467,
              48470,
              48471,
              48472,
              48473,
              48466,
              48471,
              48463,
              48470,
              48472,
              48466,
              48476,
              48466,
              48473,
              48469,
              48468,
              48469,
              48470,
              48474,
              48473,
              48473,
              48475,
              48461,
              48475,
              48478,
              48475,
              48479,
              48468,
              48475,
              48478,
              48482,
              48479,
              48472,
              48477,
              48476,
              48483,
              48477,
              48475,
              48477,
              48475,
              48476,
              48475,
              48469,
              48476,
              48471,
              48475,
              48478,
              48476,
              48476,
              48465,
              48474,
              48486,
              48475,
              48477,
              48473,
              48479,
              48483,
              48475,
              48477,
              48474,
              48480,
              48483,
              48476,
              48478,
              48469,
              48478,
              48478,
              48475,
              48477,
              48477,
              48473,
              48479,
              48479,
              48475,
              48469,
              48481,
              48473,
              48477,
              48483,
              48479,
              48481,
              48478,
              48484,
              48487,
              48482,
              48482,
              48483,
              48488,
              48479,
              48476,
              48481,
              48481,
              48486,
              48485,
              48481,
              48479,
              48475,
              48479,
              48483,
              48484,
              48487,
              48474,
              48487,
              48486,
              48481,
              48486,
              48477,
              48481,
              48475,
              48486,
              48484,
              48486,
              48484,
              48485,
              48484,
              48487,
              48486,
              48486,
              48483,
              48491,
              48485,
              48480,
              48487,
              48486,
              48493,
              48499,
              48492,
              48489,
              48489,
              48496,
              48493,
              48494,
              48499,
              48497,
              48497,
              48502,
              48502,
              48507,
              48495,
              48508,
              48507,
              48504,
              48507,
              48506,
              48505,
              48503,
              48507,
              48504,
              48497,
              48497,
              48498,
              48503,
              48498,
              48489,
              48505,
              48502,
              48499,
              48501,
              48495,
              48496,
              48495,
              48496,
              48504,
              48502,
              48498,
              48494,
              48495,
              48498,
              48501,
              48501,
              48488,
              48495,
              48494,
              48501,
              48502,
              48485,
              48491,
              48495,
              48498,
              48497,
              48489,
              48496,
              48497,
              48498,
              48500,
              48490,
              48494,
              48493,
              48495,
              48494,
              48494,
              48497,
              48495,
              48503,
              48497,
              48491,
              48491,
              48494,
              48501,
              48499,
              48486,
              48498,
              48489,
              48501,
              48498,
              48496,
              48495,
              48493,
              48493,
              48507,
              48493,
              48497,
              48491,
              48499,
              48502,
              48497,
              48505,
              48497,
              48501,
              48501,
              48503,
              48505,
              48493,
              48507,
              48499,
              48499,
              48506,
              48497,
              48500,
              48500,
              48495,
              48507,
              48497,
              48503,
              48497,
              48499,
              48503,
              48492,
              48498,
              48496,
              48504,
              48497,
              48498,
              48503,
              48497,
              48507,
              48491,
              48503,
              48498,
              48499,
              48503,
              48494,
              48499,
              48503,
              48498,
              48502,
              48496,
              48505,
              48506,
              48499,
              48502,
              48496,
              48503,
              48502,
              48495,
              48498,
              48499,
              48498,
              48499,
              48500,
              48505,
              48501,
              48501,
              48507,
              48502,
              48503,
              48496,
              48509,
              48503,
              48499,
              48507,
              48501,
              48505,
              48500,
              48507,
              48511,
              48503,
              48498,
              48505,
              48509,
              48509,
              48501,
              48507,
              48505,
              48508,
              48508,
              48501,
              48507,
              48508,
              48514,
              48511,
              48501,
              48503,
              48508,
              48510,
              48514,
              48502,
              48509,
              48508,
              48513,
              48511,
              48507,
              48501,
              48503,
              48509,
              48513,
              48509,
              48510,
              48504,
              48506,
              48511,
              48510,
              48514,
              48502,
              48511,
              48514,
              48515,
              48515,
              48501,
              48514,
              48513,
              48513,
              48519,
              48505,
              48511,
              48510,
              48515,
              48517,
              48505,
              48511,
              48509,
              48513,
              48519,
              48511,
              48511,
              48511,
              48515,
              48523,
              48511,
              48523,
              48517,
              48519,
              48525,
              48520,
              48527,
              48519,
              48527,
              48530,
              48527,
              48529,
              48525,
              48532,
              48528,
              48541,
              48535,
              48529,
              48534,
              48524,
              48536,
              48539,
              48527,
              48529,
              48523,
              48529,
              48535,
              48527,
              48530,
              48525,
              48530,
              48532,
              48523,
              48529,
              48515,
              48529,
              48527,
              48522,
              48527,
              48513,
              48527,
              48526,
              48519,
              48531,
              48511,
              48522,
              48527,
              48521,
              48529,
              48517,
              48521,
              48524,
              48519,
              48520,
              48522,
              48530,
              48520,
              48526,
              48524,
              48522,
              48531,
              48526,
              48524,
              48526,
              48523,
              48529,
              48529,
              48525,
              48526,
              48520,
              48523,
              48525,
              48525,
              48527,
              48519,
              48530,
              48521,
              48522,
              48525,
              48518,
              48524,
              48523,
              48532,
              48527,
              48518,
              48526,
              48517,
              48524,
              48528,
              48526,
              48522,
              48521,
              48526,
              48529,
              48527,
              48524,
              48514,
              48525,
              48526,
              48523,
              48527,
              48526,
              48525,
              48519,
              48526,
              48527,
              48519,
              48523,
              48519,
              48523,
              48529,
              48519,
              48523,
              48517,
              48523,
              4238,
              4555,
              4590,
              4612,
              4633,
              4649,
              4662,
              4676,
              4683,
              4699,
              4707,
              4711,
              4721,
              4723,
              4738,
              4744,
              4746,
              4756,
              4757,
              4767,
              4750,
              4723,
              4709,
              4690,
              4684,
              4676,
              4670,
              4664,
              4655,
              4655,
              4649,
              4646,
              4643,
              4641,
              4639,
              4634,
              4637,
              4634,
              4627,
              4631,
              4649,
              4678,
              4705,
              4717,
              4736,
              4745,
              4766,
              4773,
              4778,
              4789,
              4792,
              4806,
              4811,
              4813,
              4819,
              4820,
              4828,
              4836,
              4836,
              4840,
              4840,
              4846,
              4855,
              4855,
              4858,
              4858,
              4864,
              4866,
              4871,
              4874,
              4873,
              4879,
              4877,
              4888,
              4884,
              4885,
              4891,
              4889,
              4897,
              4899,
              4895,
              4902,
              4902,
              4907,
              4914,
              4907,
              4915,
              4911,
              4920,
              4923,
              4917,
              4924,
              4921,
              4927,
              4931,
              4932,
              4936,
              4933,
              4936,
              4939,
              4937,
              4941,
              4938,
              4947,
              4945,
              4950,
              4955,
              4953,
              4960,
              4954,
              4960,
              4962,
              4958,
              4965,
              4965,
              4967,
              4968,
              4971,
              4975,
              4971,
              4978,
              4979,
              4977,
              4981,
              4982,
              4987,
              4986,
              4988,
              4992,
              4990,
              4993,
              4995,
              4996,
              4999,
              4993,
              5003,
              4999,
              5006,
              5005,
              5005
            ]
          },
          {
            "time": "1498407781762",
            "light_intensity": 11.7,
            "r": 9,
            "g": 4,
            "b": 2,
            "light_intensity_raw": 15,
            "temperature": 24.33,
            "humidity": 40.298,
            "pressure": 985.766,
            "temperature2": 24.48,
            "humidity2": 39.652,
            "pressure2": 986.232,
            "contactless_temp": 22.15,
            "air_flow": 370,
            "data_raw": [
              55085,
              55049,
              55052,
              55043,
              55019,
              55033,
              55027,
              55053,
              55048,
              55047,
              55049,
              55047,
              55045,
              55045,
              55030,
              55055,
              55043,
              55013,
              55047,
              55025,
              55023,
              55035,
              55020,
              55053,
              55048,
              55034,
              55051,
              55015,
              55021,
              55043,
              55031,
              55031,
              55039,
              55050,
              55042,
              55077,
              55033,
              55027,
              55037,
              55031,
              55059,
              55033,
              55046,
              55065,
              55059,
              55077,
              55059,
              55061,
              55063,
              55060,
              55065,
              55065,
              55061,
              55053,
              55071,
              55069,
              55063,
              55072,
              55077,
              55075,
              55071,
              55079,
              55068,
              55077,
              55078,
              55082,
              55068,
              55070,
              55061,
              55055,
              55065,
              55081,
              55064,
              55069,
              55050,
              55053,
              55069,
              55075,
              55057,
              55072,
              55076,
              55072,
              55058,
              55051,
              55057,
              55066,
              55063,
              55059,
              55069,
              55075,
              55062,
              55050,
              55049,
              55057,
              55060,
              55053,
              55063,
              55051,
              55032,
              55043,
              55044,
              55055,
              55037,
              55038,
              55075,
              55081,
              55069,
              55073,
              55073,
              55058,
              55057,
              55064,
              55093,
              55062,
              55068,
              55076,
              55052,
              55068,
              55060,
              55042,
              55047,
              55041,
              55063,
              55067,
              55077,
              55079,
              55070,
              55052,
              55063,
              55070,
              55049,
              55060,
              55057,
              55044,
              55049,
              55039,
              55050,
              55061,
              55058,
              55058,
              55059,
              55054,
              55048,
              55063,
              55057,
              55066,
              55058,
              55071,
              55057,
              55071,
              55057,
              55079,
              55063,
              55063,
              55067,
              55063,
              55059,
              55061,
              55065,
              55067,
              55061,
              55072,
              55059,
              55054,
              55071,
              55068,
              55072,
              55047,
              55104,
              55064,
              55049,
              55080,
              55061,
              55071,
              55065,
              55056,
              55068,
              55051,
              55066,
              55067,
              55082,
              55063,
              55062,
              55053,
              55070,
              55078,
              55067,
              55079,
              55066,
              55071,
              55074,
              55055,
              55055,
              55054,
              55078,
              55078,
              55079,
              55071,
              55070,
              55047,
              55085,
              55063,
              55069,
              55068,
              55068,
              55075,
              55077,
              55077,
              55082,
              55077,
              55063,
              55059,
              55072,
              55051,
              55057,
              55064,
              55075,
              55059,
              55071,
              55069,
              55093,
              55059,
              55075,
              55081,
              55080,
              55077,
              55082,
              55067,
              55079,
              55071,
              55060,
              55068,
              55074,
              55071,
              55071,
              55063,
              55074,
              55051,
              55079,
              55071,
              55067,
              55060,
              55055,
              55073,
              55055,
              55049,
              55070,
              55055,
              55077,
              55059,
              55078,
              55073,
              55071,
              55078,
              55080,
              55091,
              55078,
              55077,
              55086,
              55071,
              55053,
              55071,
              55063,
              55075,
              55049,
              55071,
              55054,
              55075,
              55056,
              55061,
              55082,
              55057,
              55076,
              55075,
              55091,
              55077,
              55059,
              55073,
              55085,
              55076,
              55078,
              55079,
              55087,
              55040,
              55079,
              55080,
              55104,
              55075,
              55082,
              55096,
              55077,
              55098,
              55071,
              55077,
              55054,
              55075,
              55066,
              55077,
              55079,
              55063,
              55072,
              55057,
              55065,
              55074,
              55066,
              55075,
              55062,
              55065,
              55081,
              55064,
              55053,
              55064,
              55043,
              55074,
              55075,
              55056,
              55053,
              55051,
              55077,
              55062,
              55083,
              55064,
              55075,
              55066,
              55058,
              55075,
              55062,
              55075,
              55075,
              55052,
              55061,
              55063,
              55054,
              55070,
              55058,
              55081,
              55064,
              55068,
              55045,
              55057,
              55078,
              55068,
              55086,
              55079,
              55086,
              55078,
              55063,
              55079,
              55077,
              55070,
              55063,
              55072,
              55079,
              55059,
              55069,
              55078,
              55072,
              55079,
              55069,
              55073,
              55073,
              55081,
              55073,
              55055,
              55090,
              55069,
              55074,
              55089,
              55074,
              55109,
              55087,
              55074,
              55110,
              55077,
              55087,
              55078,
              55078,
              55079,
              55087,
              55066,
              55062,
              55079,
              55076,
              55076,
              55075,
              55063,
              55074,
              55057,
              55069,
              55068,
              55083,
              55065,
              55087,
              55084,
              55079,
              55065,
              55077,
              55067,
              55078,
              55081,
              55074,
              55065,
              55070,
              55038,
              55064,
              55062,
              55055,
              55054,
              55071,
              55073,
              55057,
              55075,
              55073,
              55081,
              55082,
              55074,
              55083,
              55080,
              55093,
              55067,
              55082,
              55057,
              55063,
              55077,
              55080,
              55091,
              55045,
              55052,
              55047,
              55071,
              55057,
              55056,
              55067,
              55085,
              55072,
              55068,
              55078,
              55077,
              55074,
              55081,
              55093,
              55090,
              55078,
              55065,
              55073,
              55079,
              55076,
              55064,
              55051,
              55063,
              55081,
              55070,
              55062,
              55063,
              55072,
              55058,
              55079,
              55060,
              55075,
              55067,
              55092,
              55082,
              55086,
              55089,
              55088,
              55070,
              55062,
              55073,
              55087,
              55081,
              55051,
              55085,
              55061,
              55087,
              55055,
              55074,
              55087,
              55085,
              55080,
              55075,
              55079,
              55077,
              55082,
              55073,
              55071,
              55091,
              55060,
              55091,
              55086,
              55092,
              55079,
              55088,
              55087,
              55087,
              55077,
              55089,
              55075,
              55087,
              55100,
              55077,
              55074,
              55053,
              55070,
              55066,
              55065,
              55077,
              55081,
              55077,
              55072,
              55080,
              55083,
              55077,
              55057,
              55041,
              55062,
              55075,
              55055,
              55096,
              55043,
              55065,
              55050,
              55063,
              55075,
              55062,
              55051,
              55077,
              55075,
              55059,
              55071,
              55074,
              55063,
              55086,
              55055,
              55077,
              55066,
              55064,
              55073,
              55059,
              55057,
              55070,
              55045,
              55066,
              55065,
              55077,
              55078,
              55071,
              55076,
              55059,
              55079,
              55083,
              55089,
              55085,
              55071,
              55090,
              55080,
              55077,
              55079,
              55063,
              55060,
              55055,
              55069,
              55058,
              55083,
              55077,
              55082,
              55078,
              55061,
              55097,
              55068,
              55067,
              55082,
              55067,
              55039,
              55083,
              55074,
              55085,
              55067,
              55087,
              55081,
              55063,
              55062,
              55078,
              55080,
              55085,
              55075,
              55079,
              55069,
              55077,
              55079,
              55105,
              55089,
              55075,
              55075,
              55087,
              55093,
              55095,
              55084,
              55099,
              55078,
              55076,
              55089,
              55085,
              55107,
              55067,
              55086,
              55099,
              55081,
              55091,
              55067,
              55087,
              55080,
              55088,
              55111,
              55081,
              55063,
              55053,
              55066,
              55083,
              55062,
              55090,
              55076,
              55095,
              55086,
              55091,
              55083,
              55071,
              55091,
              55060,
              55066,
              55076,
              55061,
              55097,
              55091,
              55078,
              55071,
              55062,
              55073,
              55056,
              55059,
              55069,
              55079,
              55066,
              55077,
              55076,
              55071,
              55087,
              55077,
              55087,
              55089,
              55055,
              55078,
              55075,
              55070,
              55072,
              55074,
              55069,
              55079,
              55093,
              55075,
              55089,
              55114,
              55086,
              55090,
              55063,
              55096,
              55072,
              55076,
              55094,
              55112,
              55104,
              55087,
              55060,
              55059,
              55061,
              55067,
              55077,
              55068,
              55079,
              55063,
              55077,
              55072,
              55074,
              55074,
              55072,
              55077,
              55090,
              55060,
              55075,
              55075,
              55104,
              55071,
              55086,
              55087,
              55074,
              55091,
              55058,
              55064,
              55080,
              55065,
              55077,
              55086,
              55085,
              55067,
              55047,
              55057,
              55075,
              55073,
              55077,
              55054,
              55078,
              55065,
              55076,
              55083,
              55071,
              55087,
              55091,
              55095,
              55073,
              55085,
              55077,
              55083,
              55045,
              55058,
              55065,
              55043,
              55094,
              55087,
              55095,
              55087,
              55074,
              55064,
              55090,
              55071,
              55082,
              55079,
              55085,
              55091,
              55083,
              55103,
              55075,
              55077,
              55079,
              55077,
              55073,
              55070,
              55079,
              55051,
              55082,
              55075,
              55066,
              55079,
              55091,
              55091,
              55066,
              55066,
              55101,
              55073,
              55071,
              55067,
              55063,
              55087,
              55087,
              55093,
              55083,
              55097,
              55091,
              55098,
              55094,
              55086,
              55096,
              55075,
              55065,
              55079,
              55087,
              55078,
              55085,
              55077,
              55061,
              55086,
              55079,
              55084,
              55071,
              55079,
              55069,
              55047,
              55055,
              55079,
              55073,
              55077,
              55062,
              55092,
              55059,
              55081,
              55086,
              55085,
              55087,
              55092,
              55094,
              55071,
              55077,
              55073,
              55091,
              55082,
              55111,
              55087,
              55079,
              55090,
              55084,
              55070,
              55081,
              55087,
              55087,
              55076,
              55056,
              55061,
              55087,
              55089,
              55084,
              55082,
              55068,
              55085,
              55083,
              55087,
              55062,
              55073,
              55052,
              55079,
              55085,
              55085,
              55083,
              55095,
              55070,
              55071,
              55087,
              55085,
              55078,
              55074,
              55077,
              55069,
              55065,
              55077,
              55084,
              55085,
              55092,
              55087,
              55080,
              55083,
              55088,
              55069,
              55081,
              55079,
              55100,
              55090,
              55090,
              55094,
              55091,
              55106,
              55114,
              55078,
              55095,
              55087,
              55083,
              55090,
              55075,
              55075,
              55063,
              55079,
              55075,
              55062,
              55077,
              55058,
              55068,
              55069,
              55077,
              55087,
              55069,
              55075,
              55057,
              55079,
              55074,
              55095,
              55082,
              55072,
              55070,
              55086,
              55105,
              55095,
              55090,
              55071,
              55092,
              55079,
              55096,
              55083,
              55090,
              55103,
              55091,
              55083,
              55089,
              55087,
              55077,
              55108,
              55095,
              55092,
              55088,
              55086,
              55104,
              55107,
              55110,
              55109,
              55095,
              55086,
              55091,
              55075,
              55097,
              55073,
              55103,
              55086,
              55093,
              55089,
              55095,
              55100,
              55094,
              55087,
              55104,
              55096,
              55094,
              55078,
              55094,
              55082,
              55095,
              55105,
              55095,
              55103,
              55099,
              55091,
              55113,
              55081,
              55095,
              55093,
              55094,
              55088,
              55109,
              55109,
              55099,
              55129,
              55115,
              55115,
              55127,
              55111,
              55103,
              55083,
              55095,
              55091,
              55108,
              55091,
              55110,
              55084,
              55092,
              55097,
              55107,
              55109,
              55116,
              55070,
              55107,
              55114,
              55108,
              55108,
              55109,
              55110,
              55094,
              55095,
              55119,
              55102,
              55116,
              55099,
              55113,
              55102,
              55084,
              55082,
              55101,
              55106,
              55088,
              55100,
              55117,
              55084,
              55095,
              55111,
              55084,
              55103,
              55089,
              55092,
              55096,
              55079,
              55090,
              55091,
              55094,
              55101,
              55062,
              55098,
              55078,
              55085,
              55086,
              55079,
              55093,
              55085,
              55078,
              55071,
              55091,
              55087,
              55090,
              55089,
              55091,
              55089,
              55111,
              55084,
              55099,
              55090,
              55094,
              55107,
              55100,
              55099,
              55107,
              55093,
              55097,
              55102,
              55097,
              55085,
              55111,
              55089,
              55095,
              55106,
              55104,
              55121,
              55098,
              55083,
              55105,
              55076,
              55100,
              55094,
              55111,
              55111,
              55079,
              55085,
              55086,
              55109,
              55099,
              55085,
              55103,
              55101,
              55109,
              55103,
              55113,
              55101,
              55102,
              55095,
              55108,
              55103,
              55108,
              55119,
              55112,
              55107,
              55105,
              55120,
              55127,
              55118,
              55112,
              55107,
              55100,
              55121,
              55124,
              55097,
              55109,
              55097,
              55114,
              55110,
              55116,
              55113,
              55105,
              55115,
              55097,
              55119,
              55073,
              55103,
              55098,
              55077,
              55110,
              55121,
              55081,
              55106,
              55085,
              55094,
              55071,
              55087,
              55095,
              55094,
              55097,
              55115,
              55099,
              55101,
              55104,
              55140,
              55108,
              55117,
              55109,
              55116,
              55111,
              55102,
              55097,
              55091,
              55101,
              55115,
              55124,
              55105,
              55128,
              55096,
              55107,
              55083,
              55111,
              55094,
              55110,
              55101,
              55099,
              55118,
              55117,
              55123,
              55125,
              55115,
              55138,
              55111,
              55113,
              55117,
              55131,
              55115,
              55103,
              55113,
              55099,
              55139,
              55115,
              55111,
              55119,
              55099,
              55134,
              55106,
              55111,
              55121,
              55119,
              55108,
              55122,
              55125,
              55135,
              55111,
              55127,
              55107,
              55130,
              55129,
              55136,
              55139,
              55115,
              55125,
              55119,
              55126,
              55107,
              55108,
              55118,
              55111,
              55108,
              55103,
              55082,
              55129,
              55111,
              55105,
              55105,
              55089,
              55101,
              55095,
              55089,
              55111,
              55103,
              55119,
              55101,
              55083,
              55118,
              55087,
              55106,
              55110,
              55109,
              55112,
              55106,
              55100,
              55086,
              55108,
              55099,
              55128,
              55101,
              55110,
              55108,
              55103,
              55120,
              55127,
              55098,
              55114,
              55113,
              55119,
              55107,
              55127,
              55111,
              55089,
              55099,
              55095,
              55130,
              55133,
              55106,
              55109,
              55116,
              55136,
              55103,
              55119,
              55113,
              55109,
              55127,
              55123,
              55114,
              55116,
              55095,
              55136,
              55103,
              55118,
              55107,
              55113,
              55131,
              55113,
              55127,
              55129,
              55131,
              55122,
              55122,
              55126,
              55138,
              55125,
              55121,
              55117,
              55134,
              55138,
              55131,
              55123,
              55125,
              55145,
              55131,
              55141,
              55126,
              55133,
              55136,
              55095,
              55116,
              55115,
              55129,
              55119,
              55123,
              55125,
              55110,
              55133,
              55123,
              55128,
              55127,
              55103,
              55136,
              55123,
              55139,
              55135,
              55134,
              55144,
              55138,
              55167,
              55135,
              55131,
              55154,
              55143,
              55157,
              55142,
              55143,
              55118,
              55128,
              55123,
              55128,
              55119,
              55124,
              55136,
              55137,
              55119,
              55106,
              55133,
              55126,
              55137,
              55145,
              55123,
              55141,
              55130,
              55129,
              55118,
              55130,
              55117,
              55125,
              55135,
              55151,
              55153,
              55132,
              55137,
              55123,
              55128,
              55139,
              55150,
              55121,
              55119,
              55116,
              55129,
              55132,
              55137,
              55157,
              55127,
              55141,
              55162,
              55143,
              55155,
              55124,
              55124,
              55107,
              55129,
              55139,
              55109,
              55127,
              55119,
              55108,
              55128,
              55131,
              55113,
              55120,
              55119,
              55129,
              55116,
              55127,
              55127,
              55127,
              55123,
              55127,
              55132,
              55141,
              55129,
              55126,
              55127,
              55108,
              55125,
              55141,
              55131,
              55134,
              55097,
              55135,
              55110,
              55148,
              55135,
              55127,
              55134,
              55138,
              55117,
              55131,
              55124,
              55120,
              55131,
              55133,
              55140,
              55133,
              55114,
              55130,
              55120,
              55114,
              55101,
              55131,
              55140,
              55127,
              55127,
              55140,
              55135,
              55141,
              55142,
              55139,
              55147,
              55142,
              55138,
              55142,
              55130,
              55143,
              55169,
              55143,
              55151,
              55149,
              55146,
              55139,
              55154,
              55143,
              55139,
              55142,
              55155,
              55131,
              55152,
              55112,
              55131,
              55139,
              55159,
              55145,
              55145,
              55163,
              55143,
              55150,
              55159,
              55131,
              55123,
              55146,
              55155,
              55160,
              55131,
              55139,
              55127,
              55121,
              55145,
              55159,
              55143,
              55137,
              55146,
              55150,
              55126,
              55111,
              55115,
              55150,
              55155,
              55126,
              55121,
              55137,
              55109,
              55144,
              55138,
              55147,
              55146,
              55137,
              55135,
              55147,
              55143,
              55137,
              55122,
              55141,
              55145,
              55133,
              55113,
              55124,
              55142,
              55156,
              55142,
              55135,
              55154,
              55154,
              55139,
              55152,
              55147,
              55127,
              55135,
              55135,
              55120,
              55159,
              55168,
              55143,
              55167,
              55150,
              55149,
              55154,
              55145,
              55147,
              55136,
              55134,
              55127,
              55136,
              55129,
              55147,
              55124,
              55131,
              55143,
              55141,
              55141,
              55131,
              55125,
              55127,
              55125,
              55151,
              55155,
              55119,
              55133,
              55151,
              55145,
              55142,
              55139,
              55140,
              55175,
              55155,
              55157,
              55133,
              55157,
              55160,
              55159,
              55133,
              55140,
              55142,
              55145,
              55157,
              55139,
              55141,
              55143,
              55135,
              55147,
              55132,
              55123,
              55132,
              55125,
              55132,
              55132,
              55133,
              55150,
              55117,
              55123,
              55125,
              55155,
              55149,
              55180,
              55151,
              55143,
              55157,
              55147,
              55142,
              55143,
              55143,
              55112,
              55125,
              55146,
              55142,
              55197,
              55141,
              55127,
              55139,
              55158,
              55137,
              55143,
              55134,
              55158,
              55142,
              55134,
              55143,
              55107,
              55151,
              55140,
              55144,
              55133,
              55157,
              55166,
              55145,
              55166,
              55161,
              55141,
              55143,
              55154,
              55142,
              55149,
              55160,
              55144,
              55157,
              55124,
              55139,
              55155,
              55171,
              55150,
              55162,
              55162,
              55139,
              55141,
              55144,
              55139,
              55139,
              55143,
              55141,
              55111,
              55131,
              55129,
              55127,
              55145,
              55145,
              55156,
              55141,
              55142,
              55142,
              55153,
              55136,
              55139,
              55146,
              55162,
              55183,
              55158,
              55167,
              55137,
              55163,
              55172,
              55187,
              55161,
              55137,
              55127,
              55165,
              55147,
              55148,
              55167,
              55157,
              55176,
              55155,
              55153,
              55159,
              55146,
              55159,
              55160,
              55149,
              55165,
              55153,
              55175,
              55143,
              55165,
              55147,
              55156,
              55158,
              55151,
              55161,
              55143,
              55146,
              55159,
              55151,
              55145,
              55145,
              55161,
              55159
            ]
          },
          {
            "time": "1498407784913",
            "light_intensity": 11.7,
            "r": 9,
            "g": 4,
            "b": 2,
            "light_intensity_raw": 15,
            "temperature": 24.35,
            "humidity": 40.312,
            "pressure": 985.747,
            "temperature2": 24.51,
            "humidity2": 39.666,
            "pressure2": 986.217,
            "contactless_temp": 22.39,
            "thickness": 0.57,
            "compass_direction": "W",
            "compass": 270,
            "angle": 32.686,
            "angle_direction": "N",
            "pitch": 31.67,
            "roll": -8.54,
            "air_flow": 390,
            "data_raw": [
              673,
              814,
              874,
              868,
              863,
              845,
              843,
              836,
              831,
              829,
              819,
              823,
              817,
              824,
              817,
              822,
              819,
              819,
              821,
              815,
              818,
              815,
              818,
              808,
              818,
              811,
              816,
              811,
              811,
              811,
              815,
              815,
              812,
              816,
              809,
              812,
              807,
              816,
              813,
              817,
              815,
              814,
              820,
              814,
              820,
              814,
              822,
              816,
              818,
              825,
              821,
              825,
              819,
              826,
              819,
              829,
              828,
              828,
              828,
              823,
              829,
              823,
              833,
              828,
              833,
              831,
              830,
              837,
              831,
              833,
              829,
              837,
              834,
              838,
              836,
              836,
              840,
              837,
              841,
              837,
              844,
              839,
              839,
              841,
              839,
              842,
              844,
              843,
              843,
              844,
              846,
              845,
              847,
              849,
              847,
              849,
              844,
              849,
              846,
              849,
              1553,
              1635,
              1679,
              1707,
              1727,
              1739,
              1753,
              1764,
              1773,
              1780,
              1787,
              1794,
              1795,
              1802,
              1807,
              1805,
              1811,
              1815,
              1812,
              1816,
              1820,
              1823,
              1818,
              1818,
              1823,
              1823,
              1820,
              1822,
              1825,
              1823,
              1824,
              1824,
              1826,
              1825,
              1826,
              1824,
              1825,
              1824,
              1824,
              1825,
              1824,
              1825,
              1826,
              1826,
              1828,
              1825,
              1825,
              1827,
              1831,
              1827,
              1829,
              1829,
              1831,
              1829,
              1829,
              1829,
              1829,
              1825,
              1827,
              1825,
              1823,
              1825,
              1823,
              1823,
              1823,
              1824,
              1824,
              1817,
              1819,
              1817,
              1824,
              1818,
              1819,
              1817,
              1819,
              1811,
              1809,
              1807,
              1809,
              1811,
              1810,
              1811,
              1805,
              1801,
              1804,
              1806,
              1807,
              1800,
              1798,
              1798,
              1512,
              1275,
              1160,
              1092,
              1053,
              1022,
              998,
              989,
              979,
              968,
              965,
              959,
              959,
              955,
              947,
              544,
              527,
              513,
              509,
              496,
              493,
              488,
              482,
              483,
              481,
              478,
              469,
              470,
              477,
              474,
              471,
              1082,
              1208,
              1264,
              1287,
              1300,
              1306,
              1310,
              1313,
              1317,
              1318,
              1319,
              1320,
              1325,
              1324,
              1323,
              1322,
              1321,
              1322,
              1319,
              1323,
              1321,
              1324,
              1326,
              1324,
              1330,
              1323,
              1329,
              1325,
              1324,
              1316,
              1319,
              1320,
              1319,
              1323,
              1321,
              1322,
              1323,
              1322,
              1323,
              1322,
              1323,
              1323,
              1323,
              1328,
              1317,
              1315,
              1313,
              1314,
              1314,
              1317,
              1315,
              1315,
              1315,
              1311,
              1310,
              1310,
              1311,
              1309,
              1311,
              1303,
              1300,
              1299,
              1302,
              1300,
              1299,
              1299,
              1300,
              1298,
              1299,
              1298,
              1295,
              1293,
              1293,
              1290,
              1135,
              1007,
              940,
              900,
              869,
              852,
              835,
              830,
              825,
              819,
              813,
              804,
              803,
              800,
              799,
              55202,
              55177,
              55190,
              55189,
              55193,
              55179,
              55187,
              55169,
              55176,
              55179,
              55215,
              55186,
              55193,
              55181,
              55199,
              55167,
              55183,
              55186,
              55183,
              55189,
              55193,
              55184,
              55195,
              55198,
              55208,
              55191,
              55191,
              55205,
              55209,
              55206,
              55183,
              55227,
              55199,
              55198,
              55193,
              55207,
              55199,
              55199,
              55231,
              55216,
              55231,
              55213,
              55215,
              55214,
              55239,
              55223,
              55212,
              55217,
              55202,
              55241,
              55238,
              55225,
              55237,
              55207,
              55260,
              55244,
              55252,
              55233,
              55237,
              55239,
              55247,
              55243,
              55215,
              55230,
              55237,
              55221,
              55247,
              55239,
              55238,
              55244,
              55234,
              55239,
              55251,
              55261,
              55249,
              55246,
              55239,
              55224,
              55210,
              55225,
              55203,
              55222,
              55227,
              55223,
              55239,
              55231,
              55222,
              55228,
              55220,
              55229,
              55237,
              55211,
              55229,
              55234,
              55227,
              55247,
              55272,
              55254,
              55260,
              55251,
              55011,
              55043,
              55056,
              55100,
              55108,
              55155,
              55166,
              55181,
              55206,
              55213,
              55226,
              55215,
              55242,
              55254,
              55245,
              55257,
              55241,
              55255,
              55264,
              55265,
              55243,
              55249,
              55238,
              55286,
              55251,
              55266,
              55280,
              55258,
              55247,
              55274,
              55271,
              55258,
              55261,
              55247,
              55269,
              55279,
              55283,
              55283,
              55261,
              55275,
              55275,
              55324,
              55277,
              55302,
              55292,
              55274,
              55302,
              55283,
              55304,
              55292,
              55322,
              55309,
              55308,
              55283,
              55297,
              55295,
              55307,
              55324,
              55291,
              55311,
              55295,
              55314,
              55296,
              55312,
              55323,
              55303,
              55297,
              55312,
              55307,
              55308,
              55325,
              55314,
              55310,
              55289,
              55329,
              55351,
              55334,
              55314,
              55322,
              55331,
              55321,
              55327,
              55320,
              55319,
              55320,
              55319,
              55293,
              55327,
              55315,
              55316,
              55327,
              55320,
              55331,
              55323,
              55312,
              55269,
              55325,
              55343,
              55333,
              55328,
              55306,
              55325,
              55321,
              55312,
              55311,
              54918,
              55010,
              55033,
              55066,
              55097,
              55080,
              55151,
              55126,
              55160,
              55162,
              55183,
              55175,
              55163,
              55179,
              55195,
              54954,
              54885,
              54895,
              54866,
              54854,
              54876,
              54869,
              54883,
              54873,
              54882,
              54875,
              54896,
              54887,
              54917,
              54892,
              54928,
              54931,
              54959,
              54951,
              54973,
              54990,
              54979,
              54981,
              55007,
              55018,
              55012,
              55027,
              55053,
              55065,
              55071,
              55076,
              55111,
              55111,
              55131,
              55119,
              55153,
              55165,
              55152,
              55180,
              55189,
              55183,
              55198,
              55220,
              55225,
              55245,
              55257,
              55274,
              55254,
              55262,
              55279,
              55302,
              55285,
              55278,
              55315,
              55309,
              55314,
              55290,
              55325,
              55338,
              55308,
              55304,
              55330,
              55313,
              55325,
              55350,
              55353,
              55351,
              55318,
              55353,
              55372,
              55385,
              55350,
              55340,
              55375,
              55350,
              55389,
              55402,
              55409,
              55430,
              55412,
              55387,
              55409,
              55403,
              55413,
              55405,
              55419,
              55403,
              55387,
              55403,
              55403
            ]
          },
          {
            "time": "1498407797751",
            "light_intensity": 15.825,
            "r": 15,
            "g": 6,
            "b": 4,
            "light_intensity_raw": 24,
            "temperature": 24.45,
            "humidity": 40.439,
            "pressure": 985.813,
            "temperature2": 24.61,
            "humidity2": 39.75,
            "pressure2": 986.213,
            "contactless_temp": 22.87,
            "thickness": 0.55,
            "compass_direction": "W",
            "compass": 270,
            "angle": 32.367,
            "angle_direction": "NE",
            "pitch": 29.85,
            "roll": -13.14,
            "air_flow": 390,
            "data_raw": [

            ]
          },
          {
            "time": "1498407798635",
            "light_intensity": 16.701,
            "r": 13,
            "g": 6,
            "b": 3,
            "light_intensity_raw": 23,
            "temperature": 24.46,
            "humidity": 40.451,
            "pressure": 985.83,
            "temperature2": 24.61,
            "humidity2": 39.762,
            "pressure2": 986.262,
            "contactless_temp": 22.87,
            "thickness": 0.55,
            "compass_direction": "W",
            "compass": 270,
            "angle": 31.675,
            "angle_direction": "NE",
            "pitch": 29.36,
            "roll": -12.45,
            "air_flow": 370,
            "data_raw": [

            ]
          },
          {
            "time": "1498407799519",
            "light_intensity": 16.701,
            "r": 13,
            "g": 6,
            "b": 3,
            "light_intensity_raw": 23,
            "temperature": 24.47,
            "humidity": 40.485,
            "pressure": 985.798,
            "temperature2": 24.62,
            "humidity2": 39.794,
            "pressure2": 986.25,
            "contactless_temp": 22.87,
            "thickness": 0.55,
            "compass_direction": "W",
            "compass": 270,
            "angle": 31.473,
            "angle_direction": "NE",
            "pitch": 29.32,
            "roll": -11.99,
            "air_flow": 390,
            "data_raw": [

            ]
          },
          {
            "time": "1498407800404",
            "detector_read1": 13139,
            "detector_read2": 3795,
            "light_intensity": 16.701,
            "r": 13,
            "g": 6,
            "b": 3,
            "light_intensity_raw": 23,
            "temperature": 24.48,
            "humidity": 40.529,
            "pressure": 985.816,
            "temperature2": 24.63,
            "humidity2": 39.817,
            "pressure2": 986.29,
            "contactless_temp": 22.95,
            "thickness": 0.54,
            "compass_direction": "W",
            "compass": 270,
            "angle": 32.061,
            "angle_direction": "NE",
            "pitch": 29.53,
            "roll": -13.08,
            "air_flow": 370,
            "recall": {
              "time": "1498407801258",
              "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": [
              1412,
              1271,
              1272,
              1270,
              1269,
              339,
              397,
              396,
              398,
              395,
              2133,
              1186,
              1181,
              1179,
              1177,
              141,
              94,
              91,
              93,
              94,
              38495,
              11476,
              11412,
              11410,
              11399,
              13306,
              11994,
              11992,
              11994,
              12000,
              18078,
              11707,
              11689,
              11692,
              11689,
              17276,
              11505,
              11491,
              11488,
              11492,
              9204,
              10997,
              11005,
              11004,
              11007,
              1971,
              2447,
              2450,
              2449,
              2448,
              6796,
              8835,
              8836,
              8836,
              8830,
              293,
              370,
              369,
              367,
              364,
              31684,
              40096,
              40110,
              40113,
              40115,
              34862,
              44539,
              44557,
              44563,
              44564,
              29724,
              39151,
              39163,
              39158,
              39169,
              28975,
              38320,
              38317,
              38311,
              38295,
              36666,
              45517,
              45524,
              45526,
              45528,
              4541,
              5649,
              5652,
              5660,
              5661,
              29401,
              42486,
              42490,
              42482,
              42479,
              941,
              1302,
              1301,
              1300,
              1303,
              40127,
              40115,
              40112,
              40105,
              40110,
              44569,
              44559,
              44560,
              44567,
              44555,
              39179,
              39172,
              39180,
              39181,
              39183,
              38347,
              38326,
              38313,
              38303,
              38295,
              1281,
              1273,
              1274,
              1265,
              1261,
              396,
              401,
              396,
              398,
              393,
              1187,
              1183,
              1183,
              1178,
              1173,
              95,
              95,
              93,
              93,
              90,
              11866,
              11437,
              11411,
              11405,
              11395,
              12013,
              11996,
              11997,
              12001,
              12007,
              11823,
              11695,
              11691,
              11693,
              11692,
              11593,
              11498,
              11487,
              11489,
              11491,
              10987,
              11002,
              11005,
              11003,
              11012,
              2446,
              2448,
              2450,
              2448,
              2452,
              8819,
              8833,
              8835,
              8837,
              8830,
              365,
              365,
              367,
              366,
              362,
              39994,
              40110,
              40112,
              40117,
              40114,
              44462,
              44545,
              44558,
              44571,
              44561,
              39023,
              39163,
              39161,
              39172,
              39170,
              38230,
              38323,
              38322,
              38299,
              38289,
              45460,
              45525,
              45523,
              45528,
              45530,
              5632,
              5652,
              5659,
              5658,
              5660,
              42347,
              42494,
              42486,
              42479,
              42471,
              1296,
              1303,
              1301,
              1300,
              1305,
              40123,
              40119,
              40105,
              40108,
              40111,
              44570,
              44561,
              44564,
              44557,
              44558,
              39175,
              39174,
              39180,
              39179,
              39180,
              38337,
              38318,
              38302,
              38303,
              38293
            ]
          },
          {
            "time": "1498407801284",
            "air_flow": 350,
            "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",
  "ConsoleMacro": "334"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
0
Latest Update:
Jun 2017