RIDES_preset_actinic


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
var number_of_protocol_sets=json.set.length;
output.numprot=json.setnumber_of_protocol_setslength;



// Define the protocol set numbers for each data set
var labels=[];

for (var index=0; index<number_of_protocol_sets; index++){
   labels.push(json.set[index].label);
}

var ECS_LEFdset=labels.indexOf('ecs_lefd');
var P700_DIRK_set=labels.indexOf('p700_dirk_set');
var PAM_set=labels.indexOf('pam_set');  //the json set 8 contains the PAM and P700 traces

var SPAD_set=labels.indexOf('spad_set');
var calib_set=labels.indexOf('spad_set');

//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 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": 1505250235290,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:38:16",
  "device_battery": 97,
  "device_firmware": 1.21,
  "sample": [
    [
      {
        "time": 1505250235290,
        "protocol_id": 1,
        "set": [
          {
            "time": 1505250235300,
            "label": "",
            "temperature": 27.35,
            "humidity": 34.754,
            "pressure": 982.482,
            "temperature2": 27.58,
            "humidity2": 34.54,
            "pressure2": 981.638,
            "contactless_temp": 26.75,
            "compass_direction": "E",
            "compass": 90,
            "angle": 37.264,
            "angle_direction": "SE",
            "pitch": 33,
            "roll": 18.4,
            "data_raw": [

            ]
          },
          {
            "time": 1505250235996,
            "label": "ecs_lefd",
            "set_light_intensity": 1001,
            "set_led_delay": [
              0,
              2,
              1001,
              10000
            ],
            "light_intensity": 0,
            "r": 0,
            "g": 0,
            "b": 0,
            "light_intensity_raw": 0,
            "temperature": 27.37,
            "humidity": 35.003,
            "pressure": 982.502,
            "temperature2": 27.6,
            "humidity2": 34.76,
            "pressure2": 981.613,
            "contactless_temp": 26.57,
            "thickness": 0.25,
            "data_raw": [
              49564,
              49549,
              49561,
              49563,
              49566,
              49571,
              49566,
              49555,
              49564,
              49558,
              49561,
              49568,
              49573,
              49567,
              49567,
              49572,
              49565,
              49567,
              49564,
              49572,
              49572,
              49570,
              49571,
              49574,
              49565,
              49556,
              49564,
              49570,
              49570,
              49574,
              49564,
              49571,
              49561,
              49571,
              49572,
              49571,
              49560,
              49567,
              49575,
              49566,
              49567,
              49560,
              49563,
              49572,
              49569,
              49570,
              49570,
              49571,
              49561,
              49557,
              49562,
              49571,
              49574,
              49577,
              49573,
              49558,
              49565,
              49563,
              49571,
              49576,
              49581,
              49569,
              49563,
              49565,
              49564,
              49566,
              49564,
              49574,
              49568,
              49575,
              49569,
              49563,
              49556,
              49558,
              49571,
              49577,
              49573,
              49567,
              49578,
              49569,
              49567,
              49570,
              49565,
              49573,
              49567,
              49573,
              49565,
              49565,
              49566,
              49571,
              49571,
              49568,
              49563,
              49566,
              49567,
              49565,
              49571,
              49565,
              49560,
              49570,
              49570,
              49569,
              49569,
              49573,
              49565,
              49558,
              49569,
              49576,
              49574,
              49575,
              49577,
              49571,
              49562,
              49559,
              49563,
              49575,
              49567,
              49567,
              49569,
              49572,
              49572,
              49575,
              49567,
              49566,
              49574,
              49570,
              49575,
              49574,
              49565,
              49570,
              49573,
              49573,
              49571,
              49569,
              49567,
              49551,
              49554,
              49560,
              49567,
              49573,
              49570,
              49573,
              49572,
              49572,
              49565,
              49553,
              49559,
              49572,
              49571,
              49570,
              49572,
              49570,
              49556,
              49558,
              49558,
              49569,
              49570,
              49569,
              49569,
              49570,
              49565,
              49571,
              49566,
              49563,
              49567,
              49563,
              49566,
              49561,
              49555,
              49566,
              49567,
              49573,
              49573,
              49572,
              49568,
              49549,
              49554,
              49559,
              49564,
              49570,
              49570,
              49567,
              49576,
              49571,
              49559,
              49556,
              49563,
              49573,
              49570,
              49571,
              49567,
              49568,
              49570,
              49559,
              49559,
              49570,
              49572,
              49570,
              49572,
              49563,
              49578,
              49586,
              49598,
              49607,
              49611,
              49622,
              49621,
              49630,
              49634,
              49630,
              49637,
              49647,
              49647,
              49655,
              49657,
              49647,
              49649,
              49659,
              49658,
              49668,
              49669,
              49606,
              49593,
              49580,
              49571,
              49567,
              49567,
              49567,
              49561,
              49560,
              49567,
              49553,
              49555,
              49561,
              49555,
              49552,
              49558,
              49553,
              49554,
              49555,
              49550,
              49554,
              49560,
              49565,
              49553,
              49553,
              49544,
              49551,
              49559,
              49547,
              49566,
              49566,
              49563,
              49561,
              49555,
              49549,
              49553,
              49551,
              49555,
              49562,
              49556,
              49563,
              49563,
              49562,
              49550,
              49551,
              49558,
              49562,
              49551,
              49560,
              49556,
              49556,
              49563,
              49559,
              49567,
              49558,
              49549,
              49556,
              49567,
              49565,
              49559,
              49562,
              49573,
              49565,
              49558,
              49564,
              49567,
              49561,
              49559,
              49561,
              49563,
              49567,
              49561,
              49563,
              49571,
              49569,
              49555,
              49550,
              49556,
              49562,
              49561,
              49571,
              49568,
              49566,
              49566,
              49568,
              49559,
              49555,
              49569,
              49564,
              49557,
              49566,
              49566,
              49559,
              49571,
              49571,
              49571,
              49571,
              49559,
              49559,
              49567,
              49558,
              49572,
              49572,
              49567,
              49569,
              49577,
              49572,
              49559,
              49556,
              49567,
              49573,
              49565,
              49567,
              49573,
              49562,
              49562,
              49563,
              49572,
              49567,
              49564,
              49561,
              49566,
              49565,
              49563,
              49563,
              49573,
              49575,
              49570,
              49563,
              49559,
              49550,
              49567,
              49559,
              49574,
              49565,
              49567,
              49573,
              49571,
              49569,
              49571,
              49563,
              49567,
              49565,
              49566,
              49566,
              49565,
              49561,
              49561,
              49574,
              49570,
              49565,
              49559,
              49557,
              49565,
              49562,
              49563,
              49567,
              49570,
              49559,
              49572,
              49561,
              49562,
              49559,
              49559,
              49573,
              49574,
              49566,
              49567,
              49567,
              49565,
              49565,
              49567,
              49567,
              49568,
              49574,
              49570,
              49571,
              49566,
              49554,
              49562,
              49567,
              49571,
              49570,
              49570,
              49561,
              49569,
              49567,
              49555,
              49567,
              49566,
              49566,
              49567,
              49569,
              49567,
              49553,
              49560,
              49567,
              49571,
              49567,
              49581,
              49581,
              49587,
              49598,
              49609,
              49615,
              49635,
              49630,
              49640,
              49640,
              49631,
              49636,
              49643,
              49651,
              49653,
              49651,
              49657,
              49658,
              49665,
              49651,
              49669,
              49610,
              49595,
              49585,
              49583,
              49569,
              49570,
              49563,
              49554,
              49552,
              49562,
              49554,
              49553,
              49555,
              49555,
              49552,
              49539,
              49545,
              49549,
              49543,
              49549,
              49551,
              49551,
              49551,
              49552,
              49551,
              49551,
              49554,
              49549,
              49553,
              49549,
              49545,
              49551,
              49554,
              49557,
              49551,
              49556,
              49562,
              49553,
              49551,
              49554,
              49557,
              49562,
              49561,
              49555,
              49551,
              49546,
              49543,
              49551,
              49557,
              49557,
              49558,
              49563,
              49563,
              49559,
              49551,
              49546,
              49549,
              49563,
              49563,
              49559,
              49560,
              49561,
              49551,
              49555,
              49563,
              49565,
              49559,
              49557,
              49562,
              49551,
              49549,
              49546,
              49555,
              49561,
              49559,
              49559,
              49554,
              49555,
              49561,
              49557,
              49562,
              49566,
              49559,
              49555,
              49553,
              49553,
              49551,
              49557,
              49560,
              49561,
              49558,
              49562,
              49565,
              49565,
              49549,
              49548,
              49565,
              49561,
              49561,
              49554,
              49562,
              49551,
              49556,
              49558,
              49566,
              49551,
              49558,
              49562,
              49561,
              49558,
              49561,
              49567,
              49569,
              49567,
              49553,
              49559,
              49563,
              49561,
              49559,
              49562,
              49569,
              49568,
              49567,
              49567,
              49551,
              49558,
              49558,
              49559,
              49569,
              49569,
              49566,
              49566,
              49563,
              49556,
              49556,
              49557,
              49571,
              49565,
              49571,
              49568,
              49559,
              49557,
              49563,
              49557,
              49567,
              49566,
              49565,
              49553,
              49557,
              49557,
              49562,
              49565,
              49566,
              49565,
              49563,
              49558,
              49549,
              49558,
              49555,
              49560,
              49562,
              49566,
              49571,
              49566,
              49567,
              49559,
              49555,
              49561,
              49564,
              49554,
              49566,
              49567,
              49561,
              49560,
              49566,
              49567,
              49562,
              49559,
              49560,
              49564,
              49562,
              49556,
              49556,
              49569,
              49566,
              49554,
              49553,
              49566,
              49555,
              49559,
              49565,
              49566,
              49567,
              49571,
              49562,
              49553,
              49551,
              49559,
              49561,
              49565,
              49581,
              49597,
              49603,
              49607,
              49606,
              49607,
              49618,
              49631,
              49633,
              49634,
              49635,
              49635,
              49635,
              49639,
              49647,
              49645,
              49650,
              49650,
              49653,
              49673,
              49603,
              49586,
              49578,
              49575,
              49559,
              49557,
              49555,
              49555,
              49543,
              49548,
              49550,
              49561,
              49554,
              49558,
              49547,
              49547,
              49542,
              49537,
              49539,
              49551,
              49541,
              49543,
              49551,
              49543,
              49548,
              49543,
              49537,
              49547,
              49545,
              49547,
              49552,
              49548,
              49542,
              49551,
              49551,
              49562,
              49550,
              49555,
              49559,
              49547,
              49536,
              49548,
              49543,
              49555,
              49552,
              49554,
              49557,
              49547,
              49551,
              49548,
              49551,
              49559,
              49562,
              49559,
              49548,
              49544,
              49552,
              49547,
              49550,
              49556,
              49551,
              49554,
              49553,
              49552,
              49550,
              49554,
              49556,
              49558,
              49547,
              49549,
              49555,
              49552,
              49547,
              49555,
              49565,
              49563,
              49557,
              49543,
              49550,
              49547,
              49547,
              49552,
              49559,
              49557,
              49559,
              49559,
              49557,
              49550,
              49552,
              49554,
              49558,
              49562,
              49557,
              49556,
              49566,
              49546,
              49551,
              49553,
              49559,
              49561,
              49562,
              49560,
              49561,
              49559,
              49561,
              49560,
              49555,
              49555,
              49555,
              49555,
              49558,
              49557,
              49554,
              49559,
              49567,
              49561,
              49547,
              49557,
              49555,
              49555,
              49549,
              49553,
              49562,
              49560,
              49557,
              49559,
              49555,
              49553,
              49556,
              49561,
              49565,
              49561,
              49562,
              49565,
              49560,
              49558,
              49550,
              49553,
              49551,
              49554,
              49567,
              49564,
              49560,
              49558,
              49559,
              49563,
              49567,
              49565,
              49559,
              49557,
              49548,
              49555,
              49559,
              49563,
              49565,
              49563,
              49559,
              49560,
              49556,
              49551,
              49549,
              49554,
              49571,
              49564,
              49559,
              49566,
              49560,
              49557,
              49555,
              49566,
              49554,
              49558,
              49563,
              49558,
              49557,
              49557,
              49563,
              49567,
              49565,
              49556,
              49564,
              49555,
              49552,
              49553,
              49564,
              49563,
              49553,
              49559,
              49569,
              49566,
              49567,
              49565,
              49567,
              49561,
              49561,
              49558,
              49565,
              49544,
              49559,
              49572,
              49593,
              49601,
              49607,
              49609,
              49611,
              49623,
              49627,
              49619,
              49634,
              49639,
              49643,
              49643,
              49647,
              49635,
              49639,
              49645,
              49659,
              49657,
              49657,
              49683,
              49613,
              49593,
              49579,
              49575,
              49575,
              49567,
              49555,
              49551,
              49555,
              49555,
              49551,
              49553,
              49554,
              49552,
              49549,
              49549,
              49549,
              49541,
              49551,
              49555,
              49556,
              49543,
              49552,
              49547,
              49543,
              49548,
              49541,
              49544,
              49553,
              49549,
              49551,
              49554,
              49546,
              49543,
              49546,
              49548,
              49554,
              49556,
              49554,
              49554,
              49554,
              49543,
              49546,
              49551,
              49553,
              49550,
              49551,
              49552,
              49548,
              49543,
              49549,
              49555,
              49557,
              49553,
              49555,
              49547,
              49539,
              49548,
              49545,
              49552,
              49557,
              49550,
              49557,
              49555,
              49549,
              49541,
              49543,
              49544,
              49553,
              49554,
              49557,
              49557,
              49553,
              49554,
              49547,
              49547,
              49555,
              49553,
              49551,
              49555,
              49548,
              49551,
              49547,
              49554,
              49551,
              49555,
              49551,
              49553,
              49551,
              49550,
              49548,
              49561,
              49560,
              49547,
              49550,
              49558,
              49551,
              49553,
              49549,
              49561,
              49555,
              49555,
              49554,
              49553,
              49551,
              49553,
              49562,
              49562,
              49555,
              49545,
              49554,
              49553,
              49553,
              49553,
              49557,
              49560,
              49559,
              49563,
              49558,
              49555,
              49552,
              49556,
              49559,
              49564,
              49563,
              49563,
              49551,
              49547,
              49547,
              49557,
              49552,
              49561,
              49562,
              49565,
              49561,
              49559,
              49546,
              49541,
              49556,
              49555,
              49557,
              49558,
              49557,
              49557,
              49558,
              49558,
              49565,
              49554,
              49553,
              49559,
              49557,
              49552,
              49550,
              49555,
              49558,
              49558,
              49561,
              49562,
              49559,
              49551,
              49554,
              49558,
              49567,
              49563,
              49560,
              49558,
              49552,
              49551,
              49551,
              49554,
              49553,
              49559,
              49550,
              49559,
              49553,
              49558,
              49560,
              49564,
              49558,
              49556,
              49559,
              49565,
              49557,
              49555,
              49551,
              49567,
              49567,
              49568,
              49562,
              49558,
              49552,
              49554,
              49559,
              49567,
              49564,
              49565,
              49553,
              49558,
              49550,
              49555,
              49577,
              49598,
              49601,
              49609,
              49619,
              49620,
              49611,
              49615,
              49631,
              49630,
              49636,
              49638,
              49645,
              49639,
              49639,
              49639,
              49645,
              49656,
              49655,
              49675,
              49603,
              49585,
              49570,
              49567,
              49557,
              49563,
              49563,
              49562,
              49541,
              49548,
              49548,
              49545,
              49546,
              49548,
              49552,
              49548,
              49551,
              49550,
              49546,
              49537,
              49537,
              49540,
              49544,
              49545,
              49548,
              49549,
              49537,
              49539,
              49542,
              49550,
              49547,
              49540,
              49543,
              49545,
              49544,
              49545,
              49550,
              49555,
              49543,
              49543,
              49541,
              49541,
              49539,
              49539,
              49544,
              49548,
              49547,
              49550,
              49549,
              49557,
              49551,
              49550,
              49549,
              49554,
              49545,
              49549,
              49547,
              49549,
              49548,
              49552,
              49552,
              49552,
              49549,
              49552,
              49555,
              49557,
              49555,
              49549,
              49559,
              49562,
              49548,
              49549,
              49551,
              49546,
              49545,
              49551,
              49553,
              49557,
              49547,
              49557,
              49559,
              49553,
              49543,
              49552,
              49551,
              49557,
              49559,
              49560,
              49562,
              49555,
              49557,
              49553,
              49557,
              49555,
              49556,
              49563,
              49564,
              49562,
              49551,
              49544,
              49559,
              49558,
              49555,
              49553,
              49555,
              49554,
              49553,
              49554,
              49565,
              49559,
              49559,
              49557,
              49555,
              49543,
              49546,
              49554,
              49558,
              49554,
              49545,
              49558,
              49559,
              49553,
              49559,
              49566,
              49564,
              49552,
              49548,
              49554,
              49547,
              49544,
              49550,
              49556,
              49553,
              49552,
              49561,
              49557,
              49543,
              49551,
              49551,
              49561,
              49555,
              49557,
              49556,
              49556,
              49550,
              49551,
              49557,
              49554,
              49553,
              49552,
              49545,
              49547,
              49546,
              49551,
              49549,
              49553,
              49558,
              49553,
              49559,
              49551,
              49551,
              49556,
              49557,
              49563,
              49561,
              49557,
              49560,
              49558,
              49559,
              49559,
              49563,
              49563,
              49551,
              49554,
              49555,
              49553,
              49554,
              49551,
              49562,
              49563,
              49555,
              49567,
              49565,
              49556,
              49543,
              49548,
              49562,
              49555,
              49558,
              49561,
              49555,
              49563,
              49557,
              49546,
              49553,
              49559,
              49561,
              49560,
              49554,
              49555,
              49575,
              49589,
              49603,
              49606,
              49617,
              49617,
              49611,
              49616,
              49610,
              49615,
              49627,
              49623,
              49626,
              49619,
              49627,
              49623,
              49633,
              49638,
              49647,
              49684,
              49596,
              49575,
              49571,
              49561,
              49555,
              49553,
              49543,
              49540,
              49535,
              49546,
              49538,
              49534,
              49536,
              49538,
              49542,
              49533,
              49547,
              49544,
              49537,
              49530,
              49531,
              49529,
              49537,
              49537,
              49534,
              49531,
              49533,
              49530,
              49532,
              49537,
              49535,
              49539,
              49538,
              49541,
              49535,
              49535,
              49537,
              49545,
              49535,
              49535,
              49527,
              49532,
              49534,
              49533,
              49537,
              49539,
              49541,
              49536,
              49538,
              49539,
              49541,
              49537,
              49541,
              49537,
              49532,
              49538,
              49539,
              49537,
              49538,
              49542,
              49548,
              49543,
              49545,
              49545,
              49541,
              49541,
              49546,
              49548,
              49551,
              49545,
              49546,
              49550,
              49550,
              49548,
              49549,
              49554,
              49556,
              49560,
              49562,
              49559,
              49560,
              49556,
              49547,
              49551,
              49552,
              49551,
              49554,
              49553,
              49553,
              49555,
              49551,
              49559,
              49567,
              49559,
              49559,
              49557,
              49547,
              49543,
              49554,
              10139,
              11023,
              11025,
              11028,
              11025,
              11019,
              11017,
              11016,
              11022,
              11017,
              11015,
              11015,
              11017,
              11006,
              11001,
              11004,
              11006,
              11004,
              11004,
              11004,
              10894,
              10816,
              10723,
              10651,
              10584,
              10517,
              10461,
              10404,
              10353,
              10299,
              10247,
              10199,
              10159,
              10120,
              10082,
              10042,
              10006,
              9971,
              9926,
              9892,
              10395,
              10486,
              10595,
              10664,
              10710,
              10751,
              10773,
              10793,
              10814,
              10835,
              10845,
              10855,
              10866,
              10872,
              10874,
              10880,
              10885,
              10895,
              10899,
              10903,
              10908,
              10907,
              10903,
              10906,
              10908,
              10913,
              10917,
              10923,
              10919,
              10920,
              10923,
              10915,
              10916,
              10919,
              10925,
              10925,
              10925,
              10927,
              10928,
              10920,
              10919,
              10923,
              10927,
              10926,
              10929,
              10927,
              10925,
              10921,
              10918,
              10923,
              10928,
              10923,
              10926,
              10927,
              10923,
              10919,
              10917,
              10918,
              10923,
              10925,
              10924,
              10922,
              10925,
              10917,
              10915,
              10913,
              10921,
              10918,
              10918,
              10919,
              10919,
              10918,
              10912,
              10914,
              10916,
              10917,
              10914,
              10916,
              10916,
              10911,
              10910,
              10912,
              10915,
              10911,
              10911,
              10911,
              10915,
              10902,
              10907,
              10905,
              10911,
              10909,
              10908,
              10905,
              10907,
              10904,
              10900,
              10900,
              10903,
              10906
            ]
          },
          {
            "time": 1505250250240,
            "label": "p700_dirk_set",
            "light_intensity": 0,
            "r": 0,
            "g": 0,
            "b": 0,
            "light_intensity_raw": 0,
            "temperature": 27.38,
            "humidity": 34.992,
            "pressure": 982.483,
            "temperature2": 27.6,
            "humidity2": 34.75,
            "pressure2": 981.605,
            "contactless_temp": 26.61,
            "compass_direction": "W",
            "compass": 270,
            "angle": 39.775,
            "angle_direction": "N",
            "pitch": 39.33,
            "roll": -6.5,
            "data_raw": [
              51079,
              51092,
              50989,
              50950,
              50925,
              50915,
              50917,
              50891,
              50890,
              50901,
              50895,
              50884,
              50869,
              50875,
              50861,
              50861,
              50851,
              50855,
              50877,
              50859,
              50863,
              50847,
              50863,
              50853,
              50853,
              50858,
              50850,
              50837,
              50835,
              50843,
              50843,
              50833,
              50850,
              50843,
              50852,
              50835,
              50845,
              50847,
              50844,
              50842,
              50844,
              50855,
              50839,
              50837,
              50836,
              50826,
              50845,
              50827,
              50847,
              50836,
              50833,
              50841,
              50851,
              50837,
              50831,
              50862,
              50855,
              50859,
              50848,
              50853,
              50839,
              50845,
              50850,
              50856,
              50843,
              50855,
              50847,
              50863,
              50851,
              50845,
              50863,
              50855,
              50868,
              50854,
              50878,
              50871,
              50879,
              50871,
              50857,
              50849,
              50861,
              50859,
              50883,
              50868,
              50863,
              50863,
              50868,
              50843,
              50847,
              50846,
              50852,
              50863,
              50862,
              50858,
              50849,
              50834,
              50844,
              50851,
              50845,
              50840,
              50826,
              50819,
              50827,
              50835,
              50816,
              50837,
              50834,
              50822,
              50822,
              50813,
              50805,
              50807,
              50795,
              50805,
              50813,
              50805,
              50799,
              50799,
              50801,
              50799,
              50817,
              50806,
              50795,
              50798,
              50801,
              50807,
              50793,
              50799,
              50795,
              50783,
              50794,
              50809,
              50799,
              50803,
              50807,
              50793,
              50790,
              50788,
              50797,
              50775,
              50794,
              50807,
              50805,
              50805,
              50810,
              50795,
              50790,
              50790,
              50797,
              50809,
              50789,
              50802,
              50807,
              50816,
              50819,
              50809,
              50815,
              50820,
              50825,
              50827,
              50818,
              50805,
              50818,
              50826,
              50815,
              50807,
              50816,
              50831,
              50834,
              50837,
              50825,
              50824,
              50837,
              50832,
              50843,
              50848,
              50835,
              50850,
              50819,
              50835,
              50823,
              50815,
              50807,
              50822,
              50841,
              50826,
              50830,
              50831,
              50848,
              50834,
              50851,
              50833,
              50822,
              50828,
              50833,
              50839,
              50825,
              50827,
              50836,
              50789,
              50726,
              50830,
              50836,
              50833,
              50845,
              50851,
              50855,
              50855,
              50860,
              50863,
              50899,
              50886,
              50883,
              50887,
              50898,
              50887,
              50895,
              50881,
              50910,
              50889,
              51753,
              50882,
              50857,
              50821,
              50831,
              50825,
              50833,
              50823,
              50840,
              50817,
              50829,
              50824,
              50809,
              50821,
              50827,
              50830,
              50833,
              50823,
              50844,
              50837,
              50820,
              50819,
              50829,
              50834,
              50834,
              50851,
              50839,
              50816,
              50837,
              50825,
              50828,
              50831,
              50829,
              50833,
              50825,
              50819,
              50831,
              50823,
              50827,
              50836,
              50819,
              50810,
              50823,
              50821,
              50819,
              50812,
              50807,
              50807,
              50805,
              50819,
              50825,
              50833,
              50814,
              50812,
              50814,
              50810,
              50812,
              50815,
              50821,
              50826,
              50836,
              50826,
              50815,
              50814,
              50805,
              50783,
              50796,
              50815,
              50803,
              50823,
              50805,
              50821,
              50815,
              50818,
              50806,
              50815,
              50823,
              50822,
              50822,
              50815,
              50802,
              50803,
              50798,
              50813,
              50826,
              50822,
              50831,
              50834,
              50823,
              50824,
              50816,
              50819,
              50840,
              50830,
              50821,
              50822,
              50823,
              50812,
              50825,
              50827,
              50829,
              50825,
              50831,
              50799,
              50795,
              50797,
              50810,
              50804,
              50811,
              50801,
              50809,
              50804,
              50821,
              50811,
              50805,
              50805,
              50800,
              50815,
              50799,
              50799,
              50791,
              50793,
              50793,
              50812,
              50804,
              50809,
              50800,
              50794,
              50795,
              50814,
              50777,
              50795,
              50812,
              50815,
              50819,
              50821,
              50807,
              50803,
              50798,
              50806,
              50790,
              50805,
              50819,
              50810,
              50783,
              50812,
              50787,
              50805,
              50789,
              50793,
              50811,
              50819,
              50814,
              50803,
              50816,
              50803,
              50812,
              50812,
              50814,
              50813,
              50819,
              50811,
              50821,
              50807,
              50829,
              50810,
              50799,
              50807,
              50807,
              50802,
              50797,
              50815,
              50809,
              50801,
              50790,
              50807,
              50791,
              50815,
              50827,
              50813,
              50815,
              50816,
              50818,
              50799,
              50819,
              50807,
              50819,
              50800,
              50810,
              50815,
              50807,
              50798,
              50785,
              50805,
              50797,
              50809,
              50807,
              50800,
              50814,
              50793,
              50695,
              50822,
              50826,
              50854,
              50857,
              50867,
              50863,
              50876,
              50860,
              50863,
              50877,
              50895,
              50875,
              50889,
              50890,
              50885,
              50879,
              50875,
              50881,
              50892,
              51837,
              50890,
              50862,
              50856,
              50838,
              50838,
              50846,
              50834,
              50834,
              50843,
              50845,
              50849,
              50834,
              50831,
              50834,
              50830,
              50815,
              50836,
              50818,
              50825,
              50820,
              50836,
              50823,
              50831,
              50831,
              50819,
              50837,
              50815,
              50837,
              50834,
              50840,
              50832,
              50814,
              50835,
              50843,
              50848,
              50835,
              50830,
              50827,
              50803,
              50822,
              50831,
              50826,
              50830,
              50823,
              50818,
              50821,
              50813,
              50819,
              50821,
              50823,
              50825,
              50823,
              50823,
              50822,
              50822,
              50822,
              50812,
              50805,
              50829,
              50823,
              50815,
              50809,
              50819,
              50809,
              50821,
              50804,
              50811,
              50811,
              50802,
              50814,
              50805,
              50809,
              50815,
              50831,
              50826,
              50810,
              50806,
              50823,
              50801,
              50818,
              50805,
              50814,
              50801,
              50805,
              50790,
              50796,
              50819,
              50790,
              50804,
              50797,
              50804,
              50802,
              50801,
              50801,
              50803,
              50809,
              50809,
              50795,
              50814,
              50822,
              50803,
              50813,
              50813,
              50823,
              50809,
              50821,
              50801,
              50815,
              50821,
              50825,
              50818,
              50840,
              50835,
              50831,
              50825,
              50827,
              50835,
              50841,
              50841,
              50830,
              50843,
              50831,
              50814,
              50821,
              50822,
              50817,
              50827,
              50831,
              50835,
              50851,
              50829,
              50832,
              50837,
              50815,
              50823,
              50816,
              50831,
              50808,
              50830,
              50846,
              50843,
              50823,
              50823,
              50852,
              50835,
              50845,
              50844,
              50844,
              50813,
              50818,
              50819,
              50821,
              50817,
              50829,
              50546,
              50865,
              50959,
              50876,
              50851,
              50947,
              50856,
              50907,
              50884,
              50854,
              50912,
              50881,
              50870,
              50904,
              50877,
              50888,
              50906,
              50894,
              50914,
              50907,
              50894,
              50907,
              50904,
              50899,
              50911,
              50908,
              50904,
              50885,
              50885,
              50879,
              50879,
              50889,
              50873,
              50872,
              50883,
              50892,
              50878,
              50885,
              50879,
              50877,
              50887,
              50890,
              50902,
              50895,
              50895,
              50715,
              50890,
              50907,
              50908,
              50914,
              50919,
              50938,
              50918,
              50932,
              50906,
              50931,
              50923,
              50946,
              50942,
              50952,
              50958,
              50944,
              50938,
              50943,
              50944,
              52003,
              50950,
              50924,
              50936,
              50914,
              50926,
              50913,
              50903,
              50912,
              50894,
              50913,
              50900,
              50903,
              50917,
              50919,
              50903,
              50893,
              50892,
              50901,
              50909,
              50886,
              50980,
              50931,
              50877,
              50985,
              50867,
              50876,
              50983,
              50875,
              50874,
              50940,
              50886,
              50963,
              50943,
              50863,
              50944,
              50918,
              50915,
              50926,
              50890,
              50911,
              50908,
              50885,
              50937,
              50906,
              50901,
              50913,
              50887,
              50913,
              50897,
              50880,
              50894,
              50882,
              50883,
              50913,
              50897,
              50904,
              50880,
              50886,
              50904,
              50898,
              50898,
              50905,
              50895,
              50916,
              50895,
              50898,
              50906,
              50895,
              50882,
              50894,
              50878,
              50911,
              50899,
              50894,
              50903,
              50912,
              50909,
              50897,
              50893,
              50906,
              50887,
              50887,
              50909,
              50903,
              50887,
              50896,
              50884,
              50890,
              50883,
              50877,
              50895,
              50891,
              50893,
              50908,
              50900,
              50915,
              50903,
              50917,
              50909,
              50917,
              50903,
              50907,
              50912,
              50914,
              50911,
              50903,
              50909,
              50906,
              50896,
              50897,
              50904,
              50895,
              50903,
              50912,
              50911,
              50911,
              50895,
              50908,
              50900,
              50902,
              50890,
              50899,
              50902,
              50886,
              50893,
              50886,
              50899,
              50897,
              50899,
              50895,
              50904,
              50918,
              50797,
              50925,
              50959,
              50852,
              50902,
              50922,
              50901,
              50874,
              50926,
              50966,
              50911,
              50893,
              50919,
              50935,
              50893,
              50899,
              50905,
              50939,
              50895,
              50903,
              50918,
              50921,
              50908,
              50897,
              50919,
              50902,
              50896,
              50917,
              50906,
              50917,
              50914,
              50913,
              50897,
              50908,
              50908,
              50902,
              50918,
              50919,
              50893,
              50906,
              50922,
              50913,
              50908,
              50893,
              50889,
              50900,
              50908,
              50924,
              50921,
              50921,
              50924,
              50905,
              50917,
              50903,
              50902,
              50890,
              50901,
              50906,
              50908,
              50912,
              50897,
              50893,
              50905,
              50907,
              50902,
              50911,
              50891,
              50699,
              50903,
              50920,
              50947,
              50948,
              50951,
              50955,
              50950,
              50958,
              50954,
              50951,
              50967,
              50937,
              50956,
              50971,
              50961,
              50973,
              50966,
              50955,
              50971,
              52095,
              50967,
              50945,
              50952,
              50933,
              50931,
              50919,
              50910,
              50915,
              50915,
              50920,
              50906,
              50917,
              50903,
              50900,
              50891,
              50907,
              50902,
              50910,
              50917,
              50914,
              50918,
              50919,
              50898,
              50893,
              50893,
              50904,
              50912,
              50915,
              50915,
              50895,
              50895,
              50889,
              50903,
              50898,
              50904,
              50911,
              50919,
              50905,
              50911,
              50906,
              50898,
              50884,
              50897,
              50895,
              50902,
              50894,
              50890,
              50891,
              50893,
              50897,
              50901,
              50900,
              50899,
              50890,
              50888,
              50887,
              50887,
              50879,
              50886,
              50909,
              50902,
              50906,
              50911,
              50891,
              50894,
              50899,
              50883,
              50895,
              50881,
              50877,
              50872,
              50871,
              50873,
              50875,
              50861,
              50857,
              50877,
              50887,
              50898,
              50885,
              50901,
              50891,
              50876,
              50883,
              50902,
              50890,
              50896,
              50885,
              50903,
              50895,
              50898,
              50891,
              50902,
              50891,
              50898,
              50918,
              50894,
              50901,
              50881,
              50883,
              50875,
              50884,
              50888,
              50883,
              50911,
              50893,
              50869,
              50887,
              50882,
              50892,
              50895,
              50898,
              50886,
              50875,
              50887,
              50869,
              50885,
              50887,
              50895,
              50879,
              50891,
              50890,
              50895,
              50890,
              50885,
              50894,
              50907,
              50887,
              50903,
              50899,
              50894,
              50875,
              50891,
              50888,
              50890,
              50886,
              50893,
              50892,
              50889,
              50910,
              50895,
              50896,
              50895,
              50912,
              50895,
              50910,
              50902,
              50901,
              50902,
              50896,
              50900,
              50909,
              50907,
              50909,
              50901,
              50919,
              50910,
              50901,
              50887,
              50896,
              50937,
              50927,
              50929,
              50913,
              50923,
              50898,
              50896,
              50903,
              50912,
              50907,
              50915,
              50895,
              50894,
              50900,
              50885,
              50871,
              50893,
              50903,
              50887,
              50890,
              50913,
              50875,
              50882,
              50894,
              50895,
              50903,
              50885,
              50894,
              50899,
              50904,
              50890,
              50903,
              50905,
              50912,
              50895,
              50917,
              50918,
              50908,
              50921,
              50619,
              50903,
              50915,
              50917,
              50912,
              50913,
              50924,
              50917,
              50919,
              50930,
              50929,
              50954,
              50951,
              50947,
              50955,
              50943,
              50945,
              50947,
              50945,
              50964,
              52635,
              50959,
              50948,
              50943,
              50938,
              50923,
              50919,
              50909,
              50922,
              50905,
              50898,
              50895,
              50884,
              50897,
              50899,
              50907,
              50917,
              50915,
              50915,
              50925,
              50919,
              50929,
              50911,
              50918,
              50909,
              50915,
              50899,
              50908,
              50910,
              50914,
              50910,
              50885,
              50902,
              50927,
              50915,
              50914,
              50917,
              50935,
              50908,
              50897,
              50882,
              50907,
              50895,
              50921,
              50914,
              50916,
              50906,
              50898,
              50882,
              50912,
              50926,
              50908,
              50911,
              50894,
              50900,
              50905,
              50893,
              50906,
              50902,
              50895,
              50919,
              50897,
              50918,
              50913,
              50913,
              50894,
              50898,
              50897,
              50895,
              50897,
              50880,
              50889,
              50882,
              50880,
              50916,
              50893,
              50919,
              50911,
              50885,
              50893,
              50902,
              50892,
              50890,
              50895,
              50888,
              50930,
              50919,
              50905,
              50899,
              50917,
              50894,
              50881,
              50889,
              50889,
              50911,
              50912,
              50911,
              50902,
              50887,
              50887,
              50909,
              50913,
              50911,
              50901,
              50916,
              50905,
              50903,
              50899,
              50893,
              50911,
              50896,
              50886,
              50900,
              50892,
              50881,
              50901,
              50888,
              50905,
              50887,
              50903,
              50887,
              50903,
              50887,
              50887,
              50894,
              50871,
              50895,
              50884,
              50888,
              50879,
              50884,
              50863,
              50875,
              50876,
              50899,
              50915,
              50909,
              50903,
              50884,
              50882,
              50881,
              50876,
              50884,
              50887,
              50872,
              50881,
              50881,
              50878,
              50882,
              50875,
              50883,
              50887,
              50871,
              50883,
              50917,
              50919,
              50917,
              50899,
              50913,
              50912,
              50909,
              50911,
              50902,
              50914,
              50909,
              50889,
              50899,
              50886,
              50887,
              50888,
              50891,
              50894,
              50885,
              50895,
              50915,
              50920,
              50912,
              50917,
              50895,
              50922,
              50925,
              50916,
              50903,
              50905,
              50921,
              50905,
              50907,
              50921,
              50914,
              50919,
              50912,
              50919,
              50910,
              50919,
              50936,
              50927,
              50925,
              50909,
              50902,
              50903,
              50567,
              50919,
              50925,
              50935,
              50948,
              50938,
              50943,
              50955,
              50958,
              50945,
              50953,
              50962,
              50949,
              50965,
              50967,
              50969,
              50977,
              50982,
              50986,
              50988,
              52434,
              50982,
              50947,
              50947,
              50919,
              50921,
              50923,
              50926,
              50927,
              50913,
              50914,
              50907,
              50910,
              50902,
              50928,
              50927,
              50941,
              50931,
              50919,
              50921,
              50923,
              50931,
              50911,
              50901,
              50901,
              50901,
              50911,
              50893,
              50918,
              50918,
              50902,
              50891,
              50917,
              50900,
              50907,
              50909,
              50903,
              50909,
              50907,
              50932,
              50919,
              50915,
              50944,
              50914,
              50907,
              50919,
              50901,
              50892,
              50909,
              50910,
              50929,
              50934,
              50916,
              50911,
              50932,
              50915,
              50915,
              50916,
              50917,
              50907,
              50901,
              50895,
              50903,
              50899,
              50888,
              50890,
              50896,
              50880,
              50894,
              50906,
              50895,
              50886,
              50903,
              50895,
              50911,
              50885,
              50881,
              50895,
              50885,
              50887,
              50902,
              50903,
              50919,
              50910,
              50904,
              50917,
              50909,
              50907,
              50899,
              50903,
              50899,
              50897,
              50899,
              50901,
              50903,
              50906,
              50916,
              50934,
              50901,
              50901,
              50907,
              50905,
              50886,
              50905,
              50911,
              50919,
              50904,
              50919,
              50909,
              50899,
              50912,
              50891,
              50898,
              50900,
              50891,
              50924,
              50919,
              50914,
              50908,
              50896,
              50911,
              50902,
              50898,
              50886,
              50917,
              50917,
              50939,
              50903,
              50915,
              50923,
              50911,
              50919,
              50913,
              50917,
              50925,
              50919,
              50919,
              50914,
              50900,
              50910,
              50914,
              50903,
              50922,
              50919,
              50911,
              50907,
              50903,
              50909,
              50910,
              50918,
              50913,
              50930,
              50906,
              50911,
              50911,
              50909,
              50906,
              50914,
              50914,
              50923,
              50902,
              50922,
              50904,
              50901,
              50919,
              50907,
              50918,
              50917,
              50913,
              50899,
              50911,
              50923,
              50886,
              50899,
              50905,
              50914,
              50909,
              50913,
              50911,
              50895,
              50907,
              50906,
              50902,
              50910,
              50911,
              50919,
              50907,
              50892,
              50884,
              50887,
              50897,
              50911,
              50894,
              50903,
              50906,
              50900,
              50903,
              50919,
              50897,
              50914,
              50482,
              50917,
              50930,
              50922,
              50914,
              50925,
              50929,
              50960,
              50965,
              50953,
              50958,
              50945,
              50929,
              50939,
              50925,
              50939,
              50959,
              50945,
              50972,
              50969,
              52503,
              50967,
              50937,
              50934,
              50929,
              50923,
              50910,
              50911,
              50917,
              50911,
              50919,
              50887,
              50903,
              50906,
              50923,
              50909,
              50917,
              50907,
              50923,
              50897,
              50894,
              50902,
              50899,
              50906,
              50925,
              50919,
              50921,
              50898,
              50918,
              50917,
              50930,
              50905,
              50909,
              50910,
              50893,
              50902,
              50907,
              50902,
              50908,
              50903,
              50903,
              50921,
              50911,
              50909,
              50916,
              50907,
              50915,
              50919,
              50934,
              50929,
              50925,
              50911,
              50927,
              50895,
              50907,
              50918,
              50913,
              50925,
              50911,
              50906,
              50906,
              50911,
              50895,
              50912,
              50907,
              50917,
              50915,
              50906,
              50914,
              50894,
              50913,
              50901,
              50909,
              50911,
              50907,
              50905,
              50917,
              50905,
              50917,
              50907,
              50914,
              50912,
              50917,
              50907,
              50912,
              50896,
              50898,
              50917,
              50899,
              50910,
              50925,
              50887,
              50889,
              50885,
              50893,
              50901,
              50907,
              50914,
              50921,
              50921
            ]
          },
          {
            "time": 1505250252824,
            "label": "pam_set",
            "light_intensity": 0,
            "r": 0,
            "g": 0,
            "b": 0,
            "light_intensity_raw": 0,
            "temperature": 27.39,
            "humidity": 34.993,
            "pressure": 982.529,
            "temperature2": 27.61,
            "humidity2": 34.75,
            "pressure2": 981.666,
            "contactless_temp": 26.61,
            "thickness": 0.24,
            "compass_direction": "E",
            "compass": 90,
            "angle": 2.27,
            "angle_direction": "S",
            "pitch": 2.27,
            "roll": 0,
            "data_raw": [
              2186,
              50971,
              2886,
              50941,
              2961,
              50912,
              2993,
              50936,
              3007,
              50931,
              3018,
              50922,
              3021,
              50922,
              3025,
              50939,
              3029,
              50935,
              3033,
              50899,
              3031,
              50942,
              3032,
              50921,
              3033,
              50918,
              3032,
              50907,
              3031,
              50920,
              3032,
              50905,
              3030,
              50919,
              3029,
              50917,
              3031,
              50917,
              3029,
              50922,
              3028,
              50934,
              3030,
              50924,
              3028,
              50903,
              3027,
              50902,
              3027,
              50915,
              3027,
              50919,
              3030,
              50922,
              3031,
              50917,
              3030,
              50911,
              3029,
              50917,
              3030,
              50930,
              3027,
              50911,
              3030,
              50917,
              3026,
              50915,
              3026,
              50893,
              3026,
              50919,
              3023,
              50914,
              3021,
              50925,
              3020,
              50904,
              3017,
              50897,
              3015,
              50898,
              3016,
              50901,
              3015,
              50894,
              3014,
              50892,
              3015,
              50915,
              3015,
              50919,
              3016,
              50896,
              3016,
              50892,
              3016,
              50918,
              3017,
              50927,
              3013,
              50899,
              3014,
              50902,
              3014,
              50888,
              3015,
              50906,
              3014,
              50906,
              3011,
              50917,
              3009,
              50903,
              3011,
              50929,
              3011,
              50907,
              3009,
              50914,
              3008,
              50888,
              3004,
              50908,
              3003,
              50906,
              3003,
              50914,
              3001,
              50894,
              2999,
              50916,
              2999,
              50898,
              3000,
              50925,
              2998,
              50907,
              2997,
              50928,
              2999,
              50921,
              3003,
              50915,
              2999,
              50891,
              3001,
              50919,
              3001,
              50909,
              2999,
              50929,
              2997,
              50935,
              2997,
              50911,
              2994,
              50915,
              2994,
              50899,
              2994,
              50897,
              2994,
              50909,
              2993,
              50914,
              2994,
              50917,
              2991,
              50910,
              2989,
              50913,
              2985,
              50918,
              2984,
              50919,
              2983,
              50922,
              2983,
              50915,
              2982,
              50919,
              2983,
              50930,
              2982,
              50918,
              2980,
              50919,
              2982,
              50883,
              2984,
              50909,
              2983,
              50911,
              2983,
              50887,
              2985,
              50904,
              2980,
              50913,
              3035,
              50910,
              3041,
              50890,
              3048,
              50903,
              3046,
              50888,
              3045,
              50901,
              3043,
              50885,
              3042,
              50892,
              3043,
              50888,
              3045,
              50885,
              3045,
              50904,
              3041,
              50871,
              3037,
              50883,
              3036,
              50881,
              3038,
              50880,
              3036,
              50879,
              3035,
              50879,
              3029,
              50895,
              3027,
              50890,
              3029,
              50887,
              3029,
              50887,
              3027,
              50895,
              3026,
              50886,
              3023,
              50896,
              3021,
              50915,
              3024,
              50905,
              3023,
              50911,
              3022,
              50911,
              3013,
              50887,
              3015,
              50888,
              3019,
              50894,
              3019,
              50904,
              3019,
              50903,
              3012,
              50896,
              3012,
              50908,
              3014,
              50903,
              3012,
              50899,
              3011,
              50907,
              3011,
              50921,
              3003,
              50904,
              3001,
              50904,
              3007,
              50902,
              3005,
              50910,
              3006,
              50914,
              3003,
              50878,
              3000,
              50891,
              2997,
              50904,
              3003,
              50887,
              3004,
              50897,
              2999,
              50903,
              2999,
              50882,
              2991,
              50888,
              2990,
              50887,
              2996,
              50911,
              2995,
              50889,
              2994,
              50883,
              2993,
              50890,
              2991,
              50903,
              2986,
              50890,
              2987,
              50902,
              2987,
              50904,
              2982,
              50919,
              2986,
              50891,
              2982,
              50891,
              2981,
              50905,
              2974,
              50911,
              2976,
              50915,
              2973,
              50907,
              2977,
              50919,
              2977,
              50901,
              2975,
              50903,
              2979,
              50900,
              2973,
              50903,
              2977,
              50887,
              2968,
              50887,
              2963,
              50891,
              2965,
              50917,
              2967,
              50871,
              2965,
              50886,
              2964,
              50885,
              2963,
              50901,
              2963,
              50877,
              2961,
              50879,
              2960,
              50887,
              2958,
              50884,
              2955,
              50871,
              2953,
              50893,
              2954,
              50868,
              2952,
              50879,
              2954,
              50886,
              2957,
              50875,
              2871,
              50947,
              2739,
              50932,
              2627,
              50945,
              2527,
              50983,
              2441,
              50993,
              2366,
              51015,
              2301,
              50999,
              2249,
              51032,
              2205,
              51048,
              2163,
              51044,
              2128,
              51047,
              2100,
              51061,
              2074,
              51019,
              2050,
              51028,
              2029,
              51033,
              1615,
              50835,
              1570,
              50876,
              1536,
              50887,
              1512,
              50905,
              1495,
              50946,
              1474,
              50951,
              1457,
              50960,
              1443,
              50954,
              1426,
              50950,
              1412,
              50972,
              1400,
              50983,
              1388,
              50991,
              1378,
              51011,
              1365,
              50998,
              1355,
              51005,
              1347,
              51002,
              2448,
              50874,
              2613,
              50819,
              2686,
              50798,
              2712,
              50795,
              2729,
              50787,
              2733,
              50790,
              2733,
              50780,
              2736,
              50770,
              2738,
              50783,
              2741,
              50797,
              2741,
              50793,
              2741,
              50795,
              2731,
              50791,
              2733,
              50783,
              2739,
              50798,
              2738,
              50803,
              2737,
              50789,
              2733,
              50787,
              2731,
              50797,
              2738,
              50802,
              2736,
              50799,
              2734,
              50793,
              2732,
              50815,
              2727,
              50799,
              2729,
              50817,
              2731,
              50807,
              2731,
              50789,
              2724,
              50795,
              2726,
              50810,
              2728,
              50775,
              2725,
              50792,
              2729,
              50778,
              2720,
              50779,
              2722,
              50795,
              2721,
              50795,
              2725,
              50807,
              2723,
              50814,
              2724,
              50803,
              2721,
              50835,
              2719,
              50819,
              2716,
              50824,
              2724,
              50830,
              2718,
              50815,
              2720,
              50807,
              2713,
              50819,
              2705,
              50819,
              2708,
              50831,
              2703,
              50822,
              2706,
              50822,
              2707,
              50819,
              2706,
              50831,
              2705,
              50833,
              2708,
              50847,
              2707,
              50817,
              2706,
              50825,
              2701,
              50827,
              2696,
              50815,
              2697,
              50855,
              2697,
              50847,
              2695,
              50850,
              2696,
              50861,
              2693,
              50854,
              2693,
              50843,
              2693,
              50861,
              2693,
              50857,
              2691,
              50847,
              2692,
              50855,
              2693,
              50837,
              2692,
              50855,
              2685,
              50858,
              2686,
              50846,
              2686,
              50869,
              2686,
              50841,
              2685,
              50846,
              2658,
              50883,
              2645,
              50889,
              2637,
              50864,
              2633,
              50882,
              2630,
              50895,
              2629,
              50898,
              2625,
              50916,
              2626,
              50914,
              2625,
              50891,
              2625,
              50916,
              2624,
              50898,
              2622,
              50890,
              2623,
              50892,
              2619,
              50889,
              2618,
              50893
            ]
          },
          {
            "time": 1505250258990,
            "label": "",
            "light_intensity": 17.496,
            "r": 19,
            "g": 8,
            "b": 5,
            "light_intensity_raw": 31,
            "temperature": 27.4,
            "humidity": 34.962,
            "pressure": 982.533,
            "temperature2": 27.63,
            "humidity2": 34.729,
            "pressure2": 981.673,
            "contactless_temp": 26.61,
            "thickness": 0.24,
            "compass_direction": "W",
            "compass": 270,
            "angle": 2.053,
            "angle_direction": "N",
            "pitch": 2.05,
            "roll": -0.18,
            "data_raw": [

            ]
          },
          {
            "time": 1505250259312,
            "label": "",
            "light_intensity": 17.496,
            "r": 19,
            "g": 8,
            "b": 5,
            "light_intensity_raw": 31,
            "temperature": 27.4,
            "humidity": 34.962,
            "pressure": 982.533,
            "temperature2": 27.62,
            "humidity2": 34.729,
            "pressure2": 981.653,
            "contactless_temp": 26.67,
            "thickness": 0.24,
            "compass_direction": "W",
            "compass": 270,
            "angle": 2.295,
            "angle_direction": "N",
            "pitch": 2.29,
            "roll": -0.18,
            "data_raw": [

            ]
          },
          {
            "time": 1505250259630,
            "label": "",
            "light_intensity": 16.464,
            "r": 16,
            "g": 8,
            "b": 4,
            "light_intensity_raw": 28,
            "temperature": 27.4,
            "humidity": 34.962,
            "pressure": 982.529,
            "temperature2": 27.63,
            "humidity2": 34.729,
            "pressure2": 981.675,
            "contactless_temp": 26.67,
            "thickness": 0.24,
            "compass_direction": "W",
            "compass": 270,
            "angle": 2.358,
            "angle_direction": "N",
            "pitch": 2.27,
            "roll": -0.64,
            "data_raw": [

            ]
          },
          {
            "time": 1505250259949,
            "label": "spad_set",
            "detector_read1": 11842,
            "detector_read2": 5597,
            "light_intensity": 16.464,
            "r": 16,
            "g": 8,
            "b": 4,
            "light_intensity_raw": 28,
            "temperature": 27.41,
            "humidity": 34.963,
            "pressure": 982.541,
            "temperature2": 27.63,
            "humidity2": 34.74,
            "pressure2": 981.654,
            "contactless_temp": 26.61,
            "thickness": 0.24,
            "compass_direction": "W",
            "compass": 270,
            "angle": 2.276,
            "angle_direction": "N",
            "pitch": 2.27,
            "roll": -0.17,
            "recall": {
              "time": 1505250260238,
              "colorcal_blank1[1]": 16540.5,
              "colorcal_blank1[2]": 27504,
              "colorcal_blank1[3]": 29952,
              "colorcal_blank1[4]": 37125.5,
              "colorcal_blank1[6]": 39609.5,
              "colorcal_blank1[8]": 39662,
              "colorcal_blank1[9]": 30323,
              "colorcal_blank1[10]": 38384.5,
              "colorcal_blank2[1]": 21346.5,
              "colorcal_blank2[2]": 19350,
              "colorcal_blank2[3]": 22990.5,
              "colorcal_blank2[4]": 19232.5,
              "colorcal_blank2[6]": 16765.5,
              "colorcal_blank2[8]": 18623,
              "colorcal_blank2[9]": 18288.5,
              "colorcal_blank2[10]": 16169,
              "colorcal_blank3[1]": 18712.5,
              "colorcal_blank3[2]": 10274.5,
              "colorcal_blank3[3]": 20166.5,
              "colorcal_blank3[4]": 14065,
              "colorcal_blank3[6]": 5995.5,
              "colorcal_blank3[8]": 6848,
              "colorcal_blank3[9]": 5393.5,
              "colorcal_blank3[10]": 5898.5,
              "colorcal_intensity1_slope[2]": 2.356,
              "colorcal_intensity1_yint[2]": 1.3,
              "colorcal_intensity2_slope[2]": 2.387,
              "colorcal_intensity2_yint[2]": 3.3,
              "colorcal_intensity3_slope[2]": 2.577,
              "colorcal_intensity3_yint[2]": -17.2,
              "ir_baseline_slope[5]": 11173,
              "ir_baseline_yint[5]": 17443.5,
              "ir_baseline_slope[3]": 636,
              "ir_baseline_yint[3]": 835
            },
            "data_raw": [
              1705,
              1441,
              1439,
              1432,
              1421,
              1440,
              1427,
              1433,
              1441,
              1430,
              649,
              551,
              547,
              546,
              547,
              548,
              551,
              549,
              550,
              550,
              3024,
              1623,
              1602,
              1598,
              1600,
              1599,
              1602,
              1603,
              1602,
              1599,
              69,
              174,
              175,
              176,
              173,
              175,
              177,
              177,
              177,
              176,
              39177,
              13751,
              13452,
              13406,
              13391,
              13380,
              13385,
              13375,
              13367,
              13364,
              15588,
              15226,
              15219,
              15219,
              15215,
              15213,
              15207,
              15213,
              15227,
              15223,
              19909,
              13190,
              13102,
              13095,
              13093,
              13087,
              13083,
              13080,
              13081,
              13083,
              18679,
              14521,
              14466,
              14460,
              14457,
              14458,
              14447,
              14446,
              14443,
              14443,
              13640,
              17022,
              17051,
              17049,
              17050,
              17050,
              17053,
              17056,
              17043,
              17043,
              2671,
              3336,
              3344,
              3346,
              3347,
              3345,
              3346,
              3347,
              3344,
              3343,
              9083,
              11912,
              11936,
              11942,
              11941,
              11940,
              11938,
              11941,
              11938,
              11939,
              627,
              810,
              812,
              813,
              817,
              817,
              817,
              816,
              815,
              813,
              38437,
              48451,
              48545,
              48561,
              48563,
              48573,
              48568,
              48566,
              48563,
              48575,
              42426,
              53689,
              53797,
              53810,
              53811,
              53821,
              53820,
              53823,
              53818,
              53821,
              33118,
              43608,
              43727,
              43737,
              43732,
              43734,
              43737,
              43736,
              43736,
              43743,
              31197,
              46343,
              46526,
              46524,
              46519,
              46510,
              46502,
              46490,
              46479,
              46471,
              56511,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              5938,
              7190,
              7199,
              7202,
              7207,
              7209,
              7209,
              7209,
              7210,
              7212,
              40265,
              59975,
              60172,
              60149,
              60131,
              60113,
              60102,
              60093,
              60073,
              60066,
              2078,
              2970,
              2981,
              2981,
              2978,
              2976,
              2977,
              2978,
              2979,
              2981,
              48567,
              48562,
              48560,
              48559,
              48563,
              48562,
              48556,
              48551,
              48548,
              48559,
              53802,
              53798,
              53798,
              53797,
              53799,
              53794,
              53801,
              53807,
              53797,
              53800,
              43758,
              43755,
              43759,
              43763,
              43767,
              43767,
              43766,
              43766,
              43766,
              43767,
              46557,
              46530,
              46519,
              46503,
              46496,
              46485,
              46483,
              46471,
              46466,
              46455
            ]
          }
        ],
        "data_raw": [

        ]
      }
    ]
  ],
  "app_os": "darwin-16.7.0",
  "app_name": "PhotosynQ",
  "app_version": "0.0.25",
  "app_device": "x64",
  "location": false,
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
2
Latest Update:
Sep 2017