RIDES1_3_1_OBi


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

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

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

// Define the protocol set numbers for each data set

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

var ECS_LEFdset=6;
var P700_DIRK_set=7;
var PAM_set=8;  //the json set 8 contains the PAM and P700 traces


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

var P700_begining_of_subtrace_for_linear_fit=55;
var P700_end_of_subtrace_for_linear_fit=170;

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

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


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

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

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

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

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

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

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

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

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

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

output.pump="none";

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

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


// Start of analyses sections

//ECS trace analysis:

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

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

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

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

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

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

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

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

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

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

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

}
catch(e){}


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


//Calculaiton of the DIRK delta_P850 

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

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

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

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

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

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

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

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

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

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

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

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

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

// Display the DIRKf results and calculate LEFd

  output.LEFd_trace = LEFd_trace;

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

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

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

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

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

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

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


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

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

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

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

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

// only display LEF if there is a light intensity measurement > 0 
// ----------------------------
if (typeof json.light_intensity != "undefined" && json.light_intensity > 0) {
	output.LEF= MathROUND((fvfm  * 0.45 * json.light_intensity),3);
}

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

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

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

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

  output.PSI_act=MathROUND(PSI_act, 3);
  output.PSI_open =MathROUND(PSI_open, 3);
  output.PSI_or =MathROUND(PSI_or, 3);
  output.PSI_ox =MathROUND(PSI_ox, 3);
    //output.PSI_dark=PSI_dark;
  //output.PSI_ss = PSI_ss; //MathROUND(PSI_ss, 3);
  //output.PSI_sat1 =MathROUND(PSI_sat1, 3);
  //output.PSI_sat2 =MathROUND(PSI_sat2, 3);

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

// Humidity changes
    var humidity_kinetics=[json.set[4].humidity,
                        json.set[5].humidity,
                        json.set[ECS_LEFdset].humidity,
                        json.set[P700_DIRK_set].humidity,
                        json.set[PAM_set].humidity,
                        json.set[9].humidity,
                        json.set[10].humidity,
                        json.set[11].humidity,
                        json.set[10].humidity,
                        json.set[11].humidity
                       ];
  	output.humidity_K=humidity_kinetics;
  	output.humidity_K_T=humidity_kinetics.join(", ");

    var humidity2_kinetics=[json.set[4].humidity2,
                        json.set[5].humidity2,
                        json.set[ECS_LEFdset].humidity2,
                        json.set[P700_DIRK_set].humidity2,
                        json.set[PAM_set].humidity2,
                        json.set[9].humidity2,
                        json.set[10].humidity2,
                        json.set[11].humidity2,
                        json.set[10].humidity2,
                        json.set[11].humidity2
                       ];
  	output.humidity2_K=humidity2_kinetics;
  	output.humidity2_K_T=humidity2_kinetics.join(", ");


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

                       ];


  output.air_temp_kinetics=air_temp_kinetics;
  
  output.LEAF_temp=contactless_temp_kinetics;
 output.LEAF_temp_T=contactless_temp_kinetics.join(", ");

var air_flow=new Array([]);

for (var i=1; i<12 ; i++){
  	air_flow.push(json.set[i].air_flow);
}

output.air_flow=air_flow;

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

//Calculation of gs using equation derived from 1st principles. This was included by Isaac (OBi)
 output.RH_change_i=MathROUND(output.leaf_RH-output.ambient_RH);
 output.RH_air_i=MathROUND(output.ambient_RH/100);

output.M_C_i=MathROUND(output.leaf_temperature-output.RH_air_i*output.ambient_temperature,4);
output.gs_C_i=MathROUND(output.RH_change_i/output.M_C_i,4);


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

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

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

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

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

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


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

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

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


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


