RIDES_KWS_2


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

// Note: the following variables are for fitting the ECS decay curves when the 
// procedure written by Kevin and Greg 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[5].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 =191; //the first point to use for Fs 
var FoPrime_end =205; //the end point to use  for Fs

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

output.pump="none";

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

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


// Start of analyses sections

//ECS trace analysis:

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

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

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

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

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

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

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

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

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

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

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

}
catch(e){}


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


//Calculaiton of the DIRK delta_P850 

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

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

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

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

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

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

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

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

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

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

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

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

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

// Display the DIRKf results and calculate LEFd

  output.LEFd_trace = LEFd_trace;

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

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

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

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

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

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

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


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

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

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

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ, PhiNO... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------




if (reg.m > 0) {
  fvfm = fvfm_noMPF;
  npqt = npqt_noMPF;
  PhiNO = PhiNO_noMPF;
  PhiNPQ = PhiNPQ_noMPF;
  qL = qL_noMPF;
  FmPrime = AFmP;
  qP = qP_noMPF;
  FvP_FmP = FvP_FmP_noMPF;
  
  if (fvfm <= 0) {
    output.Phi2= 0;
  //  	output.flag.warning.push("Phi2 is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see Phi2_noMPF variable");
    output["warning 2"] = "Phi2 is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see Phi2_noMPF variable";
  }
  if (fvfm >=0.85) {
//  	output.flag.danger.push("Phi2 above the normal range (0 - 0.85).  Please check the raw trace and consider excluding this point.");
	output["danger 5"] = "Phi2 above the normal range (0 - 0.85).  Please check the raw trace and consider excluding this point.";
  }
  else {
	  output.Phi2 		= MathROUND(fvfm,3);
  }
  

  
  
  if (npqt <= 0) {
    output.NPQt= 0;
//  	output.flag.warning.push("NPQt is negative (should be positive)!  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative NPQt value, see NPQt_noMPF variable");
	output["warning 1"] = "NPQt is negative (should be positive).  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see NPQt_noMPF variable";
  }
  else {
	  output.NPQt= MathROUND(npqt,3);
  }
	  output.qL= MathROUND(qL,3);
	  output.PhiNPQ= MathROUND(PhiNPQ,3);
	  output.PhiNO= MathROUND(PhiNO,3);
	  output.FvP_over_FmP = MathROUND(FvP_FmP,3);
	  outputqP = MathROUND(qP,3);
}

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

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

output.YII=Phi2_bar;

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

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

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

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

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

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

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

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

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

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


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


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

//var air_flow=new Array();

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

//output.air_flow=air_flow;

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



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

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

