Transmittance


Calculate leaf transmittance at three wavelengths
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 9/22/2017
//============================================

//Define the output object here
var output = {};

//Check if the key time exists in json
if (json.time !== undefined){

	//Add key time and value to output
	output.time = json.time;
}


// Transmitted green
var green = json.data_raw.slice(5,25);
var tau_green = MathMEAN(green)/json.recall["colorcal_blank1[1]"];

// Transmitted red
var red = json.data_raw.slice(35,55);
var tau_red = MathMEAN(red)/json.recall["colorcal_blank1[2]"];

// Transmitted blue
var blue = json.data_raw.slice(65,85);
var tau_blue = MathMEAN(blue)/json.recall["colorcal_blank1[4]"];


output.tau_green = tau_green;
output.tau_red = tau_red;
output.tau_blue = tau_blue;
output.PAR = json.light_intensity;
output.fRed = json.r;
output.fblue = json.b;
output.fgreen = json.g;
output.Tair = json.temperature;
output.Tleaf = json.contactless_temp;
output.RH = json.humidity;
output.thickness = json.thickness;
output.angle = json.angle;
output.orientation = json.angle_direction; // I think this is the orientation of the leaf?

//Return data
return output;
{
  "time_offset": -120,
  "time": 1506087695596,
  "device_name": "MultispeQ",
  "device_version": "1",
  "device_id": "01:12:71:16",
  "device_battery": 75,
  "device_firmware": 1.17,
  "sample": [
    {
      "time": 1506087695637,
      "protocol_id": 1,
      "light_intensity": 12,
      "r": 8,
      "g": 3,
      "b": 2,
      "light_intensity_raw": 13,
      "temperature": 26.01,
      "humidity": 49.480469,
      "pressure": 1018.854675,
      "contactless_temp": 26.32,
      "thickness": 0.04,
      "compass_direction": "N",
      "compass": "nan",
      "angle": 4.15,
      "angle_direction": "NE",
      "pitch": 3.44,
      "roll": 2.32,
      "recall": {
        "time": 1506087707321,
        "colorcal_blank1[1]": 19349.5,
        "colorcal_blank1[2]": 26160,
        "colorcal_blank1[4]": 35589
      },
      "data_raw": [
        19254,
        19215,
        19146,
        19159,
        19229,
        19116,
        19123,
        19121,
        19207,
        19181,
        19207,
        19210,
        19207,
        19175,
        19295,
        19200,
        19201,
        19245,
        19307,
        19174,
        19219,
        19337,
        19209,
        19129,
        19271,
        19271,
        19202,
        19204,
        19229,
        19286,
        26042,
        26050,
        26059,
        26055,
        26041,
        26030,
        26042,
        26034,
        26049,
        26044,
        26045,
        26054,
        26047,
        26050,
        26043,
        26066,
        26053,
        26048,
        26043,
        26042,
        26041,
        26032,
        26041,
        26052,
        26037,
        26051,
        26046,
        26038,
        26051,
        26040,
        35833,
        35411,
        35439,
        35446,
        35513,
        35435,
        35423,
        35391,
        35370,
        35325,
        35319,
        35363,
        35345,
        35357,
        35461,
        35375,
        35406,
        35449,
        35495,
        35411,
        35400,
        35403,
        35318,
        35402,
        35423,
        35406,
        35385,
        35417,
        35446,
        35392
      ]
    }
  ],
  "app_os": "win",
  "app_name": "PhotosynQ",
  "app_version": "0.3.9",
  "app_device": "x86-64",
  "location": [
    "51.9861948",
    "5.6634476"
  ],
  "ConsoleMacro": "419"
}
Default avatar
Created by

Alejandro Morales


Protocol connections:
0
Latest Update:
Sep 2017