RIDES1_2_macro_2


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 type
var calib_set=1;

// 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[3].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[3].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[3].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[3].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[3].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[4].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[4].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[5].data_raw.slice(0,310);
  data=json.set[5].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[5].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[5].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[1].humidity,json.set[2].humidity,
                        json.set[3].humidity,json.set[4].humidity,
                        json.set[5].humidity,json.set[6].humidity,
                        json.set[7].humidity,json.set[8].humidity
                       ];
  	output.humidity_kinetics=humidity_kinetics;
  
   // changes in leaf contactless_temp
  
    var air_temp_kinetics=[json.set[1].temperature,
                                json.set[2].temperature, 
                                json.set[3].temperature, 
                                json.set[4].temperature, 
                                json.set[5].temperature, 
                                json.set[6].temperature, 
                                json.set[7].temperature, 
                       ];
    
     var contactless_temp_kinetics=[json.set[1].contactless_temp,
                                json.set[2].contactless_temp,
                                json.set[3].contactless_temp,
                                json.set[4].contactless_temp,
                                json.set[5].contactless_temp,
                                json.set[6].contactless_temp,
                                json.set[7].contactless_temp
                       ];
  
  output.air_temp_kinetics=air_temp_kinetics;
  
  output.contactless_temp_kinetics=contactless_temp_kinetics;

 var light_intensity=json.set[3].light_intensity;
  output.light_intensity= light_intensity;                       
  var ambient_RH=json.set[1].humidity;
  output.ambient_RH=MathROUND(ambient_RH,3);
  var ambient_temperature=json.set[1].temperature;
  output.ambient_temperature=ambient_temperature;
  var leaf_RH=json.set[7].humidity;
  output.leaf_RH=MathROUND(leaf_RH, 2);
  leaf_temperature = json.set[3].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[9].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[9].data_raw.slice((abs_starts + i*pulses+2),(abs_starts + i*pulses+8)));
 var value2 = MathMEDIAN(json.set[9].data_raw.slice((abs_starts + i*pulses+82),(abs_starts + i*pulses+88)));
 var value3 = MathMEDIAN(json.set[9].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;
 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.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.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[9].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[9].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[9].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[9].recall["colorcal_intensity2_yint[2]"]) / json.set[9].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;
   }
 }
}

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

output.thick1=json.set[2].thickness;
output.thick2=json.set[3].thickness;
output.thick3=json.set[5].thickness;
output.thick4=json.set[9].thickness;


