PSII quantum efficiency from a 340-780 nm spectrum


Calculate PSII quantum efficiency from a 340 nm to 780 nm spectrum using the MultispeQ prototype with a HAMAMATSU mini-spectrometer. Three scans are performed with no, weak and strong actinic light. Data is in one trace (768 data points), each individual trace is 256 data points. Several different approaches are made to derive the PSII quantum efficiency. The ranges for the integrals need to be adjusted as more data is available.
//============================================
// Macro for data evaluation on PhotosynQ.org
// created: 8/23/2015
//============================================

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

// Calculate wavelength increase per tick
//============================================
var WavelengthMIN = 340;
var WavelengthMAX = 780;
var WavelengthStep = (WavelengthMAX-WavelengthMIN)/256;

// Grab the 3 traces from the inital long trace
//============================================
var trace1 = json.data_raw.slice(0,256);
var trace2 = json.data_raw.slice(256,512);
var trace3 = json.data_raw.slice(512,768);


// Substract trace1 from trace2 and trace2
//============================================
for(i=0,len=trace1.length;i<len;i++){
	trace2[i] -= trace1[i];
	trace3[i] -= trace1[i];
}

// Substract the average from the first 25
// points from each graph to correct for the
// offset
//============================================
var offset2 = MathMEAN(trace2.slice(0,25))
var offset3 = MathMEAN(trace3.slice(0,25))
for(i=0,len=trace2.length;i<len;i++){
	trace2[i] -= offset2;
	trace3[i] -= offset3;
}

// Get the reference peark for trace 2 and 3 
// to normalize
//============================================
var ref2 = MathMAX(trace2.slice(67,82))
var ref3 = MathMAX(trace3.slice(67,82))

// Normalize trace 2 and 3
//============================================
for(i=0,len=trace1.length;i<len;i++){
	trace2[i] = trace2[i] / ref2;
	trace3[i] = trace3[i] / ref3;
}

// Get Fs and Fm' first peak
//============================================
var Fs = MathMAX(trace2.slice(167,182))
var Fmp = MathMAX(trace3.slice(167,182))

//output['Fs 1st'] = Fs
//output['Fm\' 1st'] = Fmp
output['ΦII 1st peak'] = MathROUND( (Fmp - Fs) / Fmp, 3 )


// Get Fs and Fm' second peak
//============================================
var Fs2 = MathMAX(trace2.slice(194,213))
var Fmp2 = MathMAX(trace3.slice(194,213))

//output['Fs 2nd'] = Fs2
//output['Fm\' 2nd'] = Fmp2
output['ΦII 2nd peak'] = MathROUND( (Fmp2 - Fs2) / Fmp2, 3 )


// Get Fs and Fm' 1st peak integral
//============================================
var FsInt = MathSUM(trace2.slice(165,183))
var FmpInt = MathSUM(trace3.slice(165,183))

//output['Fs 1st int'] = FsInt
//output['Fm\' 1st int'] = FmpInt
output['ΦII ∫165-183'] = MathROUND( (FmpInt - FsInt) / FmpInt, 3 )


// Get Fs and Fm' 2nd peak integral
//============================================
var Fs2Int = MathSUM(trace2.slice(190,215))
var Fmp2Int = MathSUM(trace3.slice(190,215))

//output['Fs 2nd int'] = Fs2Int
//output['Fm\' 2nd int'] = Fmp2Int
output['ΦII ∫190-215'] = MathROUND( (Fmp2Int - Fs2Int) / Fmp2Int, 3 )


// Get Fs and Fm' both peaks integral
//============================================
var FsBothInt = MathSUM(trace2.slice(157,233))
var FmpBothInt = MathSUM(trace3.slice(157,233))

//output['Fs both int'] = FsBothInt
//output['Fm\' both int'] = FmpBothInt
output['ΦII ∫157-233'] = MathROUND( (FmpBothInt - FsBothInt) / FmpBothInt, 3 )


// Get Fs and Fm' by wavelength
//============================================
for(i=157;i<233;i++){
	var FsSingleWL = trace2[i]
	var FmpSingleWL = trace3[i]
    var WL = MathROUND((i * WavelengthStep), 1) + WavelengthMIN
	///output['Fs both int'] = FsSingleWL
	//output['Fm\' both int'] = FmpSingleWL
	//output['ΦII '+ WL + ' nm'] = MathROUND( (FmpSingleWL - FsSingleWL) / FmpSingleWL, 3 )
}

