Chl Fl 0-500 umol JRP v1.0


Chl fl routine from leaf photosynthesis multispeQ v1.0 at 0, 50, 100, 250, 500 umol PAR
// CALCULATIONS FOR PROTON MOTIVE FORCE VIA ECS PORTION OF THE TRACE
//----------------------------

var output = {};
var spad;
var data = json.data_raw;
var vhplus;
var tau;
var ECSt;
var quality_flag = 0;
var i = 0;
var j = 0;
var h = 0;
var k = 0;
var smooth1 = data.slice(300,600);
var smooth0 = data.slice(300,600);

///*

// CALCULATIONS FOR PHI2 PORTION OF THE TRACE
//----------------------------

// calculate the ir baseline for LED 3 which is used as the measuring light.  This subtract IR generated by the LED from the IR generated by the plant
//----------------------------
var sample_cal = json.detector_read1;

//var shinyness = (sample_cal-json.recall["ir_baseline_yint[5]"])/json.recall["ir_baseline_slope[5]"]; // where 0 is dull black electrical tape, and 1 is shiny aluminum
//var baseline = json.recall["ir_baseline_slope[3]"]*shinyness+json.recall["ir_baseline_yint[3]"];

//if (!baseline || !json.recall["ir_baseline_yint[5]"] || sample_cal == 65535) {						// if it hasn't been calibrated or there's an error or it's maxed, set baseline == 0
 // baseline = 0;
//}
baseline = 0;

/*
output["shinyness"] = shinyness;
output["baseline"] = baseline;
output["recall led slope"] = json.recall["ir_baseline_slope[3]"];
output["recall led yint"] = json.recall["ir_baseline_yint[3]"];
output["recall cal slope"] = json.recall["ir_baseline_slope[5]"];
output["recall cal yint"] = json.recall["ir_baseline_yint[5]"];
output["sample led"] = json.detector_read1;
*/

//var sample_cal = MathMEAN(data.slice(2,18));

var inverse_intensity = [1/4500,1/4050,1/3600,1/3150];

//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
//        ps2_0  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_0_start = 0; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_0_Prime, 3 Fm_0_Prime steps, and Fs_0 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_0 = MathMEAN(data.slice(ps2_0_start + 1,ps2_0_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_0_std = MathSTDEV(data.slice(ps2_0_start + 1,ps2_0_start + 4)); // create standard deviation for this value for error checking

var sat_0_vals = data.slice(ps2_0_start + 25,ps2_0_start + 48).sort();  // sort the saturating light values from low to high
var A0FmP = MathMEAN(sat_0_vals.slice(2,20)) - baseline; // take the 18 largest values and average them
var A0FmP_std = MathSTDEV(sat_0_vals); // create standard deviation for this value for error checkingjson.data_raw.slice(953,955)

sat_0_vals = data.slice(ps2_0_start + 84,ps2_0_start + 110).sort();  // sort the saturating light values from low to high
var Fm_0_P_end = MathMEAN(sat_0_vals.slice(2,23)) - baseline; // take the 21 largest values and average them
var Fm_0_P_end_std = MathSTDEV(sat_0_vals); // create standard deviation for this value for error checking