// Return data
return output;
{
  "time": "1497984576481",
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:52:59",
  "device_battery": 92,
  "device_firmware": 1.18,
  "sample": [
    [
      {
        "time": "1497984576481",
        "light_intensity_raw": 0,
        "data_raw": [

        ],
        "protocol_id": 1,
        "set": [
          {
            "time": "1497984576482",
            "blank:": "blank"
          },
          {
            "time": "1497984576492",
            "air_flow": 60,
            "recall": {
              "time": "1497984577158",
              "colorcal_blank1[1]": 19228,
              "colorcal_blank1[2]": 25656.5,
              "colorcal_blank1[3]": 29459.5,
              "colorcal_blank1[4]": 38080,
              "colorcal_blank1[6]": 33643.5,
              "colorcal_blank1[8]": 28535.5,
              "colorcal_blank1[9]": 27631.5,
              "colorcal_blank1[10]": 35334,
              "colorcal_blank2[1]": 21308.5,
              "colorcal_blank2[2]": 19335.5,
              "colorcal_blank2[3]": 23388.5,
              "colorcal_blank2[4]": 18757,
              "colorcal_blank2[6]": 16582,
              "colorcal_blank2[8]": 17330,
              "colorcal_blank2[9]": 18577.5,
              "colorcal_blank2[10]": 16794.5,
              "colorcal_blank3[1]": 19701.5,
              "colorcal_blank3[2]": 10666,
              "colorcal_blank3[3]": 20344.5,
              "colorcal_blank3[4]": 13237.5,
              "colorcal_blank3[6]": 5857,
              "colorcal_blank3[8]": 6289,
              "colorcal_blank3[9]": 5492.5,
              "colorcal_blank3[10]": 6057,
              "colorcal_intensity1_slope[2]": 2.42,
              "colorcal_intensity1_yint[2]": 1.9,
              "colorcal_intensity2_slope[2]": 2.48,
              "colorcal_intensity2_yint[2]": 0.9,
              "colorcal_intensity3_slope[2]": 2.626,
              "colorcal_intensity3_yint[2]": -19,
              "ir_baseline_slope[5]": 9797.5,
              "ir_baseline_yint[5]": 14754.5,
              "ir_baseline_slope[3]": 578.5,
              "ir_baseline_yint[3]": 801.5
            },
            "data_raw": [

            ]
          },
          {
            "time": "1497984578168",
            "air_flow": 430,
            "data_raw": [

            ]
          },
          {
            "time": "1497984579336",
            "air_flow": 550,
            "data_raw": [

            ]
          },
          {
            "time": "1497984580504",
            "light_intensity": 309.26,
            "r": 440,
            "g": 136,
            "b": 96,
            "light_intensity_raw": 638,
            "temperature": 27.74,
            "humidity": 38.103,
            "pressure": 981.814,
            "temperature2": 27.93,
            "humidity2": 38.086,
            "pressure2": 981.917,
            "contactless_temp": 26.67,
            "compass_direction": "E",
            "compass": 90,
            "angle": 17.661,
            "angle_direction": "SE",
            "pitch": 9.19,
            "roll": 15.14,
            "air_flow": 540,
            "data_raw": [

            ]
          },
          {
            "time": "1497984581113",
            "light_intensity": 334.695,
            "r": 481,
            "g": 148,
            "b": 105,
            "light_intensity_raw": 695,
            "temperature": 27.74,
            "humidity": 38.103,
            "pressure": 981.807,
            "temperature2": 27.94,
            "humidity2": 38.097,
            "pressure2": 981.927,
            "contactless_temp": 26.99,
            "thickness": 0.42,
            "compass_direction": "E",
            "compass": 90,
            "angle": 14.545,
            "angle_direction": "E",
            "pitch": 4.42,
            "roll": 13.87,
            "air_flow": 460,
            "data_raw": [

            ]
          },
          {
            "time": "1497984581697",
            "light_intensity": 328.002,
            "r": 470,
            "g": 145,
            "b": 103,
            "light_intensity_raw": 680,
            "temperature": 27.74,
            "humidity": 38.08,
            "pressure": 981.834,
            "temperature2": 27.94,
            "humidity2": 38.108,
            "pressure2": 981.922,
            "contactless_temp": 27.03,
            "thickness": 0.42,
            "air_flow": 370,
            "data_raw": [
              23775,
              23778,
              23777,
              23779,
              23775,
              23771,
              23763,
              23775,
              23774,
              23772,
              23774,
              23770,
              23769,
              23769,
              23774,
              23777,
              23775,
              23776,
              23771,
              23771,
              23769,
              23772,
              23777,
              23778,
              23781,
              23777,
              23770,
              23768,
              23771,
              23775,
              23778,
              23777,
              23777,
              23767,
              23773,
              23775,
              23779,
              23778,
              23779,
              23778,
              23771,
              23774,
              23774,
              23779,
              23779,
              23783,
              23780,
              23773,
              23770,
              23772,
              23779,
              23775,
              23780,
              23780,
              23771,
              23769,
              23767,
              23779,
              23780,
              23777,
              23778,
              23773,
              23770,
              23774,
              23777,
              23780,
              23778,
              23781,
              23779,
              23775,
              23773,
              23779,
              23779,
              23782,
              23784,
              23778,
              23777,
              23775,
              23779,
              23782,
              23782,
              23782,
              23779,
              23773,
              23779,
              23781,
              23781,
              23783,
              23783,
              23782,
              23772,
              23781,
              23778,
              23783,
              23781,
              23786,
              23784,
              23775,
              23777,
              23779,
              23781,
              23783,
              23782,
              23787,
              23780,
              23778,
              23781,
              23786,
              23784,
              23785,
              23785,
              23781,
              23778,
              23781,
              23779,
              23786,
              23788,
              23790,
              23785,
              23779,
              23776,
              23783,
              23785,
              23782,
              23786,
              23779,
              23779,
              23778,
              23783,
              23787,
              23787,
              23787,
              23786,
              23778,
              23781,
              23783,
              23787,
              23785,
              23785,
              23786,
              23778,
              23776,
              23782,
              23783,
              23785,
              23785,
              23787,
              23781,
              23779,
              23780,
              23789,
              23783,
              23783,
              23789,
              23779,
              23779,
              23785,
              23786,
              23787,
              23789,
              23787,
              23779,
              23780,
              23781,
              23786,
              23788,
              23788,
              23787,
              23779,
              23777,
              23781,
              23785,
              23786,
              23782,
              23785,
              23779,
              23782,
              23779,
              23785,
              23790,
              23787,
              23791,
              23782,
              23781,
              23776,
              23783,
              23788,
              23787,
              23787,
              23788,
              23781,
              23779,
              23783,
              23790,
              23787,
              23789,
              23787,
              23779,
              23780,
              23788,
              23787,
              23794,
              23798,
              23801,
              23793,
              23798,
              23804,
              23808,
              23811,
              23814,
              23815,
              23809,
              23816,
              23814,
              23825,
              23822,
              23826,
              23827,
              23819,
              23819,
              23824,
              23821,
              23817,
              23815,
              23811,
              23799,
              23794,
              23791,
              23803,
              23800,
              23795,
              23797,
              23787,
              23783,
              23781,
              23785,
              23792,
              23791,
              23791,
              23783,
              23787,
              23781,
              23784,
              23788,
              23790,
              23788,
              23781,
              23783,
              23781,
              23788,
              23788,
              23791,
              23791,
              23787,
              23783,
              23786,
              23786,
              23782,
              23790,
              23791,
              23787,
              23782,
              23778,
              23782,
              23789,
              23785,
              23790,
              23789,
              23779,
              23779,
              23785,
              23789,
              23785,
              23790,
              23788,
              23780,
              23782,
              23783,
              23789,
              23788,
              23789,
              23793,
              23783,
              23787,
              23789,
              23791,
              23793,
              23793,
              23792,
              23783,
              23783,
              23786,
              23790,
              23791,
              23792,
              23792,
              23783,
              23783,
              23788,
              23788,
              23793,
              23793,
              23790,
              23791,
              23786,
              23785,
              23790,
              23791,
              23790,
              23794,
              23794,
              23786,
              23791,
              23793,
              23794,
              23792,
              23796,
              23795,
              23785,
              23785,
              23790,
              23793,
              23798,
              23799,
              23794,
              23784,
              23787,
              23788,
              23791,
              23794,
              23795,
              23796,
              23787,
              23785,
              23791,
              23797,
              23795,
              23793,
              23797,
              23787,
              23787,
              23792,
              23796,
              23796,
              23795,
              23798,
              23787,
              23790,
              23787,
              23796,
              23791,
              23795,
              23796,
              23787,
              23789,
              23791,
              23794,
              23798,
              23797,
              23798,
              23791,
              23785,
              23790,
              23798,
              23798,
              23795,
              23801,
              23790,
              23790,
              23790,
              23791,
              23798,
              23800,
              23800,
              23795,
              23788,
              23790,
              23797,
              23797,
              23793,
              23802,
              23797,
              23791,
              23791,
              23798,
              23797,
              23797,
              23799,
              23793,
              23787,
              23787,
              23797,
              23797,
              23797,
              23796,
              23796,
              23788,
              23785,
              23796,
              23799,
              23795,
              23796,
              23806,
              23790,
              23790,
              23789,
              23799,
              23797,
              23799,
              23799,
              23791,
              23793,
              23790,
              23796,
              23797,
              23798,
              23802,
              23791,
              23795,
              23795,
              23801,
              23804,
              23805,
              23811,
              23808,
              23812,
              23811,
              23819,
              23825,
              23828,
              23827,
              23826,
              23821,
              23826,
              23829,
              23837,
              23833,
              23838,
              23837,
              23829,
              23832,
              23831,
              23823,
              23821,
              23819,
              23817,
              23809,
              23804,
              23807,
              23807,
              23807,
              23807,
              23803,
              23798,
              23794,
              23799,
              23803,
              23804,
              23805,
              23803,
              23793,
              23789,
              23789,
              23794,
              23797,
              23798,
              23800,
              23792,
              23794,
              23790,
              23797,
              23797,
              23795,
              23797,
              23791,
              23789,
              23793,
              23797,
              23801,
              23798,
              23797,
              23791,
              23792,
              23793,
              23795,
              23796,
              23795,
              23799,
              23793,
              23793,
              23790,
              23793,
              23796,
              23795,
              23799,
              23793,
              23789,
              23790,
              23796,
              23795,
              23793,
              23799,
              23793,
              23790,
              23793,
              23795,
              23798,
              23798,
              23800,
              23800,
              23789,
              23787,
              23795,
              23798,
              23798,
              23799,
              23800,
              23796,
              23794,
              23797,
              23801,
              23801,
              23803,
              23801,
              23792,
              23792,
              23797,
              23800,
              23801,
              23799,
              23799,
              23794,
              23794,
              23791,
              23797,
              23799,
              23803,
              23807,
              23799,
              23795,
              23797,
              23797,
              23805,
              23805,
              23805,
              23794,
              23794,
              23798,
              23799,
              23804,
              23803,
              23808,
              23800,
              23794,
              23798,
              23799,
              23801,
              23799,
              23800,
              23799,
              23796,
              23795,
              23800,
              23803,
              23802,
              23803,
              23805,
              23797,
              23792,
              23799,
              23802,
              23806,
              23807,
              23806,
              23798,
              23793,
              23800,
              23806,
              23804,
              23806,
              23803,
              23794,
              23798,
              23797,
              23804,
              23803,
              23807,
              23805,
              23793,
              23795,
              23797,
              23803,
              23806,
              23806,
              23807,
              23793,
              23795,
              23794,
              23801,
              23804,
              23805,
              23803,
              23803,
              23793,
              23794,
              23799,
              23799,
              23799,
              23803,
              23797,
              23797,
              23797,
              23804,
              23805,
              23804,
              23804,
              23807,
              23796,
              23793,
              23796,
              23804,
              23803,
              23806,
              23804,
              23797,
              23799,
              23798,
              23802,
              23800,
              23802,
              23803,
              23795,
              23799,
              23797,
              23806,
              23805,
              23805,
              23806,
              23797,
              23795,
              23798,
              23807,
              23812,
              23815,
              23821,
              23817,
              23817,
              23813,
              23825,
              23829,
              23831,
              23838,
              23831,
              23828,
              23828,
              23837,
              23840,
              23843,
              23844,
              23841,
              23837,
              23834,
              23829,
              23831,
              23824,
              23822,
              23823,
              23811,
              23809,
              23814,
              23814,
              23813,
              23812,
              23811,
              23803,
              23801,
              23803,
              23805,
              23807,
              23810,
              23808,
              23802,
              23795,
              23802,
              23809,
              23804,
              23807,
              23805,
              23798,
              23797,
              23797,
              23802,
              23804,
              23806,
              23805,
              23799,
              23797,
              23798,
              23807,
              23805,
              23805,
              23807,
              23798,
              23798,
              23800,
              23802,
              23807,
              23804,
              23806,
              23800,
              23796,
              23796,
              23801,
              23805,
              23803,
              23805,
              23803,
              23801,
              23799,
              23803,
              23805,
              23805,
              23806,
              23803,
              23797,
              23801,
              23807,
              23805,
              23806,
              23815,
              23803,
              23802,
              23803,
              23803,
              23803,
              23804,
              23804,
              23805,
              23800,
              23801,
              23807,
              23807,
              23807,
              23807,
              23807,
              23797,
              23794,
              23801,
              23805,
              23804,
              23809,
              23809,
              23795,
              23793,
              23803,
              23808,
              23805,
              23805,
              23807,
              23800,
              23799,
              23802,
              23806,
              23808,
              23811,
              23808,
              23799,
              23799,
              23800,
              23805,
              23807,
              23805,
              23807,
              23799,
              23799,
              23807,
              23808,
              23808,
              23809,
              23810,
              23799,
              23803,
              23803,
              23807,
              23804,
              23807,
              23813,
              23804,
              23804,
              23803,
              23809,
              23810,
              23811,
              23812,
              23804,
              23798,
              23800,
              23808,
              23809,
              23809,
              23811,
              23805,
              23801,
              23798,
              23809,
              23807,
              23807,
              23810,
              23802,
              23803,
              23806,
              23805,
              23809,
              23813,
              23813,
              23807,
              23802,
              23800,
              23805,
              23811,
              23809,
              23814,
              23810,
              23806,
              23807,
              23811,
              23809,
              23809,
              23811,
              23805,
              23805,
              23803,
              23807,
              23812,
              23810,
              23818,
              23811,
              23804,
              23803,
              23805,
              23808,
              23813,
              23813,
              23813,
              23803,
              23806,
              23807,
              23811,
              23811,
              23813,
              23812,
              23802,
              23806,
              23808,
              23807,
              23808,
              23807,
              23811,
              23803,
              23800,
              23804,
              23813,
              23821,
              23820,
              23825,
              23821,
              23823,
              23818,
              23831,
              23835,
              23836,
              23838,
              23839,
              23836,
              23835,
              23841,
              23845,
              23845,
              23844,
              23846,
              23843,
              23834,
              23832,
              23830,
              23827,
              23828,
              23823,
              23813,
              23811,
              23807,
              23815,
              23818,
              23813,
              23815,
              23806,
              23809,
              23811,
              23811,
              23813,
              23812,
              23813,
              23806,
              23806,
              23805,
              23808,
              23810,
              23810,
              23814,
              23806,
              23803,
              23805,
              23811,
              23811,
              23815,
              23811,
              23805,
              23807,
              23802,
              23809,
              23808,
              23810,
              23809,
              23808,
              23804,
              23808,
              23811,
              23809,
              23809,
              23809,
              23805,
              23805,
              23805,
              23807,
              23811,
              23810,
              23815,
              23808,
              23803,
              23807,
              23806,
              23806,
              23813,
              23814,
              23811,
              23805,
              23805,
              23807,
              23811,
              23812,
              23811,
              23810,
              23799,
              23806,
              23801,
              23808,
              23809,
              23807,
              23811,
              23806,
              23806,
              23803,
              23813,
              23813,
              23812,
              23814,
              23807,
              23809,
              23807,
              23813,
              23815,
              23811,
              23814,
              23806,
              23809,
              23806,
              23810,
              23812,
              23813,
              23815,
              23812,
              23812,
              23805,
              23807,
              23814,
              23813,
              23814,
              23811,
              23807,
              23804,
              23810,
              23811,
              23812,
              23812,
              23815,
              23808,
              23809,
              23810,
              23815,
              23816,
              23814,
              23819,
              23804,
              23809,
              23807,
              23813,
              23816,
              23816,
              23817,
              23809,
              23804,
              23806,
              23809,
              23813,
              23817,
              23814,
              23811,
              23805,
              23809,
              23815,
              23817,
              23815,
              23815,
              23811,
              23805,
              23807,
              23811,
              23814,
              23811,
              23816,
              23816,
              23809,
              23808,
              23807,
              23815,
              23813,
              23814,
              23816,
              23807,
              23806,
              23810,
              23813,
              23815,
              23815,
              23814,
              23805,
              23807,
              23807,
              23815,
              23814,
              23813,
              23817,
              23807,
              23808,
              23807,
              23813,
              23815,
              23813,
              23816,
              23811,
              23806,
              23806,
              23810,
              23814,
              23814,
              23818,
              23813,
              23809,
              23807,
              23814,
              23810,
              23813,
              23815,
              23813,
              23803,
              23802,
              23811,
              23813,
              23814,
              23818,
              23819,
              23809,
              23808,
              23817,
              23826,
              23829,
              23831,
              23839,
              23827,
              23830,
              23834,
              23843,
              23841,
              23844,
              23847,
              23841,
              23841,
              23843,
              23847,
              23850,
              23850,
              23852,
              23844,
              23831,
              23829,
              23827,
              23829,
              23828,
              23823,
              23827,
              23814,
              23813,
              23815,
              23820,
              23819,
              23823,
              23819,
              23810,
              23811,
              23813,
              23814,
              23815,
              23815,
              23818,
              23808,
              23805,
              23806,
              23810,
              23813,
              23814,
              23815,
              23809,
              23806,
              23810,
              23807,
              23811,
              23808,
              23817,
              23807,
              23807,
              23810,
              23813,
              23813,
              23815,
              23815,
              23813,
              23804,
              23806,
              23813,
              23816,
              23812,
              23816,
              23811,
              23807,
              23804,
              23817,
              23815,
              23815,
              23812,
              23814,
              23810,
              23809,
              23811,
              23815,
              23813,
              23817,
              23815,
              23807,
              23811,
              23814,
              23814,
              23818,
              23818,
              23819,
              23811,
              23811,
              23811,
              23819,
              23817,
              23820,
              23823,
              23813,
              23808,
              23808,
              23817,
              23813,
              23819,
              23822,
              23812,
              23811,
              23812,
              23816,
              23814,
              23817,
              23818,
              23815,
              23806,
              23812,
              23815,
              23819,
              23817,
              23817,
              23819,
              23811,
              23811,
              23817,
              23815,
              23817,
              23817,
              23815,
              23811,
              23808,
              23814,
              23823,
              23818,
              23819,
              23817,
              23811,
              23807,
              23808,
              23817,
              23817,
              23818,
              23819,
              23815,
              23815,
              23812,
              23818,
              23817,
              23819,
              23816,
              23813,
              23811,
              23811,
              23817,
              23818,
              23817,
              23823,
              23809,
              23810,
              23805,
              23812,
              23819,
              23816,
              23819,
              23810,
              23812,
              23816,
              23815,
              23820,
              23815,
              23819,
              23812,
              23812,
              23809,
              23813,
              23815,
              23816,
              23818,
              23814,
              23812,
              23813,
              23819,
              23818,
              23822,
              23819,
              23817,
              23810,
              23811,
              23819,
              23819,
              23819,
              23816,
              23817,
              23814,
              23815,
              23816,
              23817,
              23817,
              23820,
              23818,
              23814,
              23811,
              23815,
              23823,
              23820,
              23825,
              23822,
              23811,
              23810,
              23815,
              23816,
              23821,
              23821,
              23823,
              23812,
              23813,
              23818,
              23819,
              23820,
              23822,
              23824,
              23815,
              23823,
              23826,
              23832,
              23837,
              23841,
              23843,
              23839,
              23837,
              23839,
              23844,
              23849,
              23849,
              23851,
              23845,
              23843,
              23850,
              23850,
              23856,
              23859,
              23853,
              23841,
              23834,
              23833,
              23837,
              23834,
              23831,
              23832,
              23825,
              23821,
              23819,
              23822,
              23823,
              23821,
              23823,
              23823,
              23817,
              23814,
              23819,
              23820,
              23821,
              23824,
              23823,
              23810,
              23811,
              23816,
              23815,
              23819,
              23821,
              23818,
              23815,
              23810,
              23815,
              23818,
              23819,
              23819,
              23814,
              23813,
              23812,
              23811,
              23818,
              23814,
              23815,
              23821,
              23811,
              23811,
              23815,
              23815,
              23819,
              23821,
              23821,
              23814,
              23809,
              23807,
              23815,
              23819,
              23819,
              23821,
              23815,
              23813,
              23812,
              23821,
              23819,
              23817,
              23819,
              23821,
              23817,
              23813,
              23816,
              23821,
              23819,
              23822,
              23821,
              23814,
              23815,
              23812,
              23819,
              23823,
              23821,
              23821,
              23816,
              23815,
              23814,
              23818,
              23820,
              23821,
              23819,
              23811,
              23814,
              23813,
              23820,
              23821,
              23821,
              23822,
              23815,
              23814,
              23812,
              23817,
              23817,
              19670,
              19669,
              19669,
              19663,
              19664,
              19671,
              19674,
              19672,
              19679,
              19679,
              19665,
              19666,
              19665,
              19678,
              19675,
              19674,
              19678,
              19671,
              19667,
              19672,
              19427,
              19079,
              18863,
              18685,
              18537,
              18387,
              18256,
              18144,
              18039,
              17936,
              17830,
              17739,
              17635,
              17549,
              17472,
              17394,
              17316,
              17248,
              17181,
              17113,
              17488,
              17952,
              18197,
              18345,
              18472,
              18569,
              18649,
              18713,
              18777,
              18833,
              18892,
              18939,
              18983,
              19026,
              19058,
              19087,
              19126,
              19158,
              19184,
              19207,
              19238,
              19257,
              19276,
              19293,
              19317,
              19337,
              19358,
              19368,
              19387,
              19388,
              19404,
              19419,
              19436,
              19446,
              19459,
              19469,
              19467,
              19479,
              19490,
              19501,
              19506,
              19522,
              19523,
              19527,
              19527,
              19530,
              19535,
              19544,
              19549,
              19559,
              19559,
              19556,
              19558,
              19568,
              19572,
              19574,
              19577,
              19585,
              19578,
              19575,
              19585,
              19588,
              19590,
              19593,
              19593,
              19594,
              19589,
              19593,
              19597,
              19603,
              19604,
              19606,
              19607,
              19599,
              19604,
              19603,
              19609,
              19613,
              19613,
              19610,
              19609,
              19605,
              19606,
              19613,
              19618,
              19611,
              19611,
              19613,
              19609,
              19611,
              19614,
              19621,
              19619,
              19619,
              19619,
              19611,
              19611,
              19611,
              19620,
              19620
            ]
          },
          {
            "time": "1497984585157",
            "light_intensity": 328,
            "r": 470,
            "g": 145,
            "b": 103,
            "light_intensity_raw": 680,
            "temperature": 27.74,
            "humidity": 38.124,
            "pressure": 981.812,
            "temperature2": 27.94,
            "humidity2": 38.119,
            "pressure2": 981.894,
            "contactless_temp": 26.93,
            "air_flow": 370,
            "data_raw": [
              50686,
              50404,
              50340,
              50310,
              50288,
              50293,
              50265,
              50267,
              50219,
              50247,
              50238,
              50233,
              50225,
              50211,
              50228,
              50193,
              50210,
              50189,
              50192,
              50203,
              50181,
              50202,
              50179,
              50194,
              50187,
              50188,
              50171,
              50183,
              50210,
              50185,
              50186,
              50193,
              50174,
              50167,
              50192,
              50183,
              50161,
              50181,
              50154,
              50189,
              50156,
              50171,
              50175,
              50153,
              50161,
              50150,
              50165,
              50195,
              50171,
              50193,
              50151,
              50173,
              50181,
              50181,
              50169,
              50181,
              50165,
              50176,
              50178,
              50175,
              50196,
              50193,
              50189,
              50183,
              50181,
              50171,
              50183,
              50190,
              50145,
              50177,
              50188,
              50203,
              50187,
              50195,
              50194,
              50173,
              50184,
              50183,
              50167,
              50182,
              50174,
              50173,
              50165,
              50172,
              50221,
              50210,
              50201,
              50200,
              50214,
              50202,
              50197,
              50179,
              50225,
              50187,
              50221,
              50194,
              50183,
              50210,
              50186,
              50187,
              50199,
              50207,
              50199,
              50189,
              50206,
              50207,
              50205,
              50184,
              50191,
              50185,
              50186,
              50195,
              50203,
              50205,
              50201,
              50212,
              50190,
              50213,
              50207,
              50200,
              50231,
              50211,
              50246,
              50239,
              50236,
              50209,
              50213,
              50202,
              50195,
              50195,
              50212,
              50191,
              50184,
              50189,
              50166,
              50195,
              50189,
              50189,
              50190,
              50194,
              50207,
              50203,
              50188,
              50183,
              50170,
              50167,
              50188,
              50175,
              50196,
              50217,
              50165,
              50182,
              50169,
              50196,
              50174,
              50193,
              50178,
              50185,
              50184,
              50211,
              50195,
              50197,
              50186,
              50183,
              50167,
              50169,
              50210,
              50178,
              50203,
              50191,
              50200,
              50200,
              50197,
              50173,
              50181,
              50174,
              50176,
              50205,
              50192,
              50202,
              50214,
              50193,
              50176,
              50210,
              50204,
              50193,
              50207,
              50178,
              50161,
              50203,
              50209,
              50157,
              50185,
              50191,
              50163,
              50165,
              50170,
              50193,
              50185,
              50182,
              50171,
              50203,
              50207,
              50223,
              50227,
              50239,
              50243,
              50234,
              50223,
              50210,
              50247,
              50267,
              50233,
              50258,
              50247,
              50239,
              50259,
              50251,
              50240,
              50279,
              50467,
              50256,
              50257,
              50249,
              50249,
              50227,
              50223,
              50220,
              50213,
              50195,
              50191,
              50180,
              50185,
              50186,
              50173,
              50203,
              50189,
              50143,
              50171,
              50187,
              50171,
              50183,
              50196,
              50179,
              50189,
              50162,
              50171,
              50179,
              50162,
              50179,
              50199,
              50160,
              50201,
              50199,
              50183,
              50153,
              50162,
              50182,
              50173,
              50181,
              50171,
              50182,
              50162,
              50183,
              50149,
              50167,
              50181,
              50172,
              50167,
              50181,
              50174,
              50182,
              50189,
              50171,
              50193,
              50180,
              50195,
              50174,
              50168,
              50193,
              50189,
              50167,
              50183,
              50169,
              50173,
              50158,
              50162,
              50175,
              50157,
              50149,
              50178,
              50199,
              50165,
              50179,
              50162,
              50142,
              50158,
              50162,
              50162,
              50154,
              50160,
              50141,
              50166,
              50170,
              50157,
              50164,
              50171,
              50179,
              50167,
              50147,
              50168,
              50203,
              50175,
              50143,
              50154,
              50161,
              50169,
              50169,
              50166,
              50143,
              50145,
              50159,
              50155,
              50166,
              50181,
              50169,
              50163,
              50155,
              50157,
              50157,
              50149,
              50181,
              50162,
              50148,
              50148,
              50183,
              50177,
              50157,
              50147,
              50146,
              50130,
              50145,
              50161,
              50148,
              50151,
              50159,
              50135,
              50133,
              50138,
              50146,
              50151,
              50135,
              50161,
              50152,
              50155,
              50135,
              50153,
              50130,
              50140,
              50145,
              50140,
              50142,
              50126,
              50150,
              50141,
              50163,
              50144,
              50147,
              50147,
              50148,
              50135,
              50149,
              50142,
              50159,
              50126,
              50146,
              50145,
              50130,
              50167,
              50137,
              50134,
              50151,
              50129,
              50134,
              50137,
              50137,
              50129,
              50162,
              50127,
              50132,
              50120,
              50131,
              50135,
              50121,
              50119,
              50120,
              50133,
              50132,
              50117,
              50109,
              50101,
              50090,
              50128,
              50120,
              50090,
              50108,
              50123,
              50152,
              50122,
              50135,
              50119,
              50137,
              50132,
              50144,
              50141,
              50126,
              50109,
              50133,
              50099,
              50107,
              50114,
              50139,
              50135,
              50174,
              50147,
              50163,
              50164,
              50171,
              50187,
              50192,
              50187,
              50209,
              50200,
              50206,
              50211,
              50213,
              50211,
              50219,
              50209,
              50212,
              50446,
              50269,
              50239,
              50218,
              50199,
              50192,
              50195,
              50202,
              50168,
              50159,
              50161,
              50167,
              50152,
              50163,
              50163,
              50153,
              50153,
              50171,
              50149,
              50165,
              50145,
              50163,
              50143,
              50159,
              50127,
              50121,
              50136,
              50118,
              50122,
              50117,
              50116,
              50131,
              50154,
              50123,
              50141,
              50141,
              50139,
              50131,
              50127,
              50149,
              50119,
              50133,
              50136,
              50143,
              50134,
              50123,
              50131,
              50163,
              50143,
              50130,
              50139,
              50135,
              50129,
              50147,
              50138,
              50107,
              50117,
              50125,
              50165,
              50118,
              50127,
              50113,
              50135,
              50139,
              50131,
              50134,
              50118,
              50137,
              50145,
              50129,
              50136,
              50125,
              50127,
              50124,
              50126,
              50133,
              50109,
              50135,
              50140,
              50112,
              50103,
              50136,
              50131,
              50143,
              50130,
              50119,
              50107,
              50118,
              50116,
              50132,
              50135,
              50099,
              50117,
              50111,
              50119,
              50124,
              50125,
              50124,
              50132,
              50135,
              50117,
              50127,
              50135,
              50122,
              50122,
              50125,
              50113,
              50117,
              50123,
              50107,
              50114,
              50119,
              50127,
              50125,
              50096,
              50126,
              50109,
              50093,
              50116,
              50119,
              50119,
              50119,
              50124,
              50105,
              50125,
              50106,
              50098,
              50111,
              50112,
              50114,
              50103,
              50102,
              50130,
              50103,
              50101,
              50080,
              50105,
              50118,
              50105,
              50104,
              50122,
              50091,
              50082,
              50114,
              50077,
              50091,
              50106,
              50088,
              50094,
              50102,
              50106,
              50105,
              50123,
              50095,
              50099,
              50113,
              50110,
              50108,
              50113,
              50107,
              50111,
              50112,
              50101,
              50100,
              50106,
              50081,
              50111,
              50113,
              50095,
              50089,
              50104,
              50127,
              50127,
              50110,
              50110,
              50119,
              50100,
              50113,
              50117,
              50101,
              50114,
              50116,
              50087,
              50091,
              50116,
              50086,
              50085,
              50128,
              50119,
              50128,
              50125,
              50124,
              50135,
              50117,
              50106,
              50131,
              50089,
              50097,
              50118,
              50115,
              50098,
              50123,
              50126,
              50122,
              50125,
              50167,
              50183,
              50186,
              50195,
              50193,
              50187,
              50190,
              50207,
              50211,
              50207,
              50192,
              50213,
              50243,
              50214,
              50247,
              50553,
              50243,
              50216,
              50195,
              50176,
              50195,
              50176,
              50194,
              50179,
              50197,
              50158,
              50176,
              50153,
              50152,
              50146,
              50154,
              50163,
              50143,
              50164,
              50125,
              50159,
              50150,
              50154,
              50121,
              50141,
              50130,
              50145,
              50139,
              50143,
              50151,
              50143,
              50131,
              50131,
              50131,
              50143,
              50133,
              50134,
              50139,
              50113,
              50127,
              50133,
              50114,
              50140,
              50149,
              50127,
              50105,
              50125,
              50113,
              50118,
              50106,
              50121,
              50106,
              50104,
              50127,
              50123,
              50141,
              50127,
              50137,
              50147,
              50131,
              50150,
              50123,
              50131,
              50130,
              50118,
              50127,
              50108,
              50103,
              50148,
              50118,
              50117,
              50115,
              50095,
              50105,
              50115,
              50103,
              50108,
              50116,
              50104,
              50134,
              50124,
              50119,
              50132,
              50139,
              50145,
              50125,
              50111,
              50126,
              50125,
              50131,
              50139,
              50128,
              50124,
              50133,
              50130,
              50129,
              50141,
              50103,
              50101,
              50113,
              50145,
              50107,
              50117,
              50121,
              50125,
              50120,
              50105,
              50122,
              50094,
              50134,
              50116,
              50114,
              50103,
              50116,
              50117,
              50113,
              50118,
              50119,
              50123,
              50109,
              50129,
              50127,
              50122,
              50154,
              50130,
              50119,
              50127,
              50121,
              50113,
              50132,
              50122,
              50115,
              50148,
              50131,
              50129,
              50115,
              50112,
              50101,
              50111,
              50111,
              50131,
              50125,
              50113,
              50127,
              50110,
              50117,
              50123,
              50109,
              50117,
              50114,
              50116,
              50112,
              50115,
              50123,
              50126,
              50117,
              50089,
              50115,
              50141,
              50155,
              50120,
              50173,
              50135,
              50160,
              50132,
              50117,
              50139,
              50119,
              50123,
              50129,
              50123,
              50127,
              50141,
              50134,
              50147,
              50131,
              50102,
              50127,
              50119,
              50129,
              50131,
              50150,
              50102,
              50108,
              50124,
              50148,
              50147,
              50138,
              50135,
              50133,
              50166,
              50146,
              50134,
              50139,
              50142,
              50126,
              50119,
              50129,
              50148,
              50159,
              50147,
              50152,
              50159,
              50166,
              50169,
              50190,
              50204,
              50209,
              50215,
              50228,
              50206,
              50208,
              50233,
              50222,
              50238,
              50242,
              50263,
              50255,
              50227,
              50261,
              50547,
              50239,
              50204,
              50231,
              50219,
              50219,
              50188,
              50198,
              50200,
              50184,
              50195,
              50165,
              50163,
              50163,
              50151,
              50172,
              50130,
              50147,
              50127,
              50143,
              50128,
              50126,
              50122,
              50117,
              50134,
              50121,
              50106,
              50113,
              50112,
              50107,
              50113,
              50114,
              50118,
              50122,
              50116,
              50098,
              50101,
              50105,
              50097,
              50081,
              50103,
              50098,
              50101,
              50096,
              50098,
              50086,
              50089,
              50077,
              50086,
              50082,
              50079,
              50059,
              50079,
              50079,
              50085,
              50069,
              50078,
              50073,
              50091,
              50063,
              50081,
              50075,
              50092,
              50115,
              50085,
              50067,
              50074,
              50071,
              50079,
              50083,
              50115,
              50101,
              50081,
              50070,
              50086,
              50093,
              50090,
              50083,
              50091,
              50112,
              50095,
              50106,
              50100,
              50096,
              50081,
              50083,
              50092,
              50095,
              50056,
              50079,
              50103,
              50091,
              50081,
              50073,
              50083,
              50089,
              50079,
              50077,
              50084,
              50091,
              50103,
              50091,
              50102,
              50079,
              50080,
              50079,
              50084,
              50079,
              50096,
              50079,
              50087,
              50081,
              50111,
              50118,
              50095,
              50090,
              50102,
              50120,
              50118,
              50122,
              50115,
              50107,
              50095,
              50121,
              50137,
              50109,
              50095,
              50107,
              50134,
              50111,
              50109,
              50125,
              50087,
              50119,
              50109,
              50118,
              50111,
              50099,
              50106,
              50122,
              50101,
              50101,
              50087,
              50094,
              50095,
              50101,
              50134,
              50119,
              50110,
              50095,
              50101,
              50117,
              50135,
              50108,
              50117,
              50109,
              50103,
              50102,
              50095,
              50096,
              50094,
              50143,
              50107,
              50098,
              50123,
              50115,
              50131,
              50131,
              50125,
              50111,
              50077,
              50099,
              50111,
              50112,
              50103,
              50126,
              50108,
              50103,
              50107,
              50107,
              50107,
              50101,
              50079,
              50128,
              50102,
              50103,
              50111,
              50113,
              50125,
              50077,
              50085,
              50098,
              50114,
              50137,
              50117,
              50118,
              50115,
              50141,
              50138,
              50143,
              50125,
              50162,
              50171,
              50162,
              50169,
              50186,
              50189,
              50191,
              50171,
              50185,
              50177,
              50178,
              50194,
              50210,
              50203,
              50217,
              50231,
              50222,
              50241,
              50227,
              50546,
              50251,
              50247,
              50207,
              50196,
              50196,
              50153,
              50177,
              50165,
              50155,
              50135,
              50143,
              50103,
              50119,
              50123,
              50116,
              50100,
              50107,
              50135,
              50118,
              50111,
              50083,
              50142,
              50115,
              50113,
              50131,
              50120,
              50115,
              50119,
              50133,
              50100,
              50110,
              50113,
              50103,
              50111,
              50105,
              50108,
              50094,
              50121,
              50118,
              50111,
              50116,
              50119,
              50134,
              50135,
              50137,
              50140,
              50125,
              50113,
              50118,
              50117,
              50136,
              50095,
              50119,
              50122,
              50125,
              50117,
              50111,
              50116,
              50135,
              50131,
              50115,
              50101,
              50123,
              50092,
              50100,
              50091,
              50090,
              50113,
              50099,
              50115,
              50107,
              50108,
              50099,
              50135,
              50105,
              50086,
              50115,
              50143,
              50114,
              50139,
              50135,
              50127,
              50101,
              50106,
              50097,
              50121,
              50107,
              50107,
              50132,
              50107,
              50119,
              50087,
              50122,
              50111,
              50097,
              50096,
              50085,
              50081,
              50087,
              50086,
              50111,
              50078,
              50081,
              50086,
              50084,
              50067,
              50078,
              50097,
              50090,
              50065,
              50089,
              50092,
              50101,
              50086,
              50098,
              50087,
              50075,
              50084,
              50098,
              50080,
              50081,
              50081,
              50081,
              50086,
              50071,
              50089,
              50087,
              50097,
              50079,
              50091,
              50047,
              50092,
              50105,
              50067,
              50091,
              50061,
              50067,
              50061,
              50068,
              50071,
              50069,
              50069,
              50069,
              50068,
              50067,
              50087,
              50097,
              50071,
              50079,
              50067,
              50082,
              50051,
              50057,
              50071,
              50054,
              50078,
              50077,
              50076,
              50081,
              50065,
              50076,
              50104,
              50100,
              50107,
              50113,
              50103,
              50089,
              50106,
              50113,
              50100,
              50105,
              50098,
              50094,
              50113,
              50110,
              50135,
              50098,
              50087,
              50085,
              50100,
              50087,
              50105,
              50084,
              50091,
              50054,
              50054,
              50069,
              50090,
              50078,
              50079,
              50073,
              50087,
              50051,
              50063,
              50055,
              50073,
              50082,
              50068,
              50079,
              50051,
              50078,
              50107,
              50109,
              50133,
              50121,
              50132,
              50124,
              50141,
              50183,
              50176,
              50181,
              50183,
              50192,
              50187,
              50158,
              50171,
              50190,
              50183,
              50184,
              50556,
              50211,
              50179,
              50177,
              50175,
              50176,
              50168,
              50144,
              50115,
              50147,
              50140,
              50151,
              50131,
              50129,
              50137,
              50138,
              50147,
              50142,
              50111,
              50093,
              50123,
              50091,
              50107,
              50106,
              50089,
              50115,
              50102,
              50101,
              50106,
              50124,
              50094,
              50083,
              50076,
              50091,
              50087,
              50073,
              50084,
              50089,
              50083,
              50099,
              50101,
              50100,
              50086,
              50102,
              50109,
              50106,
              50099,
              50083,
              50070,
              50091,
              50071,
              50101,
              50093,
              50084,
              50084,
              50081,
              50070,
              50078,
              50087,
              50094,
              50085,
              50087,
              50089,
              50083,
              50054,
              50072,
              50079,
              50091,
              50112,
              50110,
              50103,
              50093,
              50090,
              50107,
              50087,
              50115,
              50084,
              50093,
              50096,
              50087,
              50105,
              50087,
              50108,
              50077,
              50061,
              50067,
              50084,
              50068,
              50054,
              50085,
              50061,
              50085,
              50074,
              50075,
              50086,
              50071,
              50083,
              50056,
              50070,
              50078,
              50080,
              50095,
              50071,
              50075,
              50035,
              50068,
              50073,
              50063,
              50081,
              50076,
              50066,
              50061,
              50050,
              50084,
              50087,
              50089,
              50095,
              50073,
              50067,
              50083,
              50068,
              50092,
              50097,
              50093,
              50107,
              50078,
              50095,
              50092,
              50079,
              50063,
              50079,
              50072,
              50059,
              50065,
              50063,
              50069,
              50073,
              50098,
              50084,
              50073,
              50066,
              50073,
              50069,
              50086,
              50073,
              50074,
              50066,
              50069,
              50066,
              50074,
              50101,
              50063,
              50068,
              50075,
              50083,
              50083,
              50079,
              50082,
              50081,
              50061,
              50062,
              50063,
              50083,
              50075,
              50064,
              50093,
              50073,
              50078,
              50106,
              50103,
              50085,
              50091,
              50101,
              50082,
              50079,
              50071,
              50113,
              50079,
              50064,
              50084,
              50071,
              50069,
              50061,
              50064,
              50067,
              50045,
              50063,
              50059,
              50071,
              50087,
              50077,
              50084,
              50109,
              50081,
              50085,
              50079,
              50087,
              50085,
              50077,
              50071,
              50047,
              50084,
              50076,
              50123,
              50127,
              50131,
              50137,
              50131,
              50134,
              50163,
              50147,
              50151,
              50171,
              50162,
              50174,
              50151,
              50181,
              50209,
              50207,
              50209,
              50607,
              50185,
              50183,
              50158,
              50149,
              50135,
              50130,
              50133,
              50133,
              50122,
              50116,
              50114,
              50138,
              50116,
              50103,
              50114,
              50087,
              50103,
              50116,
              50111,
              50111,
              50117,
              50092,
              50090,
              50104,
              50102,
              50095,
              50115,
              50097,
              50083,
              50087,
              50084,
              50115,
              50088,
              50081,
              50065,
              50094,
              50087,
              50090,
              50083,
              50084,
              50094,
              50083,
              50081,
              50111,
              50092,
              50085,
              50087,
              50086,
              50083,
              50084,
              50102,
              50089,
              50059,
              50075,
              50089,
              50096,
              50066,
              50067,
              50087,
              50094,
              50090,
              50097,
              50099,
              50089,
              50094,
              50094,
              50096,
              50083,
              50051,
              50093,
              50073,
              50085,
              50056,
              50067,
              50077,
              50077,
              50057,
              50058,
              50071,
              50075,
              50081,
              50094,
              50081,
              50074,
              50085,
              50059,
              50066,
              50074,
              50065,
              50063,
              50065,
              50089,
              50077,
              50089,
              50109,
              50097,
              50093,
              50129,
              50111
            ]
          },
          {
            "time": "1497984588309",
            "light_intensity": 328,
            "r": 470,
            "g": 145,
            "b": 103,
            "light_intensity_raw": 680,
            "temperature": 27.75,
            "humidity": 38.126,
            "pressure": 981.793,
            "temperature2": 27.95,
            "humidity2": 38.131,
            "pressure2": 981.917,
            "contactless_temp": 26.89,
            "thickness": 0.42,
            "compass_direction": "W",
            "compass": 270,
            "angle": 23.21,
            "angle_direction": "NE",
            "pitch": 13.25,
            "roll": -19.23,
            "air_flow": 390,
            "data_raw": [
              1541,
              2128,
              2163,
              2179,
              2192,
              2207,
              2219,
              2235,
              2254,
              2263,
              2273,
              2286,
              2294,
              2304,
              2310,
              2316,
              2322,
              2333,
              2336,
              2337,
              2340,
              2341,
              2343,
              2346,
              2347,
              2345,
              2346,
              2349,
              2342,
              2347,
              2348,
              2347,
              2350,
              2347,
              2350,
              2354,
              2351,
              2351,
              2354,
              2356,
              2354,
              2354,
              2354,
              2351,
              2351,
              2345,
              2347,
              2344,
              2343,
              2344,
              2350,
              2352,
              2354,
              2351,
              2352,
              2354,
              2352,
              2351,
              2355,
              2353,
              2346,
              2348,
              2344,
              2347,
              2343,
              2344,
              2347,
              2342,
              2348,
              2353,
              2349,
              2348,
              2352,
              2350,
              2347,
              2349,
              2347,
              2344,
              2341,
              2341,
              2343,
              2342,
              2344,
              2348,
              2348,
              2350,
              2346,
              2349,
              2347,
              2348,
              2348,
              2346,
              2345,
              2342,
              2341,
              2340,
              2343,
              2343,
              2345,
              2346,
              2773,
              2847,
              2866,
              2875,
              2881,
              2877,
              2882,
              2879,
              2881,
              2877,
              2881,
              2877,
              2881,
              2874,
              2877,
              2874,
              2877,
              2867,
              2881,
              2871,
              2875,
              2867,
              2871,
              2867,
              2873,
              2863,
              2867,
              2860,
              2861,
              2858,
              2862,
              2856,
              2858,
              2848,
              2856,
              2853,
              2851,
              2847,
              2850,
              2844,
              2847,
              2844,
              2847,
              2843,
              2843,
              2839,
              2834,
              2839,
              2833,
              2831,
              2833,
              2826,
              2831,
              2827,
              2827,
              2829,
              2824,
              2826,
              2815,
              2823,
              2820,
              2811,
              2814,
              2812,
              2809,
              2814,
              2805,
              2809,
              2810,
              2806,
              2808,
              2806,
              2797,
              2805,
              2807,
              2794,
              2788,
              2790,
              2787,
              2786,
              2786,
              2781,
              2788,
              2788,
              2779,
              2777,
              2781,
              2782,
              2777,
              2782,
              2466,
              2096,
              1894,
              1797,
              1754,
              1739,
              1735,
              1733,
              1734,
              1735,
              1731,
              1731,
              1729,
              1730,
              1727,
              1250,
              1225,
              1217,
              1211,
              1199,
              1193,
              1191,
              1187,
              1186,
              1185,
              1182,
              1175,
              1171,
              1170,
              1167,
              1165,
              2642,
              2753,
              2778,
              2799,
              2803,
              2812,
              2810,
              2817,
              2816,
              2823,
              2821,
              2829,
              2821,
              2830,
              2825,
              2830,
              2827,
              2831,
              2834,
              2831,
              2834,
              2828,
              2835,
              2828,
              2832,
              2826,
              2832,
              2823,
              2829,
              2825,
              2821,
              2819,
              2823,
              2814,
              2815,
              2813,
              2816,
              2808,
              2811,
              2807,
              2811,
              2810,
              2806,
              2810,
              2791,
              2786,
              2784,
              2787,
              2787,
              2773,
              2784,
              2781,
              2783,
              2784,
              2782,
              2776,
              2778,
              2780,
              2774,
              2761,
              2758,
              2754,
              2752,
              2756,
              2745,
              2752,
              2755,
              2755,
              2748,
              2755,
              2753,
              2749,
              2752,
              2753,
              2539,
              2391,
              2322,
              2289,
              2271,
              2258,
              2248,
              2239,
              2239,
              2237,
              2235,
              2231,
              2231,
              2230,
              2224,
              50244,
              50152,
              50170,
              50115,
              50190,
              50164,
              50171,
              50183,
              50162,
              50187,
              50174,
              50174,
              50168,
              50167,
              50174,
              50170,
              50160,
              50190,
              50167,
              50183,
              50141,
              50159,
              50143,
              50132,
              50163,
              50149,
              50129,
              50137,
              50135,
              50133,
              50138,
              50121,
              50150,
              50169,
              50123,
              50149,
              50133,
              50127,
              50159,
              50158,
              50107,
              50119,
              50125,
              50112,
              50135,
              50128,
              50111,
              50147,
              50110,
              50141,
              50141,
              50138,
              50115,
              50105,
              50141,
              50136,
              50123,
              50123,
              50118,
              50125,
              50139,
              50113,
              50111,
              50101,
              50123,
              50130,
              50117,
              50110,
              50127,
              50091,
              50116,
              50108,
              50122,
              50119,
              50119,
              50097,
              50098,
              50131,
              50085,
              50089,
              50085,
              50113,
              50115,
              50110,
              50099,
              50115,
              50082,
              50087,
              50131,
              50097,
              50111,
              50087,
              50117,
              50087,
              50106,
              50085,
              50067,
              50090,
              50126,
              50118,
              49959,
              49941,
              49934,
              49924,
              49926,
              49928,
              49937,
              49911,
              49930,
              49933,
              49941,
              49945,
              49955,
              49953,
              49951,
              49927,
              49958,
              49984,
              49966,
              49977,
              49957,
              49986,
              49948,
              49956,
              49967,
              49964,
              49954,
              49927,
              49929,
              49953,
              49956,
              49984,
              49972,
              49985,
              49959,
              49985,
              50003,
              49989,
              49975,
              49977,
              49964,
              49954,
              49987,
              49981,
              49957,
              49959,
              49991,
              49982,
              49964,
              49967,
              49954,
              49966,
              49955,
              49922,
              49903,
              49919,
              49921,
              49903,
              49922,
              49911,
              49929,
              49955,
              49951,
              49938,
              49971,
              49927,
              49935,
              49927,
              49955,
              49958,
              49940,
              49942,
              49932,
              49908,
              49924,
              49932,
              49943,
              49954,
              49959,
              49937,
              49957,
              49957,
              49968,
              49972,
              49975,
              49948,
              49963,
              49975,
              49963,
              49990,
              50105,
              50232,
              50305,
              50306,
              50337,
              50325,
              50319,
              50361,
              50318,
              50342,
              50325,
              50307,
              50309,
              50307,
              50329,
              49791,
              49829,
              49870,
              49889,
              49912,
              49965,
              49955,
              49973,
              49988,
              50007,
              50033,
              49993,
              49990,
              49984,
              50039,
              50038,
              49862,
              49843,
              49856,
              49869,
              49891,
              49887,
              49890,
              49895,
              49904,
              49913,
              49953,
              49949,
              49963,
              49956,
              49937,
              49959,
              49973,
              49977,
              49987,
              49962,
              49977,
              49973,
              49967,
              49957,
              49980,
              49991,
              49972,
              49941,
              49919,
              49935,
              49919,
              49898,
              49894,
              49957,
              49950,
              49945,
              49933,
              49905,
              49930,
              49910,
              49925,
              49913,
              49917,
              49905,
              49913,
              49923,
              49879,
              49927,
              49911,
              49890,
              49885,
              49906,
              49922,
              49903,
              49885,
              49890,
              49871,
              49859,
              49885,
              49885,
              49879,
              49908,
              49875,
              49891,
              49920,
              49891,
              49905,
              49881,
              49868,
              49895,
              49848,
              49872,
              49864,
              49868,
              49950,
              49974,
              49995,
              50036,
              50041,
              50013,
              50039,
              50050,
              50073,
              50067,
              50067,
              50073,
              50062,
              50065,
              50063
            ]
          },
          {
            "time": "1497984601143",
            "light_intensity": 650.54,
            "r": 947,
            "g": 288,
            "b": 205,
            "light_intensity_raw": 1363,
            "temperature": 27.78,
            "humidity": 38.106,
            "pressure": 981.813,
            "temperature2": 27.99,
            "humidity2": 38.09,
            "pressure2": 981.875,
            "contactless_temp": 26.89,
            "thickness": 0.42,
            "compass_direction": "W",
            "compass": 270,
            "angle": 16.583,
            "angle_direction": "NE",
            "pitch": 10.03,
            "roll": -13.27,
            "air_flow": 370,
            "data_raw": [

            ]
          },
          {
            "time": "1497984602033",
            "light_intensity": 645.362,
            "r": 936,
            "g": 285,
            "b": 203,
            "light_intensity_raw": 1349,
            "temperature": 27.79,
            "humidity": 38.117,
            "pressure": 981.818,
            "temperature2": 27.99,
            "humidity2": 38.101,
            "pressure2": 981.929,
            "contactless_temp": 26.85,
            "thickness": 0.41,
            "compass_direction": "W",
            "compass": 270,
            "angle": 16.939,
            "angle_direction": "NE",
            "pitch": 10.01,
            "roll": -13.73,
            "air_flow": 370,
            "data_raw": [

            ]
          },
          {
            "time": "1497984602918",
            "light_intensity": 645.015,
            "r": 938,
            "g": 286,
            "b": 203,
            "light_intensity_raw": 1351,
            "temperature": 27.79,
            "humidity": 38.117,
            "pressure": 981.807,
            "temperature2": 27.99,
            "humidity2": 38.112,
            "pressure2": 981.915,
            "contactless_temp": 26.85,
            "thickness": 0.41,
            "compass_direction": "W",
            "compass": 270,
            "angle": 17.171,
            "angle_direction": "NE",
            "pitch": 10.56,
            "roll": -13.62,
            "air_flow": 370,
            "data_raw": [

            ]
          },
          {
            "time": "1497984603801",
            "detector_read1": 10654,
            "detector_read2": 874,
            "light_intensity": 645.757,
            "r": 937,
            "g": 285,
            "b": 203,
            "light_intensity_raw": 1350,
            "temperature": 27.79,
            "humidity": 38.128,
            "pressure": 981.799,
            "temperature2": 27.99,
            "humidity2": 38.112,
            "pressure2": 981.903,
            "contactless_temp": 26.85,
            "thickness": 0.41,
            "compass_direction": "W",
            "compass": 270,
            "angle": 16.528,
            "angle_direction": "NE",
            "pitch": 9.62,
            "roll": -13.5,
            "air_flow": 370,
            "data_raw": [
              302,
              286,
              289,
              284,
              289,
              86,
              83,
              84,
              81,
              85,
              397,
              250,
              253,
              250,
              254,
              68,
              41,
              54,
              43,
              50,
              34109,
              9479,
              9437,
              9422,
              9425,
              10646,
              9138,
              9131,
              9133,
              9134,
              12738,
              7947,
              7941,
              7933,
              7939,
              17000,
              11109,
              11088,
              11094,
              11085,
              2313,
              2593,
              2597,
              2594,
              2596,
              245,
              279,
              280,
              284,
              284,
              1315,
              1642,
              1643,
              1641,
              1644,
              62,
              60,
              67,
              72,
              68,
              29043,
              37881,
              37879,
              37899,
              37898,
              30767,
              39991,
              40007,
              39995,
              40005,
              22181,
              29337,
              29351,
              29348,
              29356,
              29382,
              38674,
              38659,
              38651,
              38637,
              8711,
              10015,
              10020,
              10016,
              10015,
              503,
              601,
              595,
              604,
              598,
              5841,
              8078,
              8082,
              8075,
              8075,
              99,
              125,
              125,
              126,
              123,
              37893,
              37877,
              37889,
              37880,
              37899,
              39992,
              39995,
              39990,
              39993,
              39999,
              29455,
              29355,
              29359,
              29356,
              29350,
              38695,
              38672,
              38662,
              38640,
              38629,
              290,
              282,
              287,
              282,
              289,
              84,
              81,
              82,
              78,
              82,
              255,
              254,
              258,
              257,
              254,
              50,
              47,
              51,
              55,
              55,
              9796,
              9455,
              9427,
              9431,
              9412,
              9151,
              9127,
              9133,
              9125,
              9130,
              8008,
              7942,
              7940,
              7940,
              7933,
              11178,
              11098,
              11095,
              11093,
              11092,
              2594,
              2599,
              2593,
              2596,
              2593,
              284,
              276,
              283,
              277,
              279,
              1635,
              1643,
              1637,
              1639,
              1635,
              67,
              67,
              64,
              68,
              62,
              37779,
              37895,
              37885,
              37891,
              37897,
              39922,
              39999,
              40002,
              39997,
              40005,
              29269,
              29347,
              29350,
              29357,
              29347,
              38610,
              38676,
              38662,
              38643,
              38634,
              10019,
              10018,
              10019,
              10018,
              10017,
              598,
              601,
              599,
              607,
              601,
              8075,
              8083,
              8080,
              8074,
              8073,
              124,
              125,
              127,
              123,
              128,
              37899,
              37885,
              37895,
              37894,
              37895,
              39994,
              40003,
              39984,
              39993,
              39995,
              29355,
              29351,
              29350,
              29351,
              29359,
              38681,
              38664,
              38646,
              38635,
              38624
            ]
          },
          {
            "time": "1497984604675",
            "air_flow": 350,
            "data_raw": [

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

David M. Kramer


Protocol connections:
0
Latest Update:
Jun 2017