Photosynthesis RIDES


**Update:** This macro has been updated to determine the correct Foprime value This macro analyzes data from the Photosynthesis RIDES protocol set.
/**
 * Macro for data evaluation of RIDES1 
 * data on PhotosynQ.org
 * by: David M. Kramer
 * created: 2017-05-09 @ 18:15:27
 */

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

// Define the output object here
var output = {}; //dictionary to hold results
output.n_sets=json.set.length;

// Define the protocol set numbers for each data set
var ECS_LEFdset=2;
var P700_DIRK_set=3;
var PAM_set=4;  //the json set 8 contains the PAM and P700 traces
var SPAD_set=8;
var calib_set=8;

var labels=[];
for (var i=1; i < output.n_sets; i++) {
  var temp=json.set[i].label;
  labels.push(temp);
  if (temp=="DIRK_ECS"){
  	output.tt1=temp;
    ECS_LEFdset=i;
  }
  if (temp=="DIRK_P700"){
  	output.tt2=temp;
    P700_DIRK_set=i;
  }
  if (temp=="PAM"){
  	output.tt3=temp;
    PAM_set=i;
  }
  if (temp=="SPAD"){
  	output.tt4=temp;
    SPAD_set=i;
    calib_set=i;
  }

}

output.labels=labels;
output.t=json.set[1].label;

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

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



//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 =206; //the first point to use for Fo 
var FoPrime_end =220; //the end point to use  for Fo

//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["ECS_tau"] = MathROUND(0.001*fit.parameters[2].value, 4);
	output["gH+"] = MathROUND(1000/fit.parameters[2].value, 3);
	var vHplus = output["ECSt mAU"] *  output["gH+"];
	output["vH+"] = 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=MathROUND(Fs,2);

//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=MathROUND(FoPrime,2);

