RIDES1_3_1_KWS_t1


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
output.n_sets=json.set.length;

// Define the protocol set numbers for each data set

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

//output.label=json.set[2].label;

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

//output.ecs=json.set[ECS_LEFdset].data_raw;
//output.P700_DIRK_set=json.set[P700_DIRK_set].data_raw;
//output.PAM_set=json.set[PAM_set].data_raw;

//return output;

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

var Phi2_bar ="0: ";
for (var i=0; i< (10*output.Phi2); i++){
  Phi2_bar+="█";
}
for (var i=10*output.Phi2; i< 10; i++){
  Phi2_bar+="░";
}
Phi2_bar+=" :1.0 (";
Phi2_bar+=output.Phi2;
Phi2_bar+=")";

output.YII=Phi2_bar;

// 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[ECS_LEFdset].humidity,
                        json.set[P700_DIRK_set].humidity,
                        json.set[PAM_set].humidity
                       ];
  	output.humidity_K=humidity_kinetics;
  	output.humidity_K_T=humidity_kinetics.join(", ");

    var humidity2_kinetics=[
                        json.set[ECS_LEFdset].humidity2,
                        json.set[P700_DIRK_set].humidity2,
                        json.set[PAM_set].humidity2
                       ];

	output.humidity2_K=humidity2_kinetics;
  	output.humidity2_K_T=humidity2_kinetics.join(", ");


   // changes in leaf contactless_temp
  
    var air_temp_kinetics=[
                                json.set[ECS_LEFdset].temperature, 
                                json.set[P700_DIRK_set].temperature, 
                                json.set[PAM_set].temperature 
                       ];
    
     var contactless_temp_kinetics=[
                                json.set[ECS_LEFdset].contactless_temp,
                                json.set[P700_DIRK_set].contactless_temp,
                                json.set[PAM_set].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_temperature=json.set[2].temperature;
  output.ambient_temperature=ambient_temperature;
  //var leaf_RH=json.set[1].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);



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

output["order"] = ["Phi2", "Phi2_bar", "LEF", "NPQt", "SPAD", "PSI_act", "PSI_open", "tP700", "PSI_or", "PSI_ox", "ambient_temperture"];
output.LEF=output.light_intensity *output.Phi2;

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

        ],
        "protocol_id": 1,
        "set": [
          {
            "time": 1502200406205,
            "blank:": "blank"
          },
          {
            "time": 1502200406216,
            "label": "",
            "light_intensity": 21.675,
            "r": 20,
            "g": 8,
            "b": 5,
            "light_intensity_raw": 32,
            "temperature": 25.27,
            "humidity": 48.083,
            "pressure": 990.926,
            "temperature2": 25.45,
            "humidity2": 43.402,
            "pressure2": 989.973,
            "contactless_temp": 25.84,
            "compass_direction": "W",
            "compass": 270,
            "angle": 37.729,
            "angle_direction": "NE",
            "pitch": 21.08,
            "roll": -32.04,
            "data_raw": [

            ]
          },
          {
            "time": 1502200407786,
            "label": "",
            "light_intensity": 1601.571,
            "r": 2068,
            "g": 659,
            "b": 483,
            "light_intensity_raw": 3031,
            "temperature": 25.3,
            "humidity": 47.986,
            "pressure": 990.946,
            "temperature2": 25.49,
            "humidity2": 43.321,
            "pressure2": 989.956,
            "contactless_temp": 25.7,
            "thickness": 0.25,
            "data_raw": [
              55719,
              55151,
              55130,
              55123,
              55129,
              55121,
              55127,
              55128,
              55125,
              55127,
              55127,
              55124,
              55117,
              55122,
              55131,
              55125,
              55132,
              55131,
              55128,
              55129,
              55122,
              55133,
              55130,
              55135,
              55120,
              55121,
              55130,
              55130,
              55139,
              55128,
              55140,
              55123,
              55131,
              55131,
              55132,
              55143,
              55127,
              55130,
              55133,
              55131,
              55141,
              55143,
              55142,
              55127,
              55137,
              55139,
              55132,
              55141,
              55140,
              55133,
              55126,
              55147,
              55143,
              55138,
              55143,
              55143,
              55143,
              55143,
              55137,
              55140,
              55142,
              55141,
              55143,
              55147,
              55147,
              55143,
              55143,
              55135,
              55147,
              55149,
              55143,
              55146,
              55143,
              55143,
              55136,
              55144,
              55150,
              55143,
              55143,
              55133,
              55145,
              55146,
              55146,
              55153,
              55133,
              55142,
              55147,
              55154,
              55147,
              55147,
              55157,
              55139,
              55151,
              55153,
              55155,
              55134,
              55148,
              55154,
              55143,
              55161,
              55159,
              55149,
              55145,
              55161,
              55151,
              55157,
              55158,
              55151,
              55163,
              55147,
              55164,
              55165,
              55147,
              55165,
              55157,
              55173,
              55161,
              55171,
              55167,
              55155,
              55166,
              55175,
              55170,
              55171,
              55167,
              55162,
              55163,
              55167,
              55172,
              55175,
              55170,
              55158,
              55170,
              55164,
              55166,
              55175,
              55184,
              55161,
              55164,
              55157,
              55158,
              55162,
              55171,
              55175,
              55174,
              55157,
              55165,
              55171,
              55164,
              55165,
              55169,
              55159,
              55157,
              55169,
              55159,
              55171,
              55167,
              55163,
              55158,
              55167,
              55171,
              55166,
              55175,
              55175,
              55172,
              55169,
              55175,
              55170,
              55177,
              55171,
              55179,
              55177,
              55165,
              55175,
              55175,
              55174,
              55173,
              55179,
              55179,
              55183,
              55177,
              55175,
              55175,
              55178,
              55187,
              55185,
              55161,
              55175,
              55186,
              55175,
              55182,
              55187,
              55169,
              55175,
              55179,
              55187,
              55182,
              55186,
              55177,
              55179,
              55193,
              55215,
              55236,
              55238,
              55255,
              55251,
              55267,
              55265,
              55274,
              55283,
              55271,
              55290,
              55292,
              55306,
              55297,
              55317,
              55319,
              55307,
              55324,
              55319,
              55312,
              55245,
              55230,
              55231,
              55217,
              55218,
              55224,
              55215,
              55219,
              55215,
              55211,
              55203,
              55207,
              55207,
              55203,
              55203,
              55203,
              55197,
              55201,
              55207,
              55198,
              55207,
              55199,
              55192,
              55195,
              55185,
              55204,
              55201,
              55185,
              55194,
              55187,
              55191,
              55191,
              55196,
              55188,
              55191,
              55197,
              55195,
              55200,
              55182,
              55197,
              55194,
              55189,
              55205,
              55206,
              55190,
              55187,
              55197,
              55194,
              55198,
              55194,
              55194,
              55201,
              55198,
              55197,
              55196,
              55196,
              55195,
              55207,
              55204,
              55201,
              55193,
              55201,
              55198,
              55202,
              55203,
              55186,
              55199,
              55200,
              55199,
              55197,
              55191,
              55195,
              55199,
              55198,
              55187,
              55199,
              55193,
              55202,
              55201,
              55203,
              55194,
              55195,
              55206,
              55192,
              55204,
              55207,
              55207,
              55191,
              55189,
              55202,
              55201,
              55212,
              55196,
              55207,
              55207,
              55202,
              55212,
              55199,
              55195,
              55208,
              55207,
              55207,
              55215,
              55211,
              55198,
              55207,
              55207,
              55211,
              55209,
              55207,
              55200,
              55201,
              55210,
              55206,
              55201,
              55198,
              55206,
              55211,
              55209,
              55210,
              55217,
              55207,
              55203,
              55209,
              55207,
              55201,
              55210,
              55207,
              55202,
              55205,
              55213,
              55209,
              55214,
              55209,
              55207,
              55207,
              55207,
              55216,
              55214,
              55205,
              55207,
              55207,
              55209,
              55209,
              55207,
              55214,
              55209,
              55196,
              55206,
              55207,
              55203,
              55214,
              55208,
              55207,
              55210,
              55214,
              55211,
              55211,
              55207,
              55207,
              55207,
              55217,
              55218,
              55204,
              55209,
              55207,
              55219,
              55219,
              55207,
              55217,
              55214,
              55213,
              55217,
              55214,
              55202,
              55215,
              55225,
              55217,
              55207,
              55225,
              55215,
              55218,
              55220,
              55219,
              55207,
              55211,
              55216,
              55227,
              55214,
              55212,
              55220,
              55223,
              55217,
              55227,
              55214,
              55212,
              55225,
              55214,
              55223,
              55233,
              55247,
              55272,
              55280,
              55295,
              55293,
              55303,
              55307,
              55317,
              55323,
              55329,
              55327,
              55332,
              55335,
              55330,
              55342,
              55351,
              55358,
              55353,
              55360,
              55359,
              55279,
              55273,
              55262,
              55249,
              55252,
              55257,
              55256,
              55239,
              55245,
              55241,
              55239,
              55241,
              55246,
              55239,
              55238,
              55228,
              55247,
              55239,
              55239,
              55238,
              55239,
              55230,
              55219,
              55247,
              55224,
              55235,
              55241,
              55226,
              55225,
              55232,
              55234,
              55235,
              55234,
              55225,
              55223,
              55226,
              55234,
              55245,
              55223,
              55217,
              55228,
              55231,
              55227,
              55231,
              55228,
              55225,
              55235,
              55232,
              55233,
              55229,
              55230,
              55231,
              55230,
              55230,
              55229,
              55226,
              55223,
              55218,
              55233,
              55223,
              55231,
              55242,
              55223,
              55223,
              55233,
              55235,
              55234,
              55239,
              55225,
              55227,
              55229,
              55237,
              55236,
              55231,
              55222,
              55227,
              55231,
              55222,
              55237,
              55232,
              55217,
              55231,
              55235,
              55231,
              55231,
              55238,
              55227,
              55225,
              55227,
              55228,
              55231,
              55234,
              55231,
              55239,
              55232,
              55237,
              55241,
              55227,
              55229,
              55232,
              55238,
              55239,
              55235,
              55231,
              55234,
              55227,
              55234,
              55239,
              55223,
              55228,
              55227,
              55237,
              55233,
              55241,
              55235,
              55221,
              55237,
              55240,
              55237,
              55235,
              55247,
              55239,
              55223,
              55233,
              55235,
              55241,
              55236,
              55244,
              55235,
              55232,
              55238,
              55243,
              55243,
              55237,
              55231,
              55239,
              55234,
              55239,
              55239,
              55241,
              55221,
              55239,
              55239,
              55244,
              55242,
              55239,
              55239,
              55239,
              55245,
              55246,
              55239,
              55231,
              55232,
              55242,
              55239,
              55241,
              55234,
              55238,
              55239,
              55239,
              55237,
              55240,
              55239,
              55239,
              55241,
              55241,
              55231,
              55238,
              55235,
              55244,
              55247,
              55239,
              55231,
              55245,
              55239,
              55238,
              55250,
              55247,
              55254,
              55237,
              55245,
              55245,
              55246,
              55251,
              55242,
              55242,
              55243,
              55251,
              55247,
              55241,
              55250,
              55249,
              55249,
              55247,
              55257,
              55241,
              55247,
              55246,
              55255,
              55271,
              55278,
              55289,
              55315,
              55316,
              55331,
              55334,
              55330,
              55335,
              55354,
              55361,
              55359,
              55363,
              55369,
              55375,
              55377,
              55380,
              55374,
              55378,
              55382,
              55390,
              55306,
              55283,
              55297,
              55278,
              55274,
              55277,
              55272,
              55269,
              55268,
              55275,
              55273,
              55254,
              55265,
              55262,
              55273,
              55265,
              55262,
              55263,
              55251,
              55271,
              55271,
              55259,
              55254,
              55267,
              55265,
              55257,
              55254,
              55255,
              55255,
              55251,
              55263,
              55251,
              55246,
              55249,
              55258,
              55263,
              55255,
              55255,
              55255,
              55255,
              55255,
              55253,
              55265,
              55252,
              55247,
              55252,
              55251,
              55245,
              55262,
              55255,
              55242,
              55250,
              55254,
              55250,
              55250,
              55261,
              55256,
              55239,
              55245,
              55258,
              55255,
              55251,
              55251,
              55253,
              55257,
              55253,
              55251,
              55255,
              55246,
              55259,
              55263,
              55265,
              55247,
              55257,
              55249,
              55252,
              55263,
              55255,
              55247,
              55237,
              55253,
              55258,
              55254,
              55252,
              55260,
              55257,
              55247,
              55247,
              55251,
              55259,
              55259,
              55255,
              55243,
              55255,
              55245,
              55255,
              55256,
              55238,
              55251,
              55254,
              55252,
              55257,
              55252,
              55251,
              55242,
              55253,
              55262,
              55252,
              55241,
              55264,
              55251,
              55247,
              55259,
              55259,
              55247,
              55252,
              55259,
              55254,
              55254,
              55251,
              55251,
              55256,
              55252,
              55262,
              55258,
              55264,
              55243,
              55253,
              55258,
              55251,
              55259,
              55264,
              55260,
              55244,
              55255,
              55259,
              55253,
              55250,
              55251,
              55255,
              55248,
              55251,
              55265,
              55265,
              55252,
              55255,
              55254,
              55255,
              55252,
              55253,
              55255,
              55255,
              55262,
              55264,
              55250,
              55252,
              55263,
              55258,
              55255,
              55263,
              55262,
              55255,
              55247,
              55261,
              55255,
              55263,
              55252,
              55259,
              55271,
              55255,
              55251,
              55255,
              55263,
              55260,
              55257,
              55263,
              55255,
              55250,
              55256,
              55266,
              55263,
              55259,
              55263,
              55250,
              55255,
              55264,
              55265,
              55256,
              55257,
              55255,
              55260,
              55258,
              55263,
              55266,
              55259,
              55250,
              55265,
              55257,
              55262,
              55275,
              55303,
              55315,
              55315,
              55331,
              55344,
              55340,
              55360,
              55361,
              55359,
              55359,
              55369,
              55377,
              55379,
              55387,
              55377,
              55394,
              55385,
              55391,
              55403,
              55395,
              55317,
              55303,
              55299,
              55284,
              55287,
              55279,
              55275,
              55274,
              55270,
              55282,
              55284,
              55282,
              55271,
              55271,
              55267,
              55266,
              55276,
              55265,
              55263,
              55268,
              55268,
              55263,
              55273,
              55271,
              55263,
              55259,
              55273,
              55275,
              55263,
              55271,
              55264,
              55260,
              55265,
              55260,
              55269,
              55266,
              55262,
              55263,
              55258,
              55263,
              55271,
              55268,
              55253,
              55263,
              55263,
              55274,
              55264,
              55266,
              55263,
              55252,
              55265,
              55262,
              55267,
              55259,
              55264,
              55256,
              55261,
              55257,
              55268,
              55277,
              55269,
              55263,
              55265,
              55270,
              55266,
              55261,
              55267,
              55257,
              55267,
              55263,
              55271,
              55263,
              55261,
              55269,
              55267,
              55269,
              55275,
              55263,
              55257,
              55263,
              55263,
              55273,
              55264,
              55256,
              55269,
              55270,
              55263,
              55275,
              55275,
              55247,
              55267,
              55274,
              55276,
              55262,
              55278,
              55267,
              55263,
              55263,
              55271,
              55271,
              55270,
              55263,
              55270,
              55263,
              55267,
              55269,
              55261,
              55264,
              55263,
              55279,
              55269,
              55271,
              55268,
              55271,
              55271,
              55264,
              55260,
              55271,
              55263,
              55270,
              55271,
              55270,
              55266,
              55269,
              55273,
              55274,
              55262,
              55269,
              55273,
              55269,
              55267,
              55271,
              55260,
              55267,
              55267,
              55271,
              55270,
              55272,
              55264,
              55276,
              55268,
              55273,
              55280,
              55275,
              55256,
              55271,
              55276,
              55267,
              55274,
              55266,
              55277,
              55265,
              55277,
              55266,
              55269,
              55263,
              55270,
              55277,
              55257,
              55271,
              55276,
              55279,
              55272,
              55273,
              55263,
              55267,
              55270,
              55274,
              55284,
              55263,
              55271,
              55277,
              55283,
              55271,
              55269,
              55271,
              55271,
              55284,
              55276,
              55274,
              55265,
              55275,
              55270,
              55279,
              55268,
              55271,
              55282,
              55277,
              55280,
              55283,
              55271,
              55268,
              55279,
              55271,
              55283,
              55271,
              55270,
              55271,
              55267,
              55283,
              55325,
              55335,
              55330,
              55335,
              55359,
              55349,
              55362,
              55372,
              55367,
              55371,
              55381,
              55386,
              55395,
              55393,
              55393,
              55395,
              55401,
              55407,
              55391,
              55408,
              55328,
              55323,
              55317,
              55294,
              55289,
              55293,
              55293,
              55290,
              55291,
              55293,
              55271,
              55275,
              55280,
              55288,
              55279,
              55289,
              55284,
              55276,
              55275,
              55281,
              55282,
              55276,
              55288,
              55269,
              55278,
              55279,
              55281,
              55279,
              55276,
              55263,
              55276,
              55275,
              55275,
              55276,
              55282,
              55274,
              55262,
              55281,
              55272,
              55275,
              55276,
              55283,
              55274,
              55271,
              55274,
              55277,
              55274,
              55265,
              55274,
              55278,
              55271,
              55277,
              55271,
              55271,
              55267,
              55273,
              55281,
              55279,
              55263,
              55273,
              55281,
              55281,
              55286,
              55273,
              55268,
              55271,
              55271,
              55282,
              55280,
              55282,
              55278,
              55277,
              55267,
              55281,
              55280,
              55275,
              55271,
              55281,
              55281,
              55271,
              55276,
              55279,
              55276,
              55282,
              55273,
              55283,
              55273,
              55277,
              55282,
              55281,
              55263,
              55271,
              55279,
              55281,
              55271,
              55276,
              55279,
              55271,
              55277,
              55279,
              55281,
              55267,
              55276,
              55274,
              55275,
              55277,
              55267,
              55281,
              55271,
              55281,
              55282,
              55273,
              55268,
              55271,
              55279,
              55277,
              55267,
              55275,
              55277,
              55283,
              55283,
              55286,
              55267,
              55282,
              55284,
              55287,
              55277,
              55271,
              55283,
              55290,
              55274,
              55287,
              55277,
              55281,
              55271,
              55286,
              55287,
              55271,
              55271,
              55276,
              55275,
              55276,
              55271,
              55281,
              55279,
              55288,
              55279,
              55279,
              55273,
              55281,
              55280,
              55273,
              55269,
              55283,
              55283,
              55279,
              55278,
              55266,
              55274,
              55271,
              55289,
              55286,
              55275,
              55279,
              55281,
              55290,
              55271,
              55278,
              55283,
              55290,
              55278,
              55276,
              55280,
              55286,
              55281,
              55289,
              55277,
              55271,
              55290,
              55287,
              55279,
              55285,
              55282,
              55287,
              55278,
              55291,
              55281,
              55287,
              55271,
              55283,
              55287,
              55267,
              55281,
              55283,
              55290,
              55285,
              55283,
              55273,
              55271,
              55275,
              55334,
              55338,
              55347,
              55363,
              55362,
              55357,
              55367,
              55374,
              55391,
              55392,
              55387,
              55387,
              55401,
              55398,
              55411,
              55416,
              55399,
              55407,
              55421,
              55434,
              55347,
              55329,
              55311,
              55303,
              55306,
              55310,
              55310,
              55283,
              55299,
              55294,
              55291,
              55292,
              55290,
              55294,
              55275,
              55291,
              55296,
              55271,
              55281,
              55283,
              55289,
              55281,
              55286,
              55272,
              55279,
              55281,
              55280,
              55279,
              55279,
              55270,
              55282,
              55279,
              55278,
              55293,
              55273,
              55273,
              55279,
              55277,
              55282,
              55281,
              55278,
              55283,
              55282,
              55270,
              55285,
              55289,
              55279,
              55271,
              55287,
              55282,
              55276,
              55282,
              55282,
              55281,
              55282,
              55276,
              55280,
              55272,
              55287,
              55289,
              55280,
              55274,
              55281,
              55282,
              55271,
              55286,
              55284,
              55277,
              55276,
              55279,
              55291,
              55277,
              55274,
              55282,
              55284,
              55286,
              55286,
              55277,
              55271,
              55275,
              55277,
              55283,
              55288,
              55287,
              55281,
              55271,
              55285,
              55284,
              55284,
              55277,
              55287,
              55282,
              55276,
              55282,
              55284,
              55285,
              55279,
              55283,
              55285,
              260,
              272,
              273,
              273,
              274,
              277,
              276,
              275,
              271,
              280,
              283,
              279,
              273,
              275,
              273,
              271,
              276,
              278,
              277,
              273,
              172,
              271,
              263,
              260,
              258,
              260,
              264,
              249,
              249,
              252,
              248,
              241,
              240,
              245,
              246,
              242,
              238,
              247,
              238,
              235,
              1454,
              269,
              274,
              265,
              268,
              270,
              269,
              265,
              271,
              279,
              271,
              269,
              277,
              267,
              275,
              275,
              273,
              273,
              271,
              280,
              280,
              276,
              268,
              277,
              277,
              265,
              274,
              273,
              274,
              270,
              275,
              279,
              272,
              269,
              273,
              278,
              273,
              273,
              270,
              275,
              271,
              268,
              268,
              273,
              276,
              269,
              272,
              282,
              266,
              273,
              275,
              275,
              272,
              264,
              272,
              274,
              271,
              268,
              269,
              269,
              269,
              274,
              271,
              269,
              276,
              278,
              275,
              271,
              267,
              279,
              280,
              275,
              271,
              275,
              276,
              265,
              275,
              272,
              274,
              267,
              278,
              283,
              271,
              269,
              273,
              279,
              271,
              272,
              272,
              274,
              269,
              266,
              269,
              272,
              272,
              268,
              271,
              275,
              265,
              267
            ]
          },
          {
            "time": 1502200414358,
            "label": "",
            "light_intensity": 1601.6,
            "r": 2068,
            "g": 659,
            "b": 483,
            "light_intensity_raw": 3031,
            "temperature": 25.33,
            "humidity": 48.012,
            "pressure": 990.956,
            "temperature2": 25.5,
            "humidity2": 43.345,
            "pressure2": 989.971,
            "contactless_temp": 25.7,
            "compass_direction": "W",
            "compass": 270,
            "angle": 11.633,
            "angle_direction": "NE",
            "pitch": 8.86,
            "roll": -7.57,
            "data_raw": [
              52318,
              52319,
              52215,
              52212,
              52187,
              52149,
              52157,
              52133,
              52135,
              52117,
              52159,
              52164,
              52171,
              52159,
              52177,
              52176,
              52120,
              52156,
              52175,
              52155,
              52179,
              52130,
              52158,
              52143,
              52157,
              52130,
              52135,
              52137,
              52158,
              52153,
              52123,
              52167,
              52197,
              52162,
              52148,
              52167,
              52159,
              52155,
              52158,
              52150,
              52124,
              52156,
              52141,
              52155,
              52145,
              52152,
              52193,
              52191,
              52183,
              52184,
              52159,
              52167,
              52181,
              52159,
              52151,
              52170,
              52167,
              52163,
              52161,
              52153,
              52169,
              52127,
              52126,
              52148,
              52161,
              52166,
              52133,
              52159,
              52123,
              52138,
              52138,
              52168,
              52159,
              52155,
              52149,
              52121,
              52149,
              52146,
              52150,
              52147,
              52146,
              52135,
              52173,
              52152,
              52159,
              52177,
              52151,
              52174,
              52167,
              52115,
              52113,
              52151,
              52146,
              52146,
              52159,
              52135,
              52135,
              52130,
              52162,
              52144,
              52118,
              52103,
              52123,
              52131,
              52138,
              52127,
              52153,
              52135,
              52137,
              52183,
              52182,
              52183,
              52169,
              52141,
              52158,
              52141,
              52137,
              52144,
              52135,
              52155,
              52167,
              52155,
              52119,
              52163,
              52151,
              52130,
              52149,
              52145,
              52179,
              52162,
              52186,
              52185,
              52156,
              52166,
              52171,
              52153,
              52160,
              52161,
              52123,
              52134,
              52151,
              52143,
              52131,
              52145,
              52167,
              52160,
              52167,
              52152,
              52188,
              52179,
              52175,
              52151,
              52161,
              52147,
              52157,
              52194,
              52207,
              52169,
              52167,
              52156,
              52137,
              52178,
              52159,
              52167,
              52153,
              52172,
              52159,
              52167,
              52175,
              52178,
              52185,
              52209,
              52190,
              52203,
              52171,
              52180,
              52207,
              52191,
              52151,
              52171,
              52173,
              52187,
              52202,
              52202,
              52199,
              52151,
              52167,
              52167,
              52167,
              52177,
              52167,
              52186,
              52155,
              52167,
              52193,
              52182,
              52147,
              52155,
              52159,
              52156,
              51991,
              52151,
              52181,
              52152,
              52175,
              52187,
              52204,
              52181,
              52199,
              52215,
              52205,
              52234,
              52211,
              52199,
              52211,
              52216,
              52231,
              52264,
              52223,
              52263,
              53530,
              52227,
              52216,
              52190,
              52175,
              52182,
              52188,
              52175,
              52160,
              52177,
              52162,
              52151,
              52199,
              52161,
              52160,
              52166,
              52167,
              52167,
              52162,
              52171,
              52207,
              52173,
              52175,
              52191,
              52152,
              52163,
              52166,
              52143,
              52165,
              52186,
              52168,
              52138,
              52116,
              52162,
              52184,
              52195,
              52154,
              52145,
              52154,
              52158,
              52169,
              52169,
              52156,
              52169,
              52165,
              52148,
              52135,
              52182,
              52148,
              52173,
              52173,
              52162,
              52147,
              52166,
              52143,
              52150,
              52138,
              52135,
              52102,
              52137,
              52149,
              52165,
              52139,
              52121,
              52167,
              52175,
              52161,
              52167,
              52162,
              52151,
              52167,
              52151,
              52155,
              52161,
              52180,
              52173,
              52169,
              52147,
              52152,
              52189,
              52167,
              52159,
              52178,
              52151,
              52135,
              52150,
              52153,
              52145,
              52151,
              52155,
              52151,
              52149,
              52165,
              52147,
              52158,
              52163,
              52178,
              52166,
              52167,
              52162,
              52135,
              52137,
              52170,
              52136,
              52167,
              52147,
              52191,
              52147,
              52151,
              52156,
              52163,
              52141,
              52137,
              52143,
              52119,
              52129,
              52125,
              52138,
              52143,
              52103,
              52158,
              52144,
              52143,
              52163,
              52119,
              52133,
              52157,
              52171,
              52159,
              52131,
              52146,
              52129,
              52103,
              52127,
              52150,
              52147,
              52119,
              52173,
              52171,
              52137,
              52159,
              52161,
              52151,
              52152,
              52167,
              52143,
              52175,
              52167,
              52168,
              52187,
              52143,
              52190,
              52140,
              52151,
              52155,
              52143,
              52169,
              52136,
              52153,
              52163,
              52165,
              52194,
              52171,
              52153,
              52148,
              52155,
              52164,
              52138,
              52135,
              52141,
              52159,
              52139,
              52150,
              52155,
              52163,
              52157,
              52139,
              52157,
              52132,
              52146,
              52133,
              52152,
              52125,
              52135,
              52103,
              52118,
              52113,
              52151,
              52164,
              52158,
              52175,
              52148,
              52137,
              52167,
              52159,
              52151,
              52156,
              52162,
              52135,
              52143,
              51938,
              52161,
              52148,
              52169,
              52199,
              52191,
              52186,
              52223,
              52199,
              52167,
              52198,
              52203,
              52195,
              52203,
              52200,
              52207,
              52206,
              52204,
              52189,
              52215,
              53971,
              52234,
              52207,
              52193,
              52179,
              52211,
              52167,
              52175,
              52171,
              52163,
              52179,
              52167,
              52195,
              52179,
              52162,
              52150,
              52154,
              52129,
              52169,
              52142,
              52130,
              52147,
              52167,
              52133,
              52149,
              52143,
              52135,
              52121,
              52151,
              52147,
              52135,
              52154,
              52145,
              52165,
              52154,
              52163,
              52162,
              52167,
              52177,
              52165,
              52169,
              52183,
              52151,
              52179,
              52162,
              52153,
              52139,
              52177,
              52146,
              52135,
              52143,
              52157,
              52124,
              52135,
              52137,
              52124,
              52156,
              52167,
              52159,
              52116,
              52135,
              52130,
              52135,
              52149,
              52160,
              52158,
              52120,
              52167,
              52119,
              52135,
              52114,
              52128,
              52146,
              52131,
              52136,
              52119,
              52109,
              52125,
              52105,
              52105,
              52110,
              52149,
              52157,
              52122,
              52117,
              52127,
              52111,
              52115,
              52115,
              52125,
              52107,
              52138,
              52143,
              52149,
              52153,
              52167,
              52153,
              52151,
              52179,
              52169,
              52156,
              52177,
              52153,
              52143,
              52105,
              52127,
              52122,
              52123,
              52135,
              52133,
              52111,
              52135,
              52119,
              52146,
              52138,
              52127,
              52131,
              52177,
              52167,
              52175,
              52156,
              52135,
              52155,
              52162,
              52164,
              52167,
              52146,
              52157,
              52162,
              52167,
              52151,
              52159,
              52175,
              52166,
              52174,
              52171,
              52150,
              52167,
              52141,
              52166,
              52159,
              52157,
              52155,
              52151,
              52146,
              52147,
              52138,
              52164,
              52152,
              52113,
              52095,
              52103,
              52138,
              52106,
              52111,
              52129,
              52123,
              52127,
              52133,
              52108,
              52123,
              52118,
              52107,
              52101,
              52111,
              52099,
              52111,
              52100,
              52159,
              52142,
              52127,
              52141,
              52147,
              52159,
              52115,
              52131,
              52146,
              52151,
              52133,
              52135,
              52158,
              52135,
              52163,
              52140,
              52135,
              52146,
              52136,
              52138,
              52139,
              52147,
              52151,
              52125,
              52143,
              52164,
              52149,
              52135,
              52135,
              52147,
              52147,
              52158,
              51870,
              52153,
              52155,
              52203,
              52195,
              52173,
              52160,
              52187,
              52146,
              52171,
              52178,
              52185,
              52218,
              52185,
              52252,
              52244,
              52199,
              52186,
              52199,
              52225,
              53782,
              52221,
              52196,
              52192,
              52175,
              52184,
              52174,
              52182,
              52163,
              52190,
              52176,
              52163,
              52163,
              52142,
              52146,
              52155,
              52151,
              52175,
              52187,
              52187,
              52167,
              52164,
              52142,
              52135,
              52146,
              52131,
              52129,
              52116,
              52154,
              52164,
              52166,
              52151,
              52159,
              52174,
              52156,
              52160,
              52144,
              52155,
              52142,
              52157,
              52177,
              52156,
              52175,
              52164,
              52185,
              52175,
              52194,
              52190,
              52163,
              52171,
              52172,
              52185,
              52192,
              52198,
              52200,
              52177,
              52175,
              52155,
              52195,
              52185,
              52182,
              52193,
              52176,
              52150,
              52167,
              52175,
              52206,
              52167,
              52161,
              52186,
              52146,
              52142,
              52183,
              52165,
              52146,
              52158,
              52152,
              52171,
              52148,
              52181,
              52130,
              52149,
              52128,
              52111,
              52145,
              52142,
              52165,
              52157,
              52196,
              52155,
              52169,
              52146,
              52141,
              52161,
              52187,
              52187,
              52151,
              52171,
              52177,
              52166,
              52169,
              52159,
              52175,
              52170,
              52175,
              52151,
              52152,
              52188,
              52145,
              52123,
              52119,
              52148,
              52126,
              52153,
              52144,
              52151,
              52148,
              52133,
              52147,
              52151,
              52169,
              52155,
              52140,
              52174,
              52143,
              52149,
              52132,
              52155,
              52159,
              52177,
              52171,
              52154,
              52174,
              52191,
              52167,
              52167,
              52150,
              52166,
              52178,
              52151,
              52185,
              52175,
              52199,
              52202,
              52176,
              52179,
              52171,
              52194,
              52186,
              52203,
              52199,
              52169,
              52174,
              52155,
              52147,
              52175,
              52191,
              52185,
              52167,
              52167,
              52199,
              52169,
              52197,
              52179,
              52177,
              52223,
              52199,
              52197,
              52211,
              52220,
              52215,
              52183,
              52149,
              52161,
              52151,
              52167,
              52199,
              52214,
              52156,
              52167,
              52199,
              52133,
              52163,
              52163,
              52151,
              52171,
              52184,
              52178,
              52147,
              52131,
              52138,
              52143,
              52167,
              52183,
              52186,
              52171,
              52181,
              52163,
              52162,
              52181,
              51838,
              52207,
              52187,
              52195,
              52211,
              52208,
              52221,
              52222,
              52235,
              52239,
              52199,
              52207,
              52220,
              52243,
              52215,
              52224,
              52215,
              52225,
              52241,
              52203,
              53982,
              52223,
              52203,
              52202,
              52172,
              52187,
              52175,
              52167,
              52139,
              52159,
              52159,
              52161,
              52157,
              52196,
              52209,
              52172,
              52210,
              52173,
              52177,
              52157,
              52175,
              52199,
              52165,
              52173,
              52141,
              52133,
              52164,
              52200,
              52165,
              52187,
              52155,
              52155,
              52175,
              52166,
              52138,
              52178,
              52163,
              52179,
              52166,
              52187,
              52161,
              52167,
              52179,
              52147,
              52167,
              52146,
              52173,
              52143,
              52169,
              52142,
              52167,
              52169,
              52135,
              52153,
              52143,
              52107,
              52127,
              52082,
              52137,
              52127,
              52119,
              52132,
              52142,
              52137,
              52185,
              52149,
              52134,
              52137,
              52156,
              52170,
              52135,
              52175,
              52168,
              52167,
              52179,
              52167,
              52151,
              52135,
              52145,
              52152,
              52160,
              52167,
              52161,
              52175,
              52143,
              52155,
              52172,
              52141,
              52114,
              52159,
              52175,
              52184,
              52180,
              52178,
              52142,
              52155,
              52179,
              52165,
              52139,
              52139,
              52132,
              52130,
              52147,
              52167,
              52169,
              52150,
              52142,
              52178,
              52142,
              52190,
              52143,
              52124,
              52095,
              52146,
              52151,
              52115,
              52164,
              52179,
              52177,
              52139,
              52162,
              52143,
              52171,
              52155,
              52161,
              52169,
              52167,
              52165,
              52173,
              52159,
              52157,
              52162,
              52183,
              52151,
              52190,
              52163,
              52164,
              52172,
              52181,
              52175,
              52155,
              52166,
              52163,
              52139,
              52153,
              52165,
              52167,
              52161,
              52160,
              52162,
              52143,
              52138,
              52135,
              52139,
              52140,
              52150,
              52149,
              52129,
              52141,
              52135,
              52153,
              52153,
              52135,
              52158,
              52131,
              52149,
              52145,
              52153,
              52124,
              52175,
              52119,
              52111,
              52114,
              52146,
              52131,
              52135,
              52167,
              52167,
              52183,
              52165,
              52163,
              52167,
              52157,
              52152,
              52149,
              52179,
              52135,
              52137,
              52128,
              52124,
              52134,
              52134,
              52191,
              52148,
              52147,
              52150,
              52157,
              52145,
              52138,
              52153,
              51687,
              52127,
              52164,
              52191,
              52181,
              52181,
              52170,
              52199,
              52191,
              52174,
              52175,
              52159,
              52176,
              52150,
              52167,
              52189,
              52174,
              52192,
              52191,
              52206,
              54140,
              52183,
              52152,
              52143,
              52145,
              52172,
              52162,
              52151,
              52135,
              52149,
              52150,
              52151,
              52127,
              52145,
              52135,
              52165,
              52147,
              52135,
              52127,
              52158,
              52167,
              52123,
              52142,
              52127,
              52174,
              52144,
              52159,
              52142,
              52155,
              52166,
              52198,
              52168,
              52164,
              52165,
              52170,
              52181,
              52173,
              52187,
              52179,
              52182,
              52161,
              52154,
              52163,
              52127,
              52162,
              52163,
              52209,
              52198,
              52173,
              52193,
              52181,
              52197,
              52180,
              52201,
              52145,
              52145,
              52178,
              52137,
              52151,
              52132,
              52166,
              52135,
              52137,
              52195,
              52163,
              52156,
              52172,
              52145,
              52143,
              52119,
              52157,
              52138,
              52132,
              52133,
              52146,
              52125,
              52121,
              52098,
              52155,
              52107,
              52139,
              52132,
              52108,
              52158,
              52166,
              52142,
              52167,
              52143,
              52171,
              52163,
              52169,
              52125,
              52150,
              52146,
              52157,
              52161,
              52138,
              52163,
              52167,
              52161,
              52149,
              52133,
              52140,
              52114,
              52115,
              52159,
              52145,
              52163,
              52135,
              52135,
              52150,
              52135,
              52148,
              52119,
              52142,
              52150,
              52174,
              52148,
              52140,
              52147,
              52151,
              52158,
              52142,
              52147,
              52130,
              52141,
              52164,
              52138,
              52127,
              52163,
              52156,
              52159,
              52180,
              52186,
              52179,
              52141,
              52159,
              52135,
              52155,
              52176,
              52143,
              52159,
              52154,
              52141,
              52180,
              52171,
              52135,
              52153,
              52138,
              52151,
              52151,
              52141,
              52158,
              52158,
              52119,
              52159,
              52163,
              52198,
              52170,
              52185,
              52135,
              52154,
              52146,
              52141,
              52167,
              52131,
              52129,
              52141,
              52154,
              52126,
              52165,
              52143,
              52162,
              52143,
              52156,
              52172,
              52175,
              52145,
              52194,
              52151,
              52163,
              52137,
              52140,
              52142,
              52142,
              52159,
              52147,
              52129,
              52130,
              52165,
              52139,
              52153,
              52142,
              52165,
              52155,
              52167,
              52157,
              52142,
              52171,
              52166,
              51639,
              52176,
              52191,
              52185,
              52191,
              52176,
              52178,
              52217,
              52211,
              52221,
              52218,
              52225,
              52199,
              52188,
              52226,
              52177,
              52214,
              52227,
              52212,
              52219,
              54319,
              52222,
              52175,
              52159,
              52162,
              52192,
              52162,
              52148,
              52151,
              52155,
              52135,
              52145,
              52161,
              52191,
              52148,
              52173,
              52148,
              52146,
              52147,
              52135,
              52131,
              52121,
              52126,
              52147,
              52131,
              52135,
              52132,
              52130,
              52123,
              52150,
              52127,
              52143,
              52121,
              52163,
              52111,
              52126,
              52135,
              52137,
              52131,
              52168,
              52161,
              52168,
              52171,
              52155,
              52169,
              52101,
              52134,
              52121,
              52115,
              52153,
              52166,
              52151,
              52141,
              52149,
              52149,
              52163,
              52134,
              52158,
              52135,
              52146,
              52137,
              52149,
              52157,
              52187,
              52157,
              52147,
              52141,
              52145,
              52163,
              52167,
              52172,
              52155,
              52133,
              52132,
              52137,
              52123,
              52147,
              52117,
              52111,
              52150,
              52159,
              52171,
              52163,
              52167,
              52134,
              52134,
              52151,
              52155,
              52139,
              52155,
              52163,
              52163,
              52146,
              52147,
              52159,
              52141,
              52155,
              52148,
              52173,
              52157,
              52181,
              52148,
              52139,
              52165,
              52157,
              52140,
              52166,
              52150,
              52126,
              52149,
              52170,
              52178,
              52140,
              52123,
              52126,
              52147,
              52168,
              52137,
              52143,
              52162,
              52135,
              52153,
              52151,
              52157,
              52127,
              52166,
              52129,
              52151,
              52157,
              52156,
              52103,
              52115,
              52129,
              52147,
              52140,
              52125,
              52107,
              52103,
              52133,
              52157,
              52129,
              52109,
              52142,
              52139,
              52143,
              52158,
              52143,
              52134,
              52129,
              52149,
              52135,
              52161,
              52148,
              52172,
              52150,
              52154,
              52123,
              52135,
              52159,
              52109,
              52167,
              52129,
              52100,
              52105,
              52115,
              52135,
              52154,
              52175,
              52187,
              52170,
              52186,
              52159,
              52166,
              52148,
              52158,
              52143,
              52103,
              52129,
              52123,
              52157,
              52127,
              52155,
              52128,
              52129,
              52145,
              52146,
              52145,
              52151,
              52125,
              52116,
              52155,
              52147,
              52147,
              52139,
              52132,
              52159,
              52167,
              52128,
              52121,
              52157,
              51467,
              52162,
              52143,
              52163,
              52170,
              52182,
              52148,
              52156,
              52148,
              52181,
              52142,
              52170,
              52186,
              52162,
              52159,
              52198,
              52175,
              52196,
              52188,
              52199,
              54570,
              52195,
              52197,
              52189,
              52180,
              52181,
              52177,
              52167,
              52197,
              52151,
              52121,
              52154,
              52173,
              52170,
              52149,
              52171,
              52143,
              52166,
              52166,
              52150,
              52142,
              52163,
              52171,
              52146,
              52145,
              52171,
              52161,
              52159,
              52141,
              52139,
              52135,
              52157,
              52175,
              52144,
              52145,
              52135,
              52149,
              52110,
              52144,
              52142,
              52150,
              52133,
              52143,
              52143,
              52134,
              52131,
              52136,
              52151,
              52148,
              52117,
              52127,
              52125,
              52135,
              52175,
              52201,
              52151,
              52167,
              52160,
              52143,
              52133,
              52127,
              52151,
              52165,
              52162,
              52151,
              52127,
              52146,
              52130,
              52153,
              52138,
              52135,
              52135,
              52154,
              52139,
              52122,
              52106,
              52127,
              52125,
              52157,
              52182,
              52147,
              52159,
              52133,
              52127,
              52135,
              52146,
              52137,
              52143,
              52135,
              52143,
              52154,
              52131,
              52139,
              52152,
              52151,
              52177,
              52145,
              52122,
              52143,
              52160
            ]
          },
          {
            "time": 1502200416942,
            "label": "",
            "light_intensity": 1601.6,
            "r": 2068,
            "g": 659,
            "b": 483,
            "light_intensity_raw": 3031,
            "temperature": 25.36,
            "humidity": 48.015,
            "pressure": 990.935,
            "temperature2": 25.54,
            "humidity2": 43.338,
            "pressure2": 989.967,
            "contactless_temp": 24.85,
            "thickness": 0.25,
            "compass_direction": "W",
            "compass": 270,
            "angle": 12.685,
            "angle_direction": "NE",
            "pitch": 10.12,
            "roll": -7.68,
            "data_raw": [
              2167,
              52204,
              2801,
              52159,
              2853,
              52143,
              2866,
              52143,
              2874,
              52143,
              2879,
              52151,
              2886,
              52147,
              2885,
              52170,
              2888,
              52135,
              2887,
              52146,
              2881,
              52149,
              2888,
              52111,
              2885,
              52130,
              2882,
              52145,
              2887,
              52142,
              2876,
              52135,
              2889,
              52130,
              2884,
              52150,
              2881,
              52111,
              2885,
              52099,
              2881,
              52119,
              2879,
              52111,
              2881,
              52135,
              2878,
              52127,
              2877,
              52112,
              2876,
              52139,
              2869,
              52126,
              2876,
              52156,
              2870,
              52141,
              2872,
              52184,
              2862,
              52167,
              2867,
              52169,
              2869,
              52167,
              2862,
              52172,
              2863,
              52167,
              2867,
              52175,
              2867,
              52183,
              2863,
              52113,
              2862,
              52162,
              2858,
              52107,
              2860,
              52166,
              2856,
              52162,
              2856,
              52202,
              2863,
              52199,
              2853,
              52167,
              2847,
              52135,
              2850,
              52149,
              2849,
              52182,
              2854,
              52155,
              2848,
              52144,
              2851,
              52153,
              2849,
              52159,
              2845,
              52195,
              2849,
              52141,
              2849,
              52165,
              2840,
              52093,
              2848,
              52160,
              2838,
              52135,
              2846,
              52165,
              2835,
              52159,
              2834,
              52135,
              2839,
              52127,
              2838,
              52147,
              2832,
              52144,
              2831,
              52139,
              2828,
              52141,
              2823,
              52167,
              2829,
              52151,
              2818,
              52147,
              2831,
              52155,
              2829,
              52164,
              2822,
              52167,
              2826,
              52167,
              2825,
              52150,
              2819,
              52163,
              2819,
              52135,
              2816,
              52143,
              2821,
              52122,
              2823,
              52141,
              2814,
              52146,
              2815,
              52118,
              2815,
              52135,
              2807,
              52139,
              2812,
              52107,
              2808,
              52090,
              2807,
              52121,
              2806,
              52111,
              2803,
              52135,
              2801,
              52129,
              2795,
              52158,
              2790,
              52129,
              2809,
              52140,
              2795,
              52130,
              2796,
              52111,
              2796,
              52113,
              2788,
              52097,
              2801,
              52095,
              2794,
              52117,
              2794,
              52135,
              2792,
              52126,
              2817,
              52116,
              2827,
              52126,
              2830,
              52131,
              2827,
              52135,
              2826,
              52153,
              2831,
              52175,
              2823,
              52111,
              2825,
              52118,
              2818,
              52103,
              2825,
              52099,
              2822,
              52102,
              2823,
              52131,
              2818,
              52131,
              2818,
              52131,
              2821,
              52135,
              2817,
              52106,
              2817,
              52100,
              2810,
              52131,
              2820,
              52127,
              2814,
              52114,
              2810,
              52111,
              2805,
              52120,
              2806,
              52129,
              2807,
              52125,
              2806,
              52119,
              2806,
              52120,
              2796,
              52097,
              2799,
              52102,
              2798,
              52115,
              2801,
              52145,
              2798,
              52134,
              2793,
              52105,
              2795,
              52130,
              2797,
              52136,
              2795,
              52148,
              2798,
              52141,
              2786,
              52146,
              2787,
              52113,
              2788,
              52092,
              2787,
              52101,
              2786,
              52111,
              2777,
              52112,
              2781,
              52100,
              2779,
              52125,
              2781,
              52134,
              2772,
              52156,
              2773,
              52119,
              2778,
              52108,
              2774,
              52127,
              2774,
              52132,
              2778,
              52083,
              2775,
              52116,
              2769,
              52107,
              2775,
              52135,
              2763,
              52095,
              2769,
              52155,
              2765,
              52089,
              2763,
              52119,
              2757,
              52145,
              2758,
              52145,
              2759,
              52113,
              2757,
              52098,
              2753,
              52103,
              2751,
              52099,
              2752,
              52101,
              2759,
              52111,
              2749,
              52093,
              2753,
              52111,
              2751,
              52118,
              2750,
              52126,
              2735,
              52075,
              2744,
              52095,
              2746,
              52083,
              2741,
              52110,
              2739,
              52078,
              2740,
              52118,
              2742,
              52115,
              2730,
              52153,
              2729,
              52085,
              2737,
              52124,
              2741,
              52099,
              2727,
              52105,
              2730,
              52111,
              2728,
              52092,
              2726,
              52126,
              2722,
              52116,
              2731,
              52097,
              2726,
              52084,
              2721,
              52123,
              2722,
              52071,
              2653,
              52130,
              2537,
              52173,
              2453,
              52159,
              2361,
              52180,
              2290,
              52197,
              2232,
              52226,
              2177,
              52212,
              2129,
              52236,
              2100,
              52218,
              2066,
              52213,
              2040,
              52210,
              2021,
              52221,
              1997,
              52198,
              1989,
              52226,
              1987,
              52230,
              1313,
              51989,
              1287,
              51995,
              1271,
              52019,
              1251,
              52004,
              1240,
              52044,
              1228,
              52063,
              1217,
              52039,
              1204,
              52109,
              1190,
              52095,
              1183,
              52145,
              1173,
              52106,
              1159,
              52100,
              1157,
              52135,
              1156,
              52135,
              1142,
              52125,
              1127,
              52170,
              2168,
              52024,
              2303,
              51969,
              2391,
              51915,
              2447,
              51934,
              2475,
              51911,
              2489,
              51959,
              2498,
              51943,
              2503,
              51931,
              2506,
              51911,
              2512,
              51906,
              2511,
              51937,
              2511,
              51881,
              2505,
              51900,
              2511,
              51881,
              2510,
              51900,
              2514,
              51895,
              2511,
              51911,
              2514,
              51898,
              2506,
              51923,
              2503,
              51917,
              2512,
              51903,
              2507,
              51937,
              2511,
              51922,
              2500,
              51897,
              2507,
              51903,
              2505,
              51926,
              2503,
              51911,
              2506,
              51907,
              2508,
              51892,
              2505,
              51910,
              2504,
              51911,
              2507,
              51931,
              2506,
              51933,
              2506,
              51879,
              2505,
              51913,
              2503,
              51915,
              2504,
              51937,
              2488,
              51946,
              2501,
              51954,
              2502,
              51949,
              2503,
              51976,
              2502,
              51982,
              2500,
              51983,
              2496,
              51961,
              2498,
              51984,
              2497,
              51993,
              2494,
              51989,
              2490,
              51983,
              2488,
              51943,
              2497,
              51951,
              2490,
              51967,
              2498,
              52014,
              2488,
              52017,
              2486,
              51986,
              2485,
              51977,
              2487,
              51959,
              2479,
              51992,
              2488,
              51978,
              2490,
              51949,
              2478,
              51966,
              2479,
              51991,
              2469,
              51975,
              2480,
              51977,
              2477,
              51980,
              2480,
              51994,
              2472,
              51988,
              2476,
              52040,
              2475,
              51989,
              2475,
              52001,
              2472,
              51991,
              2473,
              52024,
              2475,
              51997,
              2474,
              52003,
              2470,
              51995,
              2468,
              52041,
              2453,
              51996,
              2449,
              52015,
              2447,
              52034,
              2448,
              52026,
              2439,
              52026,
              2439,
              51953,
              2441,
              51992,
              2444,
              52027,
              2446,
              52059,
              2431,
              52066,
              2439,
              52022,
              2437,
              52011,
              2438,
              52061,
              2436,
              52057
            ]
          },
          {
            "time": 1502200423108,
            "label": "",
            "light_intensity": 1310.517,
            "r": 1687,
            "g": 538,
            "b": 395,
            "light_intensity_raw": 2475,
            "temperature": 25.44,
            "humidity": 48.001,
            "pressure": 990.942,
            "temperature2": 25.63,
            "humidity2": 43.198,
            "pressure2": 989.961,
            "contactless_temp": 25.8,
            "thickness": 0.25,
            "compass_direction": "W",
            "compass": 270,
            "angle": 13.556,
            "angle_direction": "N",
            "pitch": 12.57,
            "roll": -5.13,
            "data_raw": [

            ]
          },
          {
            "time": 1502200423430,
            "label": "",
            "light_intensity": 1409.803,
            "r": 1815,
            "g": 579,
            "b": 425,
            "light_intensity_raw": 2663,
            "temperature": 25.44,
            "humidity": 48.002,
            "pressure": 990.941,
            "temperature2": 25.63,
            "humidity2": 43.272,
            "pressure2": 989.948,
            "contactless_temp": 25.8,
            "thickness": 0.25,
            "compass_direction": "W",
            "compass": 270,
            "angle": 14.333,
            "angle_direction": "N",
            "pitch": 13.4,
            "roll": -5.14,
            "data_raw": [

            ]
          },
          {
            "time": 1502200423748,
            "label": "",
            "light_intensity": 1409.803,
            "r": 1815,
            "g": 579,
            "b": 425,
            "light_intensity_raw": 2663,
            "temperature": 25.45,
            "humidity": 47.99,
            "pressure": 990.925,
            "temperature2": 25.64,
            "humidity2": 43.241,
            "pressure2": 989.964,
            "contactless_temp": 25.8,
            "thickness": 0.25,
            "compass_direction": "W",
            "compass": 270,
            "angle": 13.393,
            "angle_direction": "NE",
            "pitch": 11.82,
            "roll": -6.34,
            "data_raw": [

            ]
          },
          {
            "time": 1502200424067,
            "label": "",
            "detector_read1": 13389,
            "detector_read2": 65535,
            "light_intensity": 1502.554,
            "r": 1934,
            "g": 617,
            "b": 453,
            "light_intensity_raw": 2838,
            "temperature": 25.45,
            "humidity": 47.992,
            "pressure": 990.961,
            "temperature2": 25.64,
            "humidity2": 43.21,
            "pressure2": 989.959,
            "contactless_temp": 24.99,
            "thickness": 0.25,
            "compass_direction": "W",
            "compass": 270,
            "angle": 12.028,
            "angle_direction": "NE",
            "pitch": 10.85,
            "roll": -5.23,
            "recall": {
              "time": 1502200424356,
              "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": [
              27861,
              7371,
              7062,
              7012,
              6976,
              6963,
              6965,
              6950,
              6946,
              6950,
              394,
              294,
              295,
              296,
              297,
              292,
              292,
              291,
              297,
              295,
              2038,
              1242,
              1236,
              1239,
              1235,
              1235,
              1235,
              1234,
              1233,
              1235,
              38,
              67,
              64,
              66,
              64,
              69,
              65,
              62,
              62,
              63,
              45762,
              12694,
              12434,
              12395,
              12378,
              12366,
              12355,
              12355,
              12342,
              12361,
              15184,
              14643,
              14630,
              14631,
              14632,
              14632,
              14641,
              14631,
              14637,
              14621,
              19283,
              12195,
              12114,
              12103,
              12103,
              12103,
              12099,
              12093,
              12095,
              12094,
              21767,
              14199,
              14119,
              14121,
              14101,
              14096,
              14101,
              14101,
              14102,
              14094,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              1451,
              1733,
              1737,
              1739,
              1738,
              1735,
              1735,
              1745,
              1745,
              1743,
              7217,
              9056,
              9064,
              9068,
              9069,
              9061,
              9058,
              9065,
              9060,
              9064,
              166,
              205,
              204,
              202,
              207,
              212,
              205,
              203,
              205,
              203,
              36059,
              44484,
              44535,
              44536,
              44541,
              44537,
              44557,
              44561,
              44562,
              44547,
              41279,
              51818,
              51882,
              51887,
              51890,
              51905,
              51903,
              51896,
              51889,
              51889,
              28624,
              41799,
              41931,
              41932,
              41927,
              41931,
              41939,
              41935,
              41939,
              41932,
              35591,
              46681,
              46759,
              46767,
              46769,
              46762,
              46759,
              46741,
              46735,
              46750,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              3133,
              3738,
              3757,
              3762,
              3751,
              3757,
              3756,
              3755,
              3763,
              3765,
              31415,
              43215,
              43281,
              43271,
              43273,
              43271,
              43271,
              43259,
              43262,
              43261,
              499,
              694,
              694,
              694,
              694,
              691,
              692,
              696,
              698,
              698,
              44574,
              44539,
              44543,
              44553,
              44545,
              44546,
              44548,
              44552,
              44557,
              44547,
              51883,
              51878,
              51876,
              51888,
              51887,
              51875,
              51882,
              51871,
              51879,
              51879,
              41969,
              41963,
              41957,
              41960,
              41951,
              41951,
              41961,
              41953,
              41955,
              41951,
              46796,
              46783,
              46759,
              46761,
              46761,
              46743,
              46744,
              46743,
              46727,
              46731
            ]
          }
        ]
      }
    ]
  ],
  "app_os": "darwin-16.6.0",
  "app_name": "PhotosynQ",
  "app_version": "0.0.19",
  "app_device": "x64",
  "location": [
    "42.7224280",
    "-84.4746400"
  ],
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
1
Latest Update:
Aug 2017