/*
** Loop through the lights.  If it's zero, skip it.  If it's not in the acceptable range (>500 but <65534 (max)) skip it.
** Then choose the first blank (starting with 1 moving to 3) which fulfills this criteria
** Otherwise, calculate absorbance and transmittance and a 'spad'-like value using LED 6 (940 on clamp) to calibrate thickness
*/
//----------------------------
for (var i = 0;i<lights.length;i++) { // loop through and save one averaged 'point' for each of the cycles
  light = lights[i]; //json.set[PAM_set].data_raw[1];
  wavelengthString = wavelengths[i];                                                    
  //var value1 = MathMEDIAN(json.set[PAM_set].data_raw.slice((abs_starts + i*pulses+2),(abs_starts + i*pulses+8)));
  var value1 = MathMEDIAN(json.set[SPAD_set].data_raw.slice((abs_starts + i*pulses+2),(abs_starts + i*pulses+8)));
  var value2 = MathMEDIAN(json.set[SPAD_set].data_raw.slice((abs_starts + i*pulses+82),(abs_starts + i*pulses+88)));
  var value3 = MathMEDIAN(json.set[SPAD_set].data_raw.slice((abs_starts + i*pulses+162),(abs_starts + i*pulses+168)));
  raw_at_blank1[light] = value1;
  raw_at_blank2[light] = value2;
  raw_at_blank3[light] = value3;
  
 output.value1=value1;
 output.value2=value2;
 output.value3=value3;
  
 output.lights_length=lights.length;
 raw_at_blank1[light] = value1;
 raw_at_blank2[light] = value2;
 raw_at_blank3[light] = value3;
  
  if (json.set[calib_set].recall["colorcal_blank1["+light+"]"] != 0 && raw_at_blank1[light] > 500 && raw_at_blank1[light] < 65534) {
    abs_at_blank1[light] = MathROUND(-1*MathLOG(raw_at_blank1[light]/json.set[calib_set].recall["colorcal_blank1["+light+"]"]),3);
//    trans_at_blank1[light] = MathROUND(raw_at_blank1[light]/json.set[calib_set].recall["colorcal_blank1["+light+"]"],3);
//	output ["light".concat(light.toString(),"_transmittance")]  = trans_at_blank1[light];
    output ["absorbance_".concat(wavelengthString)]  = abs_at_blank1[light];
//	output ["light".concat(light.toString(),"_blank1")]  = json.set[calib_set].recall["colorcal_blank1["+light+"]"];
  }
  
}

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

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


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

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

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


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

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

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

        ],
        "protocol_id": 1,
        "set": [
          {
            "time": 1502216049081,
            "blank:": "blank"
          },
          {
            "time": 1502216049091,
            "label": "no_leaf_baseline",
            "light_intensity": 696.267,
            "r": 892,
            "g": 288,
            "b": 209,
            "light_intensity_raw": 1312,
            "temperature": 25.24,
            "humidity": 47.524,
            "pressure": 990.349,
            "temperature2": 25.41,
            "humidity2": 42.812,
            "pressure2": 989.346,
            "contactless_temp": 24.81,
            "compass_direction": "W",
            "compass": 270,
            "angle": 37.763,
            "angle_direction": "N",
            "pitch": 37.75,
            "roll": -1.14,
            "data_raw": [

            ]
          },
          {
            "time": 1502216052028,
            "label": "DIRK_ECS",
            "light_intensity": 1365.738,
            "r": 1762,
            "g": 563,
            "b": 411,
            "light_intensity_raw": 2584,
            "temperature": 25.27,
            "humidity": 47.55,
            "pressure": 990.375,
            "temperature2": 25.45,
            "humidity2": 42.899,
            "pressure2": 989.397,
            "contactless_temp": 25.42,
            "thickness": 0.45,
            "data_raw": [
              57158,
              56662,
              56660,
              56655,
              56644,
              56647,
              56659,
              56647,
              56652,
              56647,
              56646,
              56653,
              56647,
              56643,
              56653,
              56645,
              56647,
              56658,
              56647,
              56654,
              56661,
              56647,
              56655,
              56666,
              56642,
              56662,
              56657,
              56647,
              56662,
              56662,
              56653,
              56665,
              56658,
              56654,
              56657,
              56655,
              56657,
              56661,
              56660,
              56647,
              56658,
              56662,
              56665,
              56661,
              56660,
              56662,
              56651,
              56666,
              56675,
              56655,
              56657,
              56671,
              56665,
              56666,
              56655,
              56662,
              56670,
              56668,
              56670,
              56661,
              56660,
              56672,
              56663,
              56672,
              56669,
              56665,
              56671,
              56662,
              56667,
              56672,
              56661,
              56675,
              56658,
              56662,
              56668,
              56666,
              56663,
              56674,
              56672,
              56673,
              56671,
              56679,
              56671,
              56668,
              56679,
              56668,
              56671,
              56677,
              56673,
              56665,
              56682,
              56677,
              56670,
              56677,
              56675,
              56677,
              56669,
              56681,
              56681,
              56671,
              56682,
              56679,
              56673,
              56678,
              56687,
              56670,
              56675,
              56679,
              56663,
              56679,
              56681,
              56664,
              56675,
              56677,
              56668,
              56679,
              56687,
              56674,
              56674,
              56675,
              56670,
              56677,
              56678,
              56671,
              56679,
              56678,
              56674,
              56678,
              56681,
              56671,
              56679,
              56675,
              56675,
              56679,
              56683,
              56670,
              56681,
              56679,
              56671,
              56679,
              56686,
              56674,
              56679,
              56685,
              56674,
              56678,
              56685,
              56677,
              56674,
              56684,
              56675,
              56681,
              56684,
              56673,
              56682,
              56686,
              56678,
              56679,
              56689,
              56683,
              56685,
              56691,
              56680,
              56677,
              56679,
              56677,
              56672,
              56687,
              56679,
              56666,
              56676,
              56671,
              56663,
              56677,
              56671,
              56667,
              56669,
              56671,
              56673,
              56671,
              56665,
              56675,
              56677,
              56662,
              56665,
              56671,
              56663,
              56668,
              56670,
              56669,
              56663,
              56669,
              56664,
              56669,
              56674,
              56666,
              56670,
              56669,
              56667,
              56675,
              56681,
              56708,
              56724,
              56731,
              56737,
              56748,
              56749,
              56759,
              56768,
              56770,
              56783,
              56786,
              56785,
              56796,
              56788,
              56794,
              56802,
              56807,
              56798,
              56801,
              56807,
              56743,
              56720,
              56711,
              56703,
              56686,
              56680,
              56676,
              56679,
              56673,
              56673,
              56675,
              56666,
              56673,
              56671,
              56663,
              56667,
              56675,
              56665,
              56676,
              56661,
              56659,
              56669,
              56671,
              56663,
              56650,
              56667,
              56657,
              56652,
              56655,
              56646,
              56655,
              56647,
              56646,
              56653,
              56646,
              56649,
              56653,
              56651,
              56651,
              56645,
              56641,
              56644,
              56647,
              56641,
              56647,
              56653,
              56637,
              56641,
              56646,
              56630,
              56640,
              56647,
              56645,
              56640,
              56646,
              56651,
              56647,
              56645,
              56647,
              56653,
              56638,
              56645,
              56647,
              56639,
              56653,
              56648,
              56647,
              56653,
              56649,
              56647,
              56644,
              56661,
              56656,
              56647,
              56653,
              56655,
              56655,
              56658,
              56653,
              56652,
              56646,
              56651,
              56663,
              56643,
              56654,
              56663,
              56655,
              56670,
              56655,
              56652,
              56663,
              56655,
              56648,
              56665,
              56663,
              56650,
              56660,
              56656,
              56659,
              56655,
              56656,
              56651,
              56649,
              56651,
              56665,
              56651,
              56655,
              56667,
              56653,
              56657,
              56663,
              56661,
              56653,
              56649,
              56657,
              56665,
              56651,
              56660,
              56655,
              56653,
              56667,
              56647,
              56655,
              56658,
              56651,
              56655,
              56655,
              56662,
              56659,
              56655,
              56652,
              56669,
              56645,
              56658,
              56670,
              56652,
              56662,
              56667,
              56651,
              56662,
              56657,
              56659,
              56671,
              56660,
              56662,
              56659,
              56659,
              56675,
              56669,
              56671,
              56660,
              56662,
              56662,
              56659,
              56670,
              56656,
              56664,
              56677,
              56658,
              56677,
              56671,
              56662,
              56671,
              56667,
              56662,
              56659,
              56663,
              56667,
              56661,
              56667,
              56661,
              56673,
              56671,
              56670,
              56679,
              56655,
              56671,
              56679,
              56667,
              56676,
              56663,
              56671,
              56678,
              56669,
              56663,
              56669,
              56664,
              56664,
              56676,
              56671,
              56671,
              56673,
              56675,
              56670,
              56665,
              56667,
              56679,
              56679,
              56671,
              56679,
              56711,
              56722,
              56732,
              56743,
              56734,
              56755,
              56766,
              56767,
              56774,
              56787,
              56787,
              56787,
              56778,
              56790,
              56799,
              56786,
              56803,
              56803,
              56797,
              56805,
              56732,
              56701,
              56706,
              56685,
              56679,
              56675,
              56661,
              56670,
              56672,
              56659,
              56667,
              56663,
              56651,
              56655,
              56662,
              56653,
              56655,
              56659,
              56646,
              56654,
              56660,
              56644,
              56661,
              56652,
              56655,
              56655,
              56654,
              56649,
              56655,
              56643,
              56653,
              56660,
              56651,
              56655,
              56653,
              56645,
              56653,
              56660,
              56646,
              56651,
              56655,
              56647,
              56659,
              56660,
              56655,
              56655,
              56651,
              56653,
              56660,
              56652,
              56660,
              56657,
              56655,
              56659,
              56665,
              56647,
              56660,
              56658,
              56653,
              56660,
              56659,
              56660,
              56663,
              56651,
              56655,
              56659,
              56643,
              56663,
              56661,
              56649,
              56663,
              56666,
              56654,
              56655,
              56661,
              56656,
              56667,
              56653,
              56649,
              56661,
              56658,
              56657,
              56671,
              56666,
              56661,
              56661,
              56663,
              56655,
              56662,
              56655,
              56662,
              56661,
              56665,
              56669,
              56669,
              56652,
              56663,
              56669,
              56661,
              56671,
              56662,
              56655,
              56670,
              56659,
              56659,
              56676,
              56663,
              56663,
              56667,
              56655,
              56679,
              56659,
              56659,
              56671,
              56665,
              56663,
              56663,
              56664,
              56661,
              56667,
              56663,
              56669,
              56665,
              56671,
              56667,
              56662,
              56677,
              56668,
              56661,
              56662,
              56673,
              56671,
              56663,
              56663,
              56671,
              56666,
              56659,
              56663,
              56665,
              56661,
              56673,
              56674,
              56663,
              56673,
              56679,
              56663,
              56679,
              56669,
              56667,
              56673,
              56664,
              56660,
              56661,
              56676,
              56667,
              56670,
              56662,
              56672,
              56673,
              56667,
              56676,
              56660,
              56673,
              56671,
              56667,
              56679,
              56679,
              56676,
              56675,
              56677,
              56663,
              56678,
              56674,
              56670,
              56682,
              56667,
              56675,
              56679,
              56667,
              56672,
              56673,
              56671,
              56682,
              56681,
              56679,
              56663,
              56677,
              56676,
              56675,
              56682,
              56679,
              56674,
              56679,
              56677,
              56678,
              56680,
              56683,
              56675,
              56684,
              56679,
              56703,
              56717,
              56735,
              56751,
              56738,
              56756,
              56772,
              56771,
              56777,
              56787,
              56779,
              56793,
              56791,
              56788,
              56805,
              56796,
              56804,
              56811,
              56807,
              56812,
              56740,
              56706,
              56707,
              56703,
              56690,
              56686,
              56683,
              56666,
              56679,
              56663,
              56665,
              56671,
              56657,
              56665,
              56671,
              56667,
              56662,
              56673,
              56664,
              56670,
              56678,
              56657,
              56663,
              56670,
              56653,
              56665,
              56670,
              56663,
              56671,
              56659,
              56663,
              56672,
              56657,
              56668,
              56669,
              56663,
              56673,
              56673,
              56658,
              56670,
              56671,
              56660,
              56673,
              56670,
              56661,
              56671,
              56677,
              56669,
              56670,
              56674,
              56664,
              56669,
              56666,
              56667,
              56666,
              56671,
              56665,
              56679,
              56663,
              56669,
              56673,
              56667,
              56671,
              56663,
              56673,
              56674,
              56663,
              56674,
              56670,
              56666,
              56671,
              56679,
              56665,
              56669,
              56674,
              56666,
              56667,
              56671,
              56664,
              56669,
              56667,
              56667,
              56678,
              56671,
              56661,
              56680,
              56668,
              56669,
              56675,
              56671,
              56662,
              56679,
              56677,
              56671,
              56669,
              56682,
              56683,
              56673,
              56670,
              56671,
              56673,
              56670,
              56657,
              56678,
              56679,
              56677,
              56675,
              56668,
              56681,
              56671,
              56674,
              56681,
              56674,
              56673,
              56685,
              56683,
              56678,
              56685,
              56679,
              56683,
              56679,
              56683,
              56679,
              56681,
              56679,
              56678,
              56677,
              56679,
              56671,
              56675,
              56680,
              56684,
              56679,
              56675,
              56689,
              56683,
              56673,
              56686,
              56690,
              56667,
              56679,
              56685,
              56679,
              56683,
              56691,
              56679,
              56692,
              56684,
              56679,
              56693,
              56681,
              56684,
              56687,
              56688,
              56686,
              56696,
              56687,
              56691,
              56694,
              56693,
              56685,
              56694,
              56681,
              56681,
              56701,
              56684,
              56691,
              56695,
              56689,
              56688,
              56698,
              56693,
              56691,
              56701,
              56691,
              56688,
              56692,
              56693,
              56687,
              56698,
              56695,
              56701,
              56702,
              56698,
              56699,
              56701,
              56697,
              56693,
              56699,
              56697,
              56691,
              56699,
              56694,
              56691,
              56687,
              56698,
              56679,
              56679,
              56695,
              56698,
              56723,
              56737,
              56759,
              56749,
              56770,
              56775,
              56775,
              56788,
              56798,
              56787,
              56799,
              56795,
              56805,
              56820,
              56806,
              56810,
              56806,
              56815,
              56825,
              56833,
              56752,
              56727,
              56723,
              56711,
              56703,
              56694,
              56694,
              56689,
              56692,
              56690,
              56681,
              56681,
              56678,
              56675,
              56679,
              56675,
              56671,
              56677,
              56671,
              56674,
              56683,
              56685,
              56677,
              56664,
              56672,
              56679,
              56668,
              56675,
              56679,
              56668,
              56686,
              56674,
              56679,
              56679,
              56674,
              56673,
              56681,
              56671,
              56669,
              56677,
              56679,
              56675,
              56671,
              56675,
              56674,
              56667,
              56673,
              56679,
              56663,
              56669,
              56679,
              56678,
              56677,
              56680,
              56682,
              56678,
              56675,
              56682,
              56680,
              56684,
              56678,
              56679,
              56679,
              56679,
              56683,
              56687,
              56676,
              56679,
              56684,
              56682,
              56679,
              56683,
              56686,
              56685,
              56687,
              56687,
              56679,
              56686,
              56680,
              56686,
              56691,
              56685,
              56691,
              56682,
              56685,
              56695,
              56687,
              56688,
              56682,
              56684,
              56695,
              56687,
              56694,
              56698,
              56686,
              56689,
              56690,
              56695,
              56679,
              56682,
              56699,
              56679,
              56692,
              56695,
              56695,
              56699,
              56694,
              56697,
              56697,
              56679,
              56690,
              56691,
              56687,
              56693,
              56703,
              56703,
              56698,
              56698,
              56697,
              56689,
              56699,
              56702,
              56695,
              56697,
              56697,
              56693,
              56695,
              56703,
              56687,
              56697,
              56700,
              56687,
              56683,
              56705,
              56691,
              56695,
              56701,
              56690,
              56694,
              56703,
              56703,
              56698,
              56705,
              56706,
              56697,
              56704,
              56707,
              56705,
              56703,
              56703,
              56703,
              56710,
              56698,
              56701,
              56715,
              56701,
              56713,
              56711,
              56699,
              56703,
              56700,
              56707,
              56713,
              56703,
              56695,
              56711,
              56711,
              56701,
              56711,
              56709,
              56703,
              56703,
              56703,
              56695,
              56711,
              56707,
              56711,
              56721,
              56697,
              56709,
              56709,
              56699,
              56707,
              56705,
              56701,
              56711,
              56703,
              56708,
              56712,
              56702,
              56703,
              56708,
              56705,
              56698,
              56715,
              56711,
              56709,
              56705,
              56712,
              56727,
              56744,
              56754,
              56767,
              56778,
              56775,
              56799,
              56791,
              56799,
              56807,
              56807,
              56811,
              56819,
              56819,
              56820,
              56833,
              56818,
              56829,
              56830,
              56842,
              56855,
              56762,
              56755,
              56743,
              56731,
              56715,
              56714,
              56715,
              56701,
              56700,
              56705,
              56687,
              56697,
              56706,
              56688,
              56699,
              56701,
              56683,
              56705,
              56696,
              56690,
              56687,
              56699,
              56683,
              56683,
              56686,
              56683,
              56690,
              56691,
              56692,
              56697,
              56694,
              56684,
              56693,
              56691,
              56691,
              56692,
              56687,
              56695,
              56697,
              56683,
              56698,
              56703,
              56682,
              56695,
              56689,
              56691,
              56693,
              56690,
              56699,
              56700,
              56697,
              56707,
              56689,
              56695,
              56702,
              56694,
              56696,
              56692,
              56708,
              56701,
              56699,
              56714,
              56710,
              56695,
              56711,
              56698,
              56703,
              56703,
              56691,
              56699,
              56703,
              56700,
              56707,
              56713,
              56699,
              56700,
              56708,
              56706,
              56711,
              56695,
              56703,
              56718,
              56703,
              56715,
              56714,
              56702,
              56714,
              56708,
              56708,
              56719,
              56720,
              56704,
              56697,
              56715,
              56705,
              56707,
              56710,
              56709,
              56713,
              56713,
              56710,
              56719,
              56711,
              56710,
              56717,
              56713,
              56711,
              56712,
              56716,
              56719,
              56723,
              56713,
              56711,
              56716,
              56710,
              56711,
              56714,
              56711,
              56711,
              56711,
              56717,
              56711,
              56711,
              56727,
              56703,
              56709,
              56719,
              56710,
              56711,
              56720,
              56708,
              56711,
              56721,
              56715,
              56711,
              56719,
              56722,
              56718,
              56714,
              56720,
              56711,
              56711,
              56715,
              56719,
              56703,
              56721,
              56720,
              56715,
              56716,
              56727,
              56715,
              56714,
              56723,
              56706,
              56718,
              56727,
              56719,
              56723,
              56713,
              56721,
              56723,
              56718,
              56719,
              56724,
              56711,
              56726,
              56711,
              56719,
              56727,
              56711,
              56722,
              56719,
              56719,
              56726,
              56713,
              56726,
              56723,
              56718,
              56719,
              56714,
              56717,
              56734,
              56720,
              56722,
              56723,
              56727,
              56723,
              56723,
              56726,
              56711,
              56721,
              56726,
              56726,
              56724,
              56732,
              56720,
              56727,
              56735,
              56726,
              56735,
              56754,
              56767,
              56785,
              56783,
              56806,
              56801,
              56814,
              56825,
              56818,
              56832,
              56835,
              56839,
              56823,
              56841,
              56851,
              56847,
              56857,
              56843,
              56849,
              56871,
              56791,
              56767,
              56750,
              56737,
              56743,
              56733,
              56723,
              56721,
              56725,
              56721,
              56718,
              56719,
              56716,
              56717,
              56725,
              56711,
              56714,
              56717,
              56703,
              56712,
              56719,
              56711,
              56711,
              56711,
              56695,
              56711,
              56713,
              56707,
              56711,
              56708,
              56703,
              56717,
              56711,
              56713,
              56710,
              56691,
              56708,
              56711,
              56700,
              56711,
              56714,
              56699,
              56715,
              56713,
              56709,
              56715,
              56711,
              56711,
              56721,
              56706,
              56703,
              56719,
              56705,
              56711,
              56714,
              56706,
              56714,
              56711,
              56715,
              56718,
              56711,
              56709,
              56716,
              56719,
              56711,
              56709,
              56719,
              56715,
              56713,
              56719,
              56727,
              56711,
              56719,
              56719,
              56711,
              56718,
              56721,
              56716,
              56721,
              56723,
              56727,
              56719,
              56718,
              56717,
              56720,
              56716,
              56723,
              56713,
              56727,
              56723,
              56711,
              56724,
              56734,
              56710,
              56728,
              56725,
              56717,
              56722,
              56723,
              701,
              304,
              303,
              301,
              306,
              296,
              293,
              299,
              297,
              299,
              295,
              295,
              297,
              301,
              296,
              301,
              295,
              298,
              295,
              297,
              203,
              283,
              295,
              294,
              284,
              280,
              288,
              273,
              280,
              278,
              274,
              274,
              277,
              264,
              264,
              269,
              269,
              259,
              267,
              265,
              1450,
              295,
              295,
              289,
              292,
              291,
              290,
              293,
              289,
              289,
              293,
              295,
              294,
              300,
              303,
              289,
              295,
              296,
              294,
              294,
              290,
              296,
              299,
              297,
              291,
              302,
              303,
              293,
              298,
              296,
              290,
              293,
              302,
              298,
              298,
              294,
              300,
              301,
              301,
              295,
              300,
              295,
              291,
              305,
              300,
              296,
              295,
              299,
              301,
              291,
              298,
              297,
              292,
              292,
              306,
              292,
              299,
              300,
              289,
              300,
              295,
              294,
              298,
              294,
              291,
              307,
              305,
              295,
              304,
              295,
              301,
              304,
              296,
              295,
              295,
              296,
              300,
              295,
              300,
              293,
              295,
              295,
              300,
              299,
              298,
              300,
              301,
              305,
              302,
              294,
              298,
              295,
              291,
              303,
              298,
              295,
              298,
              300,
              290,
              302
            ]
          },
          {
            "time": 1502216057835,
            "label": "DIRK_P700",
            "light_intensity": 1365.7,
            "r": 1762,
            "g": 563,
            "b": 411,
            "light_intensity_raw": 2584,
            "temperature": 25.31,
            "humidity": 47.62,
            "pressure": 990.36,
            "temperature2": 25.48,
            "humidity2": 42.912,
            "pressure2": 989.351,
            "contactless_temp": 24.67,
            "compass_direction": "E",
            "compass": 90,
            "angle": 5.481,
            "angle_direction": "S",
            "pitch": 5.47,
            "roll": 0.41,
            "data_raw": [
              53012,
              53063,
              52951,
              52895,
              52869,
              52831,
              52817,
              52819,
              52778,
              52798,
              52793,
              52785,
              52803,
              52799,
              52786,
              52803,
              52796,
              52797,
              52834,
              52783,
              52803,
              52801,
              52799,
              52786,
              52804,
              52805,
              52797,
              52785,
              52795,
              52814,
              52797,
              52770,
              52779,
              52782,
              52826,
              52800,
              52755,
              52760,
              52761,
              52739,
              52768,
              52756,
              52751,
              52743,
              52771,
              52765,
              52776,
              52767,
              52771,
              52761,
              52737,
              52748,
              52785,
              52797,
              52789,
              52768,
              52807,
              52770,
              52764,
              52791,
              52776,
              52785,
              52800,
              52803,
              52785,
              52733,
              52750,
              52792,
              52799,
              52767,
              52767,
              52789,
              52763,
              52766,
              52751,
              52745,
              52773,
              52770,
              52761,
              52766,
              52775,
              52790,
              52766,
              52774,
              52785,
              52773,
              52762,
              52773,
              52766,
              52751,
              52779,
              52765,
              52755,
              52755,
              52794,
              52763,
              52757,
              52743,
              52803,
              52809,
              52803,
              52804,
              52734,
              52775,
              52741,
              52755,
              52762,
              52765,
              52775,
              52749,
              52761,
              52758,
              52791,
              52787,
              52761,
              52766,
              52803,
              52767,
              52758,
              52779,
              52754,
              52751,
              52772,
              52761,
              52767,
              52775,
              52770,
              52751,
              52767,
              52760,
              52777,
              52755,
              52783,
              52803,
              52775,
              52766,
              52761,
              52773,
              52775,
              52787,
              52790,
              52812,
              52754,
              52776,
              52740,
              52760,
              52779,
              52783,
              52798,
              52779,
              52792,
              52780,
              52761,
              52751,
              52787,
              52788,
              52761,
              52765,
              52764,
              52775,
              52769,
              52799,
              52753,
              52777,
              52795,
              52754,
              52769,
              52775,
              52754,
              52742,
              52755,
              52759,
              52797,
              52780,
              52737,
              52761,
              52751,
              52727,
              52727,
              52763,
              52761,
              52742,
              52755,
              52752,
              52734,
              52748,
              52775,
              52781,
              52783,
              52799,
              52771,
              52799,
              52791,
              52775,
              52773,
              52796,
              52785,
              52782,
              52765,
              52749,
              52599,
              52775,
              52770,
              52772,
              52811,
              52843,
              52833,
              52826,
              52835,
              52819,
              52841,
              52838,
              52839,
              52807,
              52839,
              52867,
              52880,
              52854,
              52878,
              52886,
              54183,
              52851,
              52818,
              52804,
              52796,
              52815,
              52795,
              52795,
              52782,
              52769,
              52786,
              52769,
              52778,
              52799,
              52786,
              52789,
              52810,
              52796,
              52790,
              52773,
              52787,
              52772,
              52786,
              52813,
              52798,
              52799,
              52791,
              52790,
              52786,
              52759,
              52787,
              52772,
              52795,
              52805,
              52790,
              52775,
              52797,
              52761,
              52802,
              52792,
              52807,
              52773,
              52781,
              52770,
              52764,
              52753,
              52765,
              52746,
              52763,
              52770,
              52768,
              52771,
              52729,
              52760,
              52767,
              52770,
              52758,
              52748,
              52769,
              52747,
              52742,
              52744,
              52745,
              52737,
              52755,
              52732,
              52723,
              52755,
              52763,
              52757,
              52718,
              52742,
              52727,
              52758,
              52735,
              52734,
              52759,
              52757,
              52751,
              52760,
              52735,
              52747,
              52740,
              52733,
              52751,
              52766,
              52730,
              52755,
              52783,
              52799,
              52746,
              52767,
              52729,
              52761,
              52782,
              52765,
              52782,
              52773,
              52757,
              52769,
              52769,
              52760,
              52787,
              52767,
              52801,
              52789,
              52786,
              52789,
              52769,
              52767,
              52775,
              52758,
              52767,
              52769,
              52776,
              52790,
              52765,
              52776,
              52771,
              52777,
              52765,
              52775,
              52797,
              52799,
              52752,
              52789,
              52775,
              52787,
              52775,
              52745,
              52762,
              52727,
              52750,
              52719,
              52726,
              52757,
              52801,
              52778,
              52759,
              52763,
              52789,
              52749,
              52769,
              52761,
              52758,
              52757,
              52789,
              52782,
              52757,
              52767,
              52746,
              52765,
              52725,
              52735,
              52741,
              52731,
              52741,
              52762,
              52766,
              52751,
              52772,
              52775,
              52768,
              52757,
              52769,
              52750,
              52768,
              52779,
              52806,
              52774,
              52779,
              52767,
              52775,
              52778,
              52759,
              52746,
              52768,
              52743,
              52769,
              52769,
              52775,
              52767,
              52775,
              52771,
              52770,
              52787,
              52783,
              52753,
              52764,
              52771,
              52753,
              52752,
              52739,
              52757,
              52767,
              52761,
              52777,
              52768,
              52775,
              52770,
              52607,
              52807,
              52807,
              52791,
              52825,
              52815,
              52807,
              52822,
              52835,
              52827,
              52837,
              52831,
              52835,
              52839,
              52871,
              52858,
              52843,
              52841,
              52894,
              52899,
              54356,
              52853,
              52836,
              52811,
              52820,
              52816,
              52799,
              52798,
              52790,
              52779,
              52779,
              52787,
              52803,
              52740,
              52775,
              52768,
              52779,
              52799,
              52786,
              52767,
              52771,
              52764,
              52754,
              52759,
              52743,
              52747,
              52736,
              52763,
              52777,
              52786,
              52792,
              52782,
              52775,
              52793,
              52763,
              52763,
              52745,
              52737,
              52753,
              52792,
              52766,
              52773,
              52731,
              52770,
              52775,
              52787,
              52759,
              52803,
              52769,
              52758,
              52801,
              52795,
              52768,
              52757,
              52800,
              52781,
              52785,
              52765,
              52783,
              52772,
              52746,
              52782,
              52771,
              52768,
              52775,
              52775,
              52773,
              52771,
              52770,
              52783,
              52772,
              52779,
              52759,
              52763,
              52731,
              52778,
              52765,
              52767,
              52777,
              52774,
              52734,
              52747,
              52776,
              52751,
              52793,
              52789,
              52729,
              52775,
              52754,
              52738,
              52730,
              52767,
              52757,
              52773,
              52746,
              52773,
              52775,
              52783,
              52773,
              52776,
              52767,
              52780,
              52781,
              52753,
              52775,
              52762,
              52746,
              52735,
              52753,
              52746,
              52757,
              52755,
              52759,
              52789,
              52779,
              52767,
              52767,
              52778,
              52774,
              52755,
              52733,
              52749,
              52739,
              52758,
              52730,
              52743,
              52743,
              52761,
              52743,
              52737,
              52759,
              52757,
              52775,
              52775,
              52770,
              52759,
              52761,
              52785,
              52753,
              52766,
              52749,
              52773,
              52752,
              52747,
              52764,
              52747,
              52756,
              52745,
              52771,
              52761,
              52779,
              52769,
              52769,
              52790,
              52781,
              52763,
              52774,
              52731,
              52733,
              52755,
              52783,
              52780,
              52767,
              52771,
              52774,
              52778,
              52755,
              52762,
              52785,
              52767,
              52758,
              52775,
              52745,
              52766,
              52763,
              52758,
              52796,
              52772,
              52755,
              52767,
              52771,
              52770,
              52778,
              52806,
              52766,
              52782,
              52785,
              52782,
              52780,
              52747,
              52781,
              52762,
              52746,
              52748,
              52742,
              52750,
              52769,
              52774,
              52759,
              52771,
              52527,
              52766,
              52783,
              52819,
              52821,
              52813,
              52827,
              52850,
              52808,
              52836,
              52864,
              52851,
              52867,
              52843,
              52831,
              52858,
              52866,
              52871,
              52873,
              52881,
              54493,
              52807,
              52799,
              52799,
              52774,
              52829,
              52802,
              52780,
              52783,
              52766,
              52791,
              52773,
              52793,
              52792,
              52782,
              52794,
              52803,
              52777,
              52802,
              52778,
              52769,
              52761,
              52783,
              52762,
              52801,
              52807,
              52806,
              52763,
              52787,
              52780,
              52766,
              52779,
              52758,
              52773,
              52774,
              52768,
              52761,
              52774,
              52753,
              52766,
              52770,
              52751,
              52800,
              52783,
              52791,
              52764,
              52751,
              52757,
              52755,
              52762,
              52763,
              52747,
              52776,
              52757,
              52715,
              52755,
              52754,
              52757,
              52739,
              52745,
              52775,
              52768,
              52764,
              52750,
              52766,
              52759,
              52747,
              52750,
              52753,
              52765,
              52763,
              52769,
              52762,
              52775,
              52759,
              52775,
              52787,
              52777,
              52767,
              52777,
              52771,
              52769,
              52737,
              52758,
              52775,
              52760,
              52770,
              52769,
              52772,
              52786,
              52759,
              52755,
              52767,
              52782,
              52775,
              52764,
              52775,
              52763,
              52769,
              52755,
              52787,
              52767,
              52769,
              52771,
              52795,
              52767,
              52761,
              52751,
              52760,
              52766,
              52771,
              52749,
              52751,
              52757,
              52781,
              52775,
              52749,
              52767,
              52758,
              52781,
              52794,
              52790,
              52743,
              52768,
              52777,
              52724,
              52754,
              52760,
              52757,
              52754,
              52749,
              52735,
              52730,
              52739,
              52742,
              52730,
              52747,
              52746,
              52750,
              52733,
              52742,
              52770,
              52747,
              52753,
              52748,
              52761,
              52747,
              52759,
              52767,
              52773,
              52756,
              52771,
              52743,
              52744,
              52697,
              52741,
              52755,
              52743,
              52775,
              52760,
              52769,
              52791,
              52754,
              52751,
              52797,
              52769,
              52775,
              52775,
              52745,
              52754,
              52754,
              52756,
              52755,
              52799,
              52787,
              52802,
              52786,
              52779,
              52799,
              52786,
              52794,
              52759,
              52779,
              52775,
              52775,
              52775,
              52755,
              52773,
              52767,
              52763,
              52768,
              52767,
              52756,
              52765,
              52777,
              52771,
              52774,
              52761,
              52783,
              52815,
              52455,
              52817,
              52798,
              52796,
              52798,
              52813,
              52801,
              52823,
              52828,
              52845,
              52826,
              52839,
              52855,
              52849,
              52847,
              52838,
              52856,
              52845,
              52853,
              52851,
              54697,
              52863,
              52829,
              52835,
              52794,
              52820,
              52793,
              52839,
              52795,
              52767,
              52798,
              52775,
              52775,
              52789,
              52765,
              52782,
              52787,
              52815,
              52777,
              52776,
              52818,
              52775,
              52787,
              52796,
              52811,
              52797,
              52796,
              52800,
              52807,
              52803,
              52812,
              52792,
              52798,
              52826,
              52821,
              52809,
              52783,
              52800,
              52783,
              52832,
              52801,
              52811,
              52839,
              52823,
              52815,
              52846,
              52815,
              52793,
              52788,
              52795,
              52805,
              52783,
              52787,
              52799,
              52784,
              52783,
              52794,
              52814,
              52799,
              52801,
              52785,
              52793,
              52788,
              52764,
              52767,
              52781,
              52787,
              52816,
              52805,
              52767,
              52807,
              52821,
              52787,
              52811,
              52807,
              52787,
              52782,
              52801,
              52793,
              52817,
              52790,
              52806,
              52803,
              52798,
              52796,
              52789,
              52799,
              52830,
              52785,
              52831,
              52791,
              52787,
              52813,
              52780,
              52807,
              52810,
              52793,
              52794,
              52813,
              52819,
              52812,
              52839,
              52837,
              52810,
              52818,
              52772,
              52811,
              52815,
              52807,
              52811,
              52824,
              52828,
              52807,
              52810,
              52823,
              52833,
              52787,
              52797,
              52814,
              52817,
              52819,
              52807,
              52801,
              52803,
              52807,
              52803,
              52789,
              52812,
              52818,
              52790,
              52804,
              52809,
              52800,
              52798,
              52779,
              52797,
              52829,
              52797,
              52841,
              52808,
              52775,
              52772,
              52790,
              52805,
              52792,
              52799,
              52801,
              52785,
              52791,
              52771,
              52807,
              52805,
              52806,
              52795,
              52807,
              52815,
              52787,
              52827,
              52806,
              52813,
              52769,
              52765,
              52789,
              52817,
              52814,
              52795,
              52796,
              52802,
              52777,
              52786,
              52789,
              52795,
              52807,
              52787,
              52807,
              52802,
              52812,
              52803,
              52802,
              52790,
              52791,
              52805,
              52787,
              52817,
              52801,
              52807,
              52798,
              52799,
              52801,
              52777,
              52790,
              52775,
              52796,
              52810,
              52793,
              52798,
              52815,
              52809,
              52795,
              52803,
              52391,
              52797,
              52819,
              52826,
              52835,
              52819,
              52838,
              52854,
              52871,
              52865,
              52868,
              52875,
              52864,
              52901,
              52878,
              52886,
              52876,
              52903,
              52866,
              52864,
              54945,
              52887,
              52862,
              52838,
              52843,
              52837,
              52825,
              52835,
              52831,
              52863,
              52819,
              52819,
              52813,
              52791,
              52796,
              52794,
              52791,
              52787,
              52783,
              52819,
              52791,
              52795,
              52833,
              52793,
              52788,
              52773,
              52779,
              52803,
              52778,
              52785,
              52829,
              52790,
              52778,
              52791,
              52799,
              52780,
              52787,
              52823,
              52820,
              52812,
              52820,
              52823,
              52839,
              52815,
              52823,
              52804,
              52801,
              52803,
              52805,
              52839,
              52828,
              52799,
              52805,
              52819,
              52827,
              52799,
              52777,
              52778,
              52774,
              52775,
              52746,
              52767,
              52775,
              52775,
              52764,
              52769,
              52781,
              52795,
              52769,
              52757,
              52772,
              52782,
              52783,
              52785,
              52807,
              52809,
              52793,
              52799,
              52783,
              52775,
              52797,
              52778,
              52809,
              52799,
              52797,
              52807,
              52797,
              52815,
              52798,
              52799,
              52813,
              52807,
              52800,
              52775,
              52797,
              52791,
              52775,
              52834,
              52790,
              52797,
              52783,
              52800,
              52780,
              52769,
              52791,
              52805,
              52815,
              52794,
              52779,
              52807,
              52803,
              52800,
              52800,
              52787,
              52798,
              52751,
              52785,
              52814,
              52811,
              52807,
              52803,
              52789,
              52776,
              52795,
              52781,
              52788,
              52756,
              52743,
              52760,
              52731,
              52761,
              52729,
              52763,
              52763,
              52761,
              52759,
              52750,
              52753,
              52756,
              52762,
              52763,
              52759,
              52757,
              52767,
              52757,
              52735,
              52745,
              52771,
              52755,
              52775,
              52775,
              52767,
              52735,
              52765,
              52779,
              52769,
              52785,
              52793,
              52775,
              52783,
              52780,
              52751,
              52777,
              52758,
              52770,
              52768,
              52777,
              52762,
              52759,
              52759,
              52741,
              52751,
              52779,
              52749,
              52762,
              52734,
              52759,
              52744,
              52725,
              52775,
              52763,
              52755,
              52762,
              52752,
              52756,
              52756,
              52762,
              52735,
              52764,
              52722,
              52749,
              52753,
              52755,
              52787,
              52774,
              52773,
              52768,
              52765,
              52762,
              52781,
              52243,
              52807,
              52809,
              52782,
              52816,
              52823,
              52829,
              52851,
              52808,
              52817,
              52847,
              52839,
              52831,
              52839,
              52842,
              52836,
              52871,
              52879,
              52859,
              52870,
              55132,
              52882,
              52850,
              52831,
              52835,
              52818,
              52802,
              52822,
              52810,
              52795,
              52765,
              52774,
              52783,
              52758,
              52760,
              52759,
              52778,
              52774,
              52775,
              52774,
              52767,
              52787,
              52798,
              52817,
              52813,
              52809,
              52789,
              52807,
              52793,
              52791,
              52803,
              52774,
              52810,
              52778,
              52796,
              52756,
              52785,
              52770,
              52785,
              52778,
              52787,
              52759,
              52783,
              52778,
              52769,
              52786,
              52777,
              52793,
              52761,
              52751,
              52743,
              52762,
              52782,
              52787,
              52766,
              52781,
              52791,
              52784,
              52773,
              52776,
              52783,
              52757,
              52792,
              52781,
              52769,
              52757,
              52787,
              52739,
              52757,
              52758,
              52766,
              52772,
              52757,
              52747,
              52775,
              52735,
              52766,
              52767,
              52763,
              52783,
              52755,
              52719,
              52738,
              52750,
              52770,
              52763,
              52785,
              52759,
              52765,
              52794,
              52775,
              52759,
              52752,
              52749,
              52761,
              52772,
              52750,
              52777,
              52785,
              52771,
              52775,
              52761,
              52745,
              52748,
              52723,
              52753,
              52731,
              52744,
              52761,
              52753,
              52775,
              52759,
              52746,
              52767,
              52745,
              52794,
              52769,
              52759,
              52778,
              52786,
              52746,
              52766,
              52750,
              52783,
              52792,
              52771,
              52791,
              52777,
              52791,
              52774,
              52790,
              52799,
              52815,
              52792,
              52798,
              52774,
              52806,
              52767,
              52784,
              52785,
              52784,
              52777,
              52772,
              52782,
              52793,
              52795,
              52763,
              52778,
              52798,
              52771,
              52734,
              52765,
              52757,
              52766,
              52758,
              52763,
              52774,
              52759,
              52749,
              52771,
              52781,
              52789,
              52790,
              52758,
              52773,
              52783,
              52790,
              52813,
              52803,
              52825,
              52823,
              52806,
              52812,
              52799,
              52787,
              52793,
              52782,
              52769,
              52785,
              52775,
              52766,
              52781,
              52775,
              52769,
              52764,
              52775,
              52755,
              52761,
              52799,
              52803,
              52777,
              52781,
              52775,
              52783,
              52764,
              52787,
              52775,
              52803,
              52797,
              52805,
              52150,
              52810,
              52823,
              52839,
              52815,
              52849,
              52839,
              52849,
              52827,
              52833,
              52827,
              52852,
              52859,
              52846,
              52847,
              52876,
              52869,
              52863,
              52889,
              52874,
              55451,
              52890,
              52840,
              52803,
              52793,
              52797,
              52803,
              52793,
              52798,
              52799,
              52801,
              52806,
              52768,
              52787,
              52775,
              52779,
              52773,
              52775,
              52775,
              52788,
              52768,
              52807,
              52799,
              52798,
              52779,
              52774,
              52785,
              52795,
              52789,
              52797,
              52778,
              52801,
              52825,
              52784,
              52800,
              52807,
              52797,
              52794,
              52815,
              52811,
              52786,
              52761,
              52775,
              52789,
              52803,
              52798,
              52807,
              52818,
              52783,
              52807,
              52788,
              52803,
              52793,
              52787,
              52797,
              52807,
              52798,
              52803,
              52797,
              52780,
              52797,
              52767,
              52757,
              52787,
              52782,
              52774,
              52775,
              52783,
              52768,
              52759,
              52787,
              52765,
              52762,
              52759,
              52758,
              52787,
              52772,
              52767,
              52767,
              52782,
              52802,
              52789,
              52789,
              52781,
              52782,
              52791,
              52792,
              52782,
              52783,
              52797,
              52792,
              52806,
              52752,
              52753,
              52743,
              52776,
              52753,
              52751,
              52770,
              52790
            ]
          },
          {
            "time": 1502216060418,
            "label": "PAM",
            "light_intensity": 1365.7,
            "r": 1762,
            "g": 563,
            "b": 411,
            "light_intensity_raw": 2584,
            "temperature": 25.36,
            "humidity": 47.594,
            "pressure": 990.35,
            "temperature2": 25.53,
            "humidity2": 42.906,
            "pressure2": 989.38,
            "contactless_temp": 24.71,
            "thickness": 0.44,
            "compass_direction": "W",
            "compass": 270,
            "angle": 5.402,
            "angle_direction": "N",
            "pitch": 5.27,
            "roll": -1.18,
            "data_raw": [
              2248,
              52941,
              3202,
              52847,
              3302,
              52826,
              3345,
              52807,
              3372,
              52779,
              3387,
              52823,
              3401,
              52807,
              3408,
              52807,
              3415,
              52791,
              3420,
              52831,
              3418,
              52807,
              3422,
              52834,
              3428,
              52835,
              3427,
              52830,
              3431,
              52789,
              3427,
              52779,
              3426,
              52804,
              3431,
              52803,
              3433,
              52831,
              3432,
              52815,
              3432,
              52807,
              3431,
              52773,
              3437,
              52811,
              3437,
              52807,
              3431,
              52770,
              3434,
              52767,
              3431,
              52815,
              3427,
              52785,
              3429,
              52779,
              3432,
              52843,
              3433,
              52792,
              3438,
              52775,
              3427,
              52827,
              3429,
              52799,
              3432,
              52805,
              3431,
              52807,
              3433,
              52797,
              3433,
              52797,
              3430,
              52785,
              3431,
              52787,
              3432,
              52793,
              3429,
              52814,
              3434,
              52807,
              3430,
              52820,
              3428,
              52798,
              3426,
              52815,
              3431,
              52834,
              3436,
              52783,
              3431,
              52769,
              3426,
              52787,
              3419,
              52787,
              3430,
              52811,
              3426,
              52817,
              3429,
              52838,
              3425,
              52791,
              3427,
              52791,
              3433,
              52794,
              3427,
              52823,
              3427,
              52789,
              3428,
              52791,
              3428,
              52796,
              3421,
              52785,
              3428,
              52797,
              3427,
              52813,
              3427,
              52798,
              3425,
              52811,
              3421,
              52804,
              3419,
              52821,
              3425,
              52786,
              3427,
              52817,
              3418,
              52829,
              3417,
              52773,
              3418,
              52805,
              3418,
              52812,
              3423,
              52825,
              3417,
              52820,
              3418,
              52788,
              3418,
              52801,
              3423,
              52842,
              3422,
              52787,
              3420,
              52807,
              3416,
              52796,
              3418,
              52827,
              3421,
              52819,
              3420,
              52797,
              3419,
              52793,
              3415,
              52785,
              3424,
              52838,
              3417,
              52795,
              3418,
              52815,
              3420,
              52822,
              3417,
              52816,
              3417,
              52839,
              3420,
              52813,
              3416,
              52792,
              3419,
              52797,
              3411,
              52799,
              3420,
              52812,
              3422,
              52811,
              3417,
              52785,
              3418,
              52779,
              3431,
              52807,
              3433,
              52758,
              3431,
              52784,
              3441,
              52796,
              3439,
              52781,
              3433,
              52829,
              3443,
              52767,
              3439,
              52807,
              3441,
              52811,
              3441,
              52797,
              3434,
              52795,
              3439,
              52791,
              3429,
              52835,
              3443,
              52841,
              3431,
              52793,
              3438,
              52796,
              3433,
              52795,
              3427,
              52800,
              3434,
              52805,
              3429,
              52801,
              3434,
              52818,
              3429,
              52807,
              3429,
              52775,
              3429,
              52760,
              3428,
              52786,
              3428,
              52765,
              3424,
              52767,
              3430,
              52806,
              3428,
              52770,
              3430,
              52776,
              3431,
              52765,
              3423,
              52785,
              3426,
              52799,
              3426,
              52763,
              3418,
              52765,
              3428,
              52804,
              3425,
              52774,
              3419,
              52786,
              3425,
              52789,
              3416,
              52785,
              3424,
              52765,
              3418,
              52748,
              3425,
              52773,
              3423,
              52767,
              3425,
              52762,
              3431,
              52787,
              3420,
              52766,
              3419,
              52801,
              3422,
              52767,
              3417,
              52783,
              3421,
              52791,
              3413,
              52764,
              3419,
              52763,
              3422,
              52789,
              3419,
              52758,
              3413,
              52759,
              3417,
              52765,
              3411,
              52757,
              3415,
              52766,
              3418,
              52743,
              3416,
              52767,
              3423,
              52759,
              3419,
              52773,
              3413,
              52770,
              3418,
              52766,
              3416,
              52747,
              3415,
              52743,
              3414,
              52771,
              3410,
              52789,
              3407,
              52777,
              3413,
              52787,
              3415,
              52764,
              3411,
              52775,
              3409,
              52769,
              3416,
              52759,
              3409,
              52758,
              3409,
              52765,
              3407,
              52749,
              3402,
              52775,
              3403,
              52783,
              3416,
              52758,
              3403,
              52753,
              3405,
              52755,
              3405,
              52737,
              3401,
              52746,
              3401,
              52760,
              3403,
              52751,
              3405,
              52735,
              3398,
              52727,
              3328,
              52811,
              3175,
              52831,
              3023,
              52843,
              2901,
              52901,
              2781,
              52919,
              2677,
              52896,
              2575,
              52934,
              2493,
              52915,
              2421,
              52950,
              2359,
              52987,
              2303,
              52958,
              2257,
              52979,
              2210,
              52957,
              2177,
              52967,
              2149,
              53037,
              1639,
              52679,
              1601,
              52731,
              1567,
              52754,
              1547,
              52773,
              1521,
              52791,
              1495,
              52783,
              1479,
              52778,
              1462,
              52835,
              1438,
              52839,
              1419,
              52851,
              1405,
              52887,
              1393,
              52885,
              1372,
              52876,
              1360,
              52911,
              1351,
              52927,
              1337,
              53003,
              2789,
              52805,
              3013,
              52739,
              3135,
              52708,
              3197,
              52719,
              3219,
              52715,
              3246,
              52679,
              3250,
              52689,
              3263,
              52663,
              3267,
              52655,
              3267,
              52679,
              3273,
              52680,
              3270,
              52679,
              3273,
              52685,
              3267,
              52671,
              3271,
              52671,
              3269,
              52666,
              3271,
              52691,
              3274,
              52645,
              3270,
              52655,
              3269,
              52628,
              3268,
              52668,
              3270,
              52669,
              3265,
              52671,
              3270,
              52653,
              3266,
              52678,
              3267,
              52659,
              3265,
              52645,
              3265,
              52669,
              3265,
              52665,
              3274,
              52649,
              3272,
              52676,
              3270,
              52681,
              3271,
              52689,
              3270,
              52719,
              3271,
              52694,
              3271,
              52735,
              3268,
              52755,
              3271,
              52710,
              3267,
              52737,
              3267,
              52749,
              3266,
              52731,
              3268,
              52767,
              3264,
              52775,
              3268,
              52765,
              3272,
              52747,
              3263,
              52755,
              3269,
              52769,
              3263,
              52715,
              3266,
              52724,
              3268,
              52757,
              3259,
              52761,
              3269,
              52753,
              3265,
              52749,
              3262,
              52731,
              3261,
              52763,
              3263,
              52757,
              3260,
              52751,
              3266,
              52775,
              3261,
              52785,
              3259,
              52769,
              3265,
              52781,
              3256,
              52767,
              3255,
              52792,
              3255,
              52805,
              3255,
              52759,
              3257,
              52779,
              3256,
              52795,
              3249,
              52731,
              3254,
              52761,
              3255,
              52799,
              3246,
              52775,
              3254,
              52758,
              3252,
              52754,
              3247,
              52766,
              3239,
              52770,
              3231,
              52808,
              3218,
              52745,
              3219,
              52791,
              3215,
              52801,
              3214,
              52779,
              3208,
              52781,
              3210,
              52838,
              3212,
              52824,
              3205,
              52804,
              3206,
              52829,
              3208,
              52815,
              3208,
              52801,
              3204,
              52824,
              3207,
              52829
            ]
          },
          {
            "time": 1502216066589,
            "label": "SPAD",
            "detector_read1": 12903,
            "detector_read2": 65535,
            "light_intensity": 133.877,
            "r": 167,
            "g": 54,
            "b": 39,
            "light_intensity_raw": 246,
            "temperature": 25.47,
            "humidity": 47.396,
            "pressure": 990.395,
            "temperature2": 25.64,
            "humidity2": 42.844,
            "pressure2": 989.374,
            "contactless_temp": 25.6,
            "thickness": 0.43,
            "compass_direction": "E",
            "compass": 90,
            "angle": 1.07,
            "angle_direction": "SE",
            "pitch": 0.63,
            "roll": 0.86,
            "recall": {
              "time": 1502216066878,
              "colorcal_blank1[1]": 21983,
              "colorcal_blank1[2]": 28172.5,
              "colorcal_blank1[3]": 29489,
              "colorcal_blank1[4]": 37150,
              "colorcal_blank1[6]": 30644.5,
              "colorcal_blank1[8]": 31670,
              "colorcal_blank1[9]": 25601.5,
              "colorcal_blank1[10]": 30224.5,
              "colorcal_blank2[1]": 23637,
              "colorcal_blank2[2]": 23502.5,
              "colorcal_blank2[3]": 24913.5,
              "colorcal_blank2[4]": 22816.5,
              "colorcal_blank2[6]": 16437.5,
              "colorcal_blank2[8]": 17945.5,
              "colorcal_blank2[9]": 18201,
              "colorcal_blank2[10]": 16425.5,
              "colorcal_blank3[1]": 20336.5,
              "colorcal_blank3[2]": 11211.5,
              "colorcal_blank3[3]": 18805.5,
              "colorcal_blank3[4]": 14531.5,
              "colorcal_blank3[6]": 5275,
              "colorcal_blank3[8]": 5942,
              "colorcal_blank3[9]": 4925.5,
              "colorcal_blank3[10]": 5376,
              "colorcal_intensity1_slope[2]": 2.631,
              "colorcal_intensity1_yint[2]": -0.1,
              "colorcal_intensity2_slope[2]": 2.01,
              "colorcal_intensity2_yint[2]": 21.9,
              "colorcal_intensity3_slope[2]": 1.457,
              "colorcal_intensity3_yint[2]": 9.7,
              "ir_baseline_slope[5]": 13995,
              "ir_baseline_yint[5]": 20427.5,
              "ir_baseline_slope[3]": 516,
              "ir_baseline_yint[3]": 669
            },
            "data_raw": [
              27327,
              6816,
              6431,
              6366,
              6338,
              6317,
              6319,
              6306,
              6298,
              6300,
              399,
              301,
              297,
              298,
              301,
              304,
              305,
              301,
              299,
              302,
              1914,
              1138,
              1135,
              1138,
              1137,
              1134,
              1133,
              1136,
              1133,
              1130,
              287,
              88,
              91,
              83,
              82,
              87,
              89,
              86,
              84,
              101,
              42389,
              12144,
              11907,
              11867,
              11830,
              11820,
              11812,
              11813,
              11817,
              11824,
              14602,
              13887,
              13873,
              13867,
              13865,
              13874,
              13865,
              13887,
              13878,
              13890,
              18291,
              11991,
              11917,
              11911,
              11908,
              11907,
              11902,
              11911,
              11905,
              11903,
              21324,
              13972,
              13889,
              13888,
              13878,
              13883,
              13881,
              13876,
              13871,
              13873,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              1482,
              1792,
              1804,
              1800,
              1796,
              1799,
              1796,
              1795,
              1791,
              1800,
              6666,
              8309,
              8319,
              8313,
              8309,
              8312,
              8310,
              8311,
              8317,
              8311,
              259,
              317,
              326,
              317,
              314,
              323,
              318,
              315,
              320,
              318,
              34453,
              42529,
              42575,
              42591,
              42588,
              42599,
              42590,
              42596,
              42593,
              42585,
              38702,
              49179,
              49239,
              49255,
              49259,
              49257,
              49257,
              49254,
              49267,
              49253,
              30968,
              41167,
              41269,
              41283,
              41277,
              41284,
              41284,
              41284,
              41289,
              41279,
              35256,
              45911,
              45993,
              46001,
              45998,
              45993,
              45992,
              45986,
              45981,
              45968,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              65535,
              3227,
              3887,
              3894,
              3897,
              3900,
              3897,
              3905,
              3900,
              3903,
              3908,
              28461,
              39655,
              39713,
              39709,
              39711,
              39702,
              39700,
              39691,
              39687,
              39688,
              811,
              1141,
              1139,
              1140,
              1140,
              1135,
              1133,
              1141,
              1149,
              1143,
              42589,
              42575,
              42591,
              42571,
              42585,
              42584,
              42583,
              42575,
              42585,
              42599,
              49246,
              49241,
              49237,
              49227,
              49229,
              49237,
              49245,
              49245,
              49242,
              49251,
              41302,
              41295,
              41285,
              41282,
              41284,
              41289,
              41289,
              41287,
              41287,
              41290,
              46015,
              45999,
              45991,
              45982,
              45979,
              45976,
              45971,
              45970,
              45966,
              45959
            ]
          }
        ]
      }
    ]
  ],
  "app_os": "darwin-16.6.0",
  "app_name": "PhotosynQ",
  "app_version": "0.0.19",
  "app_device": "x64",
  "location": [
    "42.7224280",
    "-84.4746400"
  ],
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
1
Latest Update:
Aug 2017