RIDES_light_potential


This macro analyzes data from the RIDES_light_potential
/**
 * Macro for data evaluation of RIDES1_light_potential 
 * data on PhotosynQ.org
 * by: David M. Kramer
 * created: 2017-05-09 @ 18:15:27
 *
 * The concept for the protocol came out of discussions between myself
 * and Gonzalo Estavillo during a PhotosynQ workshop (and subsequent 
 * beers). 
 */

// 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 
// nonlinear curve fitting. 

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

// Define the protocol set numbers for each data set
// NOTE: these will be overwritten by the labels!

var ECS_LEFdset;
var P700_DIRK_set;
var PAM_set;  //the json set 8 contains the PAM and P700 traces
var SPAD_set;
var calib_set;

//Find the appropriate traces (or sub-protocols in the protocol set)
// using the labels provided in the label command

var labels=[]; //holds the labels

for (var i=1; i < output.n_sets; i++) {
  var temp=json.set[i].label; //store the label for sup-protocol n in temp
  labels.push(temp);

  if (temp=="DIRK_ECS"){ //if the label is 'DIRK_ECS' it is the ECS_LEFs trace 
  	//output.tt1=temp;
    ECS_LEFdset=i;
  }
  if (temp=="DIRK_P700"){ // if the label is 'DIRK_P700' ut us tge fluorescence DIRK trace 
  	output.tt2=temp;
    var P700_DIRK_set=i;
  }
  if (temp=="PAM"){ //if the label is 'PAM' is is the trace with tboth the 
    				//fluorescence PAM and the P700 traces
  	//output.tt3=temp;
    PAM_set=i;
  }
  if (temp=="SPAD"){ //if the label is 'SPAD' it contains the SPAD traces
  	//output.tt4=temp;
    SPAD_set=i;
    calib_set=i;
  }
}

// Next DEFINE THE TRACES USEING LABEL INFO

// 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...

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

var PAM_DATA= [];//take every other point, starting with the first (i.e. point 0) 
				//for trace PSI_data
for (var i=0; i<length_of_PAM; i=i+2){
	PAM_DATA.push(json.set[PAM_set].data_raw[i]);
}

var PSI_data=[]; //take every other point, starting with the second (i.e. point 1) 
				//for trace PSI_data
for (var i=1; i<length_of_PAM+1; i=i+2){
	PSI_data.push(json.set[PAM_set].data_raw[i]);
}
output.PAM_DATA=PAM_DATA;
output.PSI_data=PSI_data.slice(0,290);

json.set[PAM_set].data_raw=PAM_DATA; //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

// The Fs paramter for ambient light intensity
var Fs_begin=1; //the first point to use for Fs 
var Fs_end =4; //the end point to use  for Fs

// The Fs paramter for INCREASED light intensity
var high_Fs_begin=190; //the first point to use for Fs 
var high_Fs_end =200; //the end point to use  for Fs

// We will use the SAME Fv/FM' values for the ambient and
// increased light intensities.

//The Fv/FM' results will be calculated using the 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 =201; //the first point to use for the FIRST Fmp
var Fm_1_end =230; //the end point to use  for the FIRST Fmp
var Fm_2_begin =231; //the first point to use for the FIRST Fmp
var Fm_2_end =245; //the end point to use  for the FIRST Fmp
var Fm_3_begin =246; //the first point to use for the FIRST Fmp
var Fm_3_end =260; //the end point to use  for the FIRST Fmp
var Fm_4_begin =261; //the first point to use for the FIRST Fmp
var Fm_4_end =275; //the end point to use  for the FIRST Fmp
var Fm_5_begin =276; //the first point to use for the FIRST Fmp
var Fm_5_end =290; //the end point to use  for the FIRST Fmp


//START AND STOP FOR F0'
var FoPrime_begin =305; //the first point to use for Fs 
var FoPrime_end =309; //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];


//************************************************************************************************
  //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 = MathROUND(MathMEAN(data.slice(Fs_begin,Fs_end)),1) - 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 Fs after changing to higher illumination conditions
var high_Fs = MathROUND(MathMEAN(data.slice(high_Fs_begin,high_Fs_end)) - baseline,1); // take only the first 4 values in the Fs range, excluding the very first
var high_Fs_std = MathSTDEV(data.slice(high_Fs_begin,high_Fs_end)); // create standard deviation for this value for error checking
output.high_Fs=high_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;

