10 - Fv/Fm - v1 - OK


FvFm
var data = json.data_raw;
var output = {};
var sample_cal = MathMEAN(data.slice(1,9));
var baseline;


var sample_cal = json.detector_read1;//es para la luz 940

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





var F0 = MathMEAN(data.slice(35,40)) - baseline;
var Fm_sort = data.slice(41,91).sort();
var Fm = MathMEAN(Fm_sort.slice(45,49)) - baseline; // take the 4 largest values and average them
var fvfm = (Fm-F0)/Fm;

// dark adapted values
output ['F0'] = MathROUND(F0,0);
output ["Fm"] = MathROUND(Fm,0);
output ["Fv/Fm"] = MathROUND(fvfm,4);

output ["baseline"] = baseline ;

var i5 = json.recall["ir_baseline_yint[5]"];
var s5 = json.recall["ir_baseline_slope[5]"];
var i3 = json.recall["ir_baseline_yint[3]"];
var s3 = json.recall["ir_baseline_slope[3]"];
/*output ["int5"] = i5;
output ["slope5"] = s5;
output ["int3"] = i3;
output ["slope3"] = s3;
*/

return output;
{
  "time_offset": 180,
  "time": 1500994565927,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:06:11:88",
  "device_battery": 17,
  "device_firmware": 1.17,
  "sample": [
    {
      "time": 1500994565980,
      "protocol_id": 1,
      "detector_read1": 8553,
      "light_intensity": 6,
      "r": 4,
      "g": 2,
      "b": 1,
      "light_intensity_raw": 7,
      "temperature": 19.1,
      "humidity": 65.755859,
      "pressure": 1018.749146,
      "temperature2": 19.290001,
      "humidity2": 64.332031,
      "pressure2": 1019.073303,
      "contactless_temp": 21.91,
      "thickness": 0,
      "compass_direction": "E",
      "compass": "90.00",
      "angle": 1.46,
      "angle_direction": "SW",
      "pitch": 1.31,
      "roll": -0.63,
      "recall": {
        "time": 1500994571529,
        "colorcal_blank1[1]": 16511.5,
        "colorcal_blank1[2]": 24324.5,
        "colorcal_blank1[3]": 29277.5,
        "colorcal_blank1[4]": 37138,
        "colorcal_blank1[6]": 33194,
        "colorcal_blank1[8]": 28720.5,
        "colorcal_blank1[9]": 31100,
        "colorcal_blank1[10]": 34614,
        "colorcal_blank2[1]": 21662,
        "colorcal_blank2[2]": 18077,
        "colorcal_blank2[3]": 21188.5,
        "colorcal_blank2[4]": 18162,
        "colorcal_blank2[6]": 16493.5,
        "colorcal_blank2[8]": 17087,
        "colorcal_blank2[9]": 18622,
        "colorcal_blank2[10]": 16523.5,
        "colorcal_blank3[1]": 20515.5,
        "colorcal_blank3[2]": 9866,
        "colorcal_blank3[3]": 19621.5,
        "colorcal_blank3[4]": 13418.5,
        "colorcal_blank3[6]": 5898.5,
        "colorcal_blank3[8]": 6295.5,
        "colorcal_blank3[9]": 5582,
        "colorcal_blank3[10]": 6047,
        "colorcal_intensity1_slope[2]": 2.309,
        "colorcal_intensity1_yint[2]": 1.7,
        "colorcal_intensity2_slope[2]": 2.377,
        "colorcal_intensity2_yint[2]": 3,
        "colorcal_intensity3_slope[2]": 2.554,
        "colorcal_intensity3_yint[2]": -17.299999,
        "ir_baseline_slope[5]": 8895,
        "ir_baseline_yint[5]": 13422.5,
        "ir_baseline_slope[3]": 526.5,
        "ir_baseline_yint[3]": 738.5
      },
      "data_raw": [
        65,
        69,
        65,
        67,
        66,
        59,
        63,
        59,
        65,
        69,
        68,
        65,
        61,
        61,
        60,
        69,
        69,
        67,
        69,
        66,
        2279,
        2284,
        2284,
        2285,
        2285,
        2291,
        2294,
        2287,
        2295,
        2297,
        2296,
        2299,
        2299,
        2295,
        2301,
        2297,
        2303,
        2305,
        2306,
        2305,
        2311,
        5582,
        6889,
        7692,
        8156,
        8427,
        8583,
        8696,
        8772,
        8821,
        8859,
        8883,
        8899,
        8917,
        8930,
        8937,
        8941,
        8955,
        8962,
        8961,
        8972,
        8977,
        8979,
        8985,
        8993,
        8995,
        8996,
        9008,
        9011,
        9015,
        9018,
        9027,
        9031,
        9029,
        9045,
        9045,
        9049,
        9047,
        9059,
        9062,
        9063,
        9064,
        9071,
        9075,
        9073,
        9076,
        9082,
        9085,
        9078,
        9090,
        9091,
        7859,
        7081,
        6495,
        6027,
        5669,
        5395,
        5188,
        5023,
        4892,
        4791,
        4704,
        4626,
        4564,
        4509,
        4453,
        4418,
        4375,
        4336,
        4311,
        4281,
        4246,
        4225,
        4201,
        4175,
        4154,
        4135,
        4117,
        4091,
        4077,
        4058,
        4040,
        4028,
        4013,
        3995,
        3985,
        3971,
        3958,
        3941,
        3933,
        3917,
        3906,
        3897,
        3883,
        3872,
        3858,
        3851,
        3843,
        3823,
        3821,
        3809,
        3802,
        3786,
        3782,
        3772,
        3758,
        3755,
        3746,
        3737,
        3724,
        3719,
        3711,
        3700,
        3693,
        3687,
        3681,
        3669,
        3667,
        3657,
        3650,
        3638,
        3635,
        3628,
        3622,
        3611,
        3611,
        3601,
        3596,
        3581,
        3580,
        3574,
        3564,
        3558,
        3555,
        3547,
        3537,
        3533,
        3533,
        3525,
        3515,
        3511,
        3507,
        3500,
        3494,
        3491,
        3486,
        3481,
        3473,
        3467,
        3467
      ]
    }
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.8",
  "app_device": "x86-32",
  "location": [
    "-32.9700778",
    "-60.6247326"
  ],
  "ConsoleMacro": null
}
Img 20171030 190259
Created by

Rodrigo Gomez


Protocol connections:
1
Latest Update:
Jul 2017