sat_0_vals = data.slice(ps2_0_start + 52,ps2_0_start + 60).sort();  // sort the saturating light values from low to high
var Fm_0_P_step1 = MathMEAN(sat_0_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_0_P_step1_std = MathSTDEV(sat_0_vals); // create standard deviation for this value for error checking

sat_0_vals = data.slice(ps2_0_start + 62,ps2_0_start + 70).sort();  // sort the saturating light values from low to high
var Fm_0_P_step2 = MathMEAN(sat_0_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_0_P_step2_std = MathSTDEV(sat_0_vals); // create standard deviation for this value for error checking

sat_0_vals = data.slice(ps2_0_start + 72,ps2_0_start + 80).sort();  // sort the saturating light values from low to high
var Fm_0_P_step3 = MathMEAN(sat_0_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_0_P_step3_std = MathSTDEV(sat_0_vals); // create standard deviation for this value for error checking

// Calculations for F0'
// ----------------------------
var Fo_0_Prime_0_values = json.data_raw.slice(ps2_0_start + 160,ps2_0_start + 270).sort();
var Fo_0_Prime = MathMEAN(Fo_0_Prime_0_values.slice(5,10)) - baseline;
var Fo_0_Prime_std = MathSTDEV(Fo_0_Prime_0_values); // create standard deviation for this value for error checking

// Calculations for corrected Fm_0_Prime using multi-phase flash
// ----------------------------
var reg_0 = MathLINREG(inverse_intensity, [A0FmP,Fm_0_P_step1,Fm_0_P_step2,Fm_0_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_0_fm_noMPF = (A0FmP-Fs_0)/A0FmP;
var fv_0_fm_MPF = (reg_0.b-Fs_0)/reg_0.b;


// Calculate NPQt,PhiNPQ_0, PhiNO_0, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_0_MPF = (4.88 / ((reg_0.b / Fo_0_Prime) -1) )-1;
var npqt_0_noMPF = (4.88 / ((A0FmP / Fo_0_Prime) -1) )-1;
var qL_0_MPF = ((reg_0.b - Fs_0)*Fo_0_Prime)/((reg_0.b-Fo_0_Prime)*Fs_0);
var qL_0_noMPF = ((A0FmP - Fs_0)*Fo_0_Prime)/((A0FmP-Fo_0_Prime)*Fs_0);
var PhiNO_0_MPF = 1/(npqt_0_MPF + 1 + qL_0_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_0_noMPF = 1/(npqt_0_noMPF + 1 + qL_0_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_0_MPF = 1-fv_0_fm_MPF-PhiNO_0_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_0_noMPF = 1-fv_0_fm_noMPF-PhiNO_0_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_0_MPF = (reg_0.b - Fs_0)/(reg_0.b - Fo_0_Prime);
var qP_0_noMPF = (Fm_0_Prime - Fs_0)/(Fm_0_Prime - Fo_0_Prime);
var FvP_Fm_0_P_MPF = (reg_0.b-Fo_0_Prime)/reg_0.b;
var FvP_Fm_0_P_noMPF = (A0FmP-Fo_0_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_0_fm = fv_0_fm_MPF;
var npqt_0  = npqt_0_MPF;
var PhiNO_0 = PhiNO_0_MPF;
var PhiNPQ_0 = PhiNPQ_0_MPF;
var qL_0 = qL_0_MPF;
var Fm_0_Prime = reg_0.b;
var qP_0 = qP_0_MPF;
var FvP_Fm_0_P = FvP_Fm_0_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;


//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
//        ps2_50  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_50_start = 280; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_50_Prime, 3 Fm_50_Prime steps, and Fs_50 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_50 = MathMEAN(data.slice(ps2_50_start + 1,ps2_50_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_50_std = MathSTDEV(data.slice(ps2_50_start + 1,ps2_50_start + 4)); // create standard deviation for this value for error checking

var sat_50_vals = data.slice(ps2_50_start + 25,ps2_50_start + 48).sort();  // sort the saturating light values from low to high
var A0FmP = MathMEAN(sat_50_vals.slice(2,20)) - baseline; // take the 18 largest values and average them
var A0FmP_std = MathSTDEV(sat_50_vals); // create standard deviation for this value for error checkingjson.data_raw.slice(953,955)

sat_50_vals = data.slice(ps2_50_start + 84,ps2_50_start + 110).sort();  // sort the saturating light values from low to high
var Fm_50_P_end = MathMEAN(sat_50_vals.slice(2,23)) - baseline; // take the 21 largest values and average them
var Fm_50_P_end_std = MathSTDEV(sat_50_vals); // create standard deviation for this value for error checking

sat_50_vals = data.slice(ps2_50_start + 52,ps2_50_start + 60).sort();  // sort the saturating light values from low to high
var Fm_50_P_step1 = MathMEAN(sat_50_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_50_P_step1_std = MathSTDEV(sat_50_vals); // create standard deviation for this value for error checking

sat_50_vals = data.slice(ps2_50_start + 62,ps2_50_start + 70).sort();  // sort the saturating light values from low to high
var Fm_50_P_step2 = MathMEAN(sat_50_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_50_P_step2_std = MathSTDEV(sat_50_vals); // create standard deviation for this value for error checking

sat_50_vals = data.slice(ps2_50_start + 72,ps2_50_start + 80).sort();  // sort the saturating light values from low to high
var Fm_50_P_step3 = MathMEAN(sat_50_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_50_P_step3_std = MathSTDEV(sat_50_vals); // create standard deviation for this value for error checking

// Calculations for F0'
// ----------------------------
var Fo_50_Prime_50_values = json.data_raw.slice(ps2_50_start + 160,ps2_50_start + 270).sort();
var Fo_50_Prime = MathMEAN(Fo_50_Prime_50_values.slice(5,10)) - baseline;
var Fo_50_Prime_std = MathSTDEV(Fo_50_Prime_50_values); // create standard deviation for this value for error checking

// Calculations for corrected Fm_50_Prime using multi-phase flash
// ----------------------------
var reg_50 = MathLINREG(inverse_intensity, [A0FmP,Fm_50_P_step1,Fm_50_P_step2,Fm_50_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_50_fm_noMPF = (A0FmP-Fs_50)/A0FmP;
var fv_50_fm_MPF = (reg_50.b-Fs_50)/reg_50.b;


// Calculate NPQt,PhiNPQ_50, PhiNO_50, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_50_MPF = (4.88 / ((reg_50.b / Fo_50_Prime) -1) )-1;
var npqt_50_noMPF = (4.88 / ((A0FmP / Fo_50_Prime) -1) )-1;
var qL_50_MPF = ((reg_50.b - Fs_50)*Fo_50_Prime)/((reg_50.b-Fo_50_Prime)*Fs_50);
var qL_50_noMPF = ((A0FmP - Fs_50)*Fo_50_Prime)/((A0FmP-Fo_50_Prime)*Fs_50);
var PhiNO_50_MPF = 1/(npqt_50_MPF + 1 + qL_50_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_50_noMPF = 1/(npqt_50_noMPF + 1 + qL_50_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_50_MPF = 1-fv_50_fm_MPF-PhiNO_50_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_50_noMPF = 1-fv_50_fm_noMPF-PhiNO_50_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_50_MPF = (reg_50.b - Fs_50)/(reg_50.b - Fo_50_Prime);
var qP_50_noMPF = (Fm_50_Prime - Fs_50)/(Fm_50_Prime - Fo_50_Prime);
var FvP_Fm_50_P_MPF = (reg_50.b-Fo_50_Prime)/reg_50.b;
var FvP_Fm_50_P_noMPF = (A0FmP-Fo_50_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_50_fm = fv_50_fm_MPF;
var npqt_50  = npqt_50_MPF;
var PhiNO_50 = PhiNO_50_MPF;
var PhiNPQ_50 = PhiNPQ_50_MPF;
var qL_50 = qL_50_MPF;
var Fm_50_Prime = reg_50.b;
var qP_50 = qP_50_MPF;
var FvP_Fm_50_P = FvP_Fm_50_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
//        ps2_100  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_100_start = 560; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_100_Prime, 3 Fm_100_Prime steps, and Fs_100 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_100 = MathMEAN(data.slice(ps2_100_start + 1,ps2_100_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_100_std = MathSTDEV(data.slice(ps2_100_start + 1,ps2_100_start + 4)); // create standard deviation for this value for error checking

var sat_100_vals = data.slice(ps2_100_start + 25,ps2_100_start + 48).sort();  // sort the saturating light values from low to high
var A0FmP = MathMEAN(sat_100_vals.slice(2,20)) - baseline; // take the 18 largest values and average them
var A0FmP_std = MathSTDEV(sat_100_vals); // create standard deviation for this value for error checkingjson.data_raw.slice(953,955)

sat_100_vals = data.slice(ps2_100_start + 84,ps2_100_start + 110).sort();  // sort the saturating light values from low to high
var Fm_100_P_end = MathMEAN(sat_100_vals.slice(2,23)) - baseline; // take the 21 largest values and average them
var Fm_100_P_end_std = MathSTDEV(sat_100_vals); // create standard deviation for this value for error checking

sat_100_vals = data.slice(ps2_100_start + 52,ps2_100_start + 60).sort();  // sort the saturating light values from low to high
var Fm_100_P_step1 = MathMEAN(sat_100_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_100_P_step1_std = MathSTDEV(sat_100_vals); // create standard deviation for this value for error checking

sat_100_vals = data.slice(ps2_100_start + 62,ps2_100_start + 70).sort();  // sort the saturating light values from low to high
var Fm_100_P_step2 = MathMEAN(sat_100_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_100_P_step2_std = MathSTDEV(sat_100_vals); // create standard deviation for this value for error checking

sat_100_vals = data.slice(ps2_100_start + 72,ps2_100_start + 80).sort();  // sort the saturating light values from low to high
var Fm_100_P_step3 = MathMEAN(sat_100_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_100_P_step3_std = MathSTDEV(sat_100_vals); // create standard deviation for this value for error checking

// Calculations for F0'
// ----------------------------
var Fo_100_Prime_100_values = json.data_raw.slice(ps2_100_start + 160,ps2_100_start + 270).sort();
var Fo_100_Prime = MathMEAN(Fo_100_Prime_100_values.slice(5,10)) - baseline;
var Fo_100_Prime_std = MathSTDEV(Fo_100_Prime_100_values); // create standard deviation for this value for error checking

// Calculations for corrected Fm_100_Prime using multi-phase flash
// ----------------------------
var reg_100 = MathLINREG(inverse_intensity, [A0FmP,Fm_100_P_step1,Fm_100_P_step2,Fm_100_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_100_fm_noMPF = (A0FmP-Fs_100)/A0FmP;
var fv_100_fm_MPF = (reg_100.b-Fs_100)/reg_100.b;


// Calculate NPQt,PhiNPQ_100, PhiNO_100, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_100_MPF = (4.88 / ((reg_100.b / Fo_100_Prime) -1) )-1;
var npqt_100_noMPF = (4.88 / ((A0FmP / Fo_100_Prime) -1) )-1;
var qL_100_MPF = ((reg_100.b - Fs_100)*Fo_100_Prime)/((reg_100.b-Fo_100_Prime)*Fs_100);
var qL_100_noMPF = ((A0FmP - Fs_100)*Fo_100_Prime)/((A0FmP-Fo_100_Prime)*Fs_100);
var PhiNO_100_MPF = 1/(npqt_100_MPF + 1 + qL_100_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_100_noMPF = 1/(npqt_100_noMPF + 1 + qL_100_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_100_MPF = 1-fv_100_fm_MPF-PhiNO_100_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_100_noMPF = 1-fv_100_fm_noMPF-PhiNO_100_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_100_MPF = (reg_100.b - Fs_100)/(reg_100.b - Fo_100_Prime);
var qP_100_noMPF = (Fm_100_Prime - Fs_100)/(Fm_100_Prime - Fo_100_Prime);
var FvP_Fm_100_P_MPF = (reg_100.b-Fo_100_Prime)/reg_100.b;
var FvP_Fm_100_P_noMPF = (A0FmP-Fo_100_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_100_fm = fv_100_fm_MPF;
var npqt_100  = npqt_100_MPF;
var PhiNO_100 = PhiNO_100_MPF;
var PhiNPQ_100 = PhiNPQ_100_MPF;
var qL_100 = qL_100_MPF;
var Fm_100_Prime = reg_100.b;
var qP_100 = qP_100_MPF;
var FvP_Fm_100_P = FvP_Fm_100_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
//        ps2_250  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_250_start = 840; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_250_Prime, 3 Fm_250_Prime steps, and Fs_250 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_250 = MathMEAN(data.slice(ps2_250_start + 1,ps2_250_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_250_std = MathSTDEV(data.slice(ps2_250_start + 1,ps2_250_start + 4)); // create standard deviation for this value for error checking

var sat_250_vals = data.slice(ps2_250_start + 25,ps2_250_start + 48).sort();  // sort the saturating light values from low to high
var A0FmP = MathMEAN(sat_250_vals.slice(2,20)) - baseline; // take the 18 largest values and average them
var A0FmP_std = MathSTDEV(sat_250_vals); // create standard deviation for this value for error checkingjson.data_raw.slice(953,955)

sat_250_vals = data.slice(ps2_250_start + 84,ps2_250_start + 110).sort();  // sort the saturating light values from low to high
var Fm_250_P_end = MathMEAN(sat_250_vals.slice(2,23)) - baseline; // take the 21 largest values and average them
var Fm_250_P_end_std = MathSTDEV(sat_250_vals); // create standard deviation for this value for error checking

sat_250_vals = data.slice(ps2_250_start + 52,ps2_250_start + 60).sort();  // sort the saturating light values from low to high
var Fm_250_P_step1 = MathMEAN(sat_250_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_250_P_step1_std = MathSTDEV(sat_250_vals); // create standard deviation for this value for error checking

sat_250_vals = data.slice(ps2_250_start + 62,ps2_250_start + 70).sort();  // sort the saturating light values from low to high
var Fm_250_P_step2 = MathMEAN(sat_250_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_250_P_step2_std = MathSTDEV(sat_250_vals); // create standard deviation for this value for error checking

sat_250_vals = data.slice(ps2_250_start + 72,ps2_250_start + 80).sort();  // sort the saturating light values from low to high
var Fm_250_P_step3 = MathMEAN(sat_250_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_250_P_step3_std = MathSTDEV(sat_250_vals); // create standard deviation for this value for error checking

// Calculations for F0'
// ----------------------------
var Fo_250_Prime_250_values = json.data_raw.slice(ps2_250_start + 160,ps2_250_start + 270).sort();
var Fo_250_Prime = MathMEAN(Fo_250_Prime_250_values.slice(5,10)) - baseline;
var Fo_250_Prime_std = MathSTDEV(Fo_250_Prime_250_values); // create standard deviation for this value for error checking

// Calculations for corrected Fm_250_Prime using multi-phase flash
// ----------------------------
var reg_250 = MathLINREG(inverse_intensity, [A0FmP,Fm_250_P_step1,Fm_250_P_step2,Fm_250_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_250_fm_noMPF = (A0FmP-Fs_250)/A0FmP;
var fv_250_fm_MPF = (reg_250.b-Fs_250)/reg_250.b;


// Calculate NPQt,PhiNPQ_250, PhiNO_250, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_250_MPF = (4.88 / ((reg_250.b / Fo_250_Prime) -1) )-1;
var npqt_250_noMPF = (4.88 / ((A0FmP / Fo_250_Prime) -1) )-1;
var qL_250_MPF = ((reg_250.b - Fs_250)*Fo_250_Prime)/((reg_250.b-Fo_250_Prime)*Fs_250);
var qL_250_noMPF = ((A0FmP - Fs_250)*Fo_250_Prime)/((A0FmP-Fo_250_Prime)*Fs_250);
var PhiNO_250_MPF = 1/(npqt_250_MPF + 1 + qL_250_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_250_noMPF = 1/(npqt_250_noMPF + 1 + qL_250_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_250_MPF = 1-fv_250_fm_MPF-PhiNO_250_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_250_noMPF = 1-fv_250_fm_noMPF-PhiNO_250_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_250_MPF = (reg_250.b - Fs_250)/(reg_250.b - Fo_250_Prime);
var qP_250_noMPF = (Fm_250_Prime - Fs_250)/(Fm_250_Prime - Fo_250_Prime);
var FvP_Fm_250_P_MPF = (reg_250.b-Fo_250_Prime)/reg_250.b;
var FvP_Fm_250_P_noMPF = (A0FmP-Fo_250_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_250_fm = fv_250_fm_MPF;
var npqt_250  = npqt_250_MPF;
var PhiNO_250 = PhiNO_250_MPF;
var PhiNPQ_250 = PhiNPQ_250_MPF;
var qL_250 = qL_250_MPF;
var Fm_250_Prime = reg_250.b;
var qP_250 = qP_250_MPF;
var FvP_Fm_250_P = FvP_Fm_250_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
//        ps2_500  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_500_start = 1120; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_500_Prime, 3 Fm_500_Prime steps, and Fs_500 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_500 = MathMEAN(data.slice(ps2_500_start + 1,ps2_500_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_500_std = MathSTDEV(data.slice(ps2_500_start + 1,ps2_500_start + 4)); // create standard deviation for this value for error checking

var sat_500_vals = data.slice(ps2_500_start + 25,ps2_500_start + 48).sort();  // sort the saturating light values from low to high
var A0FmP = MathMEAN(sat_500_vals.slice(2,20)) - baseline; // take the 18 largest values and average them
var A0FmP_std = MathSTDEV(sat_500_vals); // create standard deviation for this value for error checkingjson.data_raw.slice(953,955)

sat_500_vals = data.slice(ps2_500_start + 84,ps2_500_start + 110).sort();  // sort the saturating light values from low to high
var Fm_500_P_end = MathMEAN(sat_500_vals.slice(2,23)) - baseline; // take the 21 largest values and average them
var Fm_500_P_end_std = MathSTDEV(sat_500_vals); // create standard deviation for this value for error checking

sat_500_vals = data.slice(ps2_500_start + 52,ps2_500_start + 60).sort();  // sort the saturating light values from low to high
var Fm_500_P_step1 = MathMEAN(sat_500_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_500_P_step1_std = MathSTDEV(sat_500_vals); // create standard deviation for this value for error checking

sat_500_vals = data.slice(ps2_500_start + 62,ps2_500_start + 70).sort();  // sort the saturating light values from low to high
var Fm_500_P_step2 = MathMEAN(sat_500_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_500_P_step2_std = MathSTDEV(sat_500_vals); // create standard deviation for this value for error checking

sat_500_vals = data.slice(ps2_500_start + 72,ps2_500_start + 80).sort();  // sort the saturating light values from low to high
var Fm_500_P_step3 = MathMEAN(sat_500_vals.slice(2,6)) - baseline; // take the 4 largest values and average them
var Fm_500_P_step3_std = MathSTDEV(sat_500_vals); // create standard deviation for this value for error checking

// Calculations for F0'
// ----------------------------
var Fo_500_Prime_500_values = json.data_raw.slice(ps2_500_start + 160,ps2_500_start + 270).sort();
var Fo_500_Prime = MathMEAN(Fo_500_Prime_500_values.slice(5,10)) - baseline;
var Fo_500_Prime_std = MathSTDEV(Fo_500_Prime_500_values); // create standard deviation for this value for error checking

// Calculations for corrected Fm_500_Prime using multi-phase flash
// ----------------------------
var reg_500 = MathLINREG(inverse_intensity, [A0FmP,Fm_500_P_step1,Fm_500_P_step2,Fm_500_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_500_fm_noMPF = (A0FmP-Fs_500)/A0FmP;
var fv_500_fm_MPF = (reg_500.b-Fs_500)/reg_500.b;


// Calculate NPQt,PhiNPQ_500, PhiNO_500, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_500_MPF = (4.88 / ((reg_500.b / Fo_500_Prime) -1) )-1;
var npqt_500_noMPF = (4.88 / ((A0FmP / Fo_500_Prime) -1) )-1;
var qL_500_MPF = ((reg_500.b - Fs_500)*Fo_500_Prime)/((reg_500.b-Fo_500_Prime)*Fs_500);
var qL_500_noMPF = ((A0FmP - Fs_500)*Fo_500_Prime)/((A0FmP-Fo_500_Prime)*Fs_500);
var PhiNO_500_MPF = 1/(npqt_500_MPF + 1 + qL_500_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_500_noMPF = 1/(npqt_500_noMPF + 1 + qL_500_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_500_MPF = 1-fv_500_fm_MPF-PhiNO_500_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_500_noMPF = 1-fv_500_fm_noMPF-PhiNO_500_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_500_MPF = (reg_500.b - Fs_500)/(reg_500.b - Fo_500_Prime);
var qP_500_noMPF = (Fm_500_Prime - Fs_500)/(Fm_500_Prime - Fo_500_Prime);
var FvP_Fm_500_P_MPF = (reg_500.b-Fo_500_Prime)/reg_500.b;
var FvP_Fm_500_P_noMPF = (A0FmP-Fo_500_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_500_fm = fv_500_fm_MPF;
var npqt_500  = npqt_500_MPF;
var PhiNO_500 = PhiNO_500_MPF;
var PhiNPQ_500 = PhiNPQ_500_MPF;
var qL_500 = qL_500_MPF;
var Fm_500_Prime = reg_500.b;
var qP_500 = qP_500_MPF;
var FvP_Fm_500_P = FvP_Fm_500_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;































/****************OUTPUT VALUES FROM MACRO *******************/

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ_0, PhiNO_0... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
if (reg_0.m > 0) {
  fv_0_fm = fv_0_fm_noMPF;
  npqt_0 = npqt_0_noMPF;
  PhiNO_0 = PhiNO_0_noMPF;
  PhiNPQ_0 = PhiNPQ_0_noMPF;
  qL_0 = qL_0_noMPF;
  Fm_0_Prime = A0FmP;
  qP = qP_0_noMPF;
  FvP_Fm_0_P = fv_0_fm_noMPF;
  
  if (fv_0_fm <= 0) {
    output["Phi2_0"] 			= 0;
	warning('Phi2_0 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_0_noMPF"] 	= MathROUND(npqt_0,3);
  }
  if (fv_0_fm >=.85) {
    output["Phi2_0"] 			= -1;
	danger("Phi2_0 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_0"] 		= MathROUND(fv_0_fm,3);
  }
  
  if (npqt_0 <= 0) {
	output["PhiNPQ_0"]		= 0;
    output["NPQt_0"]			= 0;
	warning("NPQt_) is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_0_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_0_noMPF"]  = MathROUND(PhiNPQ_0,3);
	output["npqt_0_noMPF"]	= MathROUND(npqt_0,3);
  }
  else {
	output["PhiNPQ_0"]  = MathROUND(PhiNPQ_0,3);
	output["NPQt_0"]		= MathROUND(npqt_0,3);
  }
	output["PhiNO_0"]		= MathROUND(PhiNO_0,3);
	output["qL_0"]		= MathROUND(qL_0,3);
    output['FvP/Fm_0_P']		= MathROUND(FvP_Fm_0_P,3);
    output['qP_0']			= MathROUND(qP_0,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_0... 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 (fv_0_fm <= 0) {
    output["Phi2_0"] 			= 0;
	warning("Phi2_0 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_0_MPF"] 	= MathROUND(npqt_0,3);
  }
  if (fv_0_fm >=.85) {
    output["Phi2_0"] 			= -1;
	danger("Phi2_0 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_0"]			= MathROUND(fv_0_fm,3);
  }
  if (npqt_0 <= 0) {
	output["PhiNPQ_0"]		= 0;
    output["NPQt_0"]			= 0;
	warning("NPQt_0 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_0_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_0_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_0_MPF"]		= MathROUND(npqt_0,3);
  }
  else {
	output["PhiNPQ_0"]  = MathROUND(PhiNPQ_0,3);
	output["NPQt_0"]		= MathROUND(npqt_0,3);
  }
	output["PhiNO_0"]		= MathROUND(PhiNO_0,3);
	output["qL_0"]			= MathROUND(qL_0,3);
    output['FvP/Fm_0_P']		= MathROUND(FvP_Fm_0_P,3);
    output['qP_0']			= MathROUND(qP_0,3);
}

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

if (Fs_0_std > 100) {
	danger("noisy Fs_0", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_0_Prime", output);
}
*/
if (Fm_0_P_step1_std > 120 | Fm_0_P_step2_std > 120 | Fm_0_P_step3_std > 120 | Fm_0_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_0_Prime_std > 150) {
	danger("noisy Fo_0_Prime", output);
}
/*
if (reg_0.m > 0) {
	info("Used Phi2_0 and not Phi2_0 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_0_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_0_Prime slopes down.  This may mean that saturating flash is not bright enough... consider using a protocol with lower saturating light on these samples", output);
}
if (Fm_0_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_0_Prime slopes up.  This may mean that saturating flash is too bright... consider using a protocol with higher saturating light on these samples",output);
}
*/




/****************OUTPUT VALUES FROM MACRO fro 100umol*******************/

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ_50, PhiNO_50... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
if (reg_50.m > 0) {
  fv_50_fm = fv_50_fm_noMPF;
  npqt_50 = npqt_50_noMPF;
  PhiNO_50 = PhiNO_50_noMPF;
  PhiNPQ_50 = PhiNPQ_50_noMPF;
  qL_50 = qL_50_noMPF;
  Fm_50_Prime = A0FmP;
  qP = qP_50_noMPF;
  FvP_Fm_50_P = fv_50_fm_noMPF;
  
  if (fv_50_fm <= 0) {
    output["Phi2_50"] 			= 0;
	warning('Phi2_50 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_50_noMPF"] 	= MathROUND(npqt_50,3);
  }
  if (fv_50_fm >=.85) {
    output["Phi2_50"] 			= -1;
	danger("Phi2_50 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_50"] 		= MathROUND(fv_50_fm,3);
  }
  
  if (npqt_50 <= 0) {
	output["PhiNPQ_50"]		= 0;
    output["NPQt_50"]			= 0;
	warning("NPQt_) is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_50_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_50_noMPF"]  = MathROUND(PhiNPQ_50,3);
	output["npqt_50_noMPF"]	= MathROUND(npqt_50,3);
  }
  else {
	output["PhiNPQ_50"]  = MathROUND(PhiNPQ_50,3);
	output["NPQt_50"]		= MathROUND(npqt_50,3);
  }
	output["PhiNO_50"]		= MathROUND(PhiNO_50,3);
	output["qL_50"]		= MathROUND(qL_50,3);
    output['FvP/Fm_50_P']		= MathROUND(FvP_Fm_50_P,3);
    output['qP_50']			= MathROUND(qP_50,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_50... 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 (fv_50_fm <= 0) {
    output["Phi2_50"] 			= 0;
	warning("Phi2_50 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_50_MPF"] 	= MathROUND(npqt_50,3);
  }
  if (fv_50_fm >=.85) {
    output["Phi2_50"] 			= -1;
	danger("Phi2_50 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_50"]			= MathROUND(fv_50_fm,3);
  }
  if (npqt_50 <= 0) {
	output["PhiNPQ_50"]		= 0;
    output["NPQt_50"]			= 0;
	warning("NPQt_50 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_50_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_50_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_50_MPF"]		= MathROUND(npqt_50,3);
  }
  else {
	output["PhiNPQ_50"]  = MathROUND(PhiNPQ_50,3);
	output["NPQt_50"]		= MathROUND(npqt_50,3);
  }
	output["PhiNO_50"]		= MathROUND(PhiNO_50,3);
	output["qL_50"]			= MathROUND(qL_50,3);
    output['FvP/Fm_50_P']		= MathROUND(FvP_Fm_50_P,3);
    output['qP_50']			= MathROUND(qP_50,3);
}

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

if (Fs_50_std > 100) {
	danger("noisy Fs_50", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_50_Prime", output);
}
*/
if (Fm_50_P_step1_std > 120 | Fm_50_P_step2_std > 120 | Fm_50_P_step3_std > 120 | Fm_50_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_50_Prime_std > 150) {
	danger("noisy Fo_50_Prime", output);
}
/*
if (reg_50.m > 0) {
	info("Used Phi2_50 and not Phi2_50 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_50_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_50_Prime slopes down.  This may mean that saturating flash is not bright enough... consider using a protocol with lower saturating light on these samples", output);
}
if (Fm_50_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_50_Prime slopes up.  This may mean that saturating flash is too bright... consider using a protocol with higher saturating light on these samples",output);
}
*/





output["Fm_0_Prime"] 		= MathROUND(Fm_0_Prime,3);
output["Fs_0"] 			= MathROUND(Fs_0,1);
output['Fo_0_Prime']		= MathROUND(Fo_0_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_0_Prime/Fs_0)-1),3));
//output["ratio MPF/noMPF, Phi2_0"] = MathROUND(fv_0_fm_MPF / fv_0_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_0"] = MathROUND(PhiNPQ_0_MPF / PhiNPQ_0_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_0"] = MathROUND(PhiNO_0_MPF / PhiNO_0_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_0"] = MathROUND(npqt_0_MPF / npqt_0_noMPF,5);
output["MPF_slope_0"] 	= MathROUND(reg_0.m,3);
output["MPF_rsquared_0"] 	= MathROUND(reg_0.r,3);
/*
output["Phi2_0_MPF"] 		= MathROUND(fv_0_fm_MPF,3);
output["Phi2_0_noMPF"] 	= MathROUND(fv_0_fm,3);
output["Fm_0_Prime_MPF"] 	= MathROUND(reg_0.b,3);
output["Fm_0_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_0_MPF']		= MathROUND(qL_0_MPF,3);
output['qL_0_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_0_MPF']		= MathROUND(PhiNO_0_MPF,3);
output['PhiNO_0_noMPF']	= MathROUND(PhiNO_0,3);
output["Fs_0_std"] 			= MathROUND(Fs_0_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_0_P_step1_std"] 	= MathROUND(Fm_0_P_step1_std,1);
output["Fm_0_P_step2_std"] 	= MathROUND(Fm_0_P_step2_std,1);
output["Fm_0_P_step3_std"] 	= MathROUND(Fm_0_P_step3_std,1);
output["Fm_0_P_end_std"] 		= MathROUND(Fm_0_P_end_std,1);
output["Fo_0_Prime_std"] 			= MathROUND(Fo_0_Prime_std,1);
*/

//output["Fm_0_P_step1"] = MathROUND(Fm_0_P_step1,3);
//output["Fm_0_P_step2"] = MathROUND(Fm_0_P_step2,3);
//output["Fm_0_P_step3"] = MathROUND(Fm_0_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_0_P_step1,Fm_0_P_step2,Fm_0_P_step3];
//output["slopey"] = Fm_0_P_end/A0FmP - A0FmP/A0FmP ;

  output["baseline"] 	= baseline;

// Check for data quality issues and add warning or danger flags
//----------------------------

// Finally, use the "order" object to define the order of the outputs (focus on the top 6 most important for the user to see)
//----------------------------
output["Light Intensity (PAR)"] = json.light_intensity;
output["Leaf Temp Differential"] = json.contactless_temp - json.temperature;

 	
output["Ambient Temperature"] = json.temperature;
output["Ambient Humidity"] = json.humidity;
output["Leaf Angle"] = json.angle;


output["Fm_50_Prime"] 		= MathROUND(Fm_50_Prime,3);
output["Fs_50"] 			= MathROUND(Fs_50,1);
output['Fo_50_Prime']		= MathROUND(Fo_50_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_50_Prime/Fs_50)-1),3));
//output["ratio MPF/noMPF, Phi2_50"] = MathROUND(fv_50_fm_MPF / fv_50_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_50"] = MathROUND(PhiNPQ_50_MPF / PhiNPQ_50_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_50"] = MathROUND(PhiNO_50_MPF / PhiNO_50_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_50"] = MathROUND(npqt_50_MPF / npqt_50_noMPF,5);
output["MPF_slope_50"] 	= MathROUND(reg_50.m,3);
output["MPF_rsquared_50"] 	= MathROUND(reg_50.r,3);
/*
output["Phi2_50_MPF"] 		= MathROUND(fv_50_fm_MPF,3);
output["Phi2_50_noMPF"] 	= MathROUND(fv_50_fm,3);
output["Fm_50_Prime_MPF"] 	= MathROUND(reg_50.b,3);
output["Fm_50_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_50_MPF']		= MathROUND(qL_50_MPF,3);
output['qL_50_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_50_MPF']		= MathROUND(PhiNO_50_MPF,3);
output['PhiNO_50_noMPF']	= MathROUND(PhiNO_50,3);
output["Fs_50_std"] 			= MathROUND(Fs_50_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_50_P_step1_std"] 	= MathROUND(Fm_50_P_step1_std,1);
output["Fm_50_P_step2_std"] 	= MathROUND(Fm_50_P_step2_std,1);
output["Fm_50_P_step3_std"] 	= MathROUND(Fm_50_P_step3_std,1);
output["Fm_50_P_end_std"] 		= MathROUND(Fm_50_P_end_std,1);
output["Fo_50_Prime_std"] 			= MathROUND(Fo_50_Prime_std,1);
*/

//output["Fm_50_P_step1"] = MathROUND(Fm_50_P_step1,3);
//output["Fm_50_P_step2"] = MathROUND(Fm_50_P_step2,3);
//output["Fm_50_P_step3"] = MathROUND(Fm_50_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_50_P_step1,Fm_50_P_step2,Fm_50_P_step3];
//output["slopey"] = Fm_50_P_end/A0FmP - A0FmP/A0FmP ;

  output["baseline"] 	= baseline;

// Check for data quality issues and add warning or danger flags
//----------------------------

// Finally, use the "order" object to define the order of the outputs (focus on the top 6 most important for the user to see)
//----------------------------
output["Light Intensity (PAR)"] = json.light_intensity;
output["Leaf Temp Differential"] = json.contactless_temp - json.temperature;

 	
output["Ambient Temperature"] = json.temperature;
output["Ambient Humidity"] = json.humidity;
output["Leaf Angle"] = json.angle;



output["order"] = ["Phi2_0","PhiNPQ_0","PhiNO_0","Leaf Temp Differential","Leaf Angle", "Light Intensity (PAR)","Ambient Temperature","Ambient Humidity"];

//maxvalue = MathMAX([json.r,json.g,json.b]);
//output["R"] = Number(json.r);
//output["G"] = Number(json.g);
//output["B"] = Number(json.b);
//output["rval"] = json.r*(255/maxvalue);
//output["gval"] = json.g*(255/maxvalue);
//output["bval"] = json.b*(255/maxvalue);

//output["Color"] = [MathROUND(json.r*(255/maxvalue),2),MathROUND(json.g*(255/maxvalue),2),MathROUND(json.b*(255/maxvalue),2)];




/****************OUTPUT VALUES FROM MACRO *******************/

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ_100, PhiNO_100... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
if (reg_100.m > 0) {
  fv_100_fm = fv_100_fm_noMPF;
  npqt_100 = npqt_100_noMPF;
  PhiNO_100 = PhiNO_100_noMPF;
  PhiNPQ_100 = PhiNPQ_100_noMPF;
  qL_100 = qL_100_noMPF;
  Fm_100_Prime = A0FmP;
  qP = qP_100_noMPF;
  FvP_Fm_100_P = fv_100_fm_noMPF;
  
  if (fv_100_fm <= 0) {
    output["Phi2_100"] 			= 0;
	warning('Phi2_100 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_100_noMPF"] 	= MathROUND(npqt_100,3);
  }
  if (fv_100_fm >=.85) {
    output["Phi2_100"] 			= -1;
	danger("Phi2_100 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_100"] 		= MathROUND(fv_100_fm,3);
  }
  
  if (npqt_100 <= 0) {
	output["PhiNPQ_100"]		= 0;
    output["NPQt_100"]			= 0;
	warning("NPQt_) is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_100_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_100_noMPF"]  = MathROUND(PhiNPQ_100,3);
	output["npqt_100_noMPF"]	= MathROUND(npqt_100,3);
  }
  else {
	output["PhiNPQ_100"]  = MathROUND(PhiNPQ_100,3);
	output["NPQt_100"]		= MathROUND(npqt_100,3);
  }
	output["PhiNO_100"]		= MathROUND(PhiNO_100,3);
	output["qL_100"]		= MathROUND(qL_100,3);
    output['FvP/Fm_100_P']		= MathROUND(FvP_Fm_100_P,3);
    output['qP_100']			= MathROUND(qP_100,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_100... 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 (fv_100_fm <= 0) {
    output["Phi2_100"] 			= 0;
	warning("Phi2_100 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_100_MPF"] 	= MathROUND(npqt_100,3);
  }
  if (fv_100_fm >=.85) {
    output["Phi2_100"] 			= -1;
	danger("Phi2_100 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_100"]			= MathROUND(fv_100_fm,3);
  }
  if (npqt_100 <= 0) {
	output["PhiNPQ_100"]		= 0;
    output["NPQt_100"]			= 0;
	warning("NPQt_100 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_100_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_100_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_100_MPF"]		= MathROUND(npqt_100,3);
  }
  else {
	output["PhiNPQ_100"]  = MathROUND(PhiNPQ_100,3);
	output["NPQt_100"]		= MathROUND(npqt_100,3);
  }
	output["PhiNO_100"]		= MathROUND(PhiNO_100,3);
	output["qL_100"]			= MathROUND(qL_100,3);
    output['FvP/Fm_100_P']		= MathROUND(FvP_Fm_100_P,3);
    output['qP_100']			= MathROUND(qP_100,3);
}

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

if (Fs_100_std > 100) {
	danger("noisy Fs_100", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_100_Prime", output);
}
*/
if (Fm_100_P_step1_std > 120 | Fm_100_P_step2_std > 120 | Fm_100_P_step3_std > 120 | Fm_100_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_100_Prime_std > 150) {
	danger("noisy Fo_100_Prime", output);
}
/*
if (reg_100.m > 0) {
	info("Used Phi2_100 and not Phi2_100 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_100_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_100_Prime slopes down.  This may mean that saturating flash is not bright enough... consider using a protocol with lower saturating light on these samples", output);
}
if (Fm_100_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_100_Prime slopes up.  This may mean that saturating flash is too bright... consider using a protocol with higher saturating light on these samples",output);
}
*/

output["Fm_100_Prime"] 		= MathROUND(Fm_100_Prime,3);
output["Fs_100"] 			= MathROUND(Fs_100,1);
output['Fo_100_Prime']		= MathROUND(Fo_100_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_100_Prime/Fs_100)-1),3));
//output["ratio MPF/noMPF, Phi2_100"] = MathROUND(fv_100_fm_MPF / fv_100_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_100"] = MathROUND(PhiNPQ_100_MPF / PhiNPQ_100_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_100"] = MathROUND(PhiNO_100_MPF / PhiNO_100_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_100"] = MathROUND(npqt_100_MPF / npqt_100_noMPF,5);
output["MPF_slope_100"] 	= MathROUND(reg_100.m,3);
output["MPF_rsquared_100"] 	= MathROUND(reg_100.r,3);
/*
output["Phi2_100_MPF"] 		= MathROUND(fv_100_fm_MPF,3);
output["Phi2_100_noMPF"] 	= MathROUND(fv_100_fm,3);
output["Fm_100_Prime_MPF"] 	= MathROUND(reg_100.b,3);
output["Fm_100_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_100_MPF']		= MathROUND(qL_100_MPF,3);
output['qL_100_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_100_MPF']		= MathROUND(PhiNO_100_MPF,3);
output['PhiNO_100_noMPF']	= MathROUND(PhiNO_100,3);
output["Fs_100_std"] 			= MathROUND(Fs_100_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_100_P_step1_std"] 	= MathROUND(Fm_100_P_step1_std,1);
output["Fm_100_P_step2_std"] 	= MathROUND(Fm_100_P_step2_std,1);
output["Fm_100_P_step3_std"] 	= MathROUND(Fm_100_P_step3_std,1);
output["Fm_100_P_end_std"] 		= MathROUND(Fm_100_P_end_std,1);
output["Fo_100_Prime_std"] 			= MathROUND(Fo_100_Prime_std,1);
*/

//output["Fm_100_P_step1"] = MathROUND(Fm_100_P_step1,3);
//output["Fm_100_P_step2"] = MathROUND(Fm_100_P_step2,3);
//output["Fm_100_P_step3"] = MathROUND(Fm_100_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_100_P_step1,Fm_100_P_step2,Fm_100_P_step3];
//output["slopey"] = Fm_100_P_end/A0FmP - A0FmP/A0FmP ;

  output["baseline"] 	= baseline;

// Check for data quality issues and add warning or danger flags
//----------------------------

// Finally, use the "order" object to define the order of the outputs (focus on the top 6 most important for the user to see)
//----------------------------
output["Light Intensity (PAR)"] = json.light_intensity;
output["Leaf Temp Differential"] = json.contactless_temp - json.temperature;

 	
output["Ambient Temperature"] = json.temperature;
output["Ambient Humidity"] = json.humidity;
output["Leaf Angle"] = json.angle;

output["order"] = ["Phi2_100","PhiNPQ_100","PhiNO_100","Leaf Temp Differential","Leaf Angle", "Light Intensity (PAR)","Ambient Temperature","Ambient Humidity"];

//maxvalue = MathMAX([json.r,json.g,json.b]);
//output["R"] = Number(json.r);
//output["G"] = Number(json.g);
//output["B"] = Number(json.b);
//output["rval"] = json.r*(255/maxvalue);
//output["gval"] = json.g*(255/maxvalue);
//output["bval"] = json.b*(255/maxvalue);

//output["Color"] = [MathROUND(json.r*(255/maxvalue),2),MathROUND(json.g*(255/maxvalue),2),MathROUND(json.b*(255/maxvalue),2)];

 
/****************OUTPUT VALUES FROM MACRO *******************/

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ_250, PhiNO_250... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
if (reg_250.m > 0) {
  fv_250_fm = fv_250_fm_noMPF;
  npqt_250 = npqt_250_noMPF;
  PhiNO_250 = PhiNO_250_noMPF;
  PhiNPQ_250 = PhiNPQ_250_noMPF;
  qL_250 = qL_250_noMPF;
  Fm_250_Prime = A0FmP;
  qP = qP_250_noMPF;
  FvP_Fm_250_P = fv_250_fm_noMPF;
  
  if (fv_250_fm <= 0) {
    output["Phi2_250"] 			= 0;
	warning('Phi2_250 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_250_noMPF"] 	= MathROUND(npqt_250,3);
  }
  if (fv_250_fm >=.85) {
    output["Phi2_250"] 			= -1;
	danger("Phi2_250 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_250"] 		= MathROUND(fv_250_fm,3);
  }
  
  if (npqt_250 <= 0) {
	output["PhiNPQ_250"]		= 0;
    output["NPQt_250"]			= 0;
	warning("NPQt_) is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_250_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_250_noMPF"]  = MathROUND(PhiNPQ_250,3);
	output["npqt_250_noMPF"]	= MathROUND(npqt_250,3);
  }
  else {
	output["PhiNPQ_250"]  = MathROUND(PhiNPQ_250,3);
	output["NPQt_250"]		= MathROUND(npqt_250,3);
  }
	output["PhiNO_250"]		= MathROUND(PhiNO_250,3);
	output["qL_250"]		= MathROUND(qL_250,3);
    output['FvP/Fm_250_P']		= MathROUND(FvP_Fm_250_P,3);
    output['qP_250']			= MathROUND(qP_250,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_250... 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 (fv_250_fm <= 0) {
    output["Phi2_250"] 			= 0;
	warning("Phi2_250 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_250_MPF"] 	= MathROUND(npqt_250,3);
  }
  if (fv_250_fm >=.85) {
    output["Phi2_250"] 			= -1;
	danger("Phi2_250 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_250"]			= MathROUND(fv_250_fm,3);
  }
  if (npqt_250 <= 0) {
	output["PhiNPQ_250"]		= 0;
    output["NPQt_250"]			= 0;
	warning("NPQt_250 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_250_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_250_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_250_MPF"]		= MathROUND(npqt_250,3);
  }
  else {
	output["PhiNPQ_250"]  = MathROUND(PhiNPQ_250,3);
	output["NPQt_250"]		= MathROUND(npqt_250,3);
  }
	output["PhiNO_250"]		= MathROUND(PhiNO_250,3);
	output["qL_250"]			= MathROUND(qL_250,3);
    output['FvP/Fm_250_P']		= MathROUND(FvP_Fm_250_P,3);
    output['qP_250']			= MathROUND(qP_250,3);
}

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

if (Fs_250_std > 100) {
	danger("noisy Fs_250", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_250_Prime", output);
}
*/
if (Fm_250_P_step1_std > 120 | Fm_250_P_step2_std > 120 | Fm_250_P_step3_std > 120 | Fm_250_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_250_Prime_std > 150) {
	danger("noisy Fo_250_Prime", output);
}
/*
if (reg_250.m > 0) {
	info("Used Phi2_250 and not Phi2_250 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_250_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_250_Prime slopes down.  This may mean that saturating flash is not bright enough... consider using a protocol with lower saturating light on these samples", output);
}
if (Fm_250_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_250_Prime slopes up.  This may mean that saturating flash is too bright... consider using a protocol with higher saturating light on these samples",output);
}
*/

output["Fm_250_Prime"] 		= MathROUND(Fm_250_Prime,3);
output["Fs_250"] 			= MathROUND(Fs_250,1);
output['Fo_250_Prime']		= MathROUND(Fo_250_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_250_Prime/Fs_250)-1),3));
//output["ratio MPF/noMPF, Phi2_250"] = MathROUND(fv_250_fm_MPF / fv_250_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_250"] = MathROUND(PhiNPQ_250_MPF / PhiNPQ_250_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_250"] = MathROUND(PhiNO_250_MPF / PhiNO_250_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_250"] = MathROUND(npqt_250_MPF / npqt_250_noMPF,5);
output["MPF_slope_250"] 	= MathROUND(reg_250.m,3);
output["MPF_rsquared_250"] 	= MathROUND(reg_250.r,3);
/*
output["Phi2_250_MPF"] 		= MathROUND(fv_250_fm_MPF,3);
output["Phi2_250_noMPF"] 	= MathROUND(fv_250_fm,3);
output["Fm_250_Prime_MPF"] 	= MathROUND(reg_250.b,3);
output["Fm_250_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_250_MPF']		= MathROUND(qL_250_MPF,3);
output['qL_250_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_250_MPF']		= MathROUND(PhiNO_250_MPF,3);
output['PhiNO_250_noMPF']	= MathROUND(PhiNO_250,3);
output["Fs_250_std"] 			= MathROUND(Fs_250_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_250_P_step1_std"] 	= MathROUND(Fm_250_P_step1_std,1);
output["Fm_250_P_step2_std"] 	= MathROUND(Fm_250_P_step2_std,1);
output["Fm_250_P_step3_std"] 	= MathROUND(Fm_250_P_step3_std,1);
output["Fm_250_P_end_std"] 		= MathROUND(Fm_250_P_end_std,1);
output["Fo_250_Prime_std"] 			= MathROUND(Fo_250_Prime_std,1);
*/

//output["Fm_250_P_step1"] = MathROUND(Fm_250_P_step1,3);
//output["Fm_250_P_step2"] = MathROUND(Fm_250_P_step2,3);
//output["Fm_250_P_step3"] = MathROUND(Fm_250_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_250_P_step1,Fm_250_P_step2,Fm_250_P_step3];
//output["slopey"] = Fm_250_P_end/A0FmP - A0FmP/A0FmP ;

  output["baseline"] 	= baseline;

// Check for data quality issues and add warning or danger flags
//----------------------------

// Finally, use the "order" object to define the order of the outputs (focus on the top 6 most important for the user to see)
//----------------------------
output["Light Intensity (PAR)"] = json.light_intensity;
output["Leaf Temp Differential"] = json.contactless_temp - json.temperature;

 	
output["Ambient Temperature"] = json.temperature;
output["Ambient Humidity"] = json.humidity;
output["Leaf Angle"] = json.angle;

output["order"] = ["Phi2_250","PhiNPQ_250","PhiNO_250","Leaf Temp Differential","Leaf Angle", "Light Intensity (PAR)","Ambient Temperature","Ambient Humidity"];

//maxvalue = MathMAX([json.r,json.g,json.b]);
//output["R"] = Number(json.r);
//output["G"] = Number(json.g);
//output["B"] = Number(json.b);
//output["rval"] = json.r*(255/maxvalue);
//output["gval"] = json.g*(255/maxvalue);
//output["bval"] = json.b*(255/maxvalue);

//output["Color"] = [MathROUND(json.r*(255/maxvalue),2),MathROUND(json.g*(255/maxvalue),2),MathROUND(json.b*(255/maxvalue),2)];

  
/****************OUTPUT VALUES FROM MACRO *******************/

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ_500, PhiNO_500... etc.
// If Phi2 or NPQt is less than zero, make zero and give user warning.  If Phi2 is higher than .85, give user danger flag.
// ----------------------------
if (reg_500.m > 0) {
  fv_500_fm = fv_500_fm_noMPF;
  npqt_500 = npqt_500_noMPF;
  PhiNO_500 = PhiNO_500_noMPF;
  PhiNPQ_500 = PhiNPQ_500_noMPF;
  qL_500 = qL_500_noMPF;
  Fm_500_Prime = A0FmP;
  qP = qP_500_noMPF;
  FvP_Fm_500_P = fv_500_fm_noMPF;
  
  if (fv_500_fm <= 0) {
    output["Phi2_500"] 			= 0;
	warning('Phi2_500 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_500_noMPF"] 	= MathROUND(npqt_500,3);
  }
  if (fv_500_fm >=.85) {
    output["Phi2_500"] 			= -1;
	danger("Phi2_500 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_500"] 		= MathROUND(fv_500_fm,3);
  }
  
  if (npqt_500 <= 0) {
	output["PhiNPQ_500"]		= 0;
    output["NPQt_500"]			= 0;
	warning("NPQt_) is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_500_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_500_noMPF"]  = MathROUND(PhiNPQ_500,3);
	output["npqt_500_noMPF"]	= MathROUND(npqt_500,3);
  }
  else {
	output["PhiNPQ_500"]  = MathROUND(PhiNPQ_500,3);
	output["NPQt_500"]		= MathROUND(npqt_500,3);
  }
	output["PhiNO_500"]		= MathROUND(PhiNO_500,3);
	output["qL_500"]		= MathROUND(qL_500,3);
    output['FvP/Fm_500_P']		= MathROUND(FvP_Fm_500_P,3);
    output['qP_500']			= MathROUND(qP_500,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_500... 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 (fv_500_fm <= 0) {
    output["Phi2_500"] 			= 0;
	warning("Phi2_500 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  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);
	output["Phi2_500_MPF"] 	= MathROUND(npqt_500,3);
  }
  if (fv_500_fm >=.85) {
    output["Phi2_500"] 			= -1;
	danger("Phi2_500 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_500"]			= MathROUND(fv_500_fm,3);
  }
  if (npqt_500 <= 0) {
	output["PhiNPQ_500"]		= 0;
    output["NPQt_500"]			= 0;
	warning("NPQt_500 is negative (should be positive).  This may be due to a sample that is not doing photosynthesis, or you may have missed the leaf.  It has been set to zero, but check raw trace and consider excluding this point.  To see original negative value, see npqt_500_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_500_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_500_MPF"]		= MathROUND(npqt_500,3);
  }
  else {
	output["PhiNPQ_500"]  = MathROUND(PhiNPQ_500,3);
	output["NPQt_500"]		= MathROUND(npqt_500,3);
  }
	output["PhiNO_500"]		= MathROUND(PhiNO_500,3);
	output["qL_500"]			= MathROUND(qL_500,3);
    output['FvP/Fm_500_P']		= MathROUND(FvP_Fm_500_P,3);
    output['qP_500']			= MathROUND(qP_500,3);
}

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

if (Fs_500_std > 100) {
	danger("noisy Fs_500", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_500_Prime", output);
}
*/
if (Fm_500_P_step1_std > 120 | Fm_500_P_step2_std > 120 | Fm_500_P_step3_std > 120 | Fm_500_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_500_Prime_std > 150) {
	danger("noisy Fo_500_Prime", output);
}
/*
if (reg_500.m > 0) {
	info("Used Phi2_500 and not Phi2_500 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_500_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_500_Prime slopes down.  This may mean that saturating flash is not bright enough... consider using a protocol with lower saturating light on these samples", output);
}
if (Fm_500_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_500_Prime slopes up.  This may mean that saturating flash is too bright... consider using a protocol with higher saturating light on these samples",output);
}
*/

output["Fm_500_Prime"] 		= MathROUND(Fm_500_Prime,3);
output["Fs_500"] 			= MathROUND(Fs_500,1);
output['Fo_500_Prime']		= MathROUND(Fo_500_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_500_Prime/Fs_500)-1),3));
//output["ratio MPF/noMPF, Phi2_500"] = MathROUND(fv_500_fm_MPF / fv_500_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_500"] = MathROUND(PhiNPQ_500_MPF / PhiNPQ_500_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_500"] = MathROUND(PhiNO_500_MPF / PhiNO_500_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_500"] = MathROUND(npqt_500_MPF / npqt_500_noMPF,5);
output["MPF_slope_500"] 	= MathROUND(reg_500.m,3);
output["MPF_rsquared_500"] 	= MathROUND(reg_500.r,3);
/*
output["Phi2_500_MPF"] 		= MathROUND(fv_500_fm_MPF,3);
output["Phi2_500_noMPF"] 	= MathROUND(fv_500_fm,3);
output["Fm_500_Prime_MPF"] 	= MathROUND(reg_500.b,3);
output["Fm_500_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_500_MPF']		= MathROUND(qL_500_MPF,3);
output['qL_500_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_500_MPF']		= MathROUND(PhiNO_500_MPF,3);
output['PhiNO_500_noMPF']	= MathROUND(PhiNO_500,3);
output["Fs_500_std"] 			= MathROUND(Fs_500_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_500_P_step1_std"] 	= MathROUND(Fm_500_P_step1_std,1);
output["Fm_500_P_step2_std"] 	= MathROUND(Fm_500_P_step2_std,1);
output["Fm_500_P_step3_std"] 	= MathROUND(Fm_500_P_step3_std,1);
output["Fm_500_P_end_std"] 		= MathROUND(Fm_500_P_end_std,1);
output["Fo_500_Prime_std"] 			= MathROUND(Fo_500_Prime_std,1);
*/

//output["Fm_500_P_step1"] = MathROUND(Fm_500_P_step1,3);
//output["Fm_500_P_step2"] = MathROUND(Fm_500_P_step2,3);
//output["Fm_500_P_step3"] = MathROUND(Fm_500_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_500_P_step1,Fm_500_P_step2,Fm_500_P_step3];
//output["slopey"] = Fm_500_P_end/A0FmP - A0FmP/A0FmP ;

  output["baseline"] 	= baseline;

// Check for data quality issues and add warning or danger flags
//----------------------------

// Finally, use the "order" object to define the order of the outputs (focus on the top 6 most important for the user to see)
//----------------------------
output["Light Intensity (PAR)"] = json.light_intensity;
output["Leaf Temp Differential"] = json.contactless_temp - json.temperature;

 	
output["Ambient Temperature"] = json.temperature;
output["Ambient Humidity"] = json.humidity;
output["Leaf Angle"] = json.angle;

output["order"] = ["Phi2_0","PhiNPQ_0","PhiNO_0","Phi2_50","PhiNPQ_50","PhiNO_50","Phi2_100","PhiNPQ_100","PhiNO_100",
                   "Phi2_250","PhiNPQ_250","PhiNO_250","Phi2_500","PhiNPQ_500","PhiNO_500","Leaf Temp Differential","Leaf Angle", "Light Intensity (PAR)","Ambient Temperature","Ambient Humidity"];

//maxvalue = MathMAX([json.r,json.g,json.b]);
//output["R"] = Number(json.r);
//output["G"] = Number(json.g);
//output["B"] = Number(json.b);
//output["rval"] = json.r*(255/maxvalue);
//output["gval"] = json.g*(255/maxvalue);
//output["bval"] = json.b*(255/maxvalue);

//output["Color"] = [MathROUND(json.r*(255/maxvalue),2),MathROUND(json.g*(255/maxvalue),2),MathROUND(json.b*(255/maxvalue),2)];





return output;
{
  "time_offset": 240,
  "time": 1499090939954,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:38:86",
  "device_battery": 84,
  "device_firmware": 1.17,
  "sample": [
    {
      "time": 1499090939963,
      "protocol_id": 1,
      "detector_read1": 8963,
      "light_intensity": 9,
      "r": 7,
      "g": 3,
      "b": 3,
      "light_intensity_raw": 10,
      "temperature": 21.9,
      "humidity": 71.790039,
      "pressure": 998.228455,
      "temperature2": 21.790001,
      "humidity2": 70.835938,
      "pressure2": 998.576233,
      "contactless_temp": 19.99,
      "thickness": 0.31,
      "compass_direction": "E",
      "compass": "90.00",
      "angle": 1.53,
      "angle_direction": "SW",
      "pitch": 1.38,
      "roll": -0.66,
      "data_raw": [
        4363,
        4410,
        4453,
        4501,
        4533,
        4565,
        4594,
        4620,
        4641,
        4661,
        4683,
        4703,
        4711,
        4726,
        4733,
        4747,
        4757,
        4767,
        4774,
        4778,
        12536,
        14572,
        15879,
        16591,
        17063,
        17519,
        18057,
        18686,
        19329,
        19924,
        20414,
        20790,
        21067,
        21267,
        21408,
        21508,
        21573,
        21619,
        21647,
        21669,
        21684,
        21692,
        21699,
        21706,
        21708,
        21712,
        21711,
        21711,
        21710,
        21711,
        21707,
        21711,
        21719,
        21718,
        21717,
        21719,
        21719,
        21721,
        21715,
        21716,
        21703,
        21707,
        21714,
        21711,
        21714,
        21712,
        21708,
        21707,
        21707,
        21705,
        21685,
        21689,
        21693,
        21690,
        21690,
        21689,
        21689,
        21683,
        21683,
        21681,
        21703,
        21684,
        21668,
        21657,
        21644,
        21637,
        21629,
        21623,
        21615,
        21607,
        21606,
        21599,
        21591,
        21587,
        21577,
        21575,
        21569,
        21562,
        21557,
        21554,
        21549,
        21541,
        21537,
        21533,
        21527,
        21518,
        21515,
        21506,
        21495,
        21493,
        16965,
        15707,
        15117,
        14726,
        14427,
        14175,
        13943,
        13733,
        13533,
        13350,
        13174,
        13015,
        12859,
        12709,
        12575,
        12456,
        12339,
        12223,
        12115,
        12014,
        5957,
        5694,
        5575,
        5491,
        5436,
        5387,
        5350,
        5322,
        5298,
        5279,
        5259,
        5250,
        5243,
        5235,
        5230,
        5230,
        5227,
        5229,
        5229,
        5231,
        5235,
        5238,
        5242,
        5243,
        5242,
        5247,
        5252,
        5253,
        5254,
        5257,
        5263,
        5262,
        5263,
        5267,
        5271,
        5273,
        5273,
        5274,
        5281,
        5279,
        5280,
        5283,
        5284,
        5285,
        5285,
        5285,
        5285,
        5286,
        5287,
        5289,
        5286,
        5286,
        5287,
        5287,
        5289,
        5287,
        5287,
        5287,
        5287,
        5286,
        5286,
        5286,
        5285,
        5286,
        5286,
        5284,
        5285,
        5282,
        5283,
        5279,
        5283,
        5280,
        5276,
        5278,
        5278,
        5276,
        5274,
        5274,
        5272,
        5271,
        5270,
        5268,
        5270,
        5266,
        5265,
        5263,
        5265,
        5261,
        5259,
        5259,
        5255,
        5255,
        5254,
        5255,
        5250,
        5245,
        5242,
        5242,
        5239,
        5238,
        5235,
        5233,
        5233,
        5233,
        5229,
        5228,
        5227,
        5223,
        5222,
        5223,
        5222,
        5222,
        5219,
        5219,
        5216,
        5214,
        5213,
        5211,
        5210,
        5209,
        5211,
        5206,
        5206,
        5206,
        5203,
        5202,
        5199,
        5198,
        5199,
        5199,
        5191,
        5192,
        5189,
        5189,
        5189,
        5187,
        5185,
        5183,
        5183,
        5182,
        5183,
        5182,
        5177,
        5178,
        5177,
        5178,
        5174,
        5173,
        5170,
        5169,
        6745,
        6790,
        6827,
        6847,
        6858,
        6864,
        6876,
        6879,
        6876,
        6883,
        6883,
        6881,
        6871,
        6879,
        6879,
        6871,
        6863,
        6869,
        6867,
        6860,
        13026,
        13849,
        14219,
        14394,
        14529,
        14646,
        14750,
        14868,
        14957,
        15051,
        15129,
        15179,
        15243,
        15287,
        15331,
        15365,
        15385,
        15419,
        15431,
        15455,
        15470,
        15475,
        15492,
        15491,
        15502,
        15510,
        15506,
        15514,
        15511,
        15518,
        15497,
        15498,
        15496,
        15492,
        15495,
        15494,
        15487,
        15491,
        15477,
        15485,
        15453,
        15451,
        15445,
        15434,
        15435,
        15431,
        15419,
        15423,
        15411,
        15413,
        15374,
        15363,
        15364,
        15356,
        15347,
        15345,
        15333,
        15334,
        15330,
        15314,
        15399,
        15387,
        15387,
        15382,
        15369,
        15371,
        15359,
        15351,
        15346,
        15333,
        15335,
        15323,
        15322,
        15313,
        15300,
        15301,
        15285,
        15289,
        15278,
        15271,
        15266,
        15252,
        15253,
        15242,
        15238,
        15234,
        15222,
        15218,
        15207,
        15205,
        12903,
        11915,
        11311,
        10879,
        10563,
        10334,
        10153,
        10011,
        9905,
        9815,
        9733,
        9679,
        9625,
        9572,
        9533,
        9500,
        9465,
        9429,
        9407,
        9381,
        5156,
        4958,
        4862,
        4782,
        4734,
        4687,
        4655,
        4625,
        4595,
        4569,
        4563,
        4542,
        4539,
        4529,
        4516,
        4517,
        4517,
        4509,
        4511,
        4508,
        4505,
        4511,
        4511,
        4509,
        4513,
        4510,
        4517,
        4518,
        4511,
        4521,
        4523,
        4518,
        4526,
        4527,
        4521,
        4529,
        4532,
        4523,
        4533,
        4535,
        4529,
        4539,
        4540,
        4534,
        4543,
        4541,
        4537,
        4546,
        4547,
        4539,
        4548,
        4548,
        4545,
        4549,
        4551,
        4546,
        4553,
        4553,
        4549,
        4553,
        4552,
        4549,
        4559,
        4557,
        4553,
        4558,
        4556,
        4554,
        4562,
        4557,
        4555,
        4559,
        4558,
        4556,
        4562,
        4557,
        4559,
        4565,
        4562,
        4559,
        4564,
        4563,
        4563,
        4567,
        4561,
        4565,
        4567,
        4561,
        4567,
        4566,
        4563,
        4569,
        4569,
        4561,
        4570,
        4573,
        4561,
        4571,
        4569,
        4562,
        4573,
        4573,
        4566,
        4572,
        4574,
        4564,
        4572,
        4573,
        4567,
        4575,
        4574,
        4571,
        4573,
        4573,
        4573,
        4574,
        4570,
        4577,
        4577,
        4571,
        4575,
        4577,
        4571,
        4578,
        4579,
        4571,
        4581,
        4579,
        4573,
        4582,
        4580,
        4577,
        4581,
        4578,
        4577,
        4582,
        4577,
        4582,
        4583,
        4579,
        4583,
        4584,
        4577,
        4586,
        4587,
        4582,
        4588,
        4587,
        4578,
        4591,
        5748,
        5766,
        5787,
        5791,
        5803,
        5799,
        5807,
        5805,
        5813,
        5812,
        5810,
        5812,
        5811,
        5810,
        5810,
        5812,
        5813,
        5809,
        5802,
        5811,
        9084,
        9497,
        9775,
        9967,
        10091,
        10177,
        10261,
        10311,
        10363,
        10406,
        10435,
        10470,
        10495,
        10517,
        10536,
        10549,
        10567,
        10585,
        10585,
        10602,
        10610,
        10610,
        10623,
        10630,
        10631,
        10639,
        10635,
        10647,
        10650,
        10647,
        10631,
        10631,
        10626,
        10632,
        10631,
        10635,
        10637,
        10631,
        10639,
        10639,
        10606,
        10611,
        10607,
        10607,
        10610,
        10601,
        10608,
        10610,
        10600,
        10609,
        10568,
        10569,
        10567,
        10561,
        10565,
        10566,
        10558,
        10565,
        10555,
        10559,
        10646,
        10640,
        10651,
        10649,
        10648,
        10653,
        10643,
        10647,
        10647,
        10640,
        10645,
        10646,
        10636,
        10639,
        10638,
        10635,
        10635,
        10630,
        10633,
        10629,
        10623,
        10623,
        10628,
        10615,
        10620,
        10620,
        10611,
        10615,
        10607,
        10609,
        9098,
        8395,
        7956,
        7654,
        7456,
        7326,
        7234,
        7181,
        7129,
        7107,
        7081,
        7061,
        7047,
        7029,
        7022,
        7005,
        7001,
        6984,
        6983,
        6967,
        4513,
        4369,
        4300,
        4251,
        4212,
        4183,
        4155,
        4143,
        4127,
        4113,
        4110,
        4104,
        4090,
        4097,
        4092,
        4092,
        4090,
        4081,
        4089,
        4083,
        4090,
        4089,
        4081,
        4089,
        4082,
        4089,
        4090,
        4087,
        4090,
        4083,
        4092,
        4087,
        4093,
        4094,
        4091,
        4098,
        4089,
        4098,
        4095,
        4100,
        4105,
        4094,
        4102,
        4096,
        4103,
        4105,
        4102,
        4108,
        4101,
        4109,
        4103,
        4114,
        4115,
        4110,
        4113,
        4108,
        4118,
        4114,
        4118,
        4120,
        4116,
        4119,
        4115,
        4125,
        4119,
        4127,
        4127,
        4123,
        4129,
        4123,
        4131,
        4129,
        4134,
        4135,
        4132,
        4136,
        4133,
        4137,
        4141,
        4143,
        4143,
        4137,
        4147,
        4141,
        4147,
        4152,
        4147,
        4151,
        4143,
        4155,
        4155,
        4158,
        4158,
        4156,
        4162,
        4157,
        4165,
        4164,
        4165,
        4169,
        4161,
        4171,
        4167,
        4175,
        4177,
        4174,
        4179,
        4174,
        4183,
        4181,
        4187,
        4189,
        4181,
        4191,
        4185,
        4193,
        4198,
        4195,
        4199,
        4195,
        4203,
        4201,
        4204,
        4207,
        4202,
        4209,
        4203,
        4215,
        4214,
        4217,
        4220,
        4218,
        4223,
        4219,
        4223,
        4229,
        4230,
        4230,
        4227,
        4235,
        4230,
        4238,
        4239,
        4237,
        4245,
        4241,
        4249,
        4247,
        4249,
        4254,
        5283,
        5288,
        5302,
        5307,
        5306,
        5311,
        5318,
        5317,
        5313,
        5318,
        5321,
        5319,
        5318,
        5325,
        5324,
        5317,
        5323,
        5324,
        5323,
        5317,
        7252,
        7572,
        7799,
        7959,
        8073,
        8140,
        8187,
        8215,
        8239,
        8263,
        8278,
        8293,
        8301,
        8310,
        8326,
        8336,
        8346,
        8351,
        8349,
        8359,
        8365,
        8371,
        8374,
        8372,
        8377,
        8386,
        8387,
        8389,
        8390,
        8387,
        8371,
        8367,
        8368,
        8372,
        8360,
        8370,
        8374,
        8376,
        8377,
        8370,
        8341,
        8346,
        8343,
        8343,
        8337,
        8335,
        8343,
        8346,
        8345,
        8339,
        8300,
        8303,
        8300,
        8298,
        8290,
        8293,
        8298,
        8295,
        8299,
        8290,
        8391,
        8407,
        8412,
        8413,
        8409,
        8411,
        8416,
        8415,
        8414,
        8414,
        8407,
        8414,
        8416,
        8415,
        8414,
        8407,
        8409,
        8411,
        8412,
        8413,
        8410,
        8404,
        8410,
        8406,
        8407,
        8409,
        8403,
        8403,
        8405,
        8405,
        7110,
        6437,
        5991,
        5725,
        5567,
        5482,
        5427,
        5403,
        5389,
        5379,
        5360,
        5363,
        5362,
        5355,
        5347,
        5357,
        5351,
        5345,
        5349,
        5353,
        4167,
        4059,
        4013,
        3979,
        3960,
        3941,
        3928,
        3916,
        3903,
        3903,
        3903,
        3898,
        3896,
        3888,
        3883,
        3891,
        3887,
        3889,
        3880,
        3887,
        3884,
        3887,
        3877,
        3883,
        3884,
        3886,
        3878,
        3882,
        3887,
        3887,
        3879,
        3882,
        3890,
        3888,
        3883,
        3889,
        3893,
        3893,
        3886,
        3889,
        3895,
        3895,
        3889,
        3892,
        3898,
        3902,
        3895,
        3896,
        3902,
        3901,
        3901,
        3901,
        3907,
        3908,
        3904,
        3906,
        3911,
        3913,
        3908,
        3910,
        3915,
        3917,
        3911,
        3916,
        3922,
        3922,
        3919,
        3921,
        3926,
        3924,
        3922,
        3924,
        3931,
        3933,
        3934,
        3927,
        3936,
        3941,
        3937,
        3931,
        3943,
        3943,
        3947,
        3938,
        3949,
        3949,
        3950,
        3947,
        3953,
        3957,
        3959,
        3951,
        3959,
        3963,
        3963,
        3959,
        3962,
        3967,
        3973,
        3964,
        3973,
        3977,
        3977,
        3975,
        3975,
        3982,
        3983,
        3980,
        3983,
        3987,
        3990,
        3993,
        3989,
        3997,
        3999,
        3999,
        3997,
        4005,
        4007,
        4008,
        4005,
        4011,
        4014,
        4016,
        4010,
        4018,
        4023,
        4023,
        4018,
        4027,
        4029,
        4033,
        4028,
        4033,
        4038,
        4038,
        4035,
        4038,
        4043,
        4046,
        4043,
        4045,
        4051,
        4053,
        4051,
        4055,
        4060,
        4065,
        4063,
        4060,
        5499,
        5506,
        5510,
        5506,
        5509,
        5516,
        5518,
        5517,
        5519,
        5518,
        5519,
        5515,
        5512,
        5513,
        5521,
        5517,
        5519,
        5518,
        5519,
        5514,
        6811,
        7055,
        7210,
        7323,
        7399,
        7453,
        7485,
        7510,
        7525,
        7538,
        7547,
        7557,
        7560,
        7567,
        7573,
        7577,
        7585,
        7588,
        7589,
        7593,
        7596,
        7591,
        7595,
        7596,
        7596,
        7597,
        7599,
        7599,
        7605,
        7606,
        7578,
        7575,
        7570,
        7575,
        7570,
        7576,
        7575,
        7580,
        7582,
        7583,
        7545,
        7538,
        7537,
        7535,
        7535,
        7538,
        7537,
        7538,
        7539,
        7539,
        7495,
        7486,
        7481,
        7481,
        7481,
        7479,
        7476,
        7471,
        7471,
        7469,
        7586,
        7606,
        7613,
        7618,
        7620,
        7620,
        7620,
        7623,
        7623,
        7622,
        7623,
        7626,
        7622,
        7620,
        7622,
        7622,
        7620,
        7623,
        7622,
        7623,
        7621,
        7621,
        7620,
        7620,
        7621,
        7618,
        7620,
        7622,
        7618,
        7615,
        6268,
        5582,
        5179,
        4962,
        4852,
        4799,
        4770,
        4749,
        4733,
        4723,
        4718,
        4715,
        4711,
        4709,
        4709,
        4707,
        4705,
        4699,
        4701,
        4707,
        4039,
        3946,
        3913,
        3891,
        3869,
        3855,
        3844,
        3839,
        3832,
        3826,
        3823,
        3819,
        3816,
        3818,
        3821,
        3819,
        3816,
        3815,
        3813,
        3815,
        3815,
        3815,
        3815,
        3811,
        3808,
        3809,
        3815,
        3816,
        3815,
        3815,
        3816,
        3817,
        3817,
        3817,
        3813,
        3813,
        3814,
        3821,
        3822,
        3822,
        3824,
        3825,
        3823,
        3817,
        3819,
        3820,
        3823,
        3829,
        3830,
        3832,
        3831,
        3834,
        3836,
        3832,
        3831,
        3831,
        3836,
        3840,
        3841,
        3844,
        3842,
        3846,
        3847,
        3841,
        3841,
        3841,
        3851,
        3853,
        3853,
        3855,
        3858,
        3860,
        3862,
        3854,
        3855,
        3857,
        3863,
        3865,
        3866,
        3868,
        3869,
        3870,
        3869,
        3866,
        3870,
        3873,
        3878,
        3878,
        3878,
        3879,
        3883,
        3883,
        3880,
        3881,
        3880,
        3884,
        3890,
        3892,
        3897,
        3899,
        3895,
        3899,
        3901,
        3895,
        3898,
        3901,
        3907,
        3907,
        3911,
        3911,
        3911,
        3913,
        3915,
        3909,
        3915,
        3911,
        3919,
        3922,
        3926,
        3927,
        3930,
        3932,
        3931,
        3927,
        3926,
        3934,
        3935,
        3942,
        3943,
        3943,
        3943,
        3948,
        3947,
        3942,
        3944,
        3949,
        3955,
        3957,
        3961,
        3961,
        3962,
        3967,
        3965,
        3960,
        3963,
        3965,
        3972,
        3975,
        3978,
        3981
      ]
    }
  ],
  "app_os": "mac",
  "app_name": "PhotosynQ",
  "app_version": "0.3.8",
  "app_device": "x86-64",
  "location": [
    "43.0088504",
    "-78.7834220"
  ],
  "ConsoleMacro": "344"
}
Default avatar
Created by

Jonathan R Pleban


Protocol connections:
0
Latest Update:
Jul 2017