0-800 par Cl Fl


Calc Cl Fl parameters from 0 100 200 400 800 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_100  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_100_start = 280; // 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_200  
//    -----------------------------  //
//    -----------------------------  //
//    -----------------------------  //
var ps2_200_start = 560; // when does the Phi2 measurement start - usando el nuevo protocolo
// Set our Apparent Fm_200_Prime, 3 Fm_200_Prime steps, and Fs_200 to calculate both traditional fv/fm and new Multi-phase flash fv/fm
//----------------------------
var Fs_200 = MathMEAN(data.slice(ps2_200_start + 1,ps2_200_start + 4)) - baseline; // take only the first 4 values in the Fs range, excluding the very first
var Fs_200_std = MathSTDEV(data.slice(ps2_200_start + 1,ps2_200_start + 4)); // create standard deviation for this value for error checking

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

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

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

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

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

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

// Calculations for corrected Fm_200_Prime using multi-phase flash
// ----------------------------
var reg_200 = MathLINREG(inverse_intensity, [A0FmP,Fm_200_P_step1,Fm_200_P_step2,Fm_200_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_200_fm_noMPF = (A0FmP-Fs_200)/A0FmP;
var fv_200_fm_MPF = (reg_200.b-Fs_200)/reg_200.b;


// Calculate NPQt,PhiNPQ_200, PhiNO_200, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_200_MPF = (4.88 / ((reg_200.b / Fo_200_Prime) -1) )-1;
var npqt_200_noMPF = (4.88 / ((A0FmP / Fo_200_Prime) -1) )-1;
var qL_200_MPF = ((reg_200.b - Fs_200)*Fo_200_Prime)/((reg_200.b-Fo_200_Prime)*Fs_200);
var qL_200_noMPF = ((A0FmP - Fs_200)*Fo_200_Prime)/((A0FmP-Fo_200_Prime)*Fs_200);
var PhiNO_200_MPF = 1/(npqt_200_MPF + 1 + qL_200_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_200_noMPF = 1/(npqt_200_noMPF + 1 + qL_200_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_200_MPF = 1-fv_200_fm_MPF-PhiNO_200_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_200_noMPF = 1-fv_200_fm_noMPF-PhiNO_200_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_200_MPF = (reg_200.b - Fs_200)/(reg_200.b - Fo_200_Prime);
var qP_200_noMPF = (Fm_200_Prime - Fs_200)/(Fm_200_Prime - Fo_200_Prime);
var FvP_Fm_200_P_MPF = (reg_200.b-Fo_200_Prime)/reg_200.b;
var FvP_Fm_200_P_noMPF = (A0FmP-Fo_200_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_200_fm = fv_200_fm_MPF;
var npqt_200  = npqt_200_MPF;
var PhiNO_200 = PhiNO_200_MPF;
var PhiNPQ_200 = PhiNPQ_200_MPF;
var qL_200 = qL_200_MPF;
var Fm_200_Prime = reg_200.b;
var qP_200 = qP_200_MPF;
var FvP_Fm_200_P = FvP_Fm_200_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

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

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

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

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

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

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

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

// Calculations for corrected Fm_400_Prime using multi-phase flash
// ----------------------------
var reg_400 = MathLINREG(inverse_intensity, [A0FmP,Fm_400_P_step1,Fm_400_P_step2,Fm_400_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_400_fm_noMPF = (A0FmP-Fs_400)/A0FmP;
var fv_400_fm_MPF = (reg_400.b-Fs_400)/reg_400.b;


// Calculate NPQt,PhiNPQ_400, PhiNO_400, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_400_MPF = (4.88 / ((reg_400.b / Fo_400_Prime) -1) )-1;
var npqt_400_noMPF = (4.88 / ((A0FmP / Fo_400_Prime) -1) )-1;
var qL_400_MPF = ((reg_400.b - Fs_400)*Fo_400_Prime)/((reg_400.b-Fo_400_Prime)*Fs_400);
var qL_400_noMPF = ((A0FmP - Fs_400)*Fo_400_Prime)/((A0FmP-Fo_400_Prime)*Fs_400);
var PhiNO_400_MPF = 1/(npqt_400_MPF + 1 + qL_400_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_400_noMPF = 1/(npqt_400_noMPF + 1 + qL_400_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_400_MPF = 1-fv_400_fm_MPF-PhiNO_400_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_400_noMPF = 1-fv_400_fm_noMPF-PhiNO_400_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_400_MPF = (reg_400.b - Fs_400)/(reg_400.b - Fo_400_Prime);
var qP_400_noMPF = (Fm_400_Prime - Fs_400)/(Fm_400_Prime - Fo_400_Prime);
var FvP_Fm_400_P_MPF = (reg_400.b-Fo_400_Prime)/reg_400.b;
var FvP_Fm_400_P_noMPF = (A0FmP-Fo_400_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_400_fm = fv_400_fm_MPF;
var npqt_400  = npqt_400_MPF;
var PhiNO_400 = PhiNO_400_MPF;
var PhiNPQ_400 = PhiNPQ_400_MPF;
var qL_400 = qL_400_MPF;
var Fm_400_Prime = reg_400.b;
var qP_400 = qP_400_MPF;
var FvP_Fm_400_P = FvP_Fm_400_P_MPF;
var b = json.b;
var r = json.r;
var g = json.g;

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

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

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

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

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

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

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

// Calculations for corrected Fm_800_Prime using multi-phase flash
// ----------------------------
var reg_800 = MathLINREG(inverse_intensity, [A0FmP,Fm_800_P_step1,Fm_800_P_step2,Fm_800_P_step3]);

// Calculate Phi2 w/ and w/out multi-phase flash
// ----------------------------
var fv_800_fm_noMPF = (A0FmP-Fs_800)/A0FmP;
var fv_800_fm_MPF = (reg_800.b-Fs_800)/reg_800.b;


// Calculate NPQt,PhiNPQ_800, PhiNO_800, qL w/ and w/out multi-phase flash
// ----------------------------
var npqt_800_MPF = (4.88 / ((reg_800.b / Fo_800_Prime) -1) )-1;
var npqt_800_noMPF = (4.88 / ((A0FmP / Fo_800_Prime) -1) )-1;
var qL_800_MPF = ((reg_800.b - Fs_800)*Fo_800_Prime)/((reg_800.b-Fo_800_Prime)*Fs_800);
var qL_800_noMPF = ((A0FmP - Fs_800)*Fo_800_Prime)/((A0FmP-Fo_800_Prime)*Fs_800);
var PhiNO_800_MPF = 1/(npqt_800_MPF + 1 + qL_800_MPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNO_800_noMPF = 1/(npqt_800_noMPF + 1 + qL_800_noMPF*4.88); //based on equation 52 in Kramer et al., 2004 PRES
var PhiNPQ_800_MPF = 1-fv_800_fm_MPF-PhiNO_800_MPF; //based on equation 53 in Kramer et al., 2004 PRES 
var PhiNPQ_800_noMPF = 1-fv_800_fm_noMPF-PhiNO_800_noMPF; //based on equation 53 in Kramer et al., 2004 PRES 

var qP_800_MPF = (reg_800.b - Fs_800)/(reg_800.b - Fo_800_Prime);
var qP_800_noMPF = (Fm_800_Prime - Fs_800)/(Fm_800_Prime - Fo_800_Prime);
var FvP_Fm_800_P_MPF = (reg_800.b-Fo_800_Prime)/reg_800.b;
var FvP_Fm_800_P_noMPF = (A0FmP-Fo_800_Prime)/A0FmP;

// Create the variables to be printed (assume to use the MPF values unless there is a good reason not to)
// ----------------------------
var fv_800_fm = fv_800_fm_MPF;
var npqt_800  = npqt_800_MPF;
var PhiNO_800 = PhiNO_800_MPF;
var PhiNPQ_800 = PhiNPQ_800_MPF;
var qL_800 = qL_800_MPF;
var Fm_800_Prime = reg_800.b;
var qP_800 = qP_800_MPF;
var FvP_Fm_800_P = FvP_Fm_800_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_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_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_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_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_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_200.m > 0) {
  fv_200_fm = fv_200_fm_noMPF;
  npqt_200 = npqt_200_noMPF;
  PhiNO_200 = PhiNO_200_noMPF;
  PhiNPQ_200 = PhiNPQ_200_noMPF;
  qL_200 = qL_200_noMPF;
  Fm_200_Prime = A0FmP;
  qP = qP_200_noMPF;
  FvP_Fm_200_P = fv_200_fm_noMPF;
  
  if (fv_200_fm <= 0) {
    output["Phi2_200"] 			= 0;
	warning('Phi2_200 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_200_noMPF"] 	= MathROUND(npqt_200,3);
  }
  if (fv_200_fm >=.85) {
    output["Phi2_200"] 			= -1;
	danger("Phi2_200 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_200"] 		= MathROUND(fv_200_fm,3);
  }
  
  if (npqt_200 <= 0) {
	output["PhiNPQ_200"]		= 0;
    output["NPQt_200"]			= 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_200_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_200_noMPF"]  = MathROUND(PhiNPQ_200,3);
	output["npqt_200_noMPF"]	= MathROUND(npqt_200,3);
  }
  else {
	output["PhiNPQ_200"]  = MathROUND(PhiNPQ_200,3);
	output["NPQt_200"]		= MathROUND(npqt_200,3);
  }
	output["PhiNO_200"]		= MathROUND(PhiNO_200,3);
	output["qL_200"]		= MathROUND(qL_200,3);
    output['FvP/Fm_200_P']		= MathROUND(FvP_Fm_200_P,3);
    output['qP_200']			= MathROUND(qP_200,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_200... 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_200_fm <= 0) {
    output["Phi2_200"] 			= 0;
	warning("Phi2_200 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_200_MPF"] 	= MathROUND(npqt_200,3);
  }
  if (fv_200_fm >=.85) {
    output["Phi2_200"] 			= -1;
	danger("Phi2_200 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_200"]			= MathROUND(fv_200_fm,3);
  }
  if (npqt_200 <= 0) {
	output["PhiNPQ_200"]		= 0;
    output["NPQt_200"]			= 0;
	warning("NPQt_200 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_200_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_200_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_200_MPF"]		= MathROUND(npqt_250,3);
  }
  else {
	output["PhiNPQ_200"]  = MathROUND(PhiNPQ_200,3);
	output["NPQt_200"]		= MathROUND(npqt_200,3);
  }
	output["PhiNO_200"]		= MathROUND(PhiNO_200,3);
	output["qL_200"]			= MathROUND(qL_200,3);
    output['FvP/Fm_200_P']		= MathROUND(FvP_Fm_200_P,3);
    output['qP_200']			= MathROUND(qP_200,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_200_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_200_std > 100) {
	danger("noisy Fs_200", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_200_Prime", output);
}
*/
if (Fm_200_P_step1_std > 120 | Fm_200_P_step2_std > 120 | Fm_200_P_step3_std > 120 | Fm_200_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_200_Prime_std > 150) {
	danger("noisy Fo_200_Prime", output);
}
/*
if (reg_200.m > 0) {
	info("Used Phi2_200 and not Phi2_200 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_200_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_200_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_200_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_200_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_200_Prime"] 		= MathROUND(Fm_200_Prime,3);
output["Fs_200"] 			= MathROUND(Fs_200,1);
output['Fo_200_Prime']		= MathROUND(Fo_200_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_200_Prime/Fs_200)-1),3));
//output["ratio MPF/noMPF, Phi2_200"] = MathROUND(fv_200_fm_MPF / fv_200_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_200"] = MathROUND(PhiNPQ_200_MPF / PhiNPQ_200_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_200"] = MathROUND(PhiNO_200_MPF / PhiNO_200_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_200"] = MathROUND(npqt_200_MPF / npqt_200_noMPF,5);
output["MPF_slope_200"] 	= MathROUND(reg_200.m,3);
output["MPF_rsquared_200"] 	= MathROUND(reg_200.r,3);
/*
output["Phi2_200_MPF"] 		= MathROUND(fv_200_fm_MPF,3);
output["Phi2_200_noMPF"] 	= MathROUND(fv_200_fm,3);
output["Fm_200_Prime_MPF"] 	= MathROUND(reg_200.b,3);
output["Fm_200_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_200_MPF']		= MathROUND(qL_200_MPF,3);
output['qL_200_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_200_MPF']		= MathROUND(PhiNO_200_MPF,3);
output['PhiNO_200_noMPF']	= MathROUND(PhiNO_200,3);
output["Fs_200_std"] 			= MathROUND(Fs_200_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_200_P_step1_std"] 	= MathROUND(Fm_200_P_step1_std,1);
output["Fm_200_P_step2_std"] 	= MathROUND(Fm_200_P_step2_std,1);
output["Fm_200_P_step3_std"] 	= MathROUND(Fm_200_P_step3_std,1);
output["Fm_200_P_end_std"] 		= MathROUND(Fm_200_P_end_std,1);
output["Fo_200_Prime_std"] 			= MathROUND(Fo_200_Prime_std,1);
*/

//output["Fm_200_P_step1"] = MathROUND(Fm_200_P_step1,3);
//output["Fm_200_P_step2"] = MathROUND(Fm_200_P_step2,3);
//output["Fm_200_P_step3"] = MathROUND(Fm_200_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_200_P_step1,Fm_200_P_step2,Fm_200_P_step3];
//output["slopey"] = Fm_200_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_200","PhiNPQ_200","PhiNO_200","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_400, PhiNO_400... 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_400.m > 0) {
  fv_400_fm = fv_400_fm_noMPF;
  npqt_400 = npqt_400_noMPF;
  PhiNO_400 = PhiNO_400_noMPF;
  PhiNPQ_400 = PhiNPQ_400_noMPF;
  qL_400 = qL_400_noMPF;
  Fm_400_Prime = A0FmP;
  qP = qP_400_noMPF;
  FvP_Fm_400_P = fv_400_fm_noMPF;
  
  if (fv_400_fm <= 0) {
    output["Phi2_400"] 			= 0;
	warning('Phi2_400 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_400_noMPF"] 	= MathROUND(npqt_400,3);
  }
  if (fv_400_fm >=.85) {
    output["Phi2_400"] 			= -1;
	danger("Phi2_400 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_400"] 		= MathROUND(fv_400_fm,3);
  }
  
  if (npqt_400 <= 0) {
	output["PhiNPQ_400"]		= 0;
    output["NPQt_400"]			= 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_400_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_400_noMPF"]  = MathROUND(PhiNPQ_400,3);
	output["npqt_400_noMPF"]	= MathROUND(npqt_400,3);
  }
  else {
	output["PhiNPQ_400"]  = MathROUND(PhiNPQ_400,3);
	output["NPQt_400"]		= MathROUND(npqt_400,3);
  }
	output["PhiNO_400"]		= MathROUND(PhiNO_400,3);
	output["qL_400"]		= MathROUND(qL_400,3);
    output['FvP/Fm_400_P']		= MathROUND(FvP_Fm_400_P,3);
    output['qP_400']			= MathROUND(qP_400,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_400... 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_400_fm <= 0) {
    output["Phi2_400"] 			= 0;
	warning("Phi2_400 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_400_MPF"] 	= MathROUND(npqt_400,3);
  }
  if (fv_400_fm >=.85) {
    output["Phi2_400"] 			= -1;
	danger("Phi2_400 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_400"]			= MathROUND(fv_400_fm,3);
  }
  if (npqt_400 <= 0) {
	output["PhiNPQ_400"]		= 0;
    output["NPQt_400"]			= 0;
	warning("NPQt_400 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_400_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_400_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_400_MPF"]		= MathROUND(npqt_400,3);
  }
  else {
	output["PhiNPQ_400"]  = MathROUND(PhiNPQ_400,3);
	output["NPQt_400"]		= MathROUND(npqt_400,3);
  }
	output["PhiNO_400"]		= MathROUND(PhiNO_400,3);
	output["qL_400"]			= MathROUND(qL_400,3);
    output['FvP/Fm_400_P']		= MathROUND(FvP_Fm_400_P,3);
    output['qP_400']			= MathROUND(qP_400,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_400_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_400_std > 100) {
	danger("noisy Fs_400", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_400_Prime", output);
}
*/
if (Fm_400_P_step1_std > 120 | Fm_400_P_step2_std > 120 | Fm_400_P_step3_std > 120 | Fm_400_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_400_Prime_std > 150) {
	danger("noisy Fo_400_Prime", output);
}
/*
if (reg_400.m > 0) {
	info("Used Phi2_400 and not Phi2_400 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_400_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_400_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_400_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_400_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_400_Prime"] 		= MathROUND(Fm_400_Prime,3);
output["Fs_400"] 			= MathROUND(Fs_400,1);
output['Fo_400_Prime']		= MathROUND(Fo_400_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_400_Prime/Fs_400)-1),3));
//output["ratio MPF/noMPF, Phi2_400"] = MathROUND(fv_400_fm_MPF / fv_400_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_400"] = MathROUND(PhiNPQ_400_MPF / PhiNPQ_400_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_400"] = MathROUND(PhiNO_400_MPF / PhiNO_400_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_400"] = MathROUND(npqt_400_MPF / npqt_400_noMPF,5);
output["MPF_slope_400"] 	= MathROUND(reg_400.m,3);
output["MPF_rsquared_400"] 	= MathROUND(reg_400.r,3);
/*
output["Phi2_400_MPF"] 		= MathROUND(fv_400_fm_MPF,3);
output["Phi2_400_noMPF"] 	= MathROUND(fv_400_fm,3);
output["Fm_400_Prime_MPF"] 	= MathROUND(reg_400.b,3);
output["Fm_400_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_400_MPF']		= MathROUND(qL_400_MPF,3);
output['qL_400_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_400_MPF']		= MathROUND(PhiNO_400_MPF,3);
output['PhiNO_400_noMPF']	= MathROUND(PhiNO_400,3);
output["Fs_400_std"] 			= MathROUND(Fs_400_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_400_P_step1_std"] 	= MathROUND(Fm_400_P_step1_std,1);
output["Fm_400_P_step2_std"] 	= MathROUND(Fm_400_P_step2_std,1);
output["Fm_400_P_step3_std"] 	= MathROUND(Fm_400_P_step3_std,1);
output["Fm_400_P_end_std"] 		= MathROUND(Fm_400_P_end_std,1);
output["Fo_400_Prime_std"] 			= MathROUND(Fo_400_Prime_std,1);
*/

//output["Fm_400_P_step1"] = MathROUND(Fm_400_P_step1,3);
//output["Fm_400_P_step2"] = MathROUND(Fm_400_P_step2,3);
//output["Fm_400_P_step3"] = MathROUND(Fm_400_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_400_P_step1,Fm_400_P_step2,Fm_400_P_step3];
//output["slopey"] = Fm_400_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_400","PhiNPQ_400","PhiNO_400","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_800, PhiNO_800... 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_800.m > 0) {
  fv_800_fm = fv_800_fm_noMPF;
  npqt_800 = npqt_800_noMPF;
  PhiNO_800 = PhiNO_800_noMPF;
  PhiNPQ_800 = PhiNPQ_800_noMPF;
  qL_800 = qL_800_noMPF;
  Fm_800_Prime = A0FmP;
  qP = qP_800_noMPF;
  FvP_Fm_800_P = fv_800_fm_noMPF;
  
  if (fv_800_fm <= 0) {
    output["Phi2_800"] 			= 0;
	warning('Phi2_800 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_800_noMPF"] 	= MathROUND(npqt_800,3);
  }
  if (fv_800_fm >=.85) {
    output["Phi2_800"] 			= -1;
	danger("Phi2_800 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);

  }
  else {
	  output["Phi2_800"] 		= MathROUND(fv_800_fm,3);
  }
  
  if (npqt_800 <= 0) {
	output["PhiNPQ_800"]		= 0;
    output["NPQt_800"]			= 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_800_noMPF and PhiNPQ_noMPF variable",output);
	output["PhiNPQ_800_noMPF"]  = MathROUND(PhiNPQ_800,3);
	output["npqt_800_noMPF"]	= MathROUND(npqt_800,3);
  }
  else {
	output["PhiNPQ_800"]  = MathROUND(PhiNPQ_800,3);
	output["NPQt_800"]		= MathROUND(npqt_800,3);
  }
	output["PhiNO_800"]		= MathROUND(PhiNO_800,3);
	output["qL_800"]		= MathROUND(qL_800,3);
    output['FvP/Fm_800_P']		= MathROUND(FvP_Fm_800_P,3);
    output['qP_800']			= MathROUND(qP_800,3);
}

// Otherwise, use the multi-phase flash calculation for Phi2, NPQt, PhiNPQ, PhiNO_800... 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_800_fm <= 0) {
    output["Phi2_800"] 			= 0;
	warning("Phi2_800 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_800_MPF"] 	= MathROUND(npqt_800,3);
  }
  if (fv_800_fm >=.85) {
    output["Phi2_800"] 			= -1;
	danger("Phi2_800 above the normal range (0 - 0.85).  Please check the raw trace and seriously consider excluding this point.", output);
  }
  else {
    output["Phi2_800"]			= MathROUND(fv_800_fm,3);
  }
  if (npqt_800 <= 0) {
	output["PhiNPQ_800"]		= 0;
    output["NPQt_800"]			= 0;
	warning("NPQt_800 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_800_MPF and PhiNPQ_MPF variables",output);
	output["PhiNPQ_800_MPF"]  = MathROUND(PhiNPQ,3);
	output["npqt_800_MPF"]		= MathROUND(npqt_800,3);
  }
  else {
	output["PhiNPQ_800"]  = MathROUND(PhiNPQ_800,3);
	output["NPQt_800"]		= MathROUND(npqt_800,3);
  }
	output["PhiNO_800"]		= MathROUND(PhiNO_800,3);
	output["qL_800"]			= MathROUND(qL_800,3);
    output['FvP/Fm_800_P']		= MathROUND(FvP_Fm_800_P,3);
    output['qP_800']			= MathROUND(qP_800,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_800_fm  * 0.45 * json.light_intensity),3);
}

if (Fs_800_std > 100) {
	danger("noisy Fs_800", output);
}
/*
if (A0FmP_std > 300) {
	danger("noisy Fm_800_Prime", output);
}
*/
if (Fm_800_P_step1_std > 120 | Fm_800_P_step2_std > 120 | Fm_800_P_step3_std > 120 | Fm_800_P_end_std > 300) {
	danger("noisy  multi-phase flash steps",output);
}

if (Fo_800_Prime_std > 150) {
	danger("noisy Fo_800_Prime", output);
}
/*
if (reg_800.m > 0) {
	info("Used Phi2_800 and not Phi2_800 MPF - ambient light level was too low to apply MPF calculation", output);
}
if (Fm_800_P_end/A0FmP - A0FmP/A0FmP > .1) {	
	info("Fm_800_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_800_P_end/A0FmP - A0FmP/A0FmP < -.1) {
	info("Fm_800_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_800_Prime"] 		= MathROUND(Fm_800_Prime,3);
output["Fs_800"] 			= MathROUND(Fs_800,1);
output['Fo_800_Prime']		= MathROUND(Fo_800_Prime,0);
output["RFd"]           = Number(MathROUND(((Fm_800_Prime/Fs_800)-1),3));
//output["ratio MPF/noMPF, Phi2_800"] = MathROUND(fv_800_fm_MPF / fv_800_fm_noMPF,5);
//output["ratio MPF/noMPF, PhiNPQ_800"] = MathROUND(PhiNPQ_800_MPF / PhiNPQ_800_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_800"] = MathROUND(PhiNO_800_MPF / PhiNO_800_noMPF,5);
//output["ratio MPF/noMPF, PhiNO_800"] = MathROUND(npqt_800_MPF / npqt_800_noMPF,5);
output["MPF_slope_800"] 	= MathROUND(reg_800.m,3);
output["MPF_rsquared_800"] 	= MathROUND(reg_800.r,3);
/*
output["Phi2_800_MPF"] 		= MathROUND(fv_800_fm_MPF,3);
output["Phi2_800_noMPF"] 	= MathROUND(fv_800_fm,3);
output["Fm_800_Prime_MPF"] 	= MathROUND(reg_800.b,3);
output["Fm_800_Prime_noMPF"] = MathROUND(A0FmP,1);
output['qL_800_MPF']		= MathROUND(qL_800_MPF,3);
output['qL_800_noMPF']      = MathROUND(qL,3);
output['PhiNPQ_MPF']    = MathROUND(PhiNPQ_MPF,3);
output['PhiNPQ_noMPF']  = MathROUND(PhiNPQ,3);
output['PhiNO_800_MPF']		= MathROUND(PhiNO_800_MPF,3);
output['PhiNO_800_noMPF']	= MathROUND(PhiNO_800,3);
output["Fs_800_std"] 			= MathROUND(Fs_800_std,1);
output["A0FmP_std"] 			= MathROUND(A0FmP_std,1);
output["Fm_800_P_step1_std"] 	= MathROUND(Fm_800_P_step1_std,1);
output["Fm_800_P_step2_std"] 	= MathROUND(Fm_800_P_step2_std,1);
output["Fm_800_P_step3_std"] 	= MathROUND(Fm_800_P_step3_std,1);
output["Fm_800_P_end_std"] 		= MathROUND(Fm_800_P_end_std,1);
output["Fo_800_Prime_std"] 			= MathROUND(Fo_800_Prime_std,1);
*/

//output["Fm_800_P_step1"] = MathROUND(Fm_800_P_step1,3);
//output["Fm_800_P_step2"] = MathROUND(Fm_800_P_step2,3);
//output["Fm_800_P_step3"] = MathROUND(Fm_800_P_step3,3);
//output["intensity inverse"] = inverse_intensity;
//output["steps"] = [A0FmP,Fm_800_P_step1,Fm_800_P_step2,Fm_800_P_step3];
//output["slopey"] = Fm_800_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_800","PhiNPQ_800","PhiNO_800","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": 1498042467574,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:70:99",
  "device_battery": 92,
  "device_firmware": 1.17,
  "sample": [
    {
      "time": 1498042467588,
      "protocol_id": 1,
      "detector_read1": 10130,
      "light_intensity": 4,
      "r": 0,
      "g": 0,
      "b": 0,
      "light_intensity_raw": 0,
      "temperature": 22.9,
      "humidity": 63.0625,
      "pressure": 994.469849,
      "temperature2": 23.049999,
      "humidity2": 63.671875,
      "pressure2": 994.972046,
      "contactless_temp": 22.33,
      "thickness": 0.97,
      "compass_direction": "E",
      "compass": "90.00",
      "angle": 5.18,
      "angle_direction": "S",
      "pitch": 5,
      "roll": 1.36,
      "data_raw": [
        4773,
        4835,
        4887,
        4934,
        4978,
        5016,
        5057,
        5094,
        5138,
        5171,
        5205,
        5235,
        5258,
        5292,
        5319,
        5348,
        5367,
        5391,
        5405,
        5422,
        14483,
        16085,
        16989,
        17846,
        18772,
        19657,
        20401,
        20976,
        21411,
        21730,
        21974,
        22159,
        22302,
        22415,
        22499,
        22572,
        22631,
        22679,
        22714,
        22742,
        22771,
        22787,
        22804,
        22815,
        22827,
        22833,
        22839,
        22845,
        22849,
        22850,
        22813,
        22814,
        22815,
        22815,
        22815,
        22813,
        22811,
        22810,
        22806,
        22803,
        22757,
        22750,
        22749,
        22745,
        22739,
        22739,
        22737,
        22725,
        22723,
        22719,
        22656,
        22652,
        22641,
        22638,
        22638,
        22638,
        22636,
        22630,
        22629,
        22627,
        22769,
        22765,
        22765,
        22759,
        22753,
        22747,
        22737,
        22731,
        22725,
        22717,
        22712,
        22703,
        22696,
        22691,
        22683,
        22675,
        22669,
        22663,
        22660,
        22654,
        22646,
        22637,
        22634,
        22625,
        22619,
        22615,
        22609,
        22599,
        22595,
        22589,
        16943,
        15517,
        14799,
        14303,
        13916,
        13589,
        13309,
        13074,
        12859,
        12667,
        12497,
        12342,
        12201,
        12068,
        11943,
        11839,
        11735,
        11637,
        11549,
        11461,
        5652,
        5579,
        5551,
        5531,
        5517,
        5510,
        5496,
        5489,
        5480,
        5475,
        5468,
        5463,
        5457,
        5452,
        5449,
        5444,
        5439,
        5434,
        5430,
        5426,
        5425,
        5421,
        5421,
        5421,
        5419,
        5417,
        5415,
        5415,
        5411,
        5411,
        5411,
        5407,
        5407,
        5404,
        5403,
        5402,
        5402,
        5400,
        5399,
        5398,
        5394,
        5391,
        5390,
        5390,
        5389,
        5391,
        5394,
        5393,
        5393,
        5391,
        5390,
        5390,
        5389,
        5389,
        5386,
        5388,
        5387,
        5384,
        5383,
        5383,
        5383,
        5383,
        5378,
        5377,
        5376,
        5377,
        5374,
        5379,
        5378,
        5378,
        5379,
        5380,
        5380,
        5377,
        5377,
        5378,
        5377,
        5378,
        5377,
        5375,
        5376,
        5377,
        5375,
        5374,
        5375,
        5374,
        5373,
        5372,
        5371,
        5369,
        5368,
        5368,
        5367,
        5369,
        5369,
        5370,
        5372,
        5373,
        5371,
        5372,
        5372,
        5370,
        5372,
        5371,
        5371,
        5371,
        5368,
        5369,
        5367,
        5367,
        5365,
        5368,
        5369,
        5369,
        5370,
        5367,
        5365,
        5363,
        5361,
        5363,
        5362,
        5364,
        5367,
        5369,
        5367,
        5368,
        5367,
        5367,
        5367,
        5368,
        5367,
        5365,
        5363,
        5367,
        5366,
        5365,
        5365,
        5366,
        5364,
        5364,
        5366,
        5365,
        5365,
        5363,
        5367,
        5366,
        5365,
        5360,
        5361,
        5361,
        7702,
        7733,
        7749,
        7751,
        7751,
        7743,
        7748,
        7742,
        7740,
        7735,
        7727,
        7729,
        7725,
        7723,
        7715,
        7718,
        7716,
        7715,
        7706,
        7707,
        15171,
        16071,
        16648,
        17088,
        17464,
        17775,
        18031,
        18257,
        18436,
        18588,
        18718,
        18829,
        18915,
        19001,
        19068,
        19121,
        19173,
        19215,
        19247,
        19282,
        19309,
        19327,
        19349,
        19364,
        19367,
        19387,
        19393,
        19395,
        19407,
        19411,
        19338,
        19340,
        19337,
        19330,
        19329,
        19327,
        19319,
        19321,
        19317,
        19305,
        19219,
        19207,
        19189,
        19185,
        19178,
        19162,
        19158,
        19153,
        19137,
        19139,
        19015,
        18993,
        18981,
        18967,
        18951,
        18947,
        18931,
        18916,
        18915,
        18905,
        19184,
        19207,
        19215,
        19210,
        19213,
        19210,
        19200,
        19196,
        19193,
        19177,
        19177,
        19171,
        19157,
        19153,
        19147,
        19131,
        19132,
        19127,
        19109,
        19106,
        19101,
        19091,
        19086,
        19076,
        19071,
        19063,
        19047,
        19046,
        19040,
        19023,
        14055,
        12197,
        11315,
        10883,
        10650,
        10513,
        10422,
        10363,
        10315,
        10269,
        10229,
        10203,
        10175,
        10145,
        10119,
        10099,
        10079,
        10051,
        10031,
        10015,
        5350,
        5285,
        5256,
        5239,
        5220,
        5209,
        5197,
        5185,
        5180,
        5172,
        5162,
        5161,
        5159,
        5150,
        5147,
        5144,
        5135,
        5137,
        5135,
        5134,
        5125,
        5127,
        5127,
        5115,
        5119,
        5118,
        5112,
        5111,
        5113,
        5114,
        5105,
        5110,
        5107,
        5109,
        5101,
        5107,
        5104,
        5099,
        5103,
        5103,
        5103,
        5097,
        5103,
        5103,
        5094,
        5099,
        5099,
        5099,
        5095,
        5097,
        5098,
        5091,
        5097,
        5095,
        5097,
        5093,
        5095,
        5097,
        5091,
        5098,
        5096,
        5097,
        5090,
        5095,
        5097,
        5091,
        5095,
        5095,
        5095,
        5094,
        5094,
        5095,
        5092,
        5093,
        5095,
        5093,
        5091,
        5096,
        5095,
        5089,
        5095,
        5095,
        5095,
        5092,
        5095,
        5097,
        5092,
        5098,
        5098,
        5093,
        5094,
        5096,
        5098,
        5093,
        5099,
        5096,
        5094,
        5095,
        5099,
        5101,
        5095,
        5100,
        5100,
        5095,
        5098,
        5100,
        5101,
        5095,
        5103,
        5101,
        5101,
        5102,
        5101,
        5102,
        5099,
        5103,
        5106,
        5099,
        5106,
        5106,
        5111,
        5103,
        5109,
        5108,
        5103,
        5110,
        5109,
        5110,
        5107,
        5111,
        5113,
        5111,
        5113,
        5115,
        5117,
        5110,
        5117,
        5115,
        5114,
        5117,
        5118,
        5114,
        5115,
        5125,
        5125,
        5115,
        5125,
        5126,
        5118,
        5128,
        6711,
        6735,
        6739,
        6755,
        6753,
        6760,
        6764,
        6765,
        6768,
        6765,
        6767,
        6764,
        6766,
        6761,
        6767,
        6761,
        6766,
        6761,
        6764,
        6763,
        10797,
        11721,
        12356,
        12736,
        12952,
        13105,
        13221,
        13329,
        13418,
        13506,
        13581,
        13650,
        13707,
        13758,
        13808,
        13853,
        13892,
        13919,
        13954,
        13975,
        14002,
        14018,
        14043,
        14055,
        14077,
        14084,
        14102,
        14115,
        14125,
        14131,
        14059,
        14060,
        14054,
        14060,
        14061,
        14070,
        14069,
        14076,
        14072,
        14083,
        13988,
        13987,
        13973,
        13978,
        13971,
        13977,
        13973,
        13975,
        13970,
        13971,
        13858,
        13840,
        13832,
        13817,
        13817,
        13809,
        13811,
        13799,
        13805,
        13797,
        14087,
        14111,
        14134,
        14137,
        14149,
        14144,
        14151,
        14145,
        14148,
        14149,
        14147,
        14146,
        14139,
        14137,
        14131,
        14136,
        14127,
        14134,
        14122,
        14127,
        14126,
        14123,
        14120,
        14113,
        14111,
        14102,
        14106,
        14095,
        14102,
        14091,
        10899,
        9555,
        8891,
        8561,
        8416,
        8330,
        8290,
        8249,
        8229,
        8202,
        8186,
        8169,
        8159,
        8149,
        8140,
        8131,
        8123,
        8115,
        8107,
        8105,
        4975,
        4908,
        4889,
        4871,
        4853,
        4844,
        4835,
        4819,
        4817,
        4807,
        4805,
        4794,
        4797,
        4787,
        4789,
        4779,
        4781,
        4775,
        4774,
        4771,
        4773,
        4765,
        4769,
        4763,
        4768,
        4762,
        4767,
        4759,
        4762,
        4755,
        4762,
        4753,
        4759,
        4753,
        4758,
        4754,
        4757,
        4753,
        4755,
        4753,
        4757,
        4751,
        4757,
        4751,
        4755,
        4750,
        4757,
        4751,
        4756,
        4751,
        4754,
        4754,
        4757,
        4759,
        4757,
        4758,
        4758,
        4757,
        4756,
        4759,
        4758,
        4759,
        4757,
        4757,
        4758,
        4762,
        4761,
        4762,
        4762,
        4759,
        4760,
        4761,
        4764,
        4762,
        4764,
        4760,
        4764,
        4763,
        4765,
        4763,
        4765,
        4766,
        4766,
        4766,
        4768,
        4769,
        4769,
        4767,
        4772,
        4767,
        4773,
        4769,
        4772,
        4769,
        4773,
        4772,
        4773,
        4770,
        4774,
        4772,
        4775,
        4773,
        4776,
        4775,
        4777,
        4776,
        4780,
        4777,
        4779,
        4779,
        4781,
        4779,
        4783,
        4780,
        4786,
        4785,
        4788,
        4783,
        4789,
        4786,
        4791,
        4788,
        4791,
        4789,
        4794,
        4791,
        4793,
        4790,
        4797,
        4794,
        4798,
        4795,
        4801,
        4799,
        4802,
        4799,
        4803,
        4802,
        4805,
        4804,
        4806,
        4805,
        4810,
        4807,
        4810,
        4807,
        4813,
        4813,
        4815,
        4815,
        6735,
        6742,
        6753,
        6758,
        6755,
        6760,
        6765,
        6761,
        6766,
        6761,
        6768,
        6770,
        6762,
        6767,
        6761,
        6767,
        6766,
        6763,
        6766,
        6765,
        8979,
        9545,
        9924,
        10191,
        10368,
        10478,
        10562,
        10621,
        10663,
        10711,
        10746,
        10780,
        10811,
        10839,
        10861,
        10881,
        10903,
        10920,
        10930,
        10949,
        10963,
        10969,
        10988,
        10997,
        10999,
        11015,
        11021,
        11027,
        11038,
        11045,
        10973,
        10961,
        10964,
        10962,
        10962,
        10970,
        10970,
        10969,
        10979,
        10980,
        10891,
        10880,
        10873,
        10867,
        10870,
        10870,
        10865,
        10872,
        10871,
        10867,
        10767,
        10743,
        10727,
        10721,
        10723,
        10723,
        10715,
        10722,
        10719,
        10713,
        10984,
        11038,
        11059,
        11070,
        11075,
        11071,
        11079,
        11078,
        11073,
        11079,
        11079,
        11076,
        11081,
        11079,
        11076,
        11080,
        11077,
        11077,
        11071,
        11078,
        11077,
        11072,
        11079,
        11075,
        11069,
        11078,
        11071,
        11073,
        11065,
        11069,
        8737,
        7619,
        7017,
        6734,
        6603,
        6552,
        6519,
        6494,
        6484,
        6474,
        6463,
        6460,
        6454,
        6449,
        6450,
        6445,
        6450,
        6449,
        6444,
        6451,
        4701,
        4643,
        4621,
        4607,
        4592,
        4584,
        4574,
        4559,
        4559,
        4554,
        4543,
        4547,
        4540,
        4533,
        4529,
        4529,
        4524,
        4521,
        4519,
        4516,
        4516,
        4516,
        4511,
        4515,
        4513,
        4504,
        4513,
        4510,
        4502,
        4509,
        4509,
        4502,
        4510,
        4506,
        4501,
        4509,
        4507,
        4499,
        4507,
        4508,
        4506,
        4507,
        4501,
        4507,
        4504,
        4501,
        4507,
        4507,
        4504,
        4509,
        4509,
        4504,
        4509,
        4509,
        4507,
        4512,
        4510,
        4504,
        4513,
        4509,
        4511,
        4512,
        4507,
        4516,
        4514,
        4510,
        4515,
        4515,
        4513,
        4518,
        4517,
        4514,
        4517,
        4519,
        4515,
        4521,
        4517,
        4522,
        4523,
        4519,
        4522,
        4523,
        4518,
        4524,
        4527,
        4521,
        4529,
        4529,
        4523,
        4529,
        4529,
        4527,
        4533,
        4534,
        4530,
        4534,
        4532,
        4537,
        4535,
        4531,
        4538,
        4539,
        4534,
        4542,
        4541,
        4539,
        4543,
        4546,
        4541,
        4548,
        4546,
        4542,
        4549,
        4549,
        4544,
        4551,
        4549,
        4554,
        4554,
        4549,
        4556,
        4556,
        4553,
        4559,
        4559,
        4555,
        4562,
        4561,
        4557,
        4563,
        4564,
        4559,
        4566,
        4568,
        4563,
        4569,
        4569,
        4567,
        4573,
        4571,
        4571,
        4575,
        4574,
        4575,
        4577,
        4575,
        4581,
        4581,
        4577,
        4584,
        7020,
        7022,
        7023,
        7031,
        7029,
        7029,
        7028,
        7030,
        7031,
        7029,
        7023,
        7031,
        7028,
        7029,
        7021,
        7030,
        7025,
        7025,
        7020,
        7027,
        8126,
        8420,
        8587,
        8694,
        8778,
        8831,
        8869,
        8895,
        8919,
        8946,
        8960,
        8974,
        8984,
        8993,
        9006,
        9017,
        9023,
        9029,
        9033,
        9044,
        9049,
        9053,
        9061,
        9059,
        9065,
        9078,
        9077,
        9082,
        9082,
        9084,
        9037,
        9023,
        9023,
        9014,
        9011,
        9015,
        9021,
        9020,
        9020,
        9021,
        8954,
        8939,
        8931,
        8925,
        8919,
        8919,
        8927,
        8927,
        8927,
        8925,
        8841,
        8824,
        8812,
        8804,
        8797,
        8790,
        8795,
        8796,
        8794,
        8790,
        9004,
        9065,
        9099,
        9112,
        9121,
        9119,
        9123,
        9127,
        9130,
        9130,
        9126,
        9125,
        9131,
        9131,
        9130,
        9130,
        9127,
        9127,
        9133,
        9132,
        9135,
        9129,
        9129,
        9135,
        9133,
        9135,
        9136,
        9128,
        9132,
        9134,
        7383,
        6482,
        5970,
        5734,
        5623,
        5562,
        5529,
        5506,
        5495,
        5479,
        5470,
        5462,
        5461,
        5459,
        5455,
        5447,
        5453,
        5451,
        5453,
        5450,
        4495,
        4443,
        4425,
        4411,
        4399,
        4391,
        4384,
        4375,
        4367,
        4365,
        4362,
        4358,
        4354,
        4345,
        4345,
        4343,
        4339,
        4341,
        4329,
        4334,
        4335,
        4331,
        4326,
        4323,
        4328,
        4325,
        4328,
        4321,
        4325,
        4324,
        4326,
        4318,
        4323,
        4323,
        4323,
        4321,
        4319,
        4324,
        4323,
        4323,
        4321,
        4324,
        4323,
        4324,
        4322,
        4323,
        4325,
        4326,
        4326,
        4319,
        4327,
        4327,
        4328,
        4326,
        4324,
        4328,
        4329,
        4327,
        4327,
        4330,
        4331,
        4332,
        4329,
        4336,
        4335,
        4333,
        4333,
        4333,
        4339,
        4338,
        4341,
        4335,
        4341,
        4341,
        4341,
        4339,
        4342,
        4345,
        4348,
        4347,
        4341,
        4351,
        4351,
        4350,
        4345,
        4349,
        4353,
        4353,
        4352,
        4351,
        4356,
        4355,
        4359,
        4356,
        4362,
        4361,
        4362,
        4359,
        4359,
        4367,
        4365,
        4364,
        4361,
        4367,
        4367,
        4367,
        4365,
        4365,
        4372,
        4371,
        4373,
        4369,
        4374,
        4378,
        4378,
        4374,
        4378,
        4382,
        4382,
        4379,
        4377,
        4387,
        4385,
        4387,
        4382,
        4388,
        4388,
        4391,
        4387,
        4389,
        4391,
        4392,
        4395,
        4391,
        4399,
        4399,
        4399,
        4398,
        4401,
        4403,
        4405,
        4404,
        4401,
        4409,
        4408,
        4407,
        4405,
        4414,
        4411,
        4412
      ]
    }
  ],
  "app_os": "mac",
  "app_name": "PhotosynQ",
  "app_version": "0.3.8",
  "app_device": "x86-64",
  "location": [
    "42.9996168",
    "-78.7875642"
  ],
  "ConsoleMacro": "344"
}
Default avatar
Created by

Kawaguchi Hikaru


Protocol connections:
13
Latest Update:
Jul 2017