// Return data
return output;
{
  "time": "1500062274959",
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "00:00:00:05",
  "device_battery": 89,
  "device_firmware": 1.2,
  "sample": [
    [
      {
        "time": "1500062274959",
        "protocol_id": 1,
        "set": [
          {
            "time": "1500062274969",
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062275290",
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062276011",
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062276733",
            "light_intensity": 11.929,
            "r": 8,
            "g": 4,
            "b": 2,
            "light_intensity_raw": 14,
            "temperature": 25.14,
            "humidity": 49.466,
            "pressure": 987.475,
            "temperature2": 25.28,
            "humidity2": 44.706,
            "pressure2": 986.429,
            "contactless_temp": 25.7,
            "compass_direction": "E",
            "compass": 90,
            "angle": 47.929,
            "angle_direction": "S",
            "pitch": 47.92,
            "roll": -0.92,
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062278615",
            "light_intensity": 11.929,
            "r": 8,
            "g": 4,
            "b": 2,
            "light_intensity_raw": 14,
            "temperature": 25.14,
            "humidity": 49.454,
            "pressure": 987.511,
            "temperature2": 25.28,
            "humidity2": 44.675,
            "pressure2": 986.393,
            "contactless_temp": 25.71,
            "thickness": 4.48,
            "compass_direction": "E",
            "compass": 90,
            "angle": 59.81,
            "angle_direction": "S",
            "pitch": 59.13,
            "roll": -11.46,
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062278754",
            "light_intensity": 11.433,
            "r": 8,
            "g": 3,
            "b": 2,
            "light_intensity_raw": 13,
            "temperature": 25.15,
            "humidity": 49.445,
            "pressure": 987.516,
            "temperature2": 25.3,
            "humidity2": 44.741,
            "pressure2": 986.392,
            "contactless_temp": 25.56,
            "thickness": 0.09,
            "air_flow": -1,
            "data_raw": [
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              22,
              23,
              19,
              23,
              22,
              19,
              23,
              21,
              23,
              23,
              21,
              22,
              21,
              24,
              21,
              21,
              22,
              23,
              24,
              21,
              21,
              23,
              22,
              23,
              20,
              21,
              22,
              25,
              21,
              23,
              23,
              24,
              22,
              20,
              23,
              22,
              21,
              19,
              22,
              21,
              24,
              20,
              23,
              22,
              24,
              21,
              22,
              21,
              23,
              19,
              23,
              23,
              26,
              22,
              21,
              23,
              23,
              23,
              25,
              21,
              22,
              23,
              20,
              23,
              20,
              23,
              22,
              22,
              22,
              21,
              25,
              23,
              21,
              21,
              21,
              19,
              23,
              23,
              25,
              22,
              21,
              22,
              19,
              20,
              24,
              21,
              25,
              21,
              23,
              23,
              22,
              27,
              23,
              22,
              25,
              22,
              21,
              24,
              24,
              23,
              22,
              20,
              21,
              23,
              22,
              24,
              22,
              24,
              22,
              20,
              22,
              24,
              24,
              23,
              21,
              22,
              22,
              19,
              22,
              21,
              25,
              20,
              22,
              22,
              21,
              25,
              25,
              21,
              26,
              25,
              19,
              21,
              24,
              26,
              20,
              20,
              23,
              21,
              19,
              21
            ]
          },
          {
            "time": "1500062282805",
            "light_intensity": 11.4,
            "r": 8,
            "g": 3,
            "b": 2,
            "light_intensity_raw": 13,
            "temperature": 25.18,
            "humidity": 49.471,
            "pressure": 987.476,
            "temperature2": 25.33,
            "humidity2": 44.712,
            "pressure2": 986.401,
            "contactless_temp": 24.75,
            "air_flow": -1,
            "data_raw": [
              49943,
              49813,
              49811,
              49787,
              49827,
              49792,
              49778,
              49774,
              49799,
              49830,
              49826,
              49839,
              49772,
              49814,
              49777,
              49776,
              49775,
              49752,
              49751,
              49769,
              49804,
              49765,
              49743,
              49741,
              49734,
              49747,
              49743,
              49769,
              49739,
              49800,
              49759,
              49719,
              49721,
              49750,
              49687,
              49722,
              49798,
              49687,
              49729,
              49696,
              49737,
              49749,
              49694,
              49734,
              49735,
              49731,
              49752,
              49782,
              49829,
              49714,
              49757,
              49761,
              49745,
              49742,
              49757,
              49780,
              49759,
              49793,
              49841,
              49807,
              49781,
              49738,
              49799,
              49839,
              49786,
              49763,
              49813,
              49831,
              49756,
              49762,
              49769,
              49794,
              49755,
              49818,
              49735,
              49743,
              49767,
              49676,
              49723,
              49744,
              49794,
              49769,
              49763,
              49711,
              49782,
              49804,
              49791,
              49812,
              49821,
              49841,
              49830,
              49700,
              49724,
              49778,
              49775,
              49793,
              49772,
              49752,
              49794,
              49805,
              49840,
              49794,
              49785,
              49803,
              49767,
              49795,
              49780,
              49793,
              49761,
              49769,
              49779,
              49751,
              49755,
              49784,
              49760,
              49797,
              49788,
              49783,
              49772,
              49741,
              49787,
              49768,
              49788,
              49763,
              49761,
              49757,
              49759,
              49755,
              49775,
              49759,
              49733,
              49727,
              49801,
              49775,
              49723,
              49728,
              49745,
              49762,
              49773,
              49786,
              49772,
              49731,
              49768,
              49738,
              49776,
              49789,
              49727,
              49757,
              49779,
              49722,
              49731,
              49745,
              49742,
              49755,
              49722,
              49690,
              49767,
              49759,
              49683,
              49755,
              49771,
              49740,
              49727,
              49767,
              49730,
              49767,
              49774,
              49764,
              49758,
              49741,
              49768,
              49769,
              49739,
              49709,
              49767,
              49745,
              49780,
              49705,
              49727,
              49733,
              49743,
              49721,
              49682,
              49725,
              49703,
              49782,
              49839,
              49801,
              49792,
              49789,
              49786,
              49763,
              49779,
              49801,
              49781,
              49776,
              49775,
              49777,
              49769,
              49769,
              49807,
              49802,
              49800,
              49736,
              49755,
              49767,
              49742,
              49740,
              49767,
              49738,
              49719,
              49775,
              49831,
              49805,
              49821,
              49766,
              49785,
              49743,
              49763,
              49804,
              49741,
              49761,
              49796,
              49768,
              49814,
              49742,
              49740,
              49711,
              49727,
              49719,
              49693,
              49762,
              49771,
              49743,
              49751,
              49735,
              49739,
              49761,
              49772,
              49741,
              49775,
              49733,
              49769,
              49786,
              49766,
              49715,
              49791,
              49763,
              49735,
              49795,
              49767,
              49723,
              49738,
              49753,
              49816,
              49765,
              49743,
              49742,
              49748,
              49783,
              49788,
              49743,
              49750,
              49749,
              49723,
              49777,
              49783,
              49801,
              49767,
              49790,
              49780,
              49789,
              49701,
              49814,
              49748,
              49675,
              49740,
              49799,
              49806,
              49759,
              49751,
              49807,
              49806,
              49791,
              49753,
              49701,
              49701,
              49777,
              49729,
              49798,
              49745,
              49793,
              49787,
              49744,
              49745,
              49812,
              49740,
              49763,
              49743,
              49750,
              49771,
              49701,
              49714,
              49735,
              49703,
              49695,
              49773,
              49799,
              49765,
              49747,
              49766,
              49733,
              49722,
              49748,
              49660,
              49769,
              49791,
              49751,
              49722,
              49716,
              49681,
              49778,
              49705,
              49735,
              49727,
              49769,
              49771,
              49764,
              49799,
              49747,
              49790,
              49728,
              49747,
              49766,
              49771,
              49800,
              49759,
              49775,
              49791,
              49742,
              49777,
              49747,
              49714,
              49759,
              49783,
              49793,
              49719,
              49747,
              49759,
              49785,
              49753,
              49767,
              49767,
              49714,
              49696,
              49705,
              49728,
              49750,
              49713,
              49756,
              49733,
              49767,
              49763,
              49759,
              49801,
              49823,
              49753,
              49839,
              49817,
              49779,
              49817,
              49807,
              49831,
              49854,
              49745,
              49762,
              49798,
              49783,
              49799,
              49781,
              49803,
              49826,
              49807,
              49793,
              49775,
              49758,
              49783,
              49803,
              49743,
              49742,
              49764,
              49709,
              49763,
              49785,
              49702,
              49735,
              49754,
              49766,
              49799,
              49842,
              49771,
              49791,
              49728,
              49710,
              49699,
              49707,
              49700,
              49742,
              49774,
              49735,
              49785,
              49758,
              49759,
              49703,
              49735,
              49758,
              49789,
              49751,
              49713,
              49698,
              49749,
              49756,
              49710,
              49731,
              49737,
              49759,
              49717,
              49726,
              49748,
              49741,
              49717,
              49766,
              49653,
              49783,
              49769,
              49765,
              49766,
              49768,
              49751,
              49798,
              49790,
              49726,
              49766,
              49821,
              49741,
              49721,
              49760,
              49774,
              49742,
              49741,
              49767,
              49715,
              49753,
              49722,
              49695,
              49714,
              49719,
              49768,
              49752,
              49791,
              49777,
              49711,
              49697,
              49729,
              49739,
              49685,
              49716,
              49736,
              49679,
              49663,
              49683,
              49725,
              49755,
              49760,
              49813,
              49767,
              49772,
              49771,
              49753,
              49749,
              49785,
              49790,
              49794,
              49815,
              49810,
              49785,
              49735,
              49778,
              49787,
              49715,
              49682,
              49691,
              49721,
              49711,
              49743,
              49717,
              49734,
              49638,
              49755,
              49653,
              49711,
              49696,
              49655,
              49731,
              49739,
              49719,
              49698,
              49751,
              49707,
              49780,
              49709,
              49753,
              49683,
              49715,
              49779,
              49733,
              49735,
              49706,
              49675,
              49684,
              49763,
              49768,
              49703,
              49683,
              49743,
              49754,
              49745,
              49759,
              49698,
              49758,
              49763,
              49708,
              49759,
              49740,
              49752,
              49751,
              49713,
              49725,
              49695,
              49707,
              49704,
              49741,
              49771,
              49705,
              49682,
              49723,
              49695,
              49675,
              49737,
              49691,
              49708,
              49651,
              49618,
              49669,
              49659,
              49643,
              49730,
              49706,
              49734,
              49715,
              49763,
              49785,
              49732,
              49763,
              49747,
              49688,
              49693,
              49684,
              49677,
              49754,
              49702,
              49688,
              49747,
              49726,
              49745,
              49778,
              49713,
              49734,
              49745,
              49687,
              49748,
              49716,
              49788,
              49810,
              49818,
              49786,
              49811,
              49753,
              49790,
              49815,
              49775,
              49759,
              49755,
              49784,
              49726,
              49791,
              49728,
              49771,
              49715,
              49751,
              49728,
              49763,
              49765,
              49707,
              49705,
              49753,
              49767,
              49735,
              49759,
              49793,
              49766,
              49777,
              49811,
              49731,
              49726,
              49715,
              49779,
              49775,
              49796,
              49797,
              49785,
              49750,
              49763,
              49793,
              49770,
              49815,
              49802,
              49725,
              49744,
              49780,
              49727,
              49765,
              49745,
              49746,
              49797,
              49698,
              49663,
              49729,
              49735,
              49693,
              49689,
              49694,
              49715,
              49739,
              49767,
              49759,
              49715,
              49704,
              49715,
              49721,
              49744,
              49707,
              49785,
              49743,
              49802,
              49781,
              49741,
              49799,
              49773,
              49818,
              49796,
              49825,
              49775,
              49859,
              49805,
              49787,
              49831,
              49782,
              49817,
              49821,
              49780,
              49828,
              49736,
              49765,
              49823,
              49735,
              49814,
              49805,
              49834,
              49867,
              49815,
              49825,
              49807,
              49803,
              49805,
              49759,
              49741,
              49767,
              49739,
              49745,
              49761,
              49745,
              49803,
              49845,
              49833,
              49745,
              49739,
              49761,
              49788,
              49742,
              49785,
              49755,
              49791,
              49737,
              49803,
              49800,
              49757,
              49695,
              49771,
              49776,
              49815,
              49790,
              49785,
              49801,
              49751,
              49767,
              49778,
              49746,
              49807,
              49815,
              49817,
              49767,
              49754,
              49753,
              49731,
              49764,
              49797,
              49701,
              49701,
              49755,
              49753,
              49761,
              49794,
              49809,
              49833,
              49840,
              49799,
              49798,
              49779,
              49802,
              49797,
              49779,
              49767,
              49769,
              49699,
              49763,
              49733,
              49776,
              49762,
              49720,
              49764,
              49775,
              49798,
              49828,
              49742,
              49732,
              49774,
              49744,
              49742,
              49762,
              49785,
              49777,
              49766,
              49767,
              49727,
              49723,
              49719,
              49758,
              49697,
              49781,
              49722,
              49754,
              49729,
              49721,
              49770,
              49747,
              49751,
              49773,
              49747,
              49719,
              49795,
              49754,
              49757,
              49717,
              49689,
              49718,
              49695,
              49749,
              49744,
              49727,
              49739,
              49767,
              49767,
              49774,
              49746,
              49724,
              49794,
              49835,
              49749,
              49791,
              49785,
              49738,
              49787,
              49802,
              49767,
              49762,
              49771,
              49767,
              49843,
              49790,
              49771,
              49783,
              49765,
              49710,
              49706,
              49742,
              49794,
              49735,
              49725,
              49730,
              49767,
              49791,
              49782,
              49823,
              49797,
              49718,
              49767,
              49772,
              49799,
              49762,
              49786,
              49787,
              49746,
              49781,
              49776,
              49718,
              49735,
              49694,
              49703,
              49707,
              49724,
              49758,
              49715,
              49686,
              49730,
              49721,
              49733,
              49735,
              49707,
              49758,
              49760,
              49731,
              49693,
              49766,
              49809,
              49747,
              49726,
              49679,
              49677,
              49792,
              49776,
              49797,
              49770,
              49757,
              49717,
              49655,
              49712,
              49694,
              49747,
              49750,
              49733,
              49783,
              49754,
              49727,
              49728,
              49703,
              49767,
              49747,
              49781,
              49773,
              49775,
              49745,
              49750,
              49735,
              49759,
              49683,
              49753,
              49759,
              49766,
              49751,
              49735,
              49742,
              49786,
              49767,
              49812,
              49721,
              49807,
              49728,
              49767,
              49816,
              49775,
              49784,
              49769,
              49803,
              49742,
              49757,
              49827,
              49764,
              49730,
              49741,
              49764,
              49739,
              49703,
              49731,
              49751,
              49786,
              49747,
              49759,
              49738,
              49765,
              49788,
              49776,
              49788,
              49747,
              49698,
              49763,
              49780,
              49763,
              49766,
              49779,
              49751,
              49763,
              49777,
              49814,
              49788,
              49771,
              49740,
              49774,
              49783,
              49783,
              49761,
              49783,
              49793,
              49760,
              49738,
              49818,
              49803,
              49794,
              49761,
              49767,
              49765,
              49803,
              49755,
              49807,
              49784,
              49768,
              49774,
              49751,
              49757,
              49821,
              49719,
              49750,
              49750,
              49742,
              49768,
              49756,
              49727,
              49761,
              49699,
              49767,
              49739,
              49756,
              49767,
              49767,
              49831,
              49822,
              49839,
              49815,
              49822,
              49796,
              49811,
              49788,
              49795,
              49778,
              49855,
              49872,
              49823,
              49834,
              49824,
              49815,
              49780,
              49821,
              49835,
              49848,
              49850,
              49836,
              49804,
              49851,
              49847,
              49843,
              49829,
              49803,
              49755,
              49795,
              49743,
              49803,
              49787,
              49809,
              49801,
              49813,
              49798,
              49833,
              49782,
              49762,
              49802,
              49797,
              49805,
              49797,
              49863,
              49826,
              49811,
              49779,
              49774,
              49735,
              49715,
              49772,
              49777,
              49762,
              49767,
              49783,
              49781,
              49816,
              49831,
              49847,
              49802,
              49835,
              49807,
              49807,
              49855,
              49787,
              49781,
              49839,
              49749,
              49757,
              49721,
              49795,
              49778,
              49703,
              49741,
              49775,
              49801,
              49799,
              49767,
              49755,
              49767,
              49794,
              49735,
              49727,
              49680,
              49781,
              49782,
              49793,
              49799,
              49805,
              49671,
              49775,
              49698,
              49759,
              49727,
              49735,
              49703,
              49755,
              49769,
              49714,
              49763,
              49772,
              49733,
              49714,
              49751,
              49735,
              49761,
              49776,
              49789,
              49724,
              49772,
              49749,
              49777,
              49755,
              49730,
              49751,
              49755,
              49767,
              49746,
              49706,
              49761,
              49755,
              49767,
              49775,
              49749,
              49759,
              49737,
              49749,
              49770,
              49775,
              49710,
              49703,
              49711,
              49735,
              49715,
              49730,
              49755,
              49767,
              49790,
              49751,
              49767,
              49760,
              49771,
              49746,
              49750,
              49711,
              49726,
              49732,
              49791,
              49727,
              49755,
              49777,
              49765,
              49791,
              49774,
              49797,
              49792,
              49753,
              49796,
              49799,
              49735,
              49745,
              49756,
              49772,
              49737,
              49749,
              49732,
              49788,
              49715,
              49826,
              49755,
              49754,
              49742,
              49735,
              49733,
              49743,
              49784,
              49783,
              49699,
              49692,
              49710,
              49665,
              49746,
              49722,
              49741,
              49695,
              49717,
              49702,
              49743,
              49719,
              49688,
              49745,
              49762,
              49769,
              49799,
              49784,
              49767,
              49805,
              49779,
              49790,
              49742,
              49802,
              49765,
              49751,
              49787,
              49722,
              49725,
              49713,
              49768,
              49757,
              49804,
              49735,
              49727,
              49703,
              49698,
              49688,
              49752,
              49759,
              49723,
              49767,
              49743,
              49731,
              49745,
              49774,
              49733,
              49734,
              49702,
              49716,
              49729,
              49762,
              49713,
              49688,
              49695,
              49696,
              49710,
              49683,
              49714,
              49718,
              49727,
              49731,
              49735,
              49717,
              49727,
              49731,
              49750,
              49773,
              49737,
              49767,
              49766,
              49732,
              49764,
              49703,
              49759,
              49775,
              49763,
              49765,
              49772,
              49750,
              49710,
              49712,
              49711,
              49769,
              49799,
              49761,
              49822,
              49807,
              49801,
              49766,
              49764,
              49775,
              49799,
              49767,
              49722,
              49742,
              49755,
              49777,
              49799,
              49755,
              49725,
              49767,
              49743,
              49767,
              49742,
              49690,
              49753,
              49743,
              49792,
              49786,
              49781,
              49819,
              49751,
              49787,
              49767,
              49776,
              49807,
              49807,
              49751,
              49748,
              49699,
              49799,
              49767,
              49757,
              49781,
              49703,
              49678,
              49689,
              49698,
              49733,
              49694,
              49735,
              49698,
              49763,
              49782,
              49759,
              49765,
              49780,
              49699,
              49758,
              49724,
              49706,
              49803,
              49718,
              49734,
              49705,
              49767,
              49714,
              49773,
              49779,
              49735,
              49744,
              49777,
              49764,
              49757,
              49749,
              49729,
              49733,
              49744,
              49763,
              49774,
              49808,
              49787,
              49753,
              49695,
              49745,
              49731,
              49703,
              49764,
              49721,
              49719,
              49767,
              49773,
              49705,
              49673,
              49703,
              49735,
              49749,
              49751,
              49730,
              49761,
              49744,
              49713,
              49751,
              49787,
              49767,
              49747,
              49714,
              49733,
              49747,
              49808,
              49814,
              49788,
              49767,
              49790,
              49769,
              49783,
              49765,
              49787,
              49749,
              49751,
              49782,
              49674,
              49752,
              49733,
              49766,
              49735,
              49683,
              49749,
              49784,
              49767,
              49726,
              49726,
              49713,
              49703,
              49676,
              49663,
              49703,
              49671,
              49707,
              49719,
              49670,
              49744,
              49703,
              49727,
              49726,
              49735,
              49683,
              49678,
              49727,
              49762,
              49700,
              49768,
              49754,
              49760,
              49719,
              49695,
              49698,
              49700,
              49671,
              49734,
              49700,
              49703,
              49762,
              49768,
              49664,
              49747,
              49685,
              49741,
              49718,
              49791,
              49729,
              49790,
              49831,
              49801,
              49817,
              49842,
              49780,
              49750,
              49783,
              49794,
              49766,
              49797,
              49743,
              49782,
              49767,
              49728,
              49725,
              49731,
              49795,
              49811,
              49786,
              49764,
              49703,
              49822,
              49791,
              49767,
              49726,
              49769,
              49747,
              49740,
              49793,
              49825,
              49745,
              49841,
              49815,
              49825,
              49779,
              49771,
              49819,
              49821,
              49849,
              49787,
              49816,
              49815,
              49773,
              49756,
              49811,
              49766,
              49759,
              49792,
              49797,
              49766,
              49739,
              49727,
              49850,
              49834,
              49806,
              49784,
              49719,
              49780,
              49789,
              49712,
              49754,
              49772,
              49815,
              49768,
              49761,
              49767,
              49713,
              49718,
              49760,
              49719,
              49767,
              49713,
              49759,
              49715,
              49741,
              49735,
              49707,
              49732,
              49788,
              49881,
              49809,
              49767,
              49804,
              49747,
              49742,
              49789,
              49805,
              49807,
              49741,
              49781,
              49823,
              49795,
              49773,
              49767,
              49771,
              49753,
              49742,
              49809,
              49747,
              49761,
              49761,
              49770,
              49767,
              49763,
              49727,
              49750,
              49777,
              49753,
              49764,
              49783,
              49823,
              49769,
              49827,
              49683,
              49735,
              49742,
              49759,
              49781,
              49744,
              49780,
              49738,
              49767,
              49814,
              49771,
              49842,
              49887,
              49799,
              49788,
              49760,
              49836,
              49750,
              49774,
              49745,
              49760,
              49782,
              49793,
              49774,
              49774,
              49729,
              49775,
              49741,
              49815,
              49824,
              49842,
              49811,
              49778,
              49785,
              49787,
              49794,
              49784,
              49792,
              49819,
              49802,
              49780,
              49783,
              49788,
              49723,
              49765,
              49767,
              49750,
              49747,
              49777,
              49741,
              49717,
              49801,
              49787,
              49770,
              49683,
              49761,
              49734,
              49735,
              49694,
              49782,
              49712,
              49751,
              49697,
              49743,
              49737,
              49781,
              49719,
              49724,
              49783,
              49793,
              49819,
              49796,
              49747,
              49801,
              49880,
              49773,
              49705,
              49754,
              49823,
              49757,
              49775,
              49814,
              49767,
              49729,
              49767,
              49735,
              49785,
              49839,
              49806,
              49861,
              49803,
              49830,
              49833,
              49770,
              49802,
              49747,
              49735,
              49739,
              49743,
              49799,
              49791,
              49767,
              49790,
              49807,
              49802,
              49707,
              49764,
              49745,
              49774,
              49715,
              49687,
              49785,
              49813,
              49841,
              49758,
              49791,
              49787,
              49759,
              49687,
              49735,
              49715,
              49760
            ]
          },
          {
            "time": "1500062285511",
            "light_intensity": 11.4,
            "r": 8,
            "g": 3,
            "b": 2,
            "light_intensity_raw": 13,
            "temperature": 25.21,
            "humidity": 49.483,
            "pressure": 987.502,
            "temperature2": 25.37,
            "humidity2": 44.717,
            "pressure2": 986.438,
            "contactless_temp": 25.66,
            "thickness": 0.09,
            "compass_direction": "E",
            "compass": 90,
            "angle": 2.299,
            "angle_direction": "SE",
            "pitch": 1.1,
            "roll": 2.02,
            "air_flow": -1,
            "data_raw": [
              55,
              49829,
              54,
              49787,
              54,
              49755,
              57,
              49780,
              57,
              49787,
              51,
              49784,
              56,
              49801,
              55,
              49817,
              53,
              49798,
              56,
              49782,
              55,
              49803,
              54,
              49803,
              59,
              49814,
              57,
              49843,
              52,
              49825,
              57,
              49763,
              53,
              49790,
              55,
              49775,
              55,
              49735,
              53,
              49755,
              54,
              49828,
              52,
              49737,
              57,
              49756,
              57,
              49803,
              55,
              49834,
              55,
              49714,
              55,
              49759,
              55,
              49807,
              55,
              49775,
              54,
              49750,
              55,
              49790,
              57,
              49743,
              55,
              49787,
              54,
              49776,
              55,
              49811,
              55,
              49800,
              55,
              49742,
              57,
              49799,
              54,
              49771,
              53,
              49849,
              55,
              49820,
              55,
              49743,
              57,
              49690,
              54,
              49781,
              50,
              49698,
              57,
              49732,
              54,
              49758,
              56,
              49719,
              53,
              49768,
              55,
              49777,
              55,
              49763,
              57,
              49757,
              52,
              49735,
              55,
              49764,
              54,
              49737,
              56,
              49771,
              55,
              49804,
              56,
              49778,
              54,
              49779,
              54,
              49827,
              55,
              49836,
              55,
              49764,
              54,
              49847,
              52,
              49710,
              58,
              49810,
              55,
              49825,
              56,
              49765,
              54,
              49793,
              54,
              49845,
              53,
              49763,
              56,
              49766,
              55,
              49819,
              57,
              49795,
              56,
              49768,
              56,
              49756,
              57,
              49853,
              55,
              49769,
              53,
              49779,
              54,
              49835,
              53,
              49778,
              59,
              49815,
              56,
              49791,
              53,
              49867,
              55,
              49862,
              55,
              49799,
              54,
              49839,
              54,
              49858,
              51,
              49827,
              53,
              49820,
              54,
              49847,
              53,
              49882,
              56,
              49841,
              53,
              49816,
              53,
              49847,
              54,
              49847,
              53,
              49846,
              55,
              49897,
              55,
              49837,
              55,
              49883,
              53,
              49823,
              72,
              49885,
              71,
              49825,
              70,
              49875,
              66,
              49875,
              69,
              49802,
              69,
              49902,
              69,
              49863,
              69,
              49887,
              68,
              49894,
              67,
              49882,
              67,
              49844,
              67,
              49843,
              71,
              49941,
              71,
              49902,
              71,
              49887,
              68,
              49903,
              70,
              49893,
              70,
              49845,
              68,
              49839,
              69,
              49846,
              70,
              49913,
              69,
              49869,
              69,
              49842,
              70,
              49920,
              69,
              49870,
              70,
              49857,
              68,
              49811,
              69,
              49916,
              67,
              49907,
              66,
              49807,
              65,
              49751,
              66,
              49819,
              65,
              49807,
              67,
              49766,
              67,
              49812,
              71,
              49836,
              64,
              49783,
              65,
              49786,
              66,
              49855,
              67,
              49892,
              68,
              49905,
              68,
              49905,
              63,
              49792,
              68,
              49795,
              65,
              49735,
              64,
              49745,
              65,
              49770,
              62,
              49831,
              63,
              49842,
              67,
              49802,
              63,
              49735,
              65,
              49802,
              66,
              49866,
              65,
              49849,
              64,
              49797,
              64,
              49768,
              66,
              49831,
              65,
              49817,
              65,
              49805,
              67,
              49784,
              63,
              49801,
              65,
              49774,
              64,
              49741,
              67,
              49773,
              66,
              49772,
              61,
              49766,
              66,
              49725,
              63,
              49746,
              65,
              49684,
              64,
              49795,
              67,
              49703,
              61,
              49703,
              64,
              49777,
              63,
              49874,
              64,
              49855,
              63,
              49857,
              63,
              49831,
              62,
              49803,
              60,
              49780,
              61,
              49750,
              62,
              49745,
              64,
              49767,
              63,
              49727,
              63,
              49767,
              68,
              49739,
              66,
              49738,
              63,
              49782,
              63,
              49773,
              61,
              49749,
              61,
              49745,
              53,
              49679,
              54,
              49794,
              57,
              49844,
              53,
              49710,
              55,
              49803,
              53,
              49741,
              54,
              49767,
              53,
              49786,
              51,
              49775,
              54,
              49751,
              54,
              49793,
              53,
              49849,
              55,
              49758,
              54,
              49742,
              58,
              49783,
              78,
              49799,
              55,
              49766,
              57,
              49741,
              55,
              49709,
              54,
              49734,
              53,
              49799,
              53,
              49783,
              56,
              49762,
              54,
              49774,
              53,
              49751,
              54,
              49721,
              52,
              49794,
              55,
              49767,
              53,
              49785,
              57,
              49755,
              52,
              49817,
              70,
              49783,
              69,
              49759,
              69,
              49794,
              71,
              49737,
              69,
              49766,
              69,
              49822,
              70,
              49739,
              70,
              49775,
              68,
              49799,
              68,
              49767,
              66,
              49790,
              65,
              49779,
              69,
              49766,
              69,
              49718,
              66,
              49809,
              66,
              49779,
              67,
              49854,
              70,
              49773,
              69,
              49838,
              68,
              49800,
              67,
              49733,
              67,
              49818,
              67,
              49741,
              67,
              49819,
              70,
              49725,
              67,
              49823,
              70,
              49776,
              65,
              49757,
              67,
              49791,
              65,
              49842,
              66,
              49817,
              65,
              49823,
              65,
              49831,
              64,
              49784,
              65,
              49812,
              66,
              49831,
              65,
              49803,
              66,
              49810,
              67,
              49800,
              66,
              49775,
              66,
              49803,
              68,
              49774,
              66,
              49755,
              65,
              49732,
              63,
              49795,
              62,
              49753,
              64,
              49770,
              62,
              49798,
              62,
              49820,
              64,
              49773,
              64,
              49819,
              64,
              49694,
              61,
              49703,
              63,
              49830,
              64,
              49742,
              66,
              49791,
              64,
              49789,
              63,
              49735,
              63,
              49766,
              62,
              49799,
              60,
              49777,
              62,
              49815,
              59,
              49770,
              61,
              49803,
              61,
              49765,
              63,
              49755,
              61,
              49777,
              59,
              49812,
              62,
              49770,
              62,
              49867,
              60,
              49847,
              59,
              49808,
              63,
              49814,
              61,
              49780,
              52,
              49855,
              55,
              49841,
              53,
              49785,
              54,
              49749,
              53,
              49790,
              55,
              49745,
              52,
              49749,
              53,
              49753,
              56,
              49770,
              54,
              49827,
              55,
              49820,
              54,
              49777,
              51,
              49807,
              56,
              49823,
              55,
              49817
            ]
          },
          {
            "time": "1500062291922",
            "light_intensity": 20.834,
            "r": 19,
            "g": 7,
            "b": 5,
            "light_intensity_raw": 30,
            "temperature": 25.3,
            "humidity": 49.417,
            "pressure": 987.522,
            "temperature2": 25.46,
            "humidity2": 44.642,
            "pressure2": 986.455,
            "contactless_temp": 24.85,
            "thickness": 0.09,
            "compass_direction": "E",
            "compass": 90,
            "angle": 1.258,
            "angle_direction": "SE",
            "pitch": 1.09,
            "roll": 0.63,
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062292362",
            "light_intensity": 20.147,
            "r": 17,
            "g": 7,
            "b": 5,
            "light_intensity_raw": 28,
            "temperature": 25.3,
            "humidity": 49.417,
            "pressure": 987.561,
            "temperature2": 25.46,
            "humidity2": 44.662,
            "pressure2": 986.443,
            "contactless_temp": 25.66,
            "thickness": 0.09,
            "compass_direction": "E",
            "compass": 90,
            "angle": 1.723,
            "angle_direction": "SE",
            "pitch": 1.33,
            "roll": 1.1,
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062292801",
            "light_intensity": 19.535,
            "r": 16,
            "g": 7,
            "b": 4,
            "light_intensity_raw": 27,
            "temperature": 25.31,
            "humidity": 49.406,
            "pressure": 987.531,
            "temperature2": 25.47,
            "humidity2": 44.674,
            "pressure2": 986.441,
            "contactless_temp": 24.85,
            "thickness": 0.09,
            "compass_direction": "E",
            "compass": 90,
            "angle": 1.579,
            "angle_direction": "SE",
            "pitch": 1.32,
            "roll": 0.86,
            "air_flow": -1,
            "data_raw": [

            ]
          },
          {
            "time": "1500062293240",
            "detector_read1": 7057,
            "detector_read2": 65535,
            "light_intensity": 19.535,
            "r": 16,
            "g": 7,
            "b": 4,
            "light_intensity_raw": 27,
            "temperature": 25.32,
            "humidity": 49.396,
            "pressure": 987.506,
            "temperature2": 25.47,
            "humidity2": 44.653,
            "pressure2": 986.428,
            "contactless_temp": 25.7,
            "thickness": 0.09,
            "compass_direction": "E",
            "compass": 90,
            "angle": 1.592,
            "angle_direction": "SE",
            "pitch": 1.33,
            "roll": 0.87,
            "air_flow": -1,
            "recall": {
              "time": "1500062293650",
              "colorcal_blank1[1]": 21983,
              "colorcal_blank1[2]": 28172.5,
              "colorcal_blank1[3]": 29489,
              "colorcal_blank1[4]": 37150,
              "colorcal_blank1[6]": 30644.5,
              "colorcal_blank1[8]": 31670,
              "colorcal_blank1[9]": 25601.5,
              "colorcal_blank1[10]": 30224.5,
              "colorcal_blank2[1]": 23637,
              "colorcal_blank2[2]": 23502.5,
              "colorcal_blank2[3]": 24913.5,
              "colorcal_blank2[4]": 22816.5,
              "colorcal_blank2[6]": 16437.5,
              "colorcal_blank2[8]": 17945.5,
              "colorcal_blank2[9]": 18201,
              "colorcal_blank2[10]": 16425.5,
              "colorcal_blank3[1]": 20336.5,
              "colorcal_blank3[2]": 11211.5,
              "colorcal_blank3[3]": 18805.5,
              "colorcal_blank3[4]": 14531.5,
              "colorcal_blank3[6]": 5275,
              "colorcal_blank3[8]": 5942,
              "colorcal_blank3[9]": 4925.5,
              "colorcal_blank3[10]": 5376,
              "colorcal_intensity1_slope[2]": 2.631,
              "colorcal_intensity1_yint[2]": -0.1,
              "colorcal_intensity2_slope[2]": 2.01,
              "colorcal_intensity2_yint[2]": 21.9,
              "colorcal_intensity3_slope[2]": 1.457,
              "colorcal_intensity3_yint[2]": 9.7,
              "ir_baseline_slope[5]": 13995,
              "ir_baseline_yint[5]": 20427.5,
              "ir_baseline_slope[3]": 516,
              "ir_baseline_yint[3]": 669
            },
            "data_raw": [
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              24453,
              28331,
              28358,
              28348,
              28360,
              28359,
              28361,
              28351,
              28358,
              28357,
              53504,
              31081,
              30939,
              30935,
              30927,
              30918,
              30918,
              30914,
              30915,
              30919,
              9605,
              36232,
              36396,
              36332,
              36424,
              36453,
              36474,
              36394,
              36371,
              36415,
              65535,
              31418,
              30667,
              30551,
              30506,
              30484,
              30483,
              30469,
              30476,
              30465,
              28799,
              31672,
              31678,
              31683,
              31678,
              31687,
              31687,
              31693,
              31679,
              31681,
              40758,
              26735,
              26547,
              26527,
              26511,
              26504,
              26503,
              26503,
              26495,
              26499,
              47055,
              30403,
              30209,
              30182,
              30175,
              30176,
              30172,
              30166,
              30169,
              30159,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535
            ]
          },
          {
            "time": "1500062293678",
            "air_flow": -1,
            "data_raw": [

            ]
          }
        ],
        "data_raw": [

        ]
      }
    ]
  ],
  "app_os": "darwin-x64",
  "app_name": "PhotosynQ",
  "app_version": "0.0.11-DMK",
  "app_device": "x64",
  "location": [
    "42.7223315",
    "-84.4746536"
  ],
  "time_offset": "America/Detroit",
  "ConsoleMacro": "359"
}
Default avatar
Created by

Isaac Osei-Bonsu


Protocol connections:
1
Latest Update:
Jul 2017