//Return data
return output;
{
  "time_offset": 240,
  "time": 1440360625497,
  "device_id": 0,
  "firmware_version": "0.442",
  "sample": [
    [
      {
        "time": 1440360625497,
        "protocol_id": 1,
        "data_raw": [
          7752,
          7738,
          7719,
          7761,
          7774,
          7694,
          7794,
          7749,
          7725,
          7710,
          7708,
          7694,
          7682,
          7699,
          7717,
          7720,
          7782,
          7737,
          7748,
          7741,
          7725,
          7726,
          7714,
          7750,
          7747,
          7725,
          7753,
          7774,
          7767,
          7762,
          7748,
          7746,
          7769,
          7755,
          7700,
          7693,
          7723,
          7686,
          7654,
          7664,
          7687,
          7724,
          7696,
          7745,
          7775,
          7769,
          7745,
          7716,
          7713,
          7713,
          7720,
          7701,
          7721,
          7736,
          7742,
          7712,
          7699,
          7687,
          7694,
          7722,
          7725,
          7678,
          7687,
          7691,
          7704,
          7724,
          7709,
          7706,
          7723,
          7722,
          7742,
          7717,
          7705,
          7702,
          7746,
          7741,
          7727,
          7740,
          7775,
          7767,
          7735,
          7688,
          7717,
          7715,
          7698,
          7676,
          7705,
          7735,
          7738,
          7729,
          7727,
          7726,
          7713,
          7766,
          7787,
          7797,
          7804,
          7762,
          7771,
          7767,
          7778,
          7739,
          7786,
          7738,
          7763,
          7726,
          7690,
          7690,
          7718,
          7681,
          7698,
          7724,
          7776,
          7774,
          7779,
          7730,
          7717,
          7734,
          7754,
          7743,
          7738,
          7713,
          7743,
          7697,
          7755,
          7729,
          7739,
          7712,
          7699,
          7707,
          7726,
          7732,
          7725,
          7720,
          7745,
          7746,
          7718,
          7744,
          7743,
          7721,
          7752,
          7850,
          7832,
          7759,
          7734,
          7700,
          7683,
          7736,
          7705,
          7735,
          7680,
          7723,
          7720,
          7667,
          7678,
          7656,
          7686,
          7735,
          7708,
          7705,
          7706,
          7713,
          7717,
          7768,
          7713,
          7759,
          7797,
          7722,
          7788,
          7742,
          7721,
          7696,
          7710,
          7713,
          7679,
          7716,
          7686,
          7666,
          7689,
          7769,
          7739,
          7752,
          7773,
          7780,
          7747,
          7753,
          7786,
          7800,
          7811,
          7811,
          7881,
          7862,
          7820,
          7837,
          7901,
          7844,
          7786,
          7834,
          7838,
          7831,
          7833,
          7835,
          7873,
          7891,
          7894,
          7893,
          7922,
          7923,
          7940,
          7940,
          7931,
          7900,
          7904,
          7882,
          7919,
          7885,
          7912,
          7926,
          7920,
          7855,
          7820,
          7824,
          7867,
          7825,
          7877,
          7835,
          7825,
          7894,
          7854,
          7905,
          7858,
          7873,
          7837,
          7820,
          7841,
          7831,
          7837,
          7863,
          7884,
          7857,
          7836,
          7859,
          7873,
          7848,
          7841,
          7823,
          7822,
          7803,
          7848,
          7852,
          7816,
          7810,
          7809,
          7837,
          7847,
          7852,
          8008,
          8065,
          8043,
          7997,
          8045,
          7992,
          7970,
          7997,
          7968,
          7952,
          7989,
          7976,
          7978,
          8011,
          7996,
          8021,
          8017,
          8011,
          7996,
          7995,
          7984,
          8006,
          8048,
          8031,
          7996,
          7995,
          8007,
          8019,
          8006,
          8029,
          8002,
          7988,
          7979,
          7959,
          7915,
          7920,
          7956,
          7991,
          7961,
          8002,
          7987,
          7962,
          8002,
          7959,
          7976,
          7965,
          7934,
          7985,
          8002,
          7997,
          8000,
          7952,
          7948,
          7964,
          7917,
          7912,
          7894,
          7944,
          7976,
          8007,
          8034,
          8110,
          8181,
          8242,
          8333,
          8399,
          8419,
          8437,
          8390,
          8389,
          8322,
          8312,
          8315,
          8259,
          8237,
          8185,
          8107,
          8124,
          8054,
          8028,
          8035,
          8027,
          7982,
          8002,
          8000,
          8034,
          8031,
          8001,
          7985,
          8030,
          7991,
          7995,
          7995,
          8005,
          8030,
          8034,
          8052,
          8000,
          8029,
          8015,
          7967,
          8006,
          8014,
          8010,
          7997,
          7956,
          7945,
          7934,
          7969,
          7982,
          7989,
          7980,
          7956,
          7982,
          8042,
          8014,
          7986,
          8006,
          8064,
          8022,
          8015,
          8030,
          8060,
          8048,
          8036,
          8061,
          7988,
          7969,
          7971,
          8009,
          8024,
          7965,
          7967,
          7983,
          8013,
          8076,
          8069,
          8047,
          8015,
          8003,
          8004,
          8061,
          8067,
          8073,
          8052,
          8071,
          8061,
          8050,
          8024,
          8046,
          8025,
          8001,
          8012,
          8011,
          8029,
          8072,
          8139,
          8178,
          8244,
          8258,
          8277,
          8404,
          8485,
          8529,
          8629,
          8726,
          8819,
          8877,
          8966,
          9006,
          9088,
          9081,
          9081,
          8999,
          8964,
          8899,
          8850,
          8800,
          8698,
          8667,
          8604,
          8600,
          8619,
          8578,
          8565,
          8574,
          8719,
          8750,
          8703,
          8670,
          8639,
          8653,
          8733,
          8728,
          8756,
          8817,
          8803,
          8826,
          8865,
          8880,
          8923,
          8938,
          8975,
          8975,
          9020,
          8978,
          8937,
          8965,
          8916,
          8915,
          8869,
          8844,
          8869,
          8790,
          8747,
          8729,
          8707,
          8602,
          8546,
          8481,
          8483,
          8434,
          8410,
          8427,
          8459,
          8460,
          8420,
          8396,
          8382,
          8332,
          8290,
          8289,
          8271,
          8272,
          8296,
          8266,
          8263,
          8251,
          8307,
          8307,
          8261,
          8264,
          8260,
          8224,
          8229,
          8228,
          8184,
          8183,
          8212,
          8253,
          8191,
          8189,
          8197,
          8175,
          8217,
          8161,
          8098,
          8132,
          8114,
          8089,
          8140,
          8106,
          8123,
          8101,
          8089,
          8134,
          8102,
          8124,
          8175,
          8138,
          8076,
          7969,
          8054,
          7991,
          7952,
          7950,
          7990,
          7972,
          7999,
          8002,
          8008,
          7973,
          8007,
          7979,
          8004,
          7986,
          8051,
          8028,
          8007,
          7996,
          7969,
          8011,
          8006,
          8023,
          8039,
          7993,
          8001,
          8011,
          8031,
          7953,
          7954,
          7982,
          7998,
          7966,
          7971,
          7996,
          8017,
          8065,
          8013,
          8014,
          8048,
          8062,
          8083,
          8133,
          8245,
          8470,
          8866,
          9498,
          10380,
          11349,
          12164,
          12809,
          13166,
          13161,
          13028,
          12738,
          12391,
          11979,
          11545,
          11085,
          10689,
          10279,
          9943,
          9604,
          9357,
          9168,
          8995,
          8832,
          8707,
          8599,
          8537,
          8477,
          8435,
          8393,
          8375,
          8310,
          8346,
          8291,
          8284,
          8234,
          8180,
          8156,
          8174,
          8142,
          8174,
          8155,
          8139,
          8180,
          8148,
          8124,
          8170,
          8129,
          8093,
          8122,
          8121,
          8100,
          8108,
          8099,
          8066,
          8095,
          8100,
          8054,
          8071,
          8057,
          8012,
          8044,
          8033,
          8053,
          8051,
          8061,
          8066,
          8045,
          8070,
          8094,
          8065,
          8055,
          8119,
          8061,
          8107,
          8099,
          8106,
          8085,
          8058,
          8093,
          8084,
          8066,
          8107,
          8124,
          8156,
          8144,
          8196,
          8235,
          8297,
          8394,
          8445,
          8498,
          8626,
          8774,
          8926,
          9097,
          9337,
          9578,
          9886,
          10327,
          10753,
          11373,
          12068,
          12888,
          13785,
          14767,
          15950,
          17195,
          18383,
          19486,
          20494,
          21256,
          21822,
          21855,
          21642,
          21113,
          20442,
          19662,
          18805,
          18013,
          17401,
          16838,
          16442,
          16049,
          15845,
          15645,
          15570,
          15558,
          15550,
          15599,
          15776,
          16043,
          16300,
          16631,
          16955,
          17310,
          17645,
          17936,
          18229,
          18477,
          18672,
          18803,
          18972,
          19131,
          19206,
          19285,
          19268,
          19229,
          19183,
          18987,
          18730,
          18478,
          18026,
          17590,
          17092,
          16515,
          16035,
          15481,
          14986,
          14561,
          14150,
          13785,
          13427,
          13041,
          12689,
          12371,
          12036,
          11731,
          11478,
          11172,
          10925,
          10682,
          10522,
          10299,
          10088,
          9997,
          9850,
          9713,
          9599,
          9531,
          9480,
          9423,
          9338,
          9288,
          9227,
          9214,
          9224,
          9148,
          9097,
          9021,
          9033,
          8956,
          8923,
          8932,
          8885,
          8897,
          8808,
          8821
        ]
      }
    ]
  ]
}
Sebastian kuhlgert square
Created by

Sebastian


Protocol connections:
1
Latest Update:
Jan 2017