PHI2_lowlight_125-0_macro_V1


Chl Fl paramters for 5 light intensities
// 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_125  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_125_start = 0; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_125_Prime, 3 Fm_125_Prime steps, and Fs_125 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_125 = MathMEAN(data.slice(ps2_125_start + 1,ps2_125_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_125_std = MathSTDEV(data.slice(ps2_125_start + 1,ps2_125_start + 4)); // create standard deviation for this value for error checking

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

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

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

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

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

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

// Calculations for corrected Fm_125_Prime using multi-phase flash
// ----------------------------
var reg_125 = MathLINREG(inverse_intensity, [A0FmP,Fm_125_P_step1,Fm_125_P_step2,Fm_125_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_125_fm_noMPF = (A0FmP-Fs_125)/A0FmP;
var fv_125_fm_MPF = (reg_125.b-Fs_125)/reg_125.b;


// Calculate NPQt,PhiNPQ_125, PhiNO_125, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_125_MPF = (4.88 / ((reg_125.b / Fo_125_Prime) -1) )-1;
var npqt_125_noMPF = (4.88 / ((A0FmP / Fo_125_Prime) -1) )-1;
var qL_125_MPF = ((reg_125.b - Fs_125)*Fo_125_Prime)/((reg_125.b-Fo_125_Prime)*Fs_125);
var qL_125_noMPF = ((A0FmP - Fs_125)*Fo_125_Prime)/((A0FmP-Fo_125_Prime)*Fs_125);
var PhiNO_125_MPF = 1/(npqt_125_MPF + 1 + qL_125_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_125_noMPF = 1/(npqt_125_noMPF + 1 + qL_125_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_125_MPF = 1-fv_125_fm_MPF-PhiNO_125_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_125_noMPF = 1-fv_125_fm_noMPF-PhiNO_125_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_125_MPF = (reg_125.b - Fs_125)/(reg_125.b - Fo_125_Prime);
var qP_125_noMPF = (Fm_125_Prime - Fs_125)/(Fm_125_Prime - Fo_125_Prime);
var FvP_Fm_125_P_MPF = (reg_125.b-Fo_125_Prime)/reg_125.b;
var FvP_Fm_125_P_noMPF = (A0FmP-Fo_125_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_125_fm = fv_125_fm_MPF;
var npqt_125  = npqt_125_MPF;
var PhiNO_125 = PhiNO_125_MPF;
var PhiNPQ_125 = PhiNPQ_125_MPF;
var qL_125 = qL_125_MPF;
var Fm_125_Prime = reg_125.b;
var qP_125 = qP_125_MPF;
var FvP_Fm_125_P = FvP_Fm_125_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;


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

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

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

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

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

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

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

// Calculations for corrected Fm_60_Prime using multi-phase flash
// ----------------------------
var reg_60= MathLINREG(inverse_intensity, [A0FmP,Fm_60_P_step1,Fm_60_P_step2,Fm_60_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_60_fm_noMPF = (A0FmP-Fs_60)/A0FmP;
var fv_60_fm_MPF = (reg_60.b-Fs_60)/reg_60.b;


// Calculate NPQt,PhiNPQ_60, PhiNO_60, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_60_MPF = (4.88 / ((reg_60.b / Fo_60_Prime) -1) )-1;
var npqt_60_noMPF = (4.88 / ((A0FmP / Fo_60_Prime) -1) )-1;
var qL_60_MPF = ((reg_60.b - Fs_60)*Fo_60_Prime)/((reg_60.b-Fo_60_Prime)*Fs_60);
var qL_60_noMPF = ((A0FmP - Fs_60)*Fo_60_Prime)/((A0FmP-Fo_60_Prime)*Fs_60);
var PhiNO_60_MPF = 1/(npqt_60_MPF + 1 + qL_60_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_60_noMPF = 1/(npqt_60_noMPF + 1 + qL_60_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_60_MPF = 1-fv_60_fm_MPF-PhiNO_60_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_60_noMPF = 1-fv_60_fm_noMPF-PhiNO_60_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_60_MPF = (reg_60.b - Fs_60)/(reg_60.b - Fo_60_Prime);
var qP_60_noMPF = (Fm_60_Prime - Fs_60)/(Fm_60_Prime - Fo_60_Prime);
var FvP_Fm_60_P_MPF = (reg_60.b-Fo_60_Prime)/reg_60.b;
var FvP_Fm_60_P_noMPF = (A0FmP-Fo_60_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_60_fm = fv_60_fm_MPF;
var npqt_60 = npqt_60_MPF;
var PhiNO_60= PhiNO_60_MPF;
var PhiNPQ_60= PhiNPQ_60_MPF;
var qL_60= qL_60_MPF;
var Fm_60_Prime = reg_60.b;
var qP_60= qP_60_MPF;
var FvP_Fm_60_P = FvP_Fm_60_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

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

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

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

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

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

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

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

// Calculations for corrected Fm_30_Prime using multi-phase flash
// ----------------------------
var reg_30 = MathLINREG(inverse_intensity, [A0FmP,Fm_30_P_step1,Fm_30_P_step2,Fm_30_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_30_fm_noMPF = (A0FmP-Fs_30)/A0FmP;
var fv_30_fm_MPF = (reg_30.b-Fs_30)/reg_30.b;


// Calculate NPQt,PhiNPQ_30, PhiNO_30, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_30_MPF = (4.88 / ((reg_30.b / Fo_30_Prime) -1) )-1;
var npqt_30_noMPF = (4.88 / ((A0FmP / Fo_30_Prime) -1) )-1;
var qL_30_MPF = ((reg_30.b - Fs_30)*Fo_30_Prime)/((reg_30.b-Fo_30_Prime)*Fs_30);
var qL_30_noMPF = ((A0FmP - Fs_30)*Fo_30_Prime)/((A0FmP-Fo_30_Prime)*Fs_30);
var PhiNO_30_MPF = 1/(npqt_30_MPF + 1 + qL_30_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_30_noMPF = 1/(npqt_30_noMPF + 1 + qL_30_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_30_MPF = 1-fv_30_fm_MPF-PhiNO_30_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_30_noMPF = 1-fv_30_fm_noMPF-PhiNO_30_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_30_MPF = (reg_30.b - Fs_30)/(reg_30.b - Fo_30_Prime);
var qP_30_noMPF = (Fm_30_Prime - Fs_30)/(Fm_30_Prime - Fo_30_Prime);
var FvP_Fm_30_P_MPF = (reg_30.b-Fo_30_Prime)/reg_30.b;
var FvP_Fm_30_P_noMPF = (A0FmP-Fo_30_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_30_fm = fv_30_fm_MPF;
var npqt_30  = npqt_30_MPF;
var PhiNO_30 = PhiNO_30_MPF;
var PhiNPQ_30 = PhiNPQ_30_MPF;
var qL_30 = qL_30_MPF;
var Fm_30_Prime = reg_30.b;
var qP_30 = qP_30_MPF;
var FvP_Fm_30_P = FvP_Fm_30_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

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

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

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

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

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

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

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

// Calculations for corrected Fm_15_Prime using multi-phase flash
// ----------------------------
var reg_15 = MathLINREG(inverse_intensity, [A0FmP,Fm_15_P_step1,Fm_15_P_step2,Fm_15_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_15_fm_noMPF = (A0FmP-Fs_15)/A0FmP;
var fv_15_fm_MPF = (reg_15.b-Fs_15)/reg_15.b;


// Calculate NPQt,PhiNPQ_15, PhiNO_15, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_15_MPF = (4.88 / ((reg_15.b / Fo_15_Prime) -1) )-1;
var npqt_15_noMPF = (4.88 / ((A0FmP / Fo_15_Prime) -1) )-1;
var qL_15_MPF = ((reg_15.b - Fs_15)*Fo_15_Prime)/((reg_15.b-Fo_15_Prime)*Fs_15);
var qL_15_noMPF = ((A0FmP - Fs_15)*Fo_15_Prime)/((A0FmP-Fo_15_Prime)*Fs_15);
var PhiNO_15_MPF = 1/(npqt_15_MPF + 1 + qL_15_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_15_noMPF = 1/(npqt_15_noMPF + 1 + qL_15_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_15_MPF = 1-fv_15_fm_MPF-PhiNO_15_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_15_noMPF = 1-fv_15_fm_noMPF-PhiNO_15_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_15_MPF = (reg_15.b - Fs_15)/(reg_15.b - Fo_15_Prime);
var qP_15_noMPF = (Fm_15_Prime - Fs_15)/(Fm_15_Prime - Fo_15_Prime);
var FvP_Fm_15_P_MPF = (reg_15.b-Fo_15_Prime)/reg_15.b;
var FvP_Fm_15_P_noMPF = (A0FmP-Fo_15_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_15_fm = fv_15_fm_MPF;
var npqt_15  = npqt_15_MPF;
var PhiNO_15 = PhiNO_15_MPF;
var PhiNPQ_15 = PhiNPQ_15_MPF;
var qL_15 = qL_15_MPF;
var Fm_15_Prime = reg_15.b;
var qP_15 = qP_15_MPF;
var FvP_Fm_15_P = FvP_Fm_15_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
//        ps2_0  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_0_start = 1120; // 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;































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

// If multi-phase flash steps are flat or positive slope, then just use the normal Phi2, NPQt, PhiNPQ_125, PhiNO_125... 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_125.m > 0) {
  fv_125_fm = fv_125_fm_noMPF;
  npqt_125 = npqt_125_noMPF;
  PhiNO_125 = PhiNO_125_noMPF;
  PhiNPQ_125 = PhiNPQ_125_noMPF;
  qL_125 = qL_125_noMPF;
  Fm_125_Prime = A0FmP;
  qP = qP_125_noMPF;
  FvP_Fm_125_P = fv_125_fm_noMPF;
  
  if (fv_125_fm <= 0) {
    output["Phi2_125"] 			= 0;
	warning('Phi2_125 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_125_noMPF"] 	= MathROUND(npqt_125,3);
  }
  if (fv_125_fm >=.85) {
    output["Phi2_125"] 			= -1;
	danger("Phi2_125 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_125"] 		= MathROUND(fv_125_fm,3);
  }
  
  if (npqt_125 <= 0) {
	output["PhiNPQ_125"]		= 0;
    output["NPQt_125"]			= 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_125_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_125_noMPF"]  = MathROUND(PhiNPQ_125,3);
	output["npqt_125_noMPF"]	= MathROUND(npqt_125,3);
  }
  else {
	output["PhiNPQ_125"]  = MathROUND(PhiNPQ_125,3);
	output["NPQt_125"]		= MathROUND(npqt_125,3);
  }
	output["PhiNO_125"]		= MathROUND(PhiNO_125,3);
	output["qL_125"]		= MathROUND(qL_125,3);
    output['FvP/Fm_125_P']		= MathROUND(FvP_Fm_125_P,3);
    output['qP_125']			= MathROUND(qP_125,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_125... 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_125_fm <= 0) {
    output["Phi2_125"] 			= 0;
	warning("Phi2_125 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_125_MPF"] 	= MathROUND(npqt_125,3);
  }
  if (fv_125_fm >=.85) {
    output["Phi2_125"] 			= -1;
	danger("Phi2_125 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_125"]			= MathROUND(fv_125_fm,3);
  }
  if (npqt_125 <= 0) {
	output["PhiNPQ_125"]		= 0;
    output["NPQt_125"]			= 0;
	warning("NPQt_125 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_125_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_125_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_125_MPF"]		= MathROUND(npqt_125,3);
  }
  else {
	output["PhiNPQ_125"]  = MathROUND(PhiNPQ_125,3);
	output["NPQt_125"]		= MathROUND(npqt_125,3);
  }
	output["PhiNO_125"]		= MathROUND(PhiNO_125,3);
	output["qL_125"]			= MathROUND(qL_125,3);
    output['FvP/Fm_125_P']		= MathROUND(FvP_Fm_125_P,3);
    output['qP_125']			= MathROUND(qP_125,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_125_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_125_std > 100) {
	danger("noisy Fs_125", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_125_Prime", output);
}
*/
if (Fm_125_P_step1_std > 120 | Fm_125_P_step2_std > 120 | Fm_125_P_step3_std > 120 | Fm_125_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_125_Prime_std > 150) {
	danger("noisy Fo_125_Prime", output);
}
/*
if (reg_125.m > 0) {
	info("Used Phi2_125 and not Phi2_125 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_125_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_125_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_125_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_125_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_30, PhiNO_60... 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_60.m > 0) {
  fv_60_fm = fv_60_fm_noMPF;
  npqt_60= npqt_60_noMPF;
  PhiNO_60= PhiNO_60_noMPF;
  PhiNPQ_60= PhiNPQ_60_noMPF;
  qL_60= qL_60_noMPF;
  Fm_60_Prime = A0FmP;
  qP = qP_60_noMPF;
  FvP_Fm_60_P = fv_60_fm_noMPF;
  
  if (fv_60_fm <= 0) {
    output["Phi2_60"] 			= 0;
	warning('Phi2_60is 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_60_noMPF"] 	= MathROUND(npqt_60,3);
  }
  if (fv_60_fm >=.85) {
    output["Phi2_60"] 			= -1;
	danger("Phi2_60above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_60"] 		= MathROUND(fv_60_fm,3);
  }
  
  if (npqt_60<= 0) {
	output["PhiNPQ_60"]		= 0;
    output["NPQt_60"]			= 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_60_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_60_noMPF"]  = MathROUND(PhiNPQ_60,3);
	output["npqt_60_noMPF"]	= MathROUND(npqt_60,3);
  }
  else {
	output["PhiNPQ_60"]  = MathROUND(PhiNPQ_60,3);
	output["NPQt_60"]		= MathROUND(npqt_60,3);
  }
	output["PhiNO_60"]		= MathROUND(PhiNO_60,3);
	output["qL_60"]		= MathROUND(qL_60,3);
    output['FvP/Fm_60_P']		= MathROUND(FvP_Fm_60_P,3);
    output['qP_60']			= MathROUND(qP_60,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_60... 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_60_fm <= 0) {
    output["Phi2_60"] 			= 0;
	warning("Phi2_60is 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_60_MPF"] 	= MathROUND(npqt_60,3);
  }
  if (fv_60_fm >=.85) {
    output["Phi2_60"] 			= -1;
	danger("Phi2_60above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_60"]			= MathROUND(fv_60_fm,3);
  }
  if (npqt_60<= 0) {
	output["PhiNPQ_60"]		= 0;
    output["NPQt_60"]			= 0;
	warning("NPQt_60is 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_60_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_60_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_60_MPF"]		= MathROUND(npqt_60,3);
  }
  else {
	output["PhiNPQ_60"]  = MathROUND(PhiNPQ_60,3);
	output["NPQt_60"]		= MathROUND(npqt_60,3);
  }
	output["PhiNO_60"]		= MathROUND(PhiNO_60,3);
	output["qL_60"]			= MathROUND(qL_60,3);
    output['FvP/Fm_60_P']		= MathROUND(FvP_Fm_60_P,3);
    output['qP_60']			= MathROUND(qP_60,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_60_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_60_std > 100) {
	danger("noisy Fs_60", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_60_Prime", output);
}
*/
if (Fm_60_P_step1_std > 120 | Fm_60_P_step2_std > 120 | Fm_60_P_step3_std > 120 | Fm_60_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_60_Prime_std > 150) {
	danger("noisy Fo_60_Prime", output);
}
/*
if (reg_60.m > 0) {
	info("Used Phi2_60and not Phi2_60MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_60_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_60_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_60_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_60_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_125_Prime"] 		= MathROUND(Fm_125_Prime,3);
output["Fs_125"] 			= MathROUND(Fs_125,1);
output['Fo_125_Prime']		= MathROUND(Fo_125_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_125_Prime/Fs_125)-1),3));
//output["ratio MPF/noMPF, Phi2_125"] = MathROUND(fv_125_fm_MPF / fv_125_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_125"] = MathROUND(PhiNPQ_125_MPF / PhiNPQ_125_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_125"] = MathROUND(PhiNO_125_MPF / PhiNO_125_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_125"] = MathROUND(npqt_125_MPF / npqt_125_noMPF,5);
output["MPF_slope_125"] 	= MathROUND(reg_125.m,3);
output["MPF_rsquared_125"] 	= MathROUND(reg_125.r,3);
/*
output["Phi2_125_MPF"] 		= MathROUND(fv_125_fm_MPF,3);
output["Phi2_125_noMPF"] 	= MathROUND(fv_125_fm,3);
output["Fm_125_Prime_MPF"] 	= MathROUND(reg_125.b,3);
output["Fm_125_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_125_MPF']		= MathROUND(qL_125_MPF,3);
output['qL_125_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_125_MPF']		= MathROUND(PhiNO_125_MPF,3);
output['PhiNO_125_noMPF']	= MathROUND(PhiNO_125,3);
output["Fs_125_std"] 			= MathROUND(Fs_125_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_125_P_step1_std"] 	= MathROUND(Fm_125_P_step1_std,1);
output["Fm_125_P_step2_std"] 	= MathROUND(Fm_125_P_step2_std,1);
output["Fm_125_P_step3_std"] 	= MathROUND(Fm_125_P_step3_std,1);
output["Fm_125_P_end_std"] 		= MathROUND(Fm_125_P_end_std,1);
output["Fo_125_Prime_std"] 			= MathROUND(Fo_125_Prime_std,1);
*/

//output["Fm_125_P_step1"] = MathROUND(Fm_125_P_step1,3);
//output["Fm_125_P_step2"] = MathROUND(Fm_125_P_step2,3);
//output["Fm_125_P_step3"] = MathROUND(Fm_125_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_125_P_step1,Fm_125_P_step2,Fm_125_P_step3];
//output["slopey"] = Fm_125_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_60_Prime"] 		= MathROUND(Fm_60_Prime,3);
output["Fs_60"] 			= MathROUND(Fs_60,1);
output['Fo_60_Prime']		= MathROUND(Fo_60_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_60_Prime/Fs_60)-1),3));
//output["ratio MPF/noMPF, Phi2_60"] = MathROUND(fv_60_fm_MPF / fv_60_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_60"] = MathROUND(PhiNPQ_60_MPF / PhiNPQ_60_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_60"] = MathROUND(PhiNO_60_MPF / PhiNO_60_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_60"] = MathROUND(npqt_60_MPF / npqt_60_noMPF,5);
output["MPF_slope_60"] 	= MathROUND(reg_60.m,3);
output["MPF_rsquared_60"] 	= MathROUND(reg_60.r,3);
/*
output["Phi2_60_MPF"] 		= MathROUND(fv_60_fm_MPF,3);
output["Phi2_60_noMPF"] 	= MathROUND(fv_60_fm,3);
output["Fm_60_Prime_MPF"] 	= MathROUND(reg_60.b,3);
output["Fm_60_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_60_MPF']		= MathROUND(qL_60_MPF,3);
output['qL_60_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_60_MPF']		= MathROUND(PhiNO_60_MPF,3);
output['PhiNO_60_noMPF']	= MathROUND(PhiNO_60,3);
output["Fs_60_std"] 			= MathROUND(Fs_60_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_60_P_step1_std"] 	= MathROUND(Fm_60_P_step1_std,1);
output["Fm_60_P_step2_std"] 	= MathROUND(Fm_60_P_step2_std,1);
output["Fm_60_P_step3_std"] 	= MathROUND(Fm_60_P_step3_std,1);
output["Fm_60_P_end_std"] 		= MathROUND(Fm_60_P_end_std,1);
output["Fo_60_Prime_std"] 			= MathROUND(Fo_60_Prime_std,1);
*/

//output["Fm_60_P_step1"] = MathROUND(Fm_60_P_step1,3);
//output["Fm_60_P_step2"] = MathROUND(Fm_60_P_step2,3);
//output["Fm_60_P_step3"] = MathROUND(Fm_60_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_60_P_step1,Fm_60_P_step2,Fm_60_P_step3];
//output["slopey"] = Fm_60_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_125","PhiNPQ_125","PhiNO_125","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_30, PhiNO_30... 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_30.m > 0) {
  fv_30_fm = fv_30_fm_noMPF;
  npqt_30 = npqt_30_noMPF;
  PhiNO_30 = PhiNO_30_noMPF;
  PhiNPQ_30 = PhiNPQ_30_noMPF;
  qL_30 = qL_30_noMPF;
  Fm_30_Prime = A0FmP;
  qP = qP_30_noMPF;
  FvP_Fm_30_P = fv_30_fm_noMPF;
  
  if (fv_30_fm <= 0) {
    output["Phi2_30"] 			= 0;
	warning('Phi2_30 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_30_noMPF"] 	= MathROUND(npqt_30,3);
  }
  if (fv_30_fm >=.85) {
    output["Phi2_30"] 			= -1;
	danger("Phi2_30 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_30"] 		= MathROUND(fv_30_fm,3);
  }
  
  if (npqt_30 <= 0) {
	output["PhiNPQ_30"]		= 0;
    output["NPQt_30"]			= 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_30_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_30_noMPF"]  = MathROUND(PhiNPQ_30,3);
	output["npqt_30_noMPF"]	= MathROUND(npqt_30,3);
  }
  else {
	output["PhiNPQ_30"]  = MathROUND(PhiNPQ_30,3);
	output["NPQt_30"]		= MathROUND(npqt_30,3);
  }
	output["PhiNO_30"]		= MathROUND(PhiNO_30,3);
	output["qL_30"]		= MathROUND(qL_30,3);
    output['FvP/Fm_30_P']		= MathROUND(FvP_Fm_30_P,3);
    output['qP_30']			= MathROUND(qP_30,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_30... 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_30_fm <= 0) {
    output["Phi2_30"] 			= 0;
	warning("Phi2_30 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_30_MPF"] 	= MathROUND(npqt_30,3);
  }
  if (fv_30_fm >=.85) {
    output["Phi2_30"] 			= -1;
	danger("Phi2_30 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_30"]			= MathROUND(fv_30_fm,3);
  }
  if (npqt_30 <= 0) {
	output["PhiNPQ_30"]		= 0;
    output["NPQt_30"]			= 0;
	warning("NPQt_30 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_30_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_30_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_30_MPF"]		= MathROUND(npqt_30,3);
  }
  else {
	output["PhiNPQ_30"]  = MathROUND(PhiNPQ_30,3);
	output["NPQt_30"]		= MathROUND(npqt_30,3);
  }
	output["PhiNO_30"]		= MathROUND(PhiNO_30,3);
	output["qL_30"]			= MathROUND(qL_30,3);
    output['FvP/Fm_30_P']		= MathROUND(FvP_Fm_30_P,3);
    output['qP_30']			= MathROUND(qP_30,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_30_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_30_std > 100) {
	danger("noisy Fs_30", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_30_Prime", output);
}
*/
if (Fm_30_P_step1_std > 120 | Fm_30_P_step2_std > 120 | Fm_30_P_step3_std > 120 | Fm_30_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_30_Prime_std > 150) {
	danger("noisy Fo_30_Prime", output);
}
/*
if (reg_30.m > 0) {
	info("Used Phi2_30 and not Phi2_30 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_30_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_30_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_30_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_30_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_30_Prime"] 		= MathROUND(Fm_30_Prime,3);
output["Fs_30"] 			= MathROUND(Fs_30,1);
output['Fo_30_Prime']		= MathROUND(Fo_30_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_30_Prime/Fs_30)-1),3));
//output["ratio MPF/noMPF, Phi2_30"] = MathROUND(fv_30_fm_MPF / fv_30_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_30"] = MathROUND(PhiNPQ_30_MPF / PhiNPQ_30_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_30"] = MathROUND(PhiNO_30_MPF / PhiNO_30_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_30"] = MathROUND(npqt_30_MPF / npqt_30_noMPF,5);
output["MPF_slope_30"] 	= MathROUND(reg_30.m,3);
output["MPF_rsquared_30"] 	= MathROUND(reg_30.r,3);
/*
output["Phi2_30_MPF"] 		= MathROUND(fv_30_fm_MPF,3);
output["Phi2_30_noMPF"] 	= MathROUND(fv_30_fm,3);
output["Fm_30_Prime_MPF"] 	= MathROUND(reg_30.b,3);
output["Fm_30_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_30_MPF']		= MathROUND(qL_30_MPF,3);
output['qL_30_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_30_MPF']		= MathROUND(PhiNO_30_MPF,3);
output['PhiNO_30_noMPF']	= MathROUND(PhiNO_30,3);
output["Fs_30_std"] 			= MathROUND(Fs_30_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_30_P_step1_std"] 	= MathROUND(Fm_30_P_step1_std,1);
output["Fm_30_P_step2_std"] 	= MathROUND(Fm_30_P_step2_std,1);
output["Fm_30_P_step3_std"] 	= MathROUND(Fm_30_P_step3_std,1);
output["Fm_30_P_end_std"] 		= MathROUND(Fm_30_P_end_std,1);
output["Fo_30_Prime_std"] 			= MathROUND(Fo_30_Prime_std,1);
*/

//output["Fm_30_P_step1"] = MathROUND(Fm_30_P_step1,3);
//output["Fm_30_P_step2"] = MathROUND(Fm_30_P_step2,3);
//output["Fm_30_P_step3"] = MathROUND(Fm_30_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_30_P_step1,Fm_30_P_step2,Fm_30_P_step3];
//output["slopey"] = Fm_30_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_30","PhiNPQ_30","PhiNO_30","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_15, PhiNO_15... 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_15.m > 0) {
  fv_15_fm = fv_15_fm_noMPF;
  npqt_15 = npqt_15_noMPF;
  PhiNO_15 = PhiNO_15_noMPF;
  PhiNPQ_15 = PhiNPQ_15_noMPF;
  qL_15 = qL_15_noMPF;
  Fm_15_Prime = A0FmP;
  qP = qP_15_noMPF;
  FvP_Fm_15_P = fv_15_fm_noMPF;
  
  if (fv_15_fm <= 0) {
    output["Phi2_15"] 			= 0;
	warning('Phi2_15 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_15_noMPF"] 	= MathROUND(npqt_15,3);
  }
  if (fv_15_fm >=.85) {
    output["Phi2_15"] 			= -1;
	danger("Phi2_15 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_15"] 		= MathROUND(fv_15_fm,3);
  }
  
  if (npqt_15 <= 0) {
	output["PhiNPQ_15"]		= 0;
    output["NPQt_15"]			= 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_15_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_15_noMPF"]  = MathROUND(PhiNPQ_15,3);
	output["npqt_15_noMPF"]	= MathROUND(npqt_15,3);
  }
  else {
	output["PhiNPQ_15"]  = MathROUND(PhiNPQ_15,3);
	output["NPQt_15"]		= MathROUND(npqt_15,3);
  }
	output["PhiNO_15"]		= MathROUND(PhiNO_15,3);
	output["qL_15"]		= MathROUND(qL_15,3);
    output['FvP/Fm_15_P']		= MathROUND(FvP_Fm_15_P,3);
    output['qP_15']			= MathROUND(qP_15,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_15... 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_15_fm <= 0) {
    output["Phi2_15"] 			= 0;
	warning("Phi2_15 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_15_MPF"] 	= MathROUND(npqt_15,3);
  }
  if (fv_15_fm >=.85) {
    output["Phi2_15"] 			= -1;
	danger("Phi2_15 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_15"]			= MathROUND(fv_15_fm,3);
  }
  if (npqt_15 <= 0) {
	output["PhiNPQ_15"]		= 0;
    output["NPQt_15"]			= 0;
	warning("NPQt_15 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_15_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_15_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_15_MPF"]		= MathROUND(npqt_15,3);
  }
  else {
	output["PhiNPQ_15"]  = MathROUND(PhiNPQ_15,3);
	output["NPQt_15"]		= MathROUND(npqt_15,3);
  }
	output["PhiNO_15"]		= MathROUND(PhiNO_15,3);
	output["qL_15"]			= MathROUND(qL_15,3);
    output['FvP/Fm_15_P']		= MathROUND(FvP_Fm_15_P,3);
    output['qP_15']			= MathROUND(qP_15,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_15_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_15_std > 100) {
	danger("noisy Fs_15", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_15_Prime", output);
}
*/
if (Fm_15_P_step1_std > 120 | Fm_15_P_step2_std > 120 | Fm_15_P_step3_std > 120 | Fm_15_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_15_Prime_std > 150) {
	danger("noisy Fo_15_Prime", output);
}
/*
if (reg_15.m > 0) {
	info("Used Phi2_15 and not Phi2_15 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_15_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_15_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_15_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_15_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_15_Prime"] 		= MathROUND(Fm_15_Prime,3);
output["Fs_15"] 			= MathROUND(Fs_15,1);
output['Fo_15_Prime']		= MathROUND(Fo_15_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_15_Prime/Fs_15)-1),3));
//output["ratio MPF/noMPF, Phi2_15"] = MathROUND(fv_15_fm_MPF / fv_15_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_15"] = MathROUND(PhiNPQ_15_MPF / PhiNPQ_15_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_15"] = MathROUND(PhiNO_15_MPF / PhiNO_15_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_15"] = MathROUND(npqt_15_MPF / npqt_15_noMPF,5);
output["MPF_slope_15"] 	= MathROUND(reg_15.m,3);
output["MPF_rsquared_15"] 	= MathROUND(reg_15.r,3);
/*
output["Phi2_15_MPF"] 		= MathROUND(fv_15_fm_MPF,3);
output["Phi2_15_noMPF"] 	= MathROUND(fv_15_fm,3);
output["Fm_15_Prime_MPF"] 	= MathROUND(reg_15.b,3);
output["Fm_15_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_15_MPF']		= MathROUND(qL_15_MPF,3);
output['qL_15_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_15_MPF']		= MathROUND(PhiNO_15_MPF,3);
output['PhiNO_15_noMPF']	= MathROUND(PhiNO_15,3);
output["Fs_15_std"] 			= MathROUND(Fs_15_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_15_P_step1_std"] 	= MathROUND(Fm_15_P_step1_std,1);
output["Fm_15_P_step2_std"] 	= MathROUND(Fm_15_P_step2_std,1);
output["Fm_15_P_step3_std"] 	= MathROUND(Fm_15_P_step3_std,1);
output["Fm_15_P_end_std"] 		= MathROUND(Fm_15_P_end_std,1);
output["Fo_15_Prime_std"] 			= MathROUND(Fo_15_Prime_std,1);
*/

//output["Fm_15_P_step1"] = MathROUND(Fm_15_P_step1,3);
//output["Fm_15_P_step2"] = MathROUND(Fm_15_P_step2,3);
//output["Fm_15_P_step3"] = MathROUND(Fm_15_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_15_P_step1,Fm_15_P_step2,Fm_15_P_step3];
//output["slopey"] = Fm_15_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_15","PhiNPQ_15","PhiNO_15","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_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["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["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)];





return output;
{
  "time_offset": 240,
  "time": 1507051128565,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:38:86",
  "device_battery": 72,
  "device_firmware": 1.17,
  "sample": [
    {
      "time": 1507051128610,
      "protocol_id": 1,
      "detector_read1": 8978,
      "light_intensity": 7,
      "r": 5,
      "g": 2,
      "b": 2,
      "light_intensity_raw": 7,
      "temperature": 25.950001,
      "humidity": 45.03125,
      "pressure": 1010.916748,
      "temperature2": 25.860001,
      "humidity2": 44.462891,
      "pressure2": 1011.065613,
      "contactless_temp": 24.57,
      "thickness": 0.08,
      "compass_direction": "E",
      "compass": "90.00",
      "angle": 3.8,
      "angle_direction": "S",
      "pitch": 3.63,
      "roll": 1.12,
      "data_raw": [
        13255,
        13347,
        13378,
        13407,
        13417,
        13428,
        13431,
        13426,
        13426,
        13415,
        13418,
        13406,
        13407,
        13395,
        13399,
        13391,
        13381,
        13382,
        13366,
        13373,
        21691,
        22683,
        23010,
        23161,
        23285,
        23374,
        23459,
        23523,
        23573,
        23617,
        23645,
        23655,
        23674,
        23687,
        23696,
        23699,
        23700,
        23701,
        23696,
        23698,
        23691,
        23687,
        23690,
        23685,
        23671,
        23679,
        23671,
        23662,
        23659,
        23654,
        23555,
        23535,
        23525,
        23508,
        23505,
        23501,
        23485,
        23486,
        23479,
        23465,
        23367,
        23339,
        23315,
        23311,
        23306,
        23287,
        23287,
        23282,
        23268,
        23270,
        23142,
        23097,
        23086,
        23075,
        23055,
        23055,
        23052,
        23031,
        23034,
        23030,
        23324,
        23394,
        23421,
        23427,
        23436,
        23434,
        23423,
        23429,
        23420,
        23413,
        23410,
        23408,
        23398,
        23387,
        23391,
        23379,
        23366,
        23371,
        23363,
        23349,
        23352,
        23346,
        23332,
        23327,
        23328,
        23321,
        23311,
        23307,
        23305,
        23293,
        18974,
        16487,
        14831,
        13793,
        13155,
        12758,
        12524,
        12373,
        12292,
        12239,
        12201,
        12190,
        12172,
        12182,
        12183,
        12187,
        12193,
        12191,
        12203,
        12207,
        7811,
        7590,
        7469,
        7369,
        7286,
        7215,
        7161,
        7114,
        7073,
        7028,
        7007,
        6981,
        6953,
        6934,
        6926,
        6909,
        6894,
        6887,
        6883,
        6868,
        6867,
        6865,
        6852,
        6855,
        6854,
        6842,
        6848,
        6846,
        6836,
        6844,
        6841,
        6833,
        6840,
        6839,
        6833,
        6839,
        6839,
        6832,
        6839,
        6837,
        6830,
        6838,
        6839,
        6830,
        6839,
        6841,
        6831,
        6838,
        6841,
        6835,
        6843,
        6843,
        6834,
        6843,
        6843,
        6841,
        6845,
        6847,
        6839,
        6846,
        6851,
        6844,
        6850,
        6853,
        6846,
        6852,
        6854,
        6851,
        6855,
        6858,
        6855,
        6861,
        6859,
        6853,
        6862,
        6863,
        6861,
        6861,
        6867,
        6865,
        6869,
        6873,
        6870,
        6868,
        6877,
        6875,
        6876,
        6882,
        6880,
        6880,
        6886,
        6885,
        6884,
        6887,
        6888,
        6887,
        6894,
        6893,
        6897,
        6899,
        6900,
        6899,
        6901,
        6905,
        6903,
        6911,
        6915,
        6907,
        6918,
        6919,
        6913,
        6926,
        6930,
        6919,
        6934,
        6935,
        6928,
        6939,
        6941,
        6937,
        6949,
        6951,
        6940,
        6953,
        6956,
        6950,
        6959,
        6963,
        6959,
        6969,
        6973,
        6973,
        6975,
        6980,
        6980,
        6979,
        6988,
        6990,
        6983,
        6997,
        7000,
        6995,
        7006,
        7007,
        7003,
        7013,
        7018,
        7014,
        7020,
        7028,
        11239,
        11343,
        11390,
        11417,
        11434,
        11439,
        11446,
        11453,
        11458,
        11458,
        11461,
        11463,
        11463,
        11463,
        11461,
        11460,
        11457,
        11454,
        11451,
        11442,
        23466,
        24237,
        24465,
        24678,
        24908,
        25118,
        25297,
        25436,
        25539,
        25621,
        25671,
        25710,
        25733,
        25751,
        25759,
        25764,
        25763,
        25767,
        25764,
        25753,
        25751,
        25742,
        25735,
        25731,
        25721,
        25707,
        25702,
        25694,
        25695,
        25686,
        25567,
        25537,
        25525,
        25511,
        25503,
        25496,
        25491,
        25484,
        25477,
        25471,
        25324,
        25289,
        25269,
        25257,
        25254,
        25253,
        25245,
        25241,
        25238,
        25231,
        25054,
        25011,
        24993,
        24974,
        24969,
        24963,
        24956,
        24951,
        24946,
        24940,
        25355,
        25439,
        25469,
        25477,
        25479,
        25476,
        25469,
        25460,
        25460,
        25454,
        25446,
        25437,
        25423,
        25420,
        25420,
        25414,
        25413,
        25401,
        25394,
        25390,
        25381,
        25374,
        25371,
        25361,
        25351,
        25342,
        25336,
        25324,
        25313,
        25303,
        18367,
        14688,
        12510,
        11271,
        10582,
        10211,
        10015,
        9903,
        9842,
        9805,
        9779,
        9763,
        9755,
        9747,
        9743,
        9742,
        9744,
        9743,
        9751,
        9753,
        7620,
        7411,
        7300,
        7221,
        7144,
        7085,
        7031,
        6986,
        6949,
        6924,
        6896,
        6877,
        6859,
        6842,
        6828,
        6820,
        6807,
        6799,
        6793,
        6787,
        6780,
        6777,
        6771,
        6767,
        6765,
        6763,
        6758,
        6758,
        6759,
        6753,
        6753,
        6751,
        6750,
        6751,
        6749,
        6747,
        6751,
        6747,
        6749,
        6750,
        6748,
        6747,
        6745,
        6746,
        6746,
        6746,
        6747,
        6747,
        6747,
        6746,
        6749,
        6744,
        6745,
        6746,
        6750,
        6749,
        6751,
        6751,
        6749,
        6749,
        6750,
        6751,
        6751,
        6751,
        6754,
        6754,
        6751,
        6753,
        6753,
        6755,
        6754,
        6756,
        6759,
        6755,
        6758,
        6759,
        6758,
        6760,
        6759,
        6762,
        6759,
        6765,
        6763,
        6765,
        6765,
        6767,
        6770,
        6769,
        6769,
        6770,
        6773,
        6773,
        6775,
        6779,
        6777,
        6779,
        6779,
        6783,
        6784,
        6788,
        6786,
        6788,
        6788,
        6789,
        6790,
        6790,
        6793,
        6793,
        6797,
        6797,
        6799,
        6803,
        6803,
        6803,
        6808,
        6809,
        6808,
        6811,
        6815,
        6814,
        6818,
        6822,
        6821,
        6822,
        6823,
        6829,
        6831,
        6831,
        6834,
        6835,
        6839,
        6842,
        6843,
        6845,
        6849,
        6853,
        6854,
        6857,
        6858,
        6860,
        6862,
        6867,
        6871,
        6871,
        6876,
        6877,
        6877,
        6882,
        6883,
        6887,
        9831,
        9931,
        9979,
        10014,
        10036,
        10053,
        10069,
        10086,
        10098,
        10110,
        10119,
        10125,
        10123,
        10126,
        10135,
        10143,
        10146,
        10149,
        10150,
        10151,
        23337,
        24212,
        24527,
        24837,
        25143,
        25414,
        25635,
        25813,
        25935,
        26019,
        26071,
        26123,
        26151,
        26159,
        26172,
        26175,
        26181,
        26167,
        26175,
        26167,
        26164,
        26147,
        26151,
        26141,
        26131,
        26115,
        26115,
        26105,
        26094,
        26087,
        25975,
        25944,
        25926,
        25917,
        25917,
        25905,
        25895,
        25901,
        25895,
        25888,
        25741,
        25713,
        25702,
        25693,
        25682,
        25683,
        25682,
        25679,
        25669,
        25675,
        25499,
        25453,
        25429,
        25430,
        25423,
        25422,
        25414,
        25418,
        25421,
        25419,
        25846,
        25941,
        25983,
        25999,
        25993,
        26005,
        26007,
        26007,
        25999,
        26010,
        26007,
        26003,
        25999,
        26007,
        26006,
        25997,
        26007,
        26005,
        26002,
        25999,
        26003,
        26003,
        25996,
        25996,
        25998,
        25999,
        25991,
        25995,
        25995,
        25990,
        18099,
        14035,
        11713,
        10427,
        9707,
        9321,
        9111,
        8991,
        8909,
        8855,
        8811,
        8782,
        8767,
        8743,
        8730,
        8715,
        8692,
        8679,
        8676,
        8669,
        7583,
        7391,
        7278,
        7204,
        7132,
        7077,
        7031,
        6986,
        6948,
        6921,
        6897,
        6877,
        6852,
        6844,
        6831,
        6820,
        6811,
        6796,
        6788,
        6791,
        6787,
        6782,
        6777,
        6767,
        6766,
        6769,
        6765,
        6763,
        6763,
        6754,
        6759,
        6757,
        6757,
        6753,
        6748,
        6748,
        6754,
        6750,
        6751,
        6749,
        6742,
        6745,
        6750,
        6747,
        6747,
        6743,
        6740,
        6745,
        6749,
        6746,
        6749,
        6743,
        6740,
        6747,
        6746,
        6748,
        6746,
        6740,
        6742,
        6749,
        6749,
        6750,
        6750,
        6740,
        6742,
        6749,
        6750,
        6751,
        6750,
        6741,
        6743,
        6752,
        6753,
        6753,
        6753,
        6746,
        6749,
        6751,
        6755,
        6754,
        6755,
        6748,
        6755,
        6757,
        6757,
        6759,
        6752,
        6751,
        6759,
        6759,
        6764,
        6759,
        6755,
        6758,
        6764,
        6765,
        6765,
        6762,
        6759,
        6765,
        6771,
        6771,
        6770,
        6765,
        6764,
        6774,
        6774,
        6776,
        6775,
        6771,
        6773,
        6779,
        6782,
        6783,
        6783,
        6778,
        6782,
        6787,
        6787,
        6791,
        6787,
        6785,
        6791,
        6795,
        6794,
        6799,
        6799,
        6795,
        6801,
        6804,
        6805,
        6806,
        6803,
        6807,
        6811,
        6813,
        6818,
        6818,
        6812,
        6819,
        6823,
        6823,
        6825,
        6821,
        6823,
        6833,
        6834,
        6834,
        6836,
        6831,
        8717,
        8797,
        8839,
        8861,
        8891,
        8909,
        8922,
        8935,
        8951,
        8961,
        8965,
        8985,
        8991,
        8996,
        8999,
        9011,
        9018,
        9021,
        9028,
        9035,
        22433,
        23687,
        24196,
        24606,
        24965,
        25289,
        25538,
        25724,
        25855,
        25941,
        26009,
        26054,
        26083,
        26099,
        26103,
        26118,
        26111,
        26114,
        26108,
        26095,
        26098,
        26085,
        26084,
        26074,
        26065,
        26059,
        26041,
        26042,
        26030,
        26027,
        25913,
        25874,
        25870,
        25845,
        25847,
        25839,
        25837,
        25830,
        25817,
        25817,
        25679,
        25647,
        25630,
        25613,
        25612,
        25611,
        25607,
        25606,
        25591,
        25598,
        25425,
        25381,
        25363,
        25343,
        25351,
        25343,
        25336,
        25342,
        25335,
        25342,
        25762,
        25847,
        25890,
        25902,
        25914,
        25917,
        25907,
        25915,
        25911,
        25917,
        25913,
        25910,
        25914,
        25908,
        25914,
        25914,
        25910,
        25915,
        25901,
        25911,
        25903,
        25911,
        25908,
        25905,
        25908,
        25898,
        25907,
        25898,
        25903,
        25903,
        18105,
        14015,
        11667,
        10371,
        9654,
        9264,
        9047,
        8927,
        8846,
        8786,
        8750,
        8715,
        8677,
        8663,
        8642,
        8620,
        8599,
        8596,
        8582,
        8561,
        7531,
        7339,
        7247,
        7156,
        7099,
        7037,
        6992,
        6947,
        6921,
        6889,
        6865,
        6845,
        6821,
        6813,
        6798,
        6780,
        6782,
        6771,
        6755,
        6759,
        6751,
        6743,
        6742,
        6742,
        6737,
        6727,
        6733,
        6730,
        6719,
        6727,
        6722,
        6715,
        6721,
        6720,
        6712,
        6719,
        6716,
        6716,
        6711,
        6715,
        6714,
        6706,
        6715,
        6711,
        6707,
        6711,
        6713,
        6705,
        6711,
        6711,
        6706,
        6709,
        6710,
        6710,
        6703,
        6710,
        6707,
        6703,
        6708,
        6708,
        6703,
        6709,
        6708,
        6703,
        6709,
        6709,
        6711,
        6703,
        6710,
        6710,
        6703,
        6711,
        6710,
        6704,
        6711,
        6712,
        6703,
        6711,
        6713,
        6709,
        6707,
        6711,
        6713,
        6707,
        6714,
        6715,
        6707,
        6718,
        6716,
        6710,
        6718,
        6719,
        6710,
        6719,
        6722,
        6719,
        6713,
        6721,
        6719,
        6716,
        6723,
        6724,
        6717,
        6725,
        6724,
        6721,
        6727,
        6727,
        6723,
        6729,
        6729,
        6726,
        6727,
        6733,
        6734,
        6729,
        6733,
        6735,
        6729,
        6738,
        6740,
        6732,
        6743,
        6740,
        6734,
        6749,
        6747,
        6740,
        6746,
        6748,
        6751,
        6746,
        6752,
        6755,
        6749,
        6759,
        6758,
        6754,
        6759,
        6764,
        6757,
        6767,
        6765,
        6764,
        6770,
        6770,
        6772,
        6770,
        6775,
        6775,
        6311,
        6363,
        6395,
        6438,
        6467,
        6497,
        6515,
        6531,
        6558,
        6574,
        6590,
        6603,
        6612,
        6629,
        6643,
        6648,
        6667,
        6667,
        6682,
        6693,
        16761,
        20768,
        22855,
        23963,
        24603,
        25015,
        25289,
        25483,
        25619,
        25721,
        25786,
        25841,
        25876,
        25909,
        25923,
        25942,
        25948,
        25965,
        25966,
        25976,
        25973,
        25983,
        25975,
        25982,
        25979,
        25983,
        25980,
        25976,
        25971,
        25971,
        25873,
        25839,
        25831,
        25819,
        25823,
        25813,
        25815,
        25807,
        25811,
        25801,
        25683,
        25641,
        25634,
        25622,
        25621,
        25620,
        25614,
        25612,
        25611,
        25612,
        25446,
        25405,
        25383,
        25376,
        25372,
        25368,
        25367,
        25366,
        25367,
        25361,
        25763,
        25847,
        25887,
        25899,
        25910,
        25914,
        25915,
        25917,
        25915,
        25914,
        25911,
        25915,
        25903,
        25914,
        25907,
        25915,
        25900,
        25911,
        25903,
        25909,
        25907,
        25909,
        25907,
        25903,
        25906,
        25899,
        25903,
        25894,
        25899,
        25892,
        18163,
        14201,
        11977,
        10725,
        10049,
        9660,
        9439,
        9298,
        9189,
        9120,
        9050,
        9015,
        8975,
        8936,
        8910,
        8877,
        8862,
        8841,
        8815,
        8804,
        7431,
        7249,
        7159,
        7083,
        7011,
        6966,
        6911,
        6879,
        6843,
        6816,
        6791,
        6775,
        6751,
        6742,
        6724,
        6723,
        6706,
        6705,
        6695,
        6686,
        6687,
        6673,
        6679,
        6671,
        6671,
        6669,
        6659,
        6665,
        6651,
        6659,
        6656,
        6651,
        6655,
        6645,
        6650,
        6644,
        6647,
        6647,
        6639,
        6645,
        6638,
        6643,
        6643,
        6643,
        6642,
        6634,
        6641,
        6636,
        6639,
        6639,
        6631,
        6639,
        6634,
        6637,
        6635,
        6639,
        6639,
        6631,
        6639,
        6634,
        6639,
        6637,
        6638,
        6640,
        6631,
        6637,
        6635,
        6640,
        6641,
        6634,
        6641,
        6633,
        6639,
        6635,
        6639,
        6639,
        6633,
        6640,
        6641,
        6645,
        6643,
        6637,
        6642,
        6635,
        6644,
        6639,
        6646,
        6642,
        6638,
        6647,
        6637,
        6647,
        6646,
        6641,
        6647,
        6642,
        6651,
        6649,
        6650,
        6651,
        6644,
        6651,
        6649,
        6653,
        6655,
        6654,
        6657,
        6651,
        6661,
        6651,
        6662,
        6664,
        6661,
        6662,
        6653,
        6665,
        6659,
        6668,
        6668,
        6663,
        6671,
        6663,
        6673,
        6670,
        6675,
        6673,
        6670,
        6678,
        6671,
        6679,
        6678,
        6682,
        6682,
        6678,
        6685,
        6679,
        6687,
        6687,
        6687,
        6692,
        6683,
        6695,
        6689,
        6695,
        6695,
        6691,
        6698,
        6694,
        6701,
        6701
      ]
    }
  ],
  "app_os": "mac",
  "app_name": "PhotosynQ",
  "app_version": "0.3.9",
  "app_device": "x86-64",
  "location": [
    "43.0087252",
    "-78.7837889"
  ],
  "ConsoleMacro": "425"
}
Default avatar
Created by

Jonathan R Pleban


Protocol connections:
3
Latest Update:
Oct 2017