var high_fvfm_noMPF = (AFmP-high_Fs)/AFmP;
var high_fvfm_MPF = (reg.b-high_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;


//return output;



//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=100; //end of the trace for P700 steady-state
var PSI_sat1_beg=200; //beginning of the trace for P700 first saturation pulse
var PSI_sat1_end=235; //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 P700 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



/****************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.
// ----------------------------

var high_Phi2_MPF = MathROUND(high_fvfm_MPF,3);
output.high_Phi2_MPF=high_Phi2_MPF;
var high_Phi2_no_MPF = MathROUND(high_fvfm_noMPF,3);
output.high_Phi2_no_MPF=high_Phi2_no_MPF;

output.high_Phi2=high_Phi2_MPF;

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);
  }
  
//return output;

  
  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);
 // output.xxx=output.light_intensity;
//  output.high_LEF= MathROUND((3  * 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;

PSI_dark_beg=0;

//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; 


  output.LEF= MathROUND((fvfm  * 0.45 * light_intensity),3);
  //output.xxx=output.light_intensity;
  output.high_LEF= MathROUND((3  * 0.45 * light_intensity),3);

  var ambient_temperature=json.set[3].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", "high_Phi2", "Phi2_bar", "LEF", "high_LEF", "NPQt", "SPAD", "PSI_act", "PSI_open", "tP700", "PSI_or", "PSI_ox", "ambient_temperture"];
output.LEF=output.light_intensity *output.Phi2;

return output;
{
  "time": 1520723813574,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:37:32",
  "device_battery": 96,
  "device_firmware": 1.284,
  "sample": [
    [
      {
        "time": 1520723813583,
        "protocol_id": 1,
        "set": [
          {
            "time": 1520723813595,
            "label": "no_leaf_baseline",
            "light_intensity": 8.564,
            "r": 7,
            "g": 3,
            "b": 2,
            "light_intensity_raw": 12,
            "w": 760,
            "temperature": 27.69,
            "humidity": 19.841,
            "pressure": 988.134,
            "temperature2": 27.72,
            "humidity2": 19.776,
            "pressure2": 987.778,
            "contactless_temp": 26.85,
            "compass_direction": "E",
            "compass": 90,
            "angle": 1.813,
            "angle_direction": "SE",
            "pitch": 1.58,
            "roll": 0.88,
            "data_raw": [

            ]
          },
          {
            "time": 1520723814478,
            "label": "DIRK_ECS",
            "light_intensity": 8.564,
            "r": 7,
            "g": 3,
            "b": 2,
            "light_intensity_raw": 12,
            "w": 1396,
            "temperature": 27.7,
            "humidity": 19.809,
            "pressure": 988.106,
            "temperature2": 27.72,
            "humidity2": 19.755,
            "pressure2": 987.8,
            "contactless_temp": 26.99,
            "thickness": 0.29,
            "data_raw": [
              49467,
              49487,
              49493,
              49486,
              49479,
              49466,
              49479,
              49471,
              49463,
              49451,
              49459,
              49447,
              49444,
              49438,
              49447,
              49442,
              49437,
              49433,
              49437,
              49439,
              49417,
              49422,
              49425,
              49423,
              49409,
              49419,
              49410,
              49414,
              49400,
              49410,
              49401,
              49397,
              49393,
              49391,
              49397,
              49383,
              49387,
              49379,
              49383,
              49378,
              49373,
              49383,
              49375,
              49374,
              49363,
              49373,
              49365,
              49359,
              49361,
              49367,
              49363,
              49352,
              49350,
              49351,
              49361,
              49348,
              49351,
              49346,
              49351,
              49338,
              49339,
              49333,
              49341,
              49335,
              49331,
              49335,
              49339,
              49331,
              49326,
              49336,
              49319,
              49328,
              49317,
              49329,
              49331,
              49317,
              49319,
              49318,
              49321,
              49307,
              49317,
              49318,
              49317,
              49312,
              49314,
              49322,
              49309,
              49311,
              49307,
              49313,
              49294,
              49305,
              49295,
              49309,
              49291,
              49297,
              49293,
              49305,
              49288,
              49292,
              49297,
              49289,
              49283,
              49293,
              49289,
              49295,
              49286,
              49287,
              49293,
              49289,
              49286,
              49289,
              49290,
              49285,
              49286,
              49281,
              49292,
              49279,
              49278,
              49275,
              49287,
              49270,
              49279,
              49276,
              49285,
              49273,
              49273,
              49286,
              49279,
              49279,
              49274,
              49281,
              49276,
              49275,
              49262,
              49276,
              49269,
              49267,
              49258,
              49269,
              49263,
              49263,
              49258,
              49269,
              49271,
              49261,
              49268,
              49274,
              49271,
              49262,
              49270,
              49265,
              49264,
              49247,
              49262,
              49254,
              49255,
              49256,
              49259,
              49267,
              49253,
              49257,
              49255,
              49258,
              49245,
              49247,
              49257,
              49258,
              49258,
              49251,
              49261,
              49254,
              49251,
              49251,
              49258,
              49263,
              49253,
              49252,
              49251,
              49253,
              49233,
              49246,
              49247,
              49249,
              49250,
              49242,
              49255,
              49250,
              49247,
              49245,
              49255,
              49251,
              49248,
              49243,
              49247,
              49245,
              49246,
              49237,
              49249,
              49239,
              49242,
              49250,
              49246,
              49255,
              49239,
              49253,
              49251,
              49250,
              49250,
              49254,
              49262,
              49255,
              49256,
              49258,
              49269,
              49249,
              49261,
              49265,
              49271,
              49255,
              49267,
              49262,
              49269,
              49251,
              49257,
              49254,
              49263,
              49251,
              49255,
              49251,
              49253,
              49251,
              49248,
              49256,
              49251,
              49254,
              49242,
              49252,
              49241,
              49247,
              49237,
              49245,
              49249,
              49234,
              49250,
              49238,
              49241,
              49235,
              49249,
              49250,
              49245,
              49230,
              49245,
              49238,
              49238,
              49225,
              49243,
              49238,
              49231,
              49230,
              49233,
              49245,
              49229,
              49230,
              49233,
              49235,
              49221,
              49225,
              49228,
              49230,
              49229,
              49225,
              49231,
              49227,
              49223,
              49215,
              49227,
              49223,
              49221,
              49231,
              49227,
              49230,
              49215,
              49225,
              49221,
              49223,
              49207,
              49223,
              49223,
              49209,
              49223,
              49221,
              49223,
              49215,
              49217,
              49214,
              49225,
              49208,
              49220,
              49211,
              49225,
              49215,
              49217,
              49226,
              49226,
              49223,
              49211,
              49224,
              49223,
              49219,
              49214,
              49217,
              49214,
              49210,
              49223,
              49218,
              49223,
              49215,
              49223,
              49213,
              49212,
              49211,
              49213,
              49220,
              49209,
              49195,
              49218,
              49212,
              49207,
              49215,
              49214,
              49217,
              49203,
              49212,
              49214,
              49218,
              49209,
              49211,
              49210,
              49213,
              49207,
              49199,
              49212,
              49219,
              49202,
              49205,
              49208,
              49211,
              49201,
              49207,
              49217,
              49206,
              49209,
              49199,
              49211,
              49197,
              49207,
              49211,
              49205,
              49211,
              49202,
              49209,
              49202,
              49197,
              49203,
              49191,
              49211,
              49199,
              49196,
              49211,
              49208,
              49205,
              49191,
              49201,
              49206,
              49202,
              49199,
              49203,
              49210,
              49193,
              49201,
              49199,
              49207,
              49207,
              49197,
              49206,
              49199,
              49196,
              49199,
              49203,
              49209,
              49190,
              49197,
              49205,
              49203,
              49199,
              49192,
              49199,
              49198,
              49197,
              49202,
              49189,
              49199,
              49191,
              49194,
              49201,
              49191,
              49191,
              49188,
              49191,
              49195,
              49191,
              49199,
              49198,
              49193,
              49187,
              49190,
              49199,
              49189,
              49191,
              49181,
              49193,
              49197,
              49194,
              49203,
              49199,
              49203,
              49201,
              49210,
              49215,
              49199,
              49207,
              49215,
              49217,
              49214,
              49201,
              49214,
              49221,
              49209,
              49213,
              49214,
              49219,
              49209,
              49202,
              49213,
              49220,
              49212,
              49211,
              49203,
              49205,
              49206,
              49203,
              49207,
              49201,
              49203,
              49202,
              49205,
              49199,
              49203,
              49193,
              49202,
              49205,
              49195,
              49207,
              49194,
              49191,
              49204,
              49201,
              49203,
              49195,
              49190,
              49208,
              49195,
              49193,
              49199,
              49199,
              49201,
              49186,
              49186,
              49202,
              49197,
              49190,
              49188,
              49195,
              49198,
              49182,
              49187,
              49192,
              49194,
              49191,
              49187,
              49189,
              49187,
              49186,
              49191,
              49187,
              49188,
              49183,
              49187,
              49193,
              49182,
              49183,
              49191,
              49185,
              49187,
              49183,
              49187,
              49189,
              49176,
              49173,
              49185,
              49187,
              49183,
              49172,
              49185,
              49190,
              49179,
              49183,
              49174,
              49182,
              49183,
              49173,
              49189,
              49182,
              49179,
              49175,
              49185,
              49189,
              49171,
              49179,
              49185,
              49184,
              49182,
              49175,
              49183,
              49182,
              49175,
              49173,
              49181,
              49169,
              49173,
              49185,
              49174,
              49181,
              49175,
              49179,
              49186,
              49167,
              49174,
              49187,
              49179,
              49171,
              49173,
              49179,
              49185,
              49173,
              49170,
              49179,
              49173,
              49175,
              49177,
              49168,
              49181,
              49177,
              49171,
              49182,
              49175,
              49173,
              49170,
              49178,
              49183,
              49166,
              49171,
              49176,
              49171,
              49175,
              49171,
              49173,
              49173,
              49162,
              49174,
              49164,
              49174,
              49163,
              49170,
              49182,
              49175,
              49172,
              49163,
              49182,
              49175,
              49168,
              49177,
              49179,
              49167,
              49174,
              49167,
              49179,
              49179,
              49165,
              49177,
              49171,
              49177,
              49175,
              49178,
              49180,
              49158,
              49165,
              49172,
              49175,
              49175,
              49161,
              49174,
              49169,
              49163,
              49170,
              49171,
              49182,
              49161,
              49160,
              49169,
              49172,
              49169,
              49163,
              49175,
              49163,
              49162,
              49167,
              49172,
              49172,
              49164,
              49173,
              49161,
              49164,
              49168,
              49163,
              49172,
              49157,
              49167,
              49179,
              49166,
              49169,
              49169,
              49181,
              49183,
              49173,
              49175,
              49172,
              49187,
              49189,
              49179,
              49190,
              49187,
              49183,
              49191,
              49183,
              49200,
              49191,
              49187,
              49194,
              49189,
              49185,
              49189,
              49189,
              49190,
              49186,
              49181,
              49190,
              49183,
              49183,
              49191,
              49181,
              49183,
              49181,
              49176,
              49185,
              49183,
              49167,
              49183,
              49174,
              49178,
              49176,
              49169,
              49182,
              49175,
              49177,
              49173,
              49180,
              49178,
              49166,
              49173,
              49181,
              49179,
              49158,
              49175,
              49181,
              49165,
              49167,
              49173,
              49181,
              49157,
              49171,
              49166,
              49179,
              49166,
              49157,
              49173,
              49164,
              49168,
              49163,
              49166,
              49175,
              49158,
              49163,
              49158,
              49163,
              49162,
              49166,
              49167,
              49162,
              49162,
              49166,
              49172,
              49167,
              49157,
              49171,
              49166,
              49167,
              49143,
              49159,
              49170,
              49163,
              49162,
              49155,
              49165,
              49158,
              49151,
              49169,
              49157,
              49159,
              49161,
              49163,
              49167,
              49149,
              49155,
              49169,
              49163,
              49165,
              49151,
              49167,
              49157,
              49151,
              49158,
              49161,
              49165,
              49151,
              49157,
              49159,
              49157,
              49155,
              49155,
              49163,
              49153,
              49150,
              49149,
              49158,
              49160,
              49155,
              49158,
              49158,
              49159,
              49151,
              49159,
              49153,
              49157,
              49139,
              49151,
              49163,
              49147,
              49159,
              49143,
              49159,
              49143,
              49151,
              49163,
              49155,
              49157,
              49143,
              49161,
              49157,
              49149,
              49157,
              49159,
              49167,
              49149,
              49155,
              49166,
              49161,
              49155,
              49143,
              49162,
              49155,
              49151,
              49137,
              49153,
              49151,
              49149,
              49156,
              49155,
              49149,
              49131,
              49147,
              49141,
              49143,
              49150,
              49145,
              49155,
              49137,
              49143,
              49151,
              49151,
              49149,
              49134,
              49145,
              49151,
              49145,
              49149,
              49139,
              49147,
              49139,
              49143,
              49143,
              49152,
              49148,
              49141,
              49149,
              49151,
              49145,
              49139,
              49146,
              49144,
              49140,
              49145,
              49148,
              49154,
              49135,
              49134,
              49138,
              49151,
              49141,
              49146,
              49151,
              49144,
              49140,
              49134,
              49147,
              49146,
              49138,
              49143,
              49149,
              49138,
              49135,
              49147,
              49145,
              49148,
              49147,
              49147,
              49158,
              49150,
              49157,
              49159,
              49175,
              49158,
              49161,
              49161,
              49167,
              49153,
              49162,
              49164,
              49177,
              49165,
              49162,
              49163,
              49175,
              49154,
              49159,
              49153,
              49166,
              49143,
              49155,
              49151,
              49163,
              49144,
              49151,
              49153,
              49161,
              49157,
              49153,
              49165,
              49159,
              49143,
              49144,
              49153,
              49145,
              49149,
              49143,
              49153,
              49137,
              49148,
              49148,
              49151,
              49145,
              49140,
              49148,
              49151,
              49149,
              49138,
              49146,
              49143,
              49145,
              49127,
              49147,
              49143,
              49139,
              49134,
              49151,
              49135,
              49143,
              49127,
              49143,
              49146,
              49138,
              49141,
              49135,
              49149,
              49139,
              49135,
              49139,
              49143,
              49126,
              49133,
              49143,
              49140,
              49141,
              49133,
              49145,
              49142,
              49137,
              49135,
              49146,
              49136,
              49139,
              49130,
              49143,
              49129,
              49134,
              49135,
              49136,
              49143,
              49133,
              49134,
              49138,
              49139,
              49127,
              49135,
              49124,
              49128,
              49124,
              49137,
              49127,
              49132,
              49119,
              49132,
              49135,
              49127,
              49133,
              49137,
              49137,
              49127,
              49133,
              49130,
              49138,
              49126,
              49126,
              49126,
              49135,
              49128,
              49127,
              49139,
              49131,
              49137,
              49127,
              49143,
              49129,
              49127,
              49138,
              49139,
              49135,
              49127,
              49138,
              49134,
              49131,
              49124,
              49135,
              49132,
              49127,
              49123,
              49134,
              49129,
              49126,
              49125,
              49128,
              49137,
              49118,
              49129,
              49123,
              49131,
              49129,
              49131,
              49138,
              49127,
              49126,
              49119,
              49129,
              49140,
              49125,
              49131,
              49123,
              49135,
              49123,
              49123,
              49141,
              49127,
              49134,
              49120,
              49127,
              49137,
              49125,
              49131,
              49123,
              49131,
              49119,
              49127,
              49135,
              49119,
              49125,
              49117,
              49131,
              49125,
              49123,
              49133,
              49127,
              49121,
              49119,
              49125,
              49123,
              49123,
              49119,
              49127,
              49135,
              49122,
              49123,
              49127,
              49133,
              49119,
              49119,
              49123,
              49127,
              49119,
              49115,
              49131,
              49127,
              49125,
              49117,
              49129,
              49123,
              49119,
              49109,
              49125,
              49127,
              49123,
              49127,
              49126,
              49137,
              49126,
              49135,
              49130,
              49142,
              49127,
              49140,
              49145,
              49138,
              49137,
              49137,
              49149,
              49144,
              49137,
              49141,
              49154,
              49133,
              49149,
              49137,
              49150,
              49145,
              49139,
              49150,
              49149,
              49137,
              49133,
              49143,
              49140,
              49140,
              49124,
              49139,
              49145,
              49126,
              49133,
              49135,
              49139,
              49118,
              49132,
              49138,
              49131,
              49125,
              49123,
              49131,
              49119,
              49122,
              49129,
              49129,
              49135,
              49126,
              49133,
              49123,
              49127,
              49120,
              49127,
              49133,
              49125,
              49125,
              49118,
              49131,
              49122,
              49114,
              49130,
              49123,
              49127,
              49111,
              49121,
              49121,
              49111,
              49118,
              49124,
              49129,
              49122,
              49122,
              49126,
              49127,
              49109,
              49121,
              49114,
              49123,
              49122,
              49117,
              49122,
              49117,
              49111,
              49118,
              49119,
              49121,
              49111,
              49118,
              49126,
              49119,
              49117,
              49109,
              49122,
              49111,
              49116,
              49117,
              49121,
              49111,
              49119,
              49117,
              49119,
              49113,
              49107,
              49116,
              49121,
              49117,
              49113,
              49127,
              49122,
              49123,
              49113,
              49127,
              49117,
              49114,
              49099,
              49117,
              49118,
              49107,
              49115,
              49117,
              49123,
              49103,
              49110,
              49117,
              49116,
              49115,
              49111,
              49119,
              49113,
              49114,
              49108,
              49120,
              49119,
              49111,
              49125,
              49118,
              49115,
              49114,
              49119,
              49113,
              49112,
              49102,
              49111,
              49119,
              49107,
              49111,
              49105,
              49119,
              49113,
              49107,
              49118,
              49114,
              49113,
              49105,
              49116,
              49117,
              49110,
              49111,
              49108,
              49122,
              49103,
              49113,
              49110,
              49119,
              49103,
              49107,
              49113,
              49113,
              49111,
              49100,
              49111,
              49101,
              49108,
              49113,
              49111,
              49119,
              49109,
              49115,
              49111,
              49111,
              49103,
              49111,
              49119,
              49106,
              49102,
              49096,
              49114,
              49111,
              49099,
              49107,
              49104,
              49111,
              49096,
              49109,
              49114,
              49107,
              49109,
              49111,
              49115,
              49102,
              49107,
              49109,
              49118,
              49094,
              49099,
              49105,
              49117,
              49114,
              49102,
              49119,
              49112,
              49109,
              49107,
              49114,
              49111,
              49103,
              49098,
              49113,
              49113,
              49119,
              49121,
              49119,
              49121,
              49103,
              49120,
              49127,
              49125,
              49129,
              49127,
              49128,
              49119,
              49133,
              49117,
              49131,
              49121,
              49127,
              49127,
              49135,
              49121,
              49129,
              49127,
              49135,
              49129,
              49119,
              49131,
              49123,
              49121,
              49117,
              49131,
              49120,
              49119,
              49120,
              49124,
              49131,
              49111,
              49115,
              49109,
              49125,
              49115,
              49115,
              49119,
              49121,
              49123,
              49111,
              49119,
              49111,
              49107,
              49110,
              49117,
              49123,
              49115,
              49125,
              49112,
              49111,
              49103,
              49121,
              49113,
              49109,
              49107,
              49109,
              49123,
              49108,
              49108,
              49100,
              49116,
              49111,
              49101,
              49115,
              49111,
              49109,
              49101,
              49110,
              49110,
              49111,
              49097,
              49115,
              49119,
              49105,
              49103,
              49105,
              49110,
              49097,
              49099,
              49116,
              49107,
              49104,
              49103,
              49110,
              49101,
              49102,
              49097,
              49111,
              49106,
              49095,
              49109,
              49103,
              49107,
              49098,
              49113,
              49097,
              49101,
              49091,
              49099,
              49107,
              49099,
              49101,
              49103,
              49108,
              49095,
              49099,
              49095,
              49102,
              49097,
              49093,
              49110,
              49098,
              6961,
              7142,
              7185,
              7215,
              7239,
              7263,
              7292,
              7313,
              7329,
              7351,
              7371,
              7391,
              7402,
              7420,
              7439,
              7457,
              7467,
              7482,
              7501,
              7515,
              7503,
              7495,
              7494,
              7491,
              7490,
              7493,
              7495,
              7495,
              7495,
              7505,
              7505,
              7505,
              7506,
              7515,
              7518,
              7515,
              7517,
              7527,
              7531,
              7527,
              7543,
              7576,
              7597,
              7613,
              7623,
              7646,
              7660,
              7665,
              7682,
              7698,
              7710,
              7715,
              7727,
              7744,
              7750,
              7757,
              7768,
              7781,
              7793,
              7793,
              7807,
              7816,
              7825,
              7826,
              7841,
              7851,
              7856,
              7862,
              7874,
              7883,
              7889,
              7893,
              7905,
              7912,
              7915,
              7921,
              7935,
              7942,
              7944,
              7950,
              7961,
              7970,
              7971,
              7975,
              7989,
              7995,
              7997,
              8000,
              8011,
              8018,
              8017,
              8023,
              8035,
              8039,
              8041,
              8046,
              8057,
              8063,
              8060,
              8071,
              8079,
              8082,
              8082,
              8091,
              8098,
              8101,
              8104,
              8113,
              8117,
              8121,
              8126,
              8134,
              8136,
              8136,
              8141,
              8151,
              8158,
              8156,
              8162,
              8167,
              8173,
              8172,
              8178,
              8186,
              8193,
              8190,
              8195,
              8205,
              8211,
              8206,
              8212,
              8222,
              8226,
              8224,
              8231,
              8240,
              8237,
              8241,
              8246,
              8253
            ]
          },
          {
            "time": 1520723818505,
            "label": "DIRK_P700",
            "data_raw": [
              39,
              42,
              49,
              37,
              39,
              42,
              44,
              37,
              39,
              42,
              43,
              38,
              37,
              43,
              41,
              41,
              35,
              38,
              42,
              46,
              37,
              40,
              42,
              45,
              36,
              39,
              41,
              41,
              38,
              38,
              39,
              42,
              46,
              37,
              38,
              42,
              40,
              35,
              40,
              43,
              41,
              36,
              38,
              43,
              43,
              46,
              37,
              35,
              42,
              46,
              35,
              40,
              41,
              43,
              35,
              40,
              43,
              40,
              34,
              41,
              38,
              43,
              47,
              35,
              39,
              42,
              43,
              36,
              40,
              43,
              42,
              35,
              38,
              39,
              42,
              50,
              41,
              38,
              45,
              45,
              37,
              41,
              43,
              41,
              33,
              41,
              44,
              41,
              31,
              35,
              38,
              41,
              46,
              40,
              37,
              43,
              45,
              34,
              39,
              42,
              40,
              35,
              38,
              39,
              40,
              45,
              37,
              39,
              42,
              43,
              35,
              37,
              42,
              45,
              34,
              39,
              38,
              42,
              46,
              37,
              36,
              44,
              47,
              37,
              39,
              41,
              41,
              35,
              35,
              41,
              43,
              35,
              36,
              35,
              43,
              45,
              37,
              41,
              43,
              41,
              34,
              37,
              43,
              40,
              33,
              35,
              38,
              39,
              46,
              40,
              35,
              41,
              45,
              35,
              39,
              41,
              43,
              33,
              37,
              39,
              44,
              47,
              39,
              38,
              40,
              44,
              38,
              37,
              40,
              40,
              36,
              39,
              40,
              42,
              46,
              37,
              40,
              41,
              47,
              37,
              41,
              43,
              41,
              34,
              37,
              43,
              38,
              46,
              38,
              38,
              41,
              47,
              37,
              39,
              43,
              43,
              35,
              40,
              42,
              45,
              35,
              35,
              38,
              45,
              46,
              35,
              39,
              42,
              43,
              33,
              38,
              44,
              41,
              35,
              39,
              37,
              42,
              43,
              34,
              37,
              44,
              45,
              37,
              37,
              42,
              43,
              34,
              37,
              36,
              42,
              47,
              39,
              38,
              42,
              44,
              37,
              39,
              40,
              43,
              36,
              39,
              39,
              42,
              34,
              36,
              38,
              43,
              48,
              35,
              37,
              42,
              45,
              37,
              37,
              43,
              41,
              33,
              39,
              39,
              40,
              48,
              36,
              37,
              43,
              46,
              35,
              36,
              44,
              43,
              33,
              40,
              38,
              42,
              47,
              38,
              39,
              41,
              43,
              36,
              39,
              39,
              42,
              33,
              35,
              41,
              43,
              48,
              37,
              35,
              41,
              46,
              38,
              37,
              42,
              46,
              35,
              41,
              41,
              43,
              35,
              37,
              37,
              42,
              47,
              35,
              36,
              43,
              46,
              38,
              36,
              43,
              44,
              34,
              38,
              43,
              41,
              43,
              37,
              39,
              44,
              46,
              36,
              38,
              41,
              43,
              37,
              39,
              44,
              41,
              33,
              37,
              39,
              41,
              48,
              35,
              37,
              41,
              45,
              36,
              39,
              41,
              43,
              35,
              41,
              38,
              41,
              47,
              37,
              36,
              43,
              43,
              35,
              39,
              42,
              40,
              35,
              36,
              38,
              41,
              49,
              37,
              38,
              42,
              47,
              36,
              42,
              41,
              39,
              35,
              37,
              42,
              43,
              50,
              39,
              37,
              42,
              48,
              33,
              40,
              41,
              44,
              37,
              38,
              41,
              45,
              33,
              35,
              38,
              42,
              44,
              37,
              39,
              41,
              42,
              34,
              40,
              45,
              41,
              37,
              38,
              39,
              40,
              48,
              40,
              37,
              41,
              43,
              36,
              41,
              39,
              41,
              35,
              40,
              41,
              43,
              33,
              34,
              39,
              43,
              45,
              39,
              38,
              41,
              47,
              37,
              38,
              43,
              42,
              34,
              39,
              39,
              43,
              46,
              37,
              37,
              43,
              42,
              35,
              35,
              44,
              43,
              33,
              39,
              39,
              41,
              49,
              40,
              39,
              43,
              44,
              34,
              42,
              41,
              39,
              36,
              36,
              44,
              42,
              48,
              39,
              35,
              44,
              46,
              34,
              39,
              42,
              42,
              35,
              37,
              43,
              43,
              47,
              38,
              36,
              46,
              47,
              37,
              41,
              41,
              45,
              36,
              38,
              43,
              42,
              35,
              38,
              39,
              40,
              46,
              37,
              39,
              41,
              45,
              34,
              38,
              40,
              43,
              35,
              38,
              38,
              42,
              46,
              36,
              38,
              40,
              44,
              39,
              39,
              42,
              43,
              36,
              40,
              38,
              39,
              47,
              36,
              36,
              43,
              44,
              36,
              42,
              43,
              43,
              35,
              38,
              43,
              39,
              48,
              38,
              39,
              43,
              45,
              37,
              40,
              44,
              43,
              37,
              40,
              41,
              40,
              32,
              37,
              38,
              41,
              46,
              37,
              39,
              39,
              44,
              36,
              42,
              42,
              43,
              35,
              34,
              39,
              41,
              49,
              38,
              38,
              42,
              46,
              36,
              41,
              41,
              40,
              37,
              37,
              43,
              40,
              50,
              40,
              39,
              44,
              47,
              36,
              41,
              44,
              41,
              35,
              37,
              41,
              39,
              47,
              37,
              37,
              41,
              47,
              39,
              39,
              43,
              44,
              33,
              39,
              43,
              40,
              34,
              37,
              38,
              42,
              46,
              38,
              36,
              42,
              45,
              37,
              40,
              45,
              42,
              36,
              37,
              38,
              40,
              47,
              36,
              37,
              42,
              45,
              35,
              40,
              39,
              42,
              34,
              37,
              39,
              42,
              46,
              36,
              38,
              41,
              43,
              37,
              38,
              45,
              42,
              34,
              41,
              38,
              43,
              49,
              37,
              40,
              43,
              46,
              37,
              44,
              44,
              40,
              36,
              39,
              39,
              43,
              34,
              37,
              39,
              42,
              48,
              37,
              40,
              41,
              43,
              35,
              40,
              41,
              39,
              35,
              37,
              45,
              42,
              49,
              37,
              37,
              43,
              47,
              36,
              41,
              44,
              42,
              36,
              35,
              37,
              41,
              48,
              39,
              40,
              40,
              44,
              34,
              39,
              43,
              44,
              37,
              35,
              37,
              42,
              49,
              38,
              38,
              42,
              47,
              35,
              42,
              43,
              42,
              36,
              38,
              41,
              42,
              51,
              39,
              37,
              43,
              45,
              39,
              40,
              39,
              44,
              37,
              37,
              42,
              44,
              34,
              40,
              38,
              40,
              45,
              35,
              39,
              42,
              46,
              35,
              38,
              41,
              43,
              36,
              36,
              42,
              41,
              49,
              40,
              36,
              42,
              46,
              38,
              40,
              43,
              43,
              33,
              41,
              41,
              41,
              35,
              37,
              38,
              42,
              45,
              38,
              39,
              42,
              46,
              35,
              39,
              42,
              42,
              37,
              34,
              38,
              43,
              47,
              35,
              37,
              41,
              45,
              37,
              37,
              41,
              41,
              36,
              39,
              37,
              42,
              47,
              34,
              38,
              42,
              43,
              35,
              39,
              43,
              43,
              34,
              38,
              37,
              44,
              49,
              38,
              38,
              39,
              44,
              38,
              38,
              42,
              42,
              37,
              38,
              42,
              40,
              40,
              34,
              36,
              42,
              43,
              35,
              40,
              42,
              45,
              36,
              37,
              41,
              41,
              45,
              36,
              37,
              41,
              44,
              39,
              37,
              41,
              43,
              36,
              38,
              43,
              40,
              37,
              37,
              37,
              40,
              45,
              38,
              39,
              42,
              43,
              34,
              37,
              43,
              41,
              34,
              35,
              40,
              43,
              45,
              38,
              35,
              41,
              46,
              36,
              41,
              41,
              40,
              33,
              37,
              39,
              42,
              48,
              36,
              37,
              43,
              45,
              36,
              40,
              42,
              42,
              32,
              37,
              37,
              44,
              45,
              39,
              38,
              42,
              46,
              36,
              38,
              40,
              43,
              34,
              36,
              37,
              40,
              49,
              37,
              39,
              42,
              42,
              37,
              42,
              43,
              40,
              37,
              39,
              40,
              41,
              36,
              35,
              37,
              41,
              43,
              35,
              38,
              44,
              47,
              35,
              38,
              41,
              41,
              34,
              39,
              37,
              41,
              46,
              36,
              37,
              43,
              47,
              36,
              42,
              45,
              43,
              35,
              38,
              39,
              45,
              47,
              35,
              36,
              41,
              45,
              36,
              40,
              41,
              41,
              36,
              37,
              37,
              42,
              48,
              38,
              38,
              41,
              42,
              35,
              38,
              42,
              43,
              34,
              39,
              38,
              44,
              47,
              39,
              38,
              42,
              45,
              37,
              42,
              43,
              40,
              35,
              35,
              41,
              41,
              44,
              38,
              40,
              41,
              48,
              35,
              42,
              41,
              42,
              35,
              39,
              44,
              41,
              33,
              36,
              37,
              42,
              45,
              37,
              37,
              39,
              45,
              38,
              39,
              41,
              43,
              31,
              39,
              37,
              41,
              47,
              36,
              38,
              45,
              42,
              37,
              37,
              42,
              43,
              35,
              39,
              40,
              42,
              46,
              35,
              37,
              42,
              41,
              37,
              38,
              42,
              44,
              36,
              36,
              38,
              42,
              50,
              38,
              39,
              44,
              47,
              36,
              41,
              40,
              42,
              33,
              39,
              42,
              41,
              38,
              37,
              37,
              40,
              45,
              39,
              38,
              41,
              45,
              36,
              39,
              43,
              43,
              35,
              39,
              37,
              39,
              47,
              36,
              37,
              41,
              44,
              34,
              37,
              39,
              44,
              34,
              40,
              40,
              43,
              46,
              38,
              39,
              41,
              41,
              35,
              37,
              41,
              42,
              34,
              39,
              39,
              41,
              49,
              39,
              39,
              42,
              44,
              37,
              41,
              42,
              40,
              34,
              36,
              38,
              41,
              49,
              40,
              37,
              42,
              47,
              37,
              41,
              42,
              41,
              35,
              38,
              43,
              41,
              43,
              38,
              36,
              44,
              46,
              37,
              42,
              42,
              42,
              35,
              37,
              43,
              42,
              35,
              36,
              36,
              41,
              47,
              39,
              36,
              40,
              46,
              37,
              39,
              44,
              42,
              36,
              37,
              39,
              42,
              45,
              39,
              37,
              39,
              46,
              36,
              39,
              41,
              41,
              33,
              36,
              37,
              45,
              47,
              38,
              37,
              43,
              45,
              36,
              40,
              42,
              41,
              35,
              37,
              37,
              43,
              46,
              35,
              38,
              42,
              45,
              36,
              42,
              42,
              45,
              35,
              35,
              42,
              42,
              48,
              39,
              31,
              39,
              45,
              37,
              39,
              40,
              43,
              35,
              36,
              41,
              39,
              48,
              37,
              38,
              39,
              47,
              35,
              40,
              42,
              43,
              36,
              36,
              42,
              42,
              49,
              39,
              35,
              43,
              46,
              35,
              42,
              41,
              45,
              36,
              38,
              43,
              41,
              36,
              37,
              40,
              43,
              46,
              34,
              37,
              43,
              43,
              37,
              38,
              42,
              38,
              35,
              37,
              38,
              43,
              45,
              36,
              37,
              43,
              45,
              37,
              39,
              42,
              41,
              37,
              37,
              39,
              41,
              45,
              34,
              40,
              41,
              42,
              37,
              38,
              42,
              43,
              35,
              39,
              39,
              42,
              52,
              39,
              38,
              41,
              47,
              35,
              42,
              43,
              40,
              36,
              37,
              41,
              42,
              47,
              36,
              33,
              43,
              46,
              37,
              37,
              42,
              46,
              39,
              38,
              42,
              41,
              36,
              37,
              39,
              42,
              45,
              36,
              37,
              43,
              47,
              37,
              41,
              43,
              42,
              34,
              38,
              39,
              43,
              45,
              38,
              38,
              43,
              45,
              37,
              37,
              42,
              41,
              35,
              37,
              41,
              41,
              47,
              36,
              37,
              40,
              46,
              34,
              39,
              42,
              43,
              35,
              39,
              44,
              43,
              35,
              37,
              38,
              40,
              44,
              35,
              40,
              45,
              42,
              37,
              37,
              44,
              42,
              37,
              39,
              37,
              43,
              45,
              36,
              38,
              41,
              45,
              33,
              39,
              42,
              44,
              34,
              38,
              41,
              39,
              49,
              38,
              40,
              44,
              48,
              36,
              37,
              41,
              42,
              38,
              39,
              44,
              42,
              33,
              35,
              37,
              42,
              45,
              38,
              37,
              44,
              45,
              35,
              37,
              41,
              41,
              33,
              35,
              38,
              42,
              47,
              38,
              39,
              43,
              43,
              35,
              39,
              43,
              40,
              35,
              41,
              37,
              39,
              47,
              37,
              37,
              43,
              41,
              38,
              37,
              42,
              43,
              33,
              38,
              39,
              41,
              49,
              37,
              38,
              41,
              46,
              37,
              38,
              39,
              45,
              34,
              38,
              39,
              42,
              46,
              37,
              39,
              43,
              47,
              37,
              41,
              44,
              40,
              37,
              40,
              43,
              43,
              34,
              35,
              38,
              42,
              49,
              36,
              38,
              43,
              41,
              33,
              37,
              43,
              43,
              35,
              40,
              37,
              39,
              45,
              35,
              39,
              41,
              42,
              36,
              36,
              41,
              43,
              44,
              38,
              37,
              41,
              46,
              38,
              37,
              43,
              41,
              34,
              36,
              42,
              41,
              33,
              35,
              35,
              41,
              44,
              37,
              40,
              39,
              42,
              36,
              38,
              41,
              44,
              34,
              37,
              38,
              42,
              47,
              34,
              37,
              42,
              47,
              35,
              38,
              42,
              45,
              35,
              38,
              37,
              42,
              47,
              37,
              37,
              41,
              40,
              37,
              36,
              43,
              44,
              37,
              35,
              39,
              40,
              49,
              38,
              39,
              42,
              46,
              35,
              41,
              41,
              41,
              34,
              37,
              42,
              43,
              47,
              40,
              38,
              42,
              46,
              35,
              39,
              44,
              42,
              36,
              39,
              42,
              43,
              33,
              37,
              35,
              43,
              45,
              39,
              39,
              44,
              46,
              36,
              39,
              39,
              41,
              35,
              37,
              39,
              42,
              47,
              36,
              38,
              43,
              47,
              38,
              38,
              42,
              43,
              37,
              36,
              39,
              41,
              47,
              37,
              40,
              41,
              43,
              36,
              38,
              43,
              43,
              37,
              41,
              39,
              43,
              50,
              39,
              39,
              42,
              47,
              35,
              41,
              45,
              44,
              37,
              35,
              43,
              43,
              49,
              40,
              35,
              43,
              46,
              33,
              41,
              42,
              42,
              36,
              36,
              42,
              42,
              38,
              36,
              36,
              42,
              49,
              36,
              38,
              39,
              46,
              35,
              40,
              41,
              45,
              32,
              37,
              38,
              43,
              48,
              38,
              42,
              42,
              41
            ]
          },
          {
            "time": 1520723821057,
            "label": "PAM",
            "light_intensity": 8.6,
            "r": 7,
            "g": 3,
            "b": 2,
            "light_intensity_raw": 12,
            "temperature": 27.7,
            "humidity": 19.82,
            "pressure": 988.126,
            "temperature2": 27.72,
            "humidity2": 19.755,
            "pressure2": 987.802,
            "contactless_temp": 26.89,
            "thickness": 0.27,
            "compass_direction": "E",
            "compass": 90,
            "angle": 3.129,
            "angle_direction": "S",
            "pitch": 3.1,
            "roll": 0.4,
            "data_raw": [
              1096,
              30726,
              1126,
              30757,
              1151,
              30733,
              1169,
              30739,
              1175,
              30743,
              1190,
              30783,
              1194,
              30719,
              1202,
              30727,
              1207,
              30751,
              1210,
              30721,
              1218,
              30729,
              1214,
              30734,
              1219,
              30699,
              1218,
              30751,
              1223,
              30723,
              1224,
              30743,
              1221,
              30721,
              1225,
              30703,
              1222,
              30753,
              1228,
              30719,
              1223,
              30768,
              1226,
              30737,
              1228,
              30789,
              1225,
              30751,
              1231,
              30721,
              1227,
              30764,
              1232,
              30726,
              1230,
              30743,
              1230,
              30759,
              1234,
              30761,
              1229,
              30759,
              1236,
              30695,
              1233,
              30753,
              1238,
              30749,
              1237,
              30727,
              1235,
              30751,
              1242,
              30698,
              1239,
              30710,
              1243,
              30742,
              1241,
              30715,
              1242,
              30713,
              1248,
              30734,
              1245,
              30741,
              1250,
              30717,
              1247,
              30707,
              1253,
              30750,
              1253,
              30717,
              1250,
              30741,
              1257,
              30741,
              1251,
              30769,
              1257,
              30732,
              1254,
              30747,
              1255,
              30733,
              1261,
              30694,
              1256,
              30715,
              1263,
              30696,
              1259,
              30704,
              1267,
              30705,
              1262,
              30738,
              1261,
              30719,
              1266,
              30732,
              1263,
              30711,
              1269,
              30717,
              1266,
              30745,
              1268,
              30714,
              1271,
              30703,
              1267,
              30727,
              1272,
              30747,
              1269,
              30728,
              1274,
              30755,
              1273,
              30727,
              1270,
              30689,
              1276,
              30722,
              1272,
              30715,
              1275,
              30721,
              1272,
              30743,
              1276,
              30718,
              1275,
              30778,
              1276,
              30725,
              1279,
              30730,
              1275,
              30749,
              1280,
              30733,
              1275,
              30707,
              1279,
              30725,
              1283,
              30745,
              1278,
              30722,
              1283,
              30744,
              1279,
              30715,
              1282,
              30754,
              1277,
              30713,
              1278,
              30739,
              1283,
              30707,
              1279,
              30715,
              1285,
              30725,
              1281,
              30743,
              1285,
              30731,
              1282,
              30721,
              1281,
              30735,
              1285,
              30735,
              1278,
              30722,
              2017,
              30678,
              2489,
              30671,
              2746,
              30659,
              2899,
              30691,
              2985,
              30640,
              3051,
              30654,
              3090,
              30665,
              3124,
              30635,
              3141,
              30653,
              3167,
              30614,
              3173,
              30643,
              3190,
              30622,
              3194,
              30631,
              3204,
              30613,
              3210,
              30617,
              3216,
              30599,
              3224,
              30629,
              3225,
              30640,
              3236,
              30617,
              3233,
              30611,
              3242,
              30613,
              3239,
              30631,
              3246,
              30634,
              3246,
              30647,
              3253,
              30609,
              3253,
              30648,
              3253,
              30637,
              3258,
              30647,
              3258,
              30609,
              3265,
              30623,
              3262,
              30623,
              3268,
              30631,
              3265,
              30648,
              3271,
              30660,
              3267,
              30655,
              3275,
              30634,
              3270,
              30646,
              3277,
              30659,
              3274,
              30674,
              3279,
              30634,
              3277,
              30623,
              3281,
              30625,
              3279,
              30610,
              3282,
              30651,
              3287,
              30652,
              3283,
              30606,
              3289,
              30637,
              3284,
              30635,
              3291,
              30680,
              3288,
              30667,
              3296,
              30680,
              3290,
              30662,
              3295,
              30652,
              3293,
              30643,
              3298,
              30665,
              3294,
              30687,
              3298,
              30679,
              3301,
              30663,
              3298,
              30647,
              3303,
              30685,
              3298,
              30659,
              3302,
              30660,
              3300,
              30672,
              3303,
              30664,
              3303,
              30707,
              3305,
              30674,
              3302,
              30662,
              3306,
              30653,
              3307,
              30631,
              3303,
              30665,
              3313,
              30679,
              3306,
              30645,
              3311,
              30659,
              3305,
              30660,
              3314,
              30679,
              3309,
              30625,
              3314,
              30670,
              3309,
              30687,
              3317,
              30622,
              3315,
              30656,
              3319,
              30672,
              3318,
              30698,
              3314,
              30663,
              3319,
              30655,
              3314,
              30641,
              3320,
              30619,
              3315,
              30637,
              3323,
              30599,
              3317,
              30675,
              3322,
              30658,
              3317,
              30669,
              3322,
              30651,
              3319,
              30667,
              3323,
              30658,
              3321,
              30667,
              3323,
              30658,
              3325,
              30637,
              3322,
              30625,
              3326,
              30647,
              3321,
              30629,
              3409,
              30673,
              3431,
              30651,
              3442,
              30679,
              3447,
              30668,
              3447,
              30710,
              3454,
              30743,
              3454,
              30657,
              3448,
              30686,
              3451,
              30698,
              3451,
              30701,
              3447,
              30685,
              3447,
              30663,
              3450,
              30741,
              3447,
              30692,
              3447,
              30671,
              3447,
              30696,
              3448,
              30706,
              3441,
              30660,
              3442,
              30719,
              3447,
              30679,
              3448,
              30692,
              3440,
              30613,
              3439,
              30705,
              3445,
              30665,
              3442,
              30653,
              3441,
              30659,
              3440,
              30708,
              3441,
              30671,
              3437,
              30655,
              3433,
              30687,
              3441,
              30688,
              3442,
              30667,
              3435,
              30687,
              3440,
              30665,
              3442,
              30657,
              3438,
              30668,
              3435,
              30692,
              3439,
              30682,
              3438,
              30641,
              3431,
              30658,
              3430,
              30686,
              3434,
              30699,
              3431,
              30687,
              3428,
              30648,
              3435,
              30714,
              3436,
              30659,
              3430,
              30674,
              3433,
              30672,
              3431,
              30631,
              3429,
              30666,
              3429,
              30680,
              3434,
              30681,
              3426,
              30715,
              3427,
              30695,
              3429,
              30667,
              3426,
              30666,
              3423,
              30661,
              3429,
              30663,
              3426,
              30659,
              3424,
              30669,
              3430,
              30689,
              3424,
              30691,
              3419,
              30679,
              3429,
              30654,
              3423,
              30671,
              3420,
              30700,
              3423,
              30675,
              3417,
              30646,
              3423,
              30668,
              3423,
              30638,
              3416,
              30685,
              3422,
              30685,
              3423,
              30647,
              3417,
              30671,
              3419,
              30670,
              3417,
              30619,
              3417,
              30687,
              3419,
              30661,
              3413,
              30664,
              3417,
              30666,
              3411,
              30638,
              3409,
              30675,
              3415,
              30654,
              3408,
              30658,
              3414,
              30695,
              3411,
              30655,
              3408,
              30667,
              3414,
              30687,
              3408,
              30660,
              3412,
              30685,
              3254,
              30703,
              2986,
              30705,
              2777,
              30705,
              2597,
              30711,
              2462,
              30737,
              2346,
              30739,
              2268,
              30728,
              2197,
              30693,
              2149,
              30729,
              2108,
              30739,
              2071,
              30739,
              2047,
              30748,
              2020,
              30701,
              2001,
              30727,
              1981,
              30721,
              1503,
              30592,
              1445,
              30598,
              1417,
              30579,
              1389,
              30636,
              1364,
              30621,
              1348,
              30615,
              1325,
              30629,
              1314,
              30651,
              1297,
              30631,
              1286,
              30623,
              1268,
              30647,
              1261,
              30647,
              1248,
              30639,
              1244,
              30639,
              1229,
              30677,
              1227,
              31037,
              2857,
              30722,
              3066,
              30660,
              3151,
              30617,
              3201,
              30596,
              3215,
              30566,
              3227,
              30599,
              3235,
              30575,
              3231,
              30579,
              3237,
              30556,
              3237,
              30633,
              3235,
              30598,
              3234,
              30569,
              3238,
              30573,
              3237,
              30591,
              3234,
              30572,
              3231,
              30577,
              3235,
              30610,
              3234,
              30603,
              3231,
              30589,
              3231,
              30601,
              3234,
              30611,
              3229,
              30607,
              3227,
              30581,
              3229,
              30617,
              3232,
              30591,
              3227,
              30619,
              3225,
              30636,
              3231,
              30632,
              3231,
              30614,
              3229,
              30602,
              3227,
              30673,
              3229,
              30625,
              3224,
              30579,
              3221,
              30618,
              3229,
              30628,
              3225,
              30637,
              3221,
              30637,
              3229,
              30628,
              3226,
              30641,
              3221,
              30599,
              3224,
              30579,
              3220,
              30627,
              3218,
              30639,
              3220,
              30603,
              3220,
              30635,
              3213,
              30609,
              3219,
              30638,
              3210,
              30627,
              3209,
              30647,
              3213,
              30595,
              3207,
              30599,
              3212,
              30635,
              3215,
              30648,
              3207,
              30656,
              3214,
              30685,
              3206,
              30648,
              3208,
              30640,
              3210,
              30645,
              3206,
              30636,
              3206,
              30625,
              3200,
              30667,
              3200,
              30663,
              3201,
              30613,
              3196,
              30642,
              3199,
              30655,
              3195,
              30655,
              3201,
              30643,
              3193,
              30624,
              3198,
              30662,
              3198,
              30639,
              3191,
              30643,
              3195,
              30640,
              3192,
              30641,
              3199,
              30666,
              3053,
              30683,
              2847,
              30711,
              2668,
              30678,
              2532,
              30712,
              2415,
              30683,
              2331,
              30691,
              2250,
              30687,
              2199,
              30694,
              2147,
              30699,
              2115,
              30675,
              2078,
              30707,
              2054,
              30703,
              2025,
              30684,
              2006,
              30683,
              1991,
              30704
            ]
          },
          {
            "time": 1520723828251,
            "label": "SPAD",
            "detector_read1": 10098,
            "detector_read2": 4815,
            "light_intensity": 10.44,
            "r": 12,
            "g": 4,
            "b": 3,
            "light_intensity_raw": 18,
            "w": 1414,
            "temperature": 27.71,
            "humidity": 19.82,
            "pressure": 988.135,
            "temperature2": 27.74,
            "humidity2": 19.755,
            "pressure2": 987.787,
            "contactless_temp": 26.89,
            "thickness": 0.26,
            "compass_direction": "E",
            "compass": 90,
            "angle": 3.129,
            "angle_direction": "S",
            "pitch": 3.1,
            "roll": 0.4,
            "recall": {
              "time": 1520723828536,
              "colorcal_blank1[1]": 17891.5,
              "colorcal_blank1[2]": 21962.5,
              "colorcal_blank1[3]": 27542,
              "colorcal_blank1[4]": 33408.5,
              "colorcal_blank1[6]": 30341.5,
              "colorcal_blank1[8]": 26875.5,
              "colorcal_blank1[9]": 29798,
              "colorcal_blank1[10]": 34628,
              "colorcal_blank2[1]": 19665,
              "colorcal_blank2[2]": 15524,
              "colorcal_blank2[3]": 20453.5,
              "colorcal_blank2[4]": 18388,
              "colorcal_blank2[6]": 16258.5,
              "colorcal_blank2[8]": 17607,
              "colorcal_blank2[9]": 18495.5,
              "colorcal_blank2[10]": 16675.5,
              "colorcal_blank3[1]": 16958.5,
              "colorcal_blank3[2]": 8129,
              "colorcal_blank3[3]": 17428,
              "colorcal_blank3[4]": 13217.5,
              "colorcal_blank3[6]": 5768,
              "colorcal_blank3[8]": 6438.5,
              "colorcal_blank3[9]": 5431.5,
              "colorcal_blank3[10]": 6048.5,
              "colorcal_intensity1_slope[2]": 2.501,
              "colorcal_intensity1_yint[2]": 4.9,
              "colorcal_intensity2_slope[2]": 2.423,
              "colorcal_intensity2_yint[2]": 2.7,
              "colorcal_intensity3_slope[2]": 2.584,
              "colorcal_intensity3_yint[2]": -18.1,
              "ir_baseline_slope[5]": 10029,
              "ir_baseline_yint[5]": 15028,
              "ir_baseline_slope[3]": 552.5,
              "ir_baseline_yint[3]": 750.5
            },
            "data_raw": [
              1630,
              1450,
              1443,
              1455,
              1446,
              1450,
              1447,
              1459,
              1451,
              1445,
              226,
              291,
              291,
              291,
              290,
              287,
              285,
              288,
              291,
              291,
              2627,
              1197,
              1187,
              1187,
              1188,
              1189,
              1189,
              1186,
              1183,
              1185,
              479,
              66,
              58,
              59,
              55,
              53,
              56,
              60,
              58,
              57,
              47467,
              11818,
              11519,
              11501,
              11490,
              11482,
              11471,
              11473,
              11469,
              11469,
              11724,
              12236,
              12228,
              12221,
              12227,
              12219,
              12229,
              12216,
              12212,
              12218,
              22989,
              13533,
              13443,
              13431,
              13429,
              13423,
              13421,
              13421,
              13428,
              13425,
              22641,
              14703,
              14629,
              14621,
              14623,
              14618,
              14616,
              14609,
              14610,
              14606,
              10993,
              14584,
              14601,
              14611,
              14609,
              14613,
              14612,
              14621,
              14623,
              14609,
              1118,
              1855,
              1861,
              1862,
              1865,
              1861,
              1862,
              1860,
              1864,
              1863,
              6279,
              9030,
              9041,
              9041,
              9041,
              9046,
              9047,
              9048,
              9043,
              9041,
              301,
              432,
              431,
              433,
              427,
              425,
              427,
              429,
              432,
              433,
              32559,
              47093,
              47192,
              47209,
              47219,
              47223,
              47228,
              47222,
              47217,
              47222,
              36847,
              53157,
              53282,
              53291,
              53286,
              53280,
              53294,
              53287,
              53297,
              53283,
              32741,
              47543,
              47654,
              47657,
              47655,
              47659,
              47664,
              47663,
              47669,
              47657,
              28564,
              49106,
              49224,
              49221,
              49214,
              49205,
              49193,
              49191,
              49184,
              49182,
              43185,
              61341,
              61413,
              61415,
              61425,
              61417,
              61413,
              61407,
              61403,
              61408,
              3036,
              4102,
              4109,
              4110,
              4114,
              4117,
              4117,
              4117,
              4116,
              4115,
              26785,
              45597,
              45706,
              45694,
              45684,
              45675,
              45670,
              45668,
              45659,
              45649,
              1021,
              1651,
              1659,
              1659,
              1660,
              1655,
              1653,
              1655,
              1654,
              1657,
              47223,
              47218,
              47218,
              47229,
              47223,
              47225,
              47230,
              47219,
              47219,
              47219,
              53301,
              53287,
              53287,
              53265,
              53279,
              53287,
              53285,
              53287,
              53293,
              53285,
              47680,
              47685,
              47686,
              47686,
              47680,
              47682,
              47681,
              47681,
              47686,
              47683,
              49241,
              49223,
              49213,
              49200,
              49194,
              49185,
              49171,
              49167,
              49165,
              49158
            ]
          }
        ],
        "data_raw": [

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

David M. Kramer


Protocol connections:
1
Latest Update:
Mar 2018