//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) {
	danger("Phi2 is outside of expected range, please consider discarding the measurement",output);
  }
  if (fvfm >=.85) {
	danger("Phi2 is outside of expected range, please consider discarding the measurement", output);
  }
  else {
	  output["Phi2"] 		= MathROUND(fvfm,3);
  }
  
  
  if (PhiNPQ <= 0) {
	danger("PhiNPQ is outside of expected range, please consider discarding the measurement",output);
  }
   if (PhiNPQ >= 1) {
	danger("PhiNPQ is outside of expected range, please consider discarding the measurement",output);
  }
  else {
	  output.PhiNPQ= MathROUND(PhiNPQ,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.NPQt= MathROUND(npqt,3);
	  output.PhiNO= MathROUND(PhiNO,3);
	  output.FvP_over_FmP = MathROUND(FvP_FmP,3);
	  outputqP = MathROUND(qP,3);
  
    if (PhiNO <= 0) {
	danger("PhiNO is outside of expected range, please consider discarding the measurement",output);
  }
   if (PhiNO >= 1) {
	danger("PhiNO is outside of expected range, please consider discarding the measurement",output);
  }
  else {
	  output.PhiNO= MathROUND(PhiNO,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.NPQt= MathROUND(npqt,3);
	  output.PhiNPQ= MathROUND(PhiNPQ,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) {
	danger("Phi2 is outside of expected range, please consider discarding the measurement",output);
  }
  if (fvfm >=.85) {
	danger("Phi2 is outside of expected range, please consider discarding the measurement", output);
  }
  else {
	  output["Phi2"] 		= MathROUND(fvfm,3);
  }
  
  if (PhiNPQ <= 0) {
	danger("PhiNPQ is outside of expected range, please consider discarding the measurement",output);
  }
   if (PhiNPQ >= 1) {
	danger("PhiNPQ is outside of expected range, please consider discarding the measurement",output);
  }
  else {
	  output.PhiNPQ= MathROUND(PhiNPQ,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.NPQt= MathROUND(npqt,3);
	  output.PhiNO= MathROUND(PhiNO,3);
	  output.FvP_over_FmP = MathROUND(FvP_FmP,3);
	  outputqP = MathROUND(qP,3);
  
    if (PhiNO <= 0) {
	danger("PhiNO is outside of expected range, please consider discarding the measurement",output);
  }
   if (PhiNO >= 1) {
	danger("PhiNO is outside of expected range, please consider discarding the measurement",output);
  }
  else {
	  output.PhiNO= MathROUND(PhiNO,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.NPQt= MathROUND(npqt,3);
	  output.PhiNPQ= MathROUND(PhiNPQ,3);
	  output.FvP_over_FmP = MathROUND(FvP_FmP,3);
	  outputqP = MathROUND(qP,3);
}

output.FmPrime=MathROUND(FmPrime,2);

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) {
	danger("noisy Fs", output);
}
/*
if (AFmP_std > 300) {
	danger("noisy FmPrime", output);
}
*/
/*
if (FmP_step1_std > 120 | FmP_step2_std > 120 | FmP_step3_std > 120 | FmP_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}
*/
if (FoPrime_std > 150) {
	danger("noisy FoPrime", output);
}
  
 //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["PS1 Active Centers"]=MathROUND(PSI_act, 3);
  output["PS1 Open Centers"]=MathROUND(PSI_open, 3);
  output["PS1 Over Reduced Centers"]=MathROUND(PSI_or, 3);
  output["PS1 Oxidized Centers"]=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 (PAR)"]= light_intensity; 
  var ambient_temperature=json.set[3].temperature;
  output["Ambient Temperature"]=ambient_temperature;
  var ambient_humidity=json.set[3].humidity;
  output["Ambient Humidity"]=ambient_humidity;
  var ambient_pressure=json.set[3].pressure;
  output["Ambient Pressure"]=ambient_pressure;
  //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 Temperature Differential"]=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["Relative Chlorophyll"]=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("Relative chlorophyll content 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("Relative chlorophyll content 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("Relative chlorophyll content is very high.  If this value is associated with a typical leaf, consider recalibrating device.", output);
}

output["Thickness"]=json.set[ECS_LEFdset].thickness;
output.thick2=json.set[ECS_LEFdset].thickness;
output.thick3=json.set[PAM_set].thickness;
output.thick4=json.set[calib_set].thickness;
output["Leaf Angle"]=json.set[4].angle;
output.R=Number(json.set[ECS_LEFdset].r);
output.G=Number(json.set[ECS_LEFdset].g);
output.B=Number(json.set[ECS_LEFdset].b);

output.LEF=output["Light Intensity (PAR)"] * 0.45 * output.Phi2;
output["order"] = ["Phi2", "PhiNPQ", "PhiNO", "Light Intensity (PAR)", "Relative Chlorophyll", "Leaf Temperature Differential", "LEF", "NPQt", "ECSt mAU", "gH+", "vH+", "PS1 Active Centers", "PS1 Open Centers", "PS1 Over Reduced Centers", "PS1 Oxidized Centers", "Ambient Temperature", "Ambient Humidity", "Leaf Angle", "Thickness"];


return output;
{
  "time": 1508095118006,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:38:29",
  "device_battery": 92,
  "device_firmware": 1.22,
  "sample": [
    [
      {
        "time": 1508095118006,
        "protocol_id": 1,
        "set": [
          {
            "time": 1508095118016,
            "label": "no_leaf_baseline",
            "light_intensity": 26.946,
            "r": 24,
            "g": 12,
            "b": 7,
            "light_intensity_raw": 41,
            "temperature": 23.45,
            "humidity": 51.631,
            "pressure": 980.82,
            "temperature2": 23.4,
            "humidity2": 52.369,
            "pressure2": 981.329,
            "contactless_temp": 22.05,
            "compass_direction": "E",
            "compass": 90,
            "angle": 19.744,
            "angle_direction": "SE",
            "pitch": 8.98,
            "roll": 17.66,
            "data_raw": [

            ]
          },
          {
            "time": 1508095118417,
            "label": "DIRK_ECS",
            "light_intensity": 27.037,
            "r": 21,
            "g": 11,
            "b": 6,
            "light_intensity_raw": 38,
            "temperature": 23.49,
            "humidity": 51.573,
            "pressure": 980.806,
            "temperature2": 23.45,
            "humidity2": 52.279,
            "pressure2": 981.334,
            "contactless_temp": 23.01,
            "thickness": 0.38,
            "data_raw": [
              50007,
              49530,
              49515,
              49497,
              49499,
              49487,
              49487,
              49498,
              49493,
              49497,
              49503,
              49508,
              49509,
              49505,
              49502,
              49503,
              49497,
              49497,
              49502,
              49509,
              49510,
              49506,
              49503,
              49497,
              49507,
              49508,
              49501,
              49500,
              49498,
              49501,
              49510,
              49499,
              49495,
              49511,
              49512,
              49503,
              49505,
              49501,
              49503,
              49511,
              49496,
              49503,
              49510,
              49500,
              49503,
              49495,
              49505,
              49512,
              49506,
              49498,
              49502,
              49510,
              49499,
              49495,
              49493,
              49509,
              49491,
              49495,
              49492,
              49511,
              49497,
              49490,
              49501,
              49489,
              49487,
              49503,
              49490,
              49489,
              49495,
              49487,
              49484,
              49495,
              49487,
              49492,
              49490,
              49502,
              49501,
              49499,
              49487,
              49509,
              49503,
              49495,
              49503,
              49502,
              49508,
              49507,
              49501,
              49503,
              49507,
              49501,
              49499,
              49498,
              49502,
              49514,
              49505,
              49501,
              49495,
              49510,
              49501,
              49509,
              49505,
              49513,
              49525,
              49516,
              49511,
              49517,
              49513,
              49507,
              49514,
              49523,
              49504,
              49514,
              49507,
              49523,
              49510,
              49504,
              49501,
              49520,
              49515,
              49509,
              49513,
              49508,
              49519,
              49511,
              49501,
              49513,
              49521,
              49508,
              49512,
              49515,
              49508,
              49515,
              49518,
              49512,
              49518,
              49507,
              49520,
              49515,
              49515,
              49505,
              49523,
              49517,
              49503,
              49523,
              49510,
              49509,
              49517,
              49518,
              49515,
              49517,
              49516,
              49523,
              49517,
              49515,
              49526,
              49517,
              49515,
              49519,
              49526,
              49516,
              49522,
              49523,
              49509,
              49529,
              49532,
              49523,
              49526,
              49516,
              49521,
              49533,
              49520,
              49528,
              49537,
              49521,
              49520,
              49526,
              49530,
              49539,
              49534,
              49529,
              49527,
              49524,
              49534,
              49527,
              49535,
              49524,
              49543,
              49535,
              49523,
              49539,
              49543,
              49523,
              49531,
              49528,
              49523,
              49545,
              49535,
              49529,
              49536,
              49524,
              49548,
              49542,
              49545,
              49537,
              49543,
              49557,
              49555,
              49555,
              49549,
              49550,
              49569,
              49565,
              49567,
              49558,
              49563,
              49571,
              49565,
              49557,
              49559,
              49557,
              49567,
              49556,
              49556,
              49550,
              49566,
              49553,
              49547,
              49543,
              49538,
              49538,
              49546,
              49543,
              49547,
              49553,
              49545,
              49560,
              49557,
              49543,
              49549,
              49549,
              49539,
              49549,
              49551,
              49556,
              49555,
              49557,
              49551,
              49558,
              49565,
              49555,
              49563,
              49550,
              49543,
              49555,
              49546,
              49549,
              49552,
              49551,
              49562,
              49563,
              49553,
              49554,
              49549,
              49545,
              49555,
              49549,
              49543,
              49551,
              49555,
              49559,
              49563,
              49569,
              49553,
              49557,
              49558,
              49555,
              49553,
              49565,
              49554,
              49556,
              49563,
              49547,
              49563,
              49566,
              49566,
              49569,
              49559,
              49561,
              49565,
              49558,
              49557,
              49559,
              49558,
              49555,
              49573,
              49551,
              49564,
              49559,
              49559,
              49567,
              49559,
              49555,
              49566,
              49547,
              49551,
              49561,
              49561,
              49561,
              49566,
              49553,
              49562,
              49559,
              49551,
              49569,
              49569,
              49558,
              49566,
              49574,
              49565,
              49581,
              49569,
              49566,
              49566,
              49559,
              49565,
              49574,
              49569,
              49565,
              49575,
              49567,
              49563,
              49557,
              49559,
              49563,
              49563,
              49567,
              49573,
              49580,
              49571,
              49579,
              49575,
              49569,
              49575,
              49571,
              49563,
              49567,
              49575,
              49569,
              49570,
              49567,
              49564,
              49574,
              49559,
              49564,
              49570,
              49569,
              49578,
              49569,
              49557,
              49561,
              49560,
              49559,
              49569,
              49575,
              49567,
              49575,
              49562,
              49559,
              49567,
              49566,
              49574,
              49572,
              49578,
              49573,
              49577,
              49567,
              49567,
              49575,
              49573,
              49572,
              49570,
              49570,
              49575,
              49573,
              49571,
              49575,
              49569,
              49561,
              49565,
              49570,
              49555,
              49559,
              49545,
              49557,
              49559,
              49569,
              49563,
              49573,
              49570,
              49571,
              49573,
              49561,
              49574,
              49571,
              49566,
              49570,
              49573,
              49563,
              49571,
              49565,
              49570,
              49571,
              49575,
              49566,
              49564,
              49559,
              49558,
              49559,
              49548,
              49554,
              49560,
              49565,
              49568,
              49581,
              49580,
              49579,
              49577,
              49579,
              49589,
              49583,
              49584,
              49591,
              49589,
              49593,
              49590,
              49595,
              49577,
              49585,
              49588,
              49583,
              49601,
              49579,
              49576,
              49587,
              49575,
              49566,
              49568,
              49559,
              49570,
              49573,
              49574,
              49574,
              49567,
              49563,
              49573,
              49570,
              49568,
              49575,
              49573,
              49567,
              49566,
              49578,
              49557,
              49559,
              49560,
              49569,
              49570,
              49556,
              49561,
              49557,
              49548,
              49568,
              49576,
              49554,
              49566,
              49564,
              49562,
              49557,
              49558,
              49555,
              49572,
              49567,
              49555,
              49566,
              49564,
              49554,
              49559,
              49561,
              49559,
              49567,
              49552,
              49552,
              49561,
              49557,
              49572,
              49577,
              49557,
              49570,
              49557,
              49557,
              49567,
              49565,
              49550,
              49557,
              49561,
              49563,
              49575,
              49572,
              49568,
              49567,
              49570,
              49559,
              49562,
              49554,
              49571,
              49572,
              49559,
              49561,
              49567,
              49552,
              49571,
              49574,
              49565,
              49565,
              49556,
              49554,
              49561,
              49571,
              49566,
              49567,
              49560,
              49550,
              49564,
              49557,
              49567,
              49561,
              49567,
              49567,
              49561,
              49557,
              49570,
              49571,
              49568,
              49570,
              49566,
              49560,
              49569,
              49563,
              49554,
              49561,
              49563,
              49565,
              49574,
              49570,
              49571,
              49570,
              49555,
              49563,
              49559,
              49553,
              49562,
              49566,
              49570,
              49575,
              49567,
              49562,
              49567,
              49563,
              49559,
              49573,
              49562,
              49567,
              49574,
              49558,
              49565,
              49558,
              49559,
              49557,
              49571,
              49570,
              49570,
              49566,
              49557,
              49554,
              49565,
              49561,
              49574,
              49572,
              49556,
              49574,
              49577,
              49566,
              49571,
              49567,
              49559,
              49562,
              49573,
              49570,
              49578,
              49562,
              49562,
              49566,
              49560,
              49558,
              49563,
              49575,
              49567,
              49564,
              49554,
              49567,
              49575,
              49565,
              49569,
              49554,
              49570,
              49574,
              49578,
              49562,
              49560,
              49564,
              49554,
              49561,
              49563,
              49559,
              49567,
              49561,
              49559,
              49567,
              49562,
              49567,
              49570,
              49570,
              49575,
              49574,
              49566,
              49573,
              49563,
              49564,
              49561,
              49567,
              49574,
              49586,
              49574,
              49582,
              49586,
              49582,
              49581,
              49594,
              49586,
              49603,
              49604,
              49596,
              49601,
              49601,
              49599,
              49596,
              49610,
              49599,
              49607,
              49606,
              49605,
              49594,
              49595,
              49584,
              49585,
              49586,
              49593,
              49592,
              49585,
              49577,
              49581,
              49572,
              49585,
              49581,
              49568,
              49579,
              49584,
              49570,
              49577,
              49573,
              49583,
              49572,
              49578,
              49567,
              49579,
              49586,
              49575,
              49579,
              49569,
              49573,
              49573,
              49571,
              49579,
              49573,
              49566,
              49571,
              49573,
              49575,
              49579,
              49575,
              49565,
              49573,
              49587,
              49581,
              49575,
              49575,
              49565,
              49575,
              49573,
              49579,
              49587,
              49578,
              49578,
              49578,
              49573,
              49577,
              49577,
              49575,
              49583,
              49587,
              49567,
              49572,
              49571,
              49574,
              49575,
              49573,
              49569,
              49572,
              49577,
              49574,
              49575,
              49577,
              49569,
              49579,
              49567,
              49563,
              49579,
              49579,
              49575,
              49579,
              49573,
              49570,
              49567,
              49563,
              49579,
              49583,
              49571,
              49573,
              49575,
              49559,
              49579,
              49581,
              49571,
              49575,
              49567,
              49565,
              49583,
              49573,
              49574,
              49573,
              49560,
              49574,
              49584,
              49581,
              49579,
              49573,
              49571,
              49580,
              49571,
              49567,
              49574,
              49579,
              49582,
              49583,
              49577,
              49575,
              49575,
              49580,
              49588,
              49582,
              49575,
              49583,
              49575,
              49580,
              49583,
              49575,
              49567,
              49586,
              49584,
              49573,
              49592,
              49573,
              49583,
              49587,
              49575,
              49577,
              49577,
              49571,
              49574,
              49571,
              49578,
              49586,
              49584,
              49577,
              49580,
              49583,
              49578,
              49579,
              49585,
              49583,
              49583,
              49589,
              49578,
              49587,
              49575,
              49587,
              49575,
              49576,
              49583,
              49590,
              49583,
              49589,
              49579,
              49578,
              49583,
              49585,
              49586,
              49588,
              49587,
              49573,
              49587,
              49587,
              49584,
              49594,
              49582,
              49575,
              49581,
              49572,
              49586,
              49597,
              49589,
              49591,
              49589,
              49578,
              49598,
              49593,
              49579,
              49586,
              49574,
              49581,
              49592,
              49589,
              49581,
              49586,
              49580,
              49586,
              49578,
              49567,
              49589,
              49583,
              49585,
              49595,
              49601,
              49599,
              49601,
              49605,
              49603,
              49607,
              49615,
              49611,
              49616,
              49618,
              49611,
              49627,
              49617,
              49618,
              49625,
              49615,
              49625,
              49617,
              49629,
              49615,
              49619,
              49612,
              49610,
              49616,
              49599,
              49603,
              49616,
              49612,
              49607,
              49613,
              49606,
              49607,
              49603,
              49606,
              49598,
              49590,
              49596,
              49605,
              49603,
              49605,
              49607,
              49594,
              49597,
              49606,
              49588,
              49595,
              49588,
              49591,
              49595,
              49586,
              49589,
              49605,
              49603,
              49593,
              49594,
              49585,
              49591,
              49593,
              49590,
              49605,
              49603,
              49587,
              49600,
              49593,
              49582,
              49602,
              49601,
              49588,
              49591,
              49583,
              49603,
              49603,
              49585,
              49597,
              49591,
              49590,
              49600,
              49604,
              49592,
              49593,
              49588,
              49587,
              49585,
              49598,
              49589,
              49584,
              49587,
              49586,
              49601,
              49591,
              49583,
              49585,
              49579,
              49587,
              49599,
              49588,
              49591,
              49590,
              49586,
              49595,
              49588,
              49583,
              49598,
              49589,
              49579,
              49582,
              49586,
              49591,
              49587,
              49583,
              49585,
              49589,
              49593,
              49593,
              49590,
              49579,
              49599,
              49597,
              49588,
              49585,
              49589,
              49577,
              49588,
              49577,
              49583,
              49594,
              49589,
              49594,
              49592,
              49581,
              49591,
              49583,
              49585,
              49602,
              49598,
              49589,
              49592,
              49589,
              49583,
              49587,
              49603,
              49597,
              49594,
              49590,
              49588,
              49584,
              49591,
              49593,
              49589,
              49581,
              49589,
              49590,
              49585,
              49592,
              49591,
              49585,
              49598,
              49575,
              49583,
              49585,
              49581,
              49587,
              49598,
              49589,
              49586,
              49601,
              49584,
              49585,
              49587,
              49587,
              49597,
              49597,
              49590,
              49603,
              49599,
              49579,
              49588,
              49583,
              49583,
              49588,
              49587,
              49581,
              49593,
              49585,
              49586,
              49588,
              49577,
              49586,
              49586,
              49591,
              49608,
              49603,
              49590,
              49599,
              49599,
              49589,
              49595,
              49599,
              49604,
              49595,
              49595,
              49589,
              49591,
              49599,
              49607,
              49599,
              49593,
              49598,
              49593,
              49588,
              49602,
              49603,
              49590,
              49594,
              49599,
              49593,
              49587,
              49587,
              49583,
              49599,
              49596,
              49610,
              49619,
              49621,
              49630,
              49628,
              49615,
              49631,
              49619,
              49626,
              49635,
              49625,
              49628,
              49646,
              49641,
              49639,
              49637,
              49628,
              49646,
              49619,
              49619,
              49625,
              49622,
              49613,
              49615,
              49623,
              49613,
              49622,
              49623,
              49625,
              49634,
              49625,
              49612,
              49618,
              49609,
              49613,
              49623,
              49613,
              49619,
              49631,
              49619,
              49623,
              49619,
              49602,
              49611,
              49613,
              49609,
              49614,
              49608,
              49606,
              49611,
              49597,
              49601,
              49614,
              49613,
              49615,
              49601,
              49601,
              49600,
              49594,
              49587,
              49610,
              49605,
              49595,
              49607,
              49607,
              49600,
              49600,
              49591,
              49595,
              49598,
              49593,
              49600,
              49606,
              49595,
              49603,
              49597,
              49589,
              49592,
              49594,
              49585,
              49599,
              49602,
              49601,
              49603,
              49595,
              49593,
              49596,
              49594,
              49595,
              49591,
              49590,
              49606,
              49606,
              49605,
              49600,
              49599,
              49589,
              49595,
              49598,
              49589,
              49604,
              49589,
              49586,
              49598,
              49579,
              49590,
              49598,
              49581,
              49589,
              49589,
              49591,
              49599,
              49601,
              49587,
              49593,
              49604,
              49595,
              49591,
              49588,
              49584,
              49597,
              49584,
              49589,
              49601,
              49590,
              49599,
              49595,
              49594,
              49613,
              49604,
              49589,
              49597,
              49593,
              49606,
              49602,
              49591,
              49590,
              49594,
              49595,
              49599,
              49595,
              49581,
              49597,
              49604,
              49599,
              49595,
              49597,
              49591,
              49593,
              49601,
              49602,
              49601,
              49588,
              49583,
              49595,
              49590,
              49600,
              49591,
              49579,
              49588,
              49593,
              49596,
              49606,
              49594,
              49584,
              49599,
              49601,
              49590,
              49597,
              49581,
              49597,
              49601,
              49586,
              49597,
              49602,
              49595,
              49596,
              49594,
              49609,
              49597,
              49595,
              49589,
              49591,
              49598,
              49587,
              49586,
              49591,
              49590,
              49596,
              49593,
              49590,
              49593,
              49592,
              49594,
              49590,
              49587,
              49603,
              49597,
              49590,
              49593,
              49592,
              49587,
              49599,
              49588,
              49591,
              49589,
              49606,
              49602,
              49589,
              49605,
              49601,
              49597,
              49584,
              49603,
              49610,
              49595,
              49591,
              49591,
              49607,
              49611,
              49606,
              49621,
              49636,
              49615,
              49614,
              49623,
              49625,
              49629,
              49629,
              49623,
              49639,
              49625,
              49624,
              49635,
              49638,
              49637,
              49637,
              49655,
              49641,
              49632,
              49623,
              49614,
              49634,
              49625,
              49612,
              49615,
              49618,
              49631,
              49614,
              49610,
              49618,
              49627,
              49614,
              49617,
              49609,
              49601,
              49617,
              49614,
              49617,
              49615,
              49607,
              49609,
              49615,
              49607,
              49612,
              49602,
              49595,
              49615,
              49601,
              49594,
              49610,
              49615,
              49601,
              49607,
              49599,
              49610,
              49611,
              49595,
              49609,
              49611,
              49606,
              49611,
              49603,
              49601,
              49611,
              49596,
              49606,
              49607,
              49606,
              49606,
              49601,
              49598,
              49602,
              49609,
              49601,
              49601,
              49596,
              49603,
              49603,
              49602,
              49593,
              49610,
              49601,
              49600,
              49604,
              49597,
              49607,
              49605,
              49599,
              49596,
              49607,
              49599,
              49602,
              49603,
              49603,
              49605,
              49605,
              49594,
              49607,
              49593,
              49595,
              49594,
              49602,
              49593,
              49597,
              49601,
              49603,
              49603,
              49595,
              49608,
              49600,
              49591,
              49605,
              49597,
              49589,
              49599,
              49596,
              1265,
              1377,
              1380,
              1382,
              1385,
              1391,
              1392,
              1392,
              1391,
              1399,
              1395,
              1397,
              1399,
              1403,
              1400,
              1404,
              1400,
              1401,
              1412,
              1410,
              1387,
              1370,
              1357,
              1355,
              1348,
              1346,
              1341,
              1339,
              1327,
              1326,
              1326,
              1318,
              1319,
              1310,
              1310,
              1316,
              1302,
              1303,
              1303,
              1298,
              1315,
              1327,
              1341,
              1348,
              1354,
              1349,
              1359,
              1363,
              1364,
              1374,
              1368,
              1374,
              1375,
              1378,
              1380,
              1384,
              1379,
              1388,
              1387,
              1388,
              1391,
              1391,
              1388,
              1403,
              1392,
              1396,
              1402,
              1392,
              1396,
              1405,
              1399,
              1403,
              1409,
              1398,
              1413,
              1405,
              1405,
              1410,
              1414,
              1406,
              1410,
              1411,
              1411,
              1415,
              1416,
              1411,
              1415,
              1413,
              1421,
              1417,
              1415,
              1419,
              1415,
              1413,
              1413,
              1417,
              1414,
              1420,
              1420,
              1412,
              1420,
              1413,
              1417,
              1415,
              1415,
              1423,
              1423,
              1418,
              1417,
              1424,
              1412,
              1423,
              1414,
              1420,
              1423,
              1413,
              1420,
              1417,
              1423,
              1427,
              1422,
              1431,
              1419,
              1425,
              1416,
              1423,
              1427,
              1417,
              1429,
              1422,
              1422,
              1426,
              1423,
              1418,
              1431,
              1416,
              1422,
              1426,
              1423,
              1426
            ]
          },
          {
            "time": 1508095124711,
            "label": "DIRK_P700",
            "light_intensity": 27,
            "r": 21,
            "g": 11,
            "b": 6,
            "light_intensity_raw": 38,
            "temperature": 23.52,
            "humidity": 51.555,
            "pressure": 980.831,
            "temperature2": 23.48,
            "humidity2": 52.271,
            "pressure2": 981.322,
            "contactless_temp": 22.67,
            "compass_direction": "E",
            "compass": 90,
            "angle": 5.279,
            "angle_direction": "E",
            "pitch": -1.38,
            "roll": 5.1,
            "data_raw": [
              56423,
              56421,
              56422,
              56411,
              56388,
              56426,
              56431,
              56410,
              56423,
              56428,
              56434,
              56411,
              56409,
              56406,
              56421,
              56421,
              56382,
              56385,
              56410,
              56393,
              56418,
              56418,
              56391,
              56385,
              56399,
              56397,
              56415,
              56422,
              56402,
              56433,
              56420,
              56427,
              56401,
              56391,
              56415,
              56411,
              56407,
              56389,
              56401,
              56403,
              56417,
              56445,
              56396,
              56415,
              56407,
              56403,
              56404,
              56391,
              56379,
              56399,
              56413,
              56409,
              56414,
              56415,
              56422,
              56415,
              56402,
              56404,
              56414,
              56415,
              56381,
              56415,
              56406,
              56411,
              56398,
              56381,
              56403,
              56405,
              56402,
              56391,
              56409,
              56391,
              56405,
              56377,
              56396,
              56385,
              56404,
              56375,
              56398,
              56415,
              56407,
              56418,
              56400,
              56425,
              56384,
              56419,
              56429,
              56421,
              56409,
              56422,
              56387,
              56417,
              56415,
              56423,
              56401,
              56405,
              56389,
              56391,
              56377,
              56413,
              56417,
              56387,
              56398,
              56398,
              56391,
              56395,
              56379,
              56383,
              56408,
              56381,
              56377,
              56384,
              56390,
              56404,
              56418,
              56413,
              56431,
              56427,
              56417,
              56394,
              56401,
              56375,
              56387,
              56409,
              56375,
              56384,
              56404,
              56390,
              56442,
              56415,
              56420,
              56423,
              56454,
              56426,
              56431,
              56438,
              56420,
              56430,
              56431,
              56410,
              56439,
              56415,
              56399,
              56427,
              56415,
              56415,
              56415,
              56391,
              56407,
              56414,
              56429,
              56417,
              56423,
              56443,
              56394,
              56432,
              56434,
              56419,
              56439,
              56431,
              56402,
              56408,
              56429,
              56437,
              56441,
              56421,
              56423,
              56455,
              56410,
              56393,
              56415,
              56434,
              56413,
              56434,
              56397,
              56399,
              56415,
              56409,
              56433,
              56418,
              56423,
              56399,
              56425,
              56415,
              56417,
              56417,
              56383,
              56401,
              56405,
              56390,
              56388,
              56377,
              56414,
              56399,
              56397,
              56375,
              56389,
              56391,
              56396,
              56392,
              56379,
              56375,
              56419,
              56377,
              56381,
              56383,
              56371,
              56382,
              56375,
              56394,
              56393,
              56375,
              56394,
              56381,
              56381,
              56351,
              56379,
              56391,
              56382,
              56389,
              56411,
              56405,
              56380,
              56397,
              56426,
              56375,
              56391,
              56383,
              56394,
              56366,
              56398,
              56378,
              56353,
              56363,
              56362,
              56366,
              56371,
              56407,
              56378,
              56371,
              56393,
              56372,
              56399,
              56405,
              56391,
              56413,
              56415,
              56384,
              56391,
              56385,
              56391,
              56369,
              56410,
              56421,
              56402,
              56399,
              56391,
              56357,
              56357,
              56390,
              56399,
              56394,
              56413,
              56422,
              56409,
              56400,
              56403,
              56385,
              56355,
              56357,
              56381,
              56353,
              56379,
              56340,
              56351,
              56381,
              56350,
              56361,
              56351,
              56347,
              56374,
              56347,
              56359,
              56375,
              56359,
              56355,
              56367,
              56371,
              56367,
              56364,
              56383,
              56367,
              56391,
              56379,
              56367,
              56393,
              56343,
              56369,
              56385,
              56413,
              56406,
              56421,
              56426,
              56413,
              56428,
              56418,
              56387,
              56375,
              56383,
              56407,
              56384,
              56371,
              56389,
              56407,
              56400,
              56402,
              56384,
              56375,
              56391,
              56393,
              56411,
              56391,
              56407,
              56401,
              56406,
              56406,
              56404,
              56400,
              56382,
              56381,
              56382,
              56391,
              56383,
              56401,
              56357,
              56382,
              56367,
              56372,
              56380,
              56399,
              56389,
              56391,
              56379,
              56380,
              56407,
              56373,
              56397,
              56391,
              56383,
              56391,
              56363,
              56393,
              56386,
              56393,
              56375,
              56391,
              56374,
              56357,
              56383,
              56374,
              56377,
              56375,
              56361,
              56378,
              56383,
              56422,
              56391,
              56423,
              56381,
              56412,
              56426,
              56394,
              56421,
              56437,
              56407,
              56427,
              56415,
              56427,
              56421,
              56454,
              56403,
              56427,
              56422,
              56410,
              56398,
              56406,
              56391,
              56421,
              56427,
              56444,
              56387,
              56413,
              56391,
              56382,
              56418,
              56426,
              56422,
              56417,
              56387,
              56388,
              56382,
              56390,
              56391,
              56434,
              56419,
              56402,
              56436,
              56406,
              56419,
              56406,
              56407,
              56385,
              56405,
              56393,
              56390,
              56377,
              56380,
              56389,
              56397,
              56383,
              56381,
              56373,
              56391,
              56408,
              56413,
              56387,
              56407,
              56405,
              56413,
              56391,
              56422,
              56415,
              56417,
              56413,
              56427,
              56411,
              56422,
              56399,
              56422,
              56389,
              56442,
              56403,
              56383,
              56391,
              56398,
              56390,
              56407,
              56403,
              56382,
              56413,
              56410,
              56415,
              56422,
              56389,
              56406,
              56419,
              56413,
              56397,
              56409,
              56419,
              56427,
              56457,
              56439,
              56415,
              56419,
              56405,
              56402,
              56409,
              56438,
              56415,
              56415,
              56418,
              56421,
              56411,
              56423,
              56407,
              56399,
              56419,
              56426,
              56419,
              56411,
              56431,
              56422,
              56404,
              56418,
              56405,
              56415,
              56410,
              56427,
              56389,
              56383,
              56414,
              56411,
              56401,
              56385,
              56383,
              56395,
              56405,
              56398,
              56400,
              56395,
              56403,
              56406,
              56368,
              56391,
              56381,
              56388,
              56398,
              56362,
              56399,
              56386,
              56399,
              56409,
              56396,
              56402,
              56375,
              56401,
              56397,
              56381,
              56395,
              56383,
              56397,
              56413,
              56414,
              56405,
              56394,
              56401,
              56429,
              56391,
              56431,
              56407,
              56439,
              56383,
              56402,
              56415,
              56387,
              56395,
              56412,
              56396,
              56409,
              56415,
              56408,
              56419,
              56401,
              56412,
              56414,
              56401,
              56391,
              56415,
              56422,
              56403,
              56418,
              56430,
              56411,
              56396,
              56390,
              56378,
              56393,
              56369,
              56399,
              56387,
              56367,
              56379,
              56408,
              56397,
              56379,
              56383,
              56371,
              56391,
              56389,
              56363,
              56384,
              56407,
              56382,
              56427,
              56398,
              56389,
              56424,
              56419,
              56400,
              56394,
              56415,
              56382,
              56391,
              56374,
              56367,
              56407,
              56422,
              56408,
              56390,
              56411,
              56408,
              56389,
              56404,
              56397,
              56415,
              56412,
              56404,
              56407,
              56390,
              56399,
              56392,
              56414,
              56413,
              56438,
              56421,
              56402,
              56427,
              56400,
              56433,
              56438,
              56417,
              56433,
              56426,
              56415,
              56426,
              56414,
              56395,
              56407,
              56421,
              56411,
              56415,
              56403,
              56437,
              56421,
              56425,
              56414,
              56431,
              56403,
              56405,
              56427,
              56430,
              56421,
              56403,
              56425,
              56417,
              56427,
              56391,
              56416,
              56409,
              56366,
              56415,
              56390,
              56399,
              56401,
              56410,
              56408,
              56420,
              56409,
              56416,
              56421,
              56406,
              56407,
              56415,
              56415,
              56397,
              56397,
              56400,
              56416,
              56395,
              56453,
              56388,
              56385,
              56400,
              56391,
              56390,
              56398,
              56398,
              56389,
              56400,
              56404,
              56410,
              56391,
              56384,
              56395,
              56395,
              56390,
              56401,
              56393,
              56402,
              56388,
              56389,
              56409,
              56415,
              56381,
              56386,
              56381,
              56394,
              56401,
              56387,
              56376,
              56401,
              56380,
              56369,
              56389,
              56399,
              56399,
              56401,
              56389,
              56389,
              56405,
              56407,
              56396,
              56402,
              56380,
              56391,
              56399,
              56396,
              56407,
              56407,
              56392,
              56407,
              56390,
              56383,
              56395,
              56385,
              56381,
              56405,
              56396,
              56398,
              56358,
              56391,
              56364,
              56390,
              56418,
              56375,
              56361,
              56364,
              56414,
              56386,
              56379,
              56385,
              56413,
              56399,
              56405,
              56423,
              56391,
              56379,
              56389,
              56383,
              56399,
              56434,
              56391,
              56415,
              56369,
              56394,
              56386,
              56409,
              56383,
              56395,
              56383,
              56383,
              56371,
              56382,
              56387,
              56403,
              56394,
              56417,
              56374,
              56395,
              56382,
              56397,
              56376,
              56391,
              56406,
              56367,
              56424,
              56393,
              56393,
              56403,
              56425,
              56382,
              56409,
              56393,
              56389,
              56385,
              56386,
              56406,
              56395,
              56395,
              56389,
              56398,
              56367,
              56377,
              56398,
              56361,
              56369,
              56391,
              56394,
              56389,
              56385,
              56375,
              56414,
              56370,
              56402,
              56413,
              56397,
              56406,
              56396,
              56391,
              56420,
              56404,
              56365,
              56345,
              56355,
              56374,
              56359,
              56394,
              56379,
              56365,
              56394,
              56381,
              56349,
              56355,
              56361,
              56343,
              56378,
              56364,
              56414,
              56371,
              56379,
              56362,
              56377,
              56382,
              56369,
              56387,
              56378,
              56375,
              56389,
              56369,
              56379,
              56355,
              56372,
              56360,
              56365,
              56389,
              56425,
              56399,
              56387,
              56393,
              56387,
              56395,
              56375,
              56384,
              56405,
              56390,
              56409,
              56378,
              56378,
              56403,
              56391,
              56369,
              56391,
              56385,
              56387,
              56364,
              56406,
              56353,
              56361,
              56387,
              56415,
              56383,
              56406,
              56385,
              56389,
              56390,
              56401,
              56378,
              56363,
              56415,
              56391,
              56399,
              56408,
              56420,
              56401,
              56407,
              56381,
              56411,
              56398,
              56427,
              56442,
              56436,
              56420,
              56414,
              56421,
              56413,
              56401,
              56415,
              56410,
              56403,
              56400,
              56415,
              56390,
              56382,
              56405,
              56371,
              56382,
              56389,
              56378,
              56394,
              56351,
              56375,
              56405,
              56364,
              56351,
              56371,
              56358,
              56376,
              56379,
              56379,
              56402,
              56412,
              56393,
              56371,
              56390,
              56359,
              56385,
              56409,
              56373,
              56397,
              56387,
              56383,
              56417,
              56374,
              56365,
              56382,
              56381,
              56373,
              56367,
              56382,
              56351,
              56381,
              56390,
              56375,
              56366,
              56392,
              56388,
              56418,
              56403,
              56414,
              56383,
              56401,
              56396,
              56371,
              56365,
              56386,
              56377,
              56383,
              56414,
              56404,
              56392,
              56364,
              56405,
              56404,
              56413,
              56422,
              56431,
              56421,
              56419,
              56445,
              56406,
              56425,
              56409,
              56390,
              56423,
              56441,
              56387,
              56407,
              56400,
              56409,
              56371,
              56403,
              56391,
              56402,
              56393,
              56379,
              56342,
              56381,
              56385,
              56366,
              56375,
              56383,
              56387,
              56400,
              56403,
              56401,
              56425,
              56410,
              56391,
              56395,
              56387,
              56393,
              56371,
              56389,
              56403,
              56379,
              56414,
              56384,
              56400,
              56379,
              56402,
              56421,
              56406,
              56406,
              56397,
              56394,
              56401,
              56343,
              56380,
              56399,
              56382,
              56405,
              56382,
              56403,
              56378,
              56395,
              56371,
              56391,
              56386,
              56381,
              56399,
              56409,
              56391,
              56409,
              56399,
              56377,
              56410,
              56405,
              56407,
              56405,
              56407,
              56421,
              56386,
              56391,
              56383,
              56393,
              56377,
              56377,
              56418,
              56402,
              56421,
              56416,
              56406,
              56409,
              56437,
              56426,
              56439,
              56421,
              56423,
              56421,
              56411,
              56433,
              56403,
              56421,
              56378,
              56396,
              56399,
              56382,
              56419,
              56367,
              56403,
              56405,
              56371,
              56394,
              56413,
              56394,
              56409,
              56416,
              56383,
              56403,
              56423,
              56401,
              56402,
              56407,
              56411,
              56390,
              56389,
              56390,
              56383,
              56415,
              56379,
              56420,
              56404,
              56389,
              56410,
              56417,
              56392,
              56403,
              56391,
              56386,
              56423,
              56411,
              56404,
              56399,
              56393,
              56397,
              56395,
              56381,
              56367,
              56389,
              56449,
              56355,
              56392,
              56409,
              56435,
              56415,
              56443,
              56427,
              56399,
              56386,
              56407,
              56389,
              56399,
              56409,
              56375,
              56365,
              56384,
              56419,
              56411,
              56435,
              56398,
              56391,
              56427,
              56418,
              56393,
              56418,
              56398,
              56388,
              56394,
              56439,
              56423,
              56421,
              56414,
              56408,
              56399,
              56409,
              56419,
              56431,
              56415,
              56423,
              56425,
              56428,
              56415,
              56411,
              56403,
              56405,
              56397,
              56409,
              56415,
              56405,
              56392,
              56411,
              56407,
              56375,
              56389,
              56417,
              56420,
              56399,
              56363,
              56391,
              56386,
              56397,
              56422,
              56430,
              56415,
              56386,
              56403,
              56394,
              56414,
              56401,
              56395,
              56411,
              56413,
              56385,
              56399,
              56383,
              56389,
              56404,
              56379,
              56418,
              56394,
              56390,
              56422,
              56419,
              56425,
              56427,
              56390,
              56394,
              56390,
              56391,
              56399,
              56409,
              56401,
              56398,
              56423,
              56410,
              56413,
              56395,
              56385,
              56421,
              56410,
              56401,
              56420,
              56414,
              56407,
              56406,
              56412,
              56451,
              56416,
              56386,
              56406,
              56399,
              56426,
              56422,
              56427,
              56408,
              56432,
              56429,
              56414,
              56417,
              56403,
              56409,
              56431,
              56407,
              56421,
              56425,
              56429,
              56423,
              56432,
              56437,
              56435,
              56429,
              56408,
              56409,
              56417,
              56422,
              56393,
              56401,
              56372,
              56399,
              56419,
              56414,
              56387,
              56389,
              56391,
              56407,
              56411,
              56420,
              56413,
              56405,
              56395,
              56425,
              56399,
              56404,
              56439,
              56394,
              56419,
              56433,
              56419,
              56413,
              56415,
              56418,
              56387,
              56397,
              56371,
              56377,
              56380,
              56370,
              56388,
              56362,
              56388,
              56326,
              56391,
              56396,
              56411,
              56411,
              56389,
              56374,
              56421,
              56428,
              56410,
              56393,
              56442,
              56420,
              56421,
              56433,
              56409,
              56384,
              56434,
              56426,
              56395,
              56415,
              56399,
              56411,
              56439,
              56403,
              56403,
              56415,
              56415,
              56420,
              56391,
              56409,
              56411,
              56414,
              56401,
              56395,
              56412,
              56397,
              56403,
              56368,
              56383,
              56399,
              56391,
              56413,
              56435,
              56404,
              56412,
              56422,
              56397,
              56413,
              56438,
              56407,
              56442,
              56401,
              56413,
              56412,
              56405,
              56422,
              56419,
              56434,
              56403,
              56407,
              56423,
              56399,
              56419,
              56423,
              56439,
              56443,
              56419,
              56401,
              56385,
              56404,
              56405,
              56447,
              56434,
              56421,
              56429,
              56397,
              56430,
              56444,
              56440,
              56419,
              56450,
              56439,
              56418,
              56423,
              56428,
              56423,
              56433,
              56433,
              56405,
              56415,
              56426,
              56422,
              56441,
              56409,
              56423,
              56411,
              56410,
              56407,
              56398,
              56416,
              56413,
              56402,
              56388,
              56389,
              56447,
              56402,
              56391,
              56414,
              56415,
              56401,
              56418,
              56410,
              56431,
              56408,
              56403,
              56421,
              56374,
              56386,
              56395,
              56404,
              56398,
              56394,
              56390,
              56358,
              56385,
              56377,
              56381,
              56363,
              56373,
              56402,
              56386,
              56391,
              56417,
              56363,
              56378,
              56391,
              56371,
              56363,
              56365,
              56387,
              56390,
              56388,
              56368,
              56385,
              56357,
              56381,
              56405,
              56406,
              56389,
              56388,
              56413,
              56436,
              56441,
              56439,
              56413,
              56402,
              56407,
              56413,
              56421,
              56419,
              56453,
              56420,
              56410,
              56394,
              56388,
              56387,
              56404,
              56415,
              56389,
              56392,
              56399,
              56400,
              56405,
              56358,
              56380,
              56375,
              56396,
              56379,
              56387,
              56371,
              56384,
              56364,
              56353,
              56384,
              56359,
              56413,
              56394,
              56385,
              56370,
              56426,
              56411,
              56415,
              56417,
              56391,
              56375,
              56398,
              56386,
              56387,
              56411,
              56399,
              56402,
              56373,
              56374,
              56359,
              56342,
              56346,
              56399,
              56398,
              56383,
              56411,
              56389,
              56386,
              56381,
              56358,
              56369,
              56374,
              56382,
              56423,
              56414,
              56375,
              56387,
              56411,
              56386,
              56385,
              56387,
              56355,
              56370,
              56399,
              56365,
              56385,
              56384,
              56393,
              56401,
              56385,
              56370,
              56357,
              56356,
              56379,
              56380,
              56398,
              56374,
              56385,
              56386,
              56386,
              56375,
              56389,
              56401,
              56393,
              56391,
              56387,
              56399,
              56389,
              56378,
              56406,
              56394,
              56392,
              56390,
              56383,
              56387,
              56375,
              56359,
              56388,
              56375,
              56387,
              56407,
              56401,
              56408,
              56403,
              56441,
              56418,
              56395,
              56407,
              56388,
              56417,
              56410,
              56403,
              56405,
              56383,
              56415,
              56378,
              56382,
              56389,
              56362,
              56379,
              56404,
              56402,
              56376,
              56405,
              56381,
              56385,
              56402,
              56420,
              56400,
              56410,
              56404,
              56436,
              56421,
              56390,
              56394,
              56406,
              56412,
              56422,
              56429,
              56425,
              56407,
              56382,
              56412,
              56434,
              56428,
              56416,
              56421,
              56407,
              56417,
              56383,
              56443,
              56424,
              56437,
              56431,
              56417,
              56407,
              56451,
              56418,
              56438,
              56453,
              56442,
              56417,
              56421,
              56419,
              56443,
              56442,
              56423,
              56401,
              56436,
              56431,
              56423,
              56431,
              56451,
              56413,
              56442,
              56404,
              56411,
              56418,
              56398,
              56438,
              56409,
              56400,
              56418,
              56423,
              56433,
              56435,
              56467,
              56443,
              56428,
              56435,
              56416,
              56446,
              56439,
              56419,
              56398,
              56402,
              56401,
              56427,
              56455,
              56427,
              56435,
              56438,
              56445,
              56450
            ]
          },
          {
            "time": 1508095127293,
            "label": "PAM",
            "light_intensity": 27,
            "r": 21,
            "g": 11,
            "b": 6,
            "light_intensity_raw": 38,
            "temperature": 23.56,
            "humidity": 51.548,
            "pressure": 980.791,
            "temperature2": 23.52,
            "humidity2": 52.254,
            "pressure2": 981.336,
            "contactless_temp": 22.47,
            "thickness": 0.35,
            "compass_direction": "E",
            "compass": 90,
            "angle": 5.262,
            "angle_direction": "NE",
            "pitch": -2.06,
            "roll": 4.84,
            "data_raw": [
              868,
              56462,
              921,
              56459,
              944,
              56441,
              951,
              56418,
              965,
              56419,
              962,
              56403,
              975,
              56424,
              971,
              56420,
              975,
              56389,
              981,
              56425,
              980,
              56430,
              988,
              56395,
              989,
              56447,
              989,
              56427,
              987,
              56407,
              994,
              56405,
              991,
              56401,
              996,
              56422,
              989,
              56403,
              990,
              56474,
              990,
              56393,
              993,
              56425,
              997,
              56435,
              998,
              56454,
              996,
              56433,
              986,
              56437,
              993,
              56430,
              992,
              56399,
              994,
              56435,
              995,
              56397,
              994,
              56419,
              986,
              56381,
              998,
              56433,
              991,
              56425,
              993,
              56411,
              994,
              56418,
              997,
              56444,
              989,
              56425,
              992,
              56386,
              994,
              56424,
              996,
              56422,
              996,
              56413,
              997,
              56410,
              995,
              56410,
              990,
              56438,
              994,
              56426,
              999,
              56402,
              997,
              56381,
              999,
              56398,
              997,
              56407,
              998,
              56376,
              996,
              56408,
              992,
              56436,
              995,
              56453,
              1000,
              56451,
              1003,
              56418,
              1003,
              56409,
              1000,
              56442,
              1001,
              56441,
              1000,
              56427,
              1000,
              56417,
              1001,
              56419,
              1000,
              56398,
              1000,
              56420,
              998,
              56423,
              1002,
              56431,
              1004,
              56423,
              1000,
              56421,
              1011,
              56403,
              997,
              56431,
              998,
              56422,
              1003,
              56438,
              1007,
              56431,
              1004,
              56425,
              1007,
              56369,
              1000,
              56409,
              998,
              56409,
              1003,
              56433,
              1007,
              56400,
              1003,
              56401,
              1007,
              56418,
              1000,
              56415,
              1001,
              56401,
              1005,
              56397,
              1007,
              56423,
              1006,
              56452,
              1003,
              56417,
              1012,
              56419,
              1004,
              56423,
              1010,
              56415,
              1011,
              56399,
              1009,
              56398,
              1004,
              56410,
              1007,
              56439,
              1009,
              56423,
              1009,
              56412,
              1012,
              56475,
              1015,
              56446,
              1007,
              56422,
              1013,
              56441,
              2450,
              56410,
              2694,
              56299,
              2745,
              56303,
              2767,
              56353,
              2791,
              56351,
              2796,
              56358,
              2805,
              56357,
              2816,
              56343,
              2823,
              56337,
              2831,
              56379,
              2837,
              56318,
              2834,
              56347,
              2835,
              56343,
              2837,
              56382,
              2835,
              56375,
              2841,
              56359,
              2840,
              56336,
              2839,
              56325,
              2836,
              56372,
              2838,
              56377,
              2841,
              56389,
              2841,
              56351,
              2839,
              56380,
              2844,
              56363,
              2847,
              56358,
              2838,
              56375,
              2847,
              56371,
              2838,
              56399,
              2850,
              56355,
              2843,
              56381,
              2853,
              56375,
              2844,
              56355,
              2847,
              56393,
              2843,
              56399,
              2848,
              56375,
              2843,
              56371,
              2850,
              56397,
              2842,
              56387,
              2848,
              56388,
              2840,
              56390,
              2849,
              56402,
              2841,
              56403,
              2848,
              56415,
              2839,
              56388,
              2846,
              56384,
              2850,
              56353,
              2846,
              56371,
              2852,
              56385,
              2847,
              56418,
              2849,
              56380,
              2844,
              56422,
              2851,
              56427,
              2847,
              56420,
              2849,
              56411,
              2851,
              56415,
              2851,
              56358,
              2851,
              56388,
              2848,
              56399,
              2850,
              56405,
              2846,
              56396,
              2851,
              56409,
              2853,
              56421,
              2850,
              56418,
              2850,
              56391,
              2851,
              56453,
              2854,
              56431,
              2857,
              56415,
              2856,
              56395,
              2851,
              56421,
              2848,
              56417,
              2855,
              56422,
              2849,
              56389,
              2856,
              56410,
              2857,
              56423,
              2852,
              56429,
              2851,
              56383,
              2844,
              56388,
              2856,
              56441,
              2853,
              56423,
              2849,
              56440,
              2849,
              56439,
              2850,
              56423,
              2850,
              56423,
              2851,
              56429,
              2850,
              56401,
              2851,
              56433,
              2849,
              56429,
              2846,
              56420,
              2849,
              56392,
              2852,
              56423,
              2429,
              56451,
              2017,
              56469,
              1807,
              56461,
              1673,
              56461,
              1611,
              56443,
              1569,
              56428,
              1540,
              56415,
              1522,
              56442,
              1517,
              56437,
              1508,
              56439,
              1500,
              56460,
              1496,
              56420,
              1495,
              56453,
              1495,
              56430,
              1494,
              56411,
              903,
              56319,
              863,
              56340,
              853,
              56306,
              829,
              56337,
              823,
              56380,
              811,
              56407,
              798,
              56366,
              800,
              56389,
              799,
              56404,
              791,
              56398,
              795,
              56407,
              793,
              56421,
              783,
              56397,
              789,
              56405,
              787,
              56413,
              782,
              56699,
              2275,
              56457,
              2485,
              56322,
              2568,
              56290,
              2620,
              56330,
              2642,
              56293,
              2663,
              56289,
              2667,
              56297,
              2682,
              56304,
              2678,
              56319,
              2686,
              56310,
              2679,
              56303,
              2685,
              56299,
              2689,
              56282,
              2679,
              56303,
              2688,
              56287,
              2684,
              56302,
              2686,
              56247,
              2682,
              56295,
              2685,
              56257,
              2688,
              56293,
              2683,
              56285,
              2689,
              56279,
              2686,
              56291,
              2689,
              56313,
              2686,
              56314,
              2679,
              56294,
              2688,
              56301,
              2683,
              56276,
              2689,
              56289,
              2687,
              56298,
              2693,
              56258,
              2690,
              56301,
              2692,
              56292,
              2691,
              56279,
              2691,
              56303,
              2690,
              56295,
              2685,
              56284,
              2693,
              56273,
              2688,
              56299,
              2701,
              56303,
              2691,
              56303,
              2693,
              56323,
              2687,
              56290,
              2697,
              56281,
              2689,
              56291,
              2692,
              56323,
              2686,
              56335,
              2694,
              56312,
              2686,
              56351,
              2698,
              56309,
              2687,
              56303,
              2695,
              56374,
              2691,
              56351,
              2697,
              56367,
              2693,
              56351,
              2697,
              56356,
              2700,
              56367,
              2699,
              56381,
              2703,
              56407,
              2693,
              56392,
              2695,
              56367,
              2692,
              56358,
              2698,
              56395,
              2698,
              56360,
              2703,
              56373,
              2700,
              56382,
              2703,
              56379,
              2709,
              56412,
              2702,
              56379,
              2713,
              56424,
              2710,
              56435,
              2715,
              56446,
              2719,
              56423,
              2714,
              56441,
              2373,
              56454,
              2033,
              56498,
              1863,
              56513,
              1756,
              56493,
              1681,
              56488,
              1635,
              56471,
              1601,
              56464,
              1567,
              56436,
              1546,
              56463,
              1527,
              56484,
              1507,
              56458,
              1497,
              56495,
              1495,
              56519,
              1483,
              56452,
              1472,
              56484
            ]
          },
          {
            "time": 1508095133465,
            "label": "SPAD",
            "detector_read1": 7875,
            "detector_read2": 9693,
            "light_intensity": 26.498,
            "r": 24,
            "g": 11,
            "b": 7,
            "light_intensity_raw": 40,
            "temperature": 23.64,
            "humidity": 51.494,
            "pressure": 980.755,
            "temperature2": 23.62,
            "humidity2": 52.233,
            "pressure2": 981.36,
            "contactless_temp": 22.19,
            "thickness": 0.34,
            "compass_direction": "E",
            "compass": 90,
            "angle": 6.042,
            "angle_direction": "NE",
            "pitch": -3.48,
            "roll": 4.94,
            "recall": {
              "time": 1508095133753,
              "colorcal_blank1[1]": 20705.5,
              "colorcal_blank1[2]": 26370,
              "colorcal_blank1[3]": 28728,
              "colorcal_blank1[4]": 39694,
              "colorcal_blank1[6]": 30462.5,
              "colorcal_blank1[8]": 25909,
              "colorcal_blank1[9]": 29546,
              "colorcal_blank1[10]": 33469.5,
              "colorcal_blank2[1]": 21202.5,
              "colorcal_blank2[2]": 19446.5,
              "colorcal_blank2[3]": 23855.5,
              "colorcal_blank2[4]": 19446,
              "colorcal_blank2[6]": 16533,
              "colorcal_blank2[8]": 17071,
              "colorcal_blank2[9]": 18485.5,
              "colorcal_blank2[10]": 16459,
              "colorcal_blank3[1]": 19654,
              "colorcal_blank3[2]": 10132.5,
              "colorcal_blank3[3]": 21014,
              "colorcal_blank3[4]": 13994.5,
              "colorcal_blank3[6]": 5870.5,
              "colorcal_blank3[8]": 6257,
              "colorcal_blank3[9]": 5420.5,
              "colorcal_blank3[10]": 5927,
              "colorcal_intensity1_slope[2]": 2.224,
              "colorcal_intensity1_yint[2]": 7.3,
              "colorcal_intensity2_slope[2]": 2.321,
              "colorcal_intensity2_yint[2]": 5.2,
              "colorcal_intensity3_slope[2]": 2.586,
              "colorcal_intensity3_yint[2]": -18.7,
              "ir_baseline_slope[5]": 7217,
              "ir_baseline_yint[5]": 11118,
              "ir_baseline_slope[3]": 581.5,
              "ir_baseline_yint[3]": 797.5
            },
            "data_raw": [
              3409,
              3013,
              2999,
              2993,
              2983,
              2981,
              2992,
              2981,
              2979,
              2980,
              963,
              1158,
              1154,
              1155,
              1166,
              1159,
              1157,
              1157,
              1154,
              1153,
              6549,
              3499,
              3458,
              3456,
              3454,
              3451,
              3453,
              3452,
              3450,
              3450,
              127,
              291,
              290,
              293,
              288,
              289,
              292,
              287,
              286,
              291,
              40056,
              11198,
              10810,
              10769,
              10753,
              10746,
              10730,
              10726,
              10725,
              10726,
              12465,
              10831,
              10819,
              10815,
              10818,
              10812,
              10817,
              10809,
              10815,
              10816,
              24260,
              15103,
              14945,
              14919,
              14913,
              14922,
              14914,
              14912,
              14902,
              14912,
              18715,
              13758,
              13671,
              13659,
              13657,
              13649,
              13651,
              13648,
              13652,
              13655,
              22946,
              29251,
              29306,
              29309,
              29310,
              29316,
              29307,
              29316,
              29315,
              29317,
              5521,
              7132,
              7172,
              7169,
              7168,
              7171,
              7169,
              7175,
              7166,
              7169,
              19662,
              25717,
              25773,
              25773,
              25782,
              25786,
              25783,
              25781,
              25779,
              25786,
              1081,
              1365,
              1364,
              1370,
              1365,
              1374,
              1367,
              1370,
              1376,
              1375,
              34078,
              44437,
              44554,
              44545,
              44557,
              44563,
              44565,
              44573,
              44562,
              44566,
              36432,
              48159,
              48243,
              48253,
              48265,
              48274,
              48265,
              48267,
              48267,
              48274,
              39141,
              52335,
              52557,
              52573,
              52583,
              52585,
              52585,
              52583,
              52580,
              52579,
              34011,
              45172,
              45358,
              45359,
              45356,
              45349,
              45348,
              45340,
              45328,
              45326,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              12471,
              15516,
              15593,
              15595,
              15604,
              15613,
              15600,
              15611,
              15614,
              15609,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              3763,
              5039,
              5047,
              5055,
              5055,
              5054,
              5055,
              5048,
              5052,
              5049,
              44569,
              44575,
              44575,
              44569,
              44564,
              44567,
              44567,
              44572,
              44578,
              44568,
              48275,
              48266,
              48268,
              48271,
              48287,
              48285,
              48291,
              48274,
              48287,
              48281,
              52599,
              52590,
              52583,
              52593,
              52576,
              52589,
              52590,
              52591,
              52587,
              52587,
              45400,
              45387,
              45375,
              45358,
              45350,
              45339,
              45338,
              45331,
              45323,
              45315
            ]
          }
        ],
        "data_raw": [

        ]
      }
    ]
  ],
  "app_os": "darwin-16.7.0",
  "app_name": "PhotosynQ",
  "app_version": "0.0.27",
  "app_device": "x64",
  "location": [
    "42.7223950",
    "-84.4746093"
  ],
  "time_offset": "America/Detroit"
}
Screen shot 2017 05 31 at 12.23.10 pm
Created by

PhotosynQ Admin


Protocol connections:
7
Latest Update:
Feb 2018