DMK basic fv_fmp


simple test of a fluorescence transient with daturating pulse
/**
 * Macro for data evaluation of RIDES1_light_potential 
 * data on PhotosynQ.org
 * by: David M. Kramer
 * created: 2017-05-09 @ 18:15:27 
 *    
 * The concept for the protocol came out of discussions between myself
 * and Gonzalo Estavillo during a PhotosynQ workshop (and subsequent 
 * beers). The idea is: what would be the instantaneous increase in
 * LEF if the light intensity suddently increased to a certain point
 * near saturation. To estmate this value, we started with RISES1_3_1 
 * but in additiopn to the steady-state (ambient) light Fs valuies
 * taken before the saturation pulse, we added a second, ~10-s
 * illumination with 1000 uE. We assumed that the 10s was not sufficient
 * change NPQ by a substantial amount, so that the Fv/FM' and NPQ
 * parameters were taken with the sole saturation pulses.
 
/* Note: Special thanks to Sebastian Kuhlgert for the curve fitting routines!
*   
* The following variables are for fitting the ECS decay curves when the 
* procedure written by Kevin and Greg often fails. Fortunately, Sebastian added 
* a really important new feature that allows for very flexible and useful 
* nonlinear curve fitting. 
*/     
  
// Define the output object here
var output = {}; //dictionary to hold results
n_sets=json.set.length;
//output.n_sets=json.set.length;
var details=1;  
    
var fluor_trans=GetProtocolByLabel( "fluor_trans", json, true );


var number_traces = fluor_trans.length;

for (var i=0; i<number_traces; i++){
 output["trace#"+i]= fluor_trans[i].data_raw;
}

return output;

var WASP_ECS_Decon=[]; 
var ECS_only_traces=[]; 
var ECS_w_WASP=[]; 
var Fluor = [];
var Phi2=[];
var wasp_vals=[];
output.number_traces=number_traces;

for (var i=0; i<number_traces; i++) {
  
    ECS_traces = DIRK_ECS[i].data_raw; 
    output.ECS_traces_composite=DIRK_ECS[i].data_raw; 
  
    ECS_WASP = ArrayNth( ECS_traces, 4, 0 );// sub trace with both the ECS and the WASP pulse (I, not A)
    output.ECS_WASP=ECS_WASP;
  	ECS_w_WASP.push(ECS_WASP);
    ECS_only = ArrayNth( ECS_traces, 4, 1 ); // sub trace with the ECS but NO WASP pulse (I, not A)
    output.ECS_only=ECS_only;
    WASP_only = ArrayNth( ECS_traces, 4, 2 ); // sub trace with WASP but NO ECS pulse (I, not A)
    output.WASP_only=WASP_only;
    var FLUOR = ArrayNth( ECS_traces, 4, 3 ); // sub trace with WASP but NO ECS pulse (I, not A)
    output.FLUOR=FLUOR;
    Fluor.push(FLUOR);
	output.bleed=DIRK_ECS[i].bleed;

  
  output.XXXX=TransformTrace("subtract", ECS_WASP, ECS_only);
   
  
   
    var ECS_WASP_m_WASP = TransformTrace( "subtract", ECS_WASP, WASP_only); //ECS_wasp_diff, ECS_no_wasp);
    output.ECS_WASP_m_WASP=ECS_WASP_m_WASP;  // difference between the trace with ECS and WASP and just the WASP 
                                             // should get rid of the WASP component,
                                             // leaving only the ECS with the actinic effect of the WASP pulse
    
    var ECS_WASP_m_ECS_only = TransformTrace( "subtract", ECS_WASP_m_WASP, ECS_only); //ECS_wasp_diff, ECS_no_wasp);
                                            // Differnece between the corrected ECS trace that
                                            // has actinic effect of WASP and the trace with 
                                            // no WASP actinic. This means that
                                            // if the WASP pulse induces an increase
                                            // in ECS (by inducing charge separation)
                                            // the increase in absorbance should decrease
                                            // the ECS_WASP_m_ECS_only signal. 
	output.ECS_WASP_m_ECS_only=ECS_WASP_m_ECS_only;
  
  var baseline = MathMEAN(ECS_WASP_m_ECS_only.slice(10,20) );
  
   
  	ECS_WASP_m_ECS_only = TransformTrace( "subtract", ECS_WASP_m_ECS_only, baseline);
    output["ECS_WASP_m_ECS_only:" + i]=ECS_WASP_m_ECS_only; 
 	ECS_WASP_m_ECS_only[0]=0; 
 	ECS_WASP_m_ECS_only[30]=0;
  	ECS_WASP_m_ECS_only[60]=0; 
  
  WASP_ECS_Decon.push(ECS_WASP_m_ECS_only); 
  var wasp_ss=MathMEAN(ECS_WASP_m_ECS_only.slice(1,29));
  var wasp_sp=MathMEAN(ECS_WASP_m_ECS_only.slice(31,59));
  var we=MathROUND(wasp_sp-wasp_ss,3);
  wasp_vals.push(MathROUND(we,2)); // 
   
  var b = ECS_only[0]; 
  var ECS_only_m_b=TransformTrace( "subtract", ECS_only, b);
  ECS_only_traces.push(ECS_only);
  var Fs=MathMEAN(FLUOR.slice(1,29));
  var Fmp=MathMAX(FLUOR.slice(31,59));
  var fi2= (Fmp-Fs)/Fmp;
  Phi2.push(MathROUND(fi2,3));
} 

output.WASP_ECS_Decon=WASP_ECS_Decon; 
output.ECS_only_traces=ECS_only_traces;
output.ECS_w_WASP=ECS_w_WASP;
output.Fluor=Fluor;

output.wasp=wasp_vals;
output.wasp_vals="[" + wasp_vals.join() + "]";

output.Phi2=Phi2;
output.zPhi2vals="[" + Phi2.join() + "]";

return output;
{
  "time": 1547402983382,
  "device_name": "MultispeQ",
  "device_version": "2",
  "device_id": "32:11:48:18",
  "device_battery": 23,
  "device_firmware": 2.008,
  "sample": [
    [
      {
        "time": 1547402983382,
        "v_arrays": [
          [
            "0",
            "40",
            "80",
            "160",
            "320",
            "640",
            "1280",
            "2000",
            "640",
            "320",
            "160",
            "80",
            "40",
            "20"
          ],
          [
            "2000",
            "1000"
          ]
        ],
        "set_repeats": 1,
        "protocol_id": 1,
        "set": [
          {
            "time": 1547402983389,
            "label": "fluor_trans",
            "data_raw": [
              998,
              870,
              873,
              873,
              875,
              879,
              883,
              883,
              885,
              884,
              887,
              887,
              889,
              891,
              893,
              889,
              896,
              896,
              895,
              895,
              896,
              899,
              898,
              900,
              904,
              903,
              906,
              906,
              906,
              909,
              2174,
              1505,
              1700,
              1812,
              1900,
              1992,
              2076,
              2163,
              2252,
              2332,
              2415,
              2486,
              2558,
              2626,
              2684,
              2744,
              2798,
              2847,
              2894,
              2938,
              2976,
              3015,
              3049,
              3079,
              3112,
              3137,
              3162,
              3188,
              3209,
              3228,
              1849,
              3029,
              2908,
              2814,
              2739,
              2669,
              2603,
              2545,
              2487,
              2433,
              2382,
              2334,
              2285,
              2243,
              2198,
              2161,
              2118,
              2081,
              2050,
              2017,
              1983,
              1949,
              1923,
              1893,
              1867,
              1842,
              1815,
              1795,
              1771,
              1749,
              1731,
              1709,
              1691,
              1677,
              1659,
              1643,
              1630,
              1616,
              1603,
              1591,
              1579,
              1569,
              1555,
              1545,
              1538,
              1530,
              1518,
              1510,
              1504,
              1495,
              1486,
              1483,
              1473,
              1469,
              1458,
              1455,
              1449,
              1443,
              1439,
              1434,
              1427,
              1422,
              1419,
              1412,
              1411,
              1410,
              1403,
              1400,
              1398,
              1395,
              1389,
              1389,
              1381,
              1379,
              1377,
              1377,
              1375,
              1370,
              1367,
              1369,
              1363,
              1361,
              1359,
              1354,
              1354,
              1353,
              1350,
              1350,
              1347,
              1346,
              1342,
              1343,
              1339,
              1338,
              1337,
              1334,
              1334,
              1333,
              1333,
              1330,
              1325,
              1327,
              1321,
              1326,
              1321,
              1321,
              1319,
              1315,
              1317,
              1315,
              1317,
              1315,
              1313,
              1309,
              1311,
              1313,
              1309,
              1311,
              1309,
              1307,
              1306,
              1303,
              1307,
              1306,
              1299,
              1301,
              1301,
              1298,
              1299,
              1297,
              1297,
              1296,
              1297,
              1295,
              1291,
              1291,
              1289,
              1291,
              1289,
              1291,
              1290,
              1287,
              1287,
              1287,
              1283,
              1283,
              1287,
              1287,
              1287,
              1283,
              1283,
              1283,
              1281,
              1282,
              1282,
              1283,
              1281,
              1281,
              1281,
              1277,
              1278,
              1277,
              1276,
              1275,
              1280,
              1275,
              1274,
              1276,
              1275,
              1275,
              1272,
              1271,
              1273,
              1274,
              1275,
              1271,
              1270,
              1271,
              1275,
              1271,
              1271,
              1267,
              1269,
              1266,
              1267,
              1267,
              1267,
              1267,
              1265,
              1268,
              1264,
              1265,
              1267,
              1263,
              1266,
              1267,
              1263,
              1265,
              1264,
              1262,
              1259,
              1263,
              1265,
              1265,
              1262,
              1263,
              1261,
              1259,
              1260,
              1260,
              1259,
              1260,
              1259,
              1258,
              1259,
              1257,
              1259,
              1259,
              1258,
              1255,
              1257,
              1256,
              1258,
              1257,
              1257,
              1258,
              1255,
              1256,
              1255,
              1255,
              1254,
              1254,
              1255,
              1253,
              1251,
              1251,
              1251,
              1255,
              1253,
              1251,
              1253,
              1251,
              1251,
              1255,
              1255,
              1253,
              1250,
              1251,
              1249,
              1251,
              1251,
              1251,
              1251,
              1250,
              1252,
              1249,
              1248,
              1251,
              1246,
              1250,
              1249,
              1250,
              1251,
              1249,
              1249,
              1250,
              1249,
              1248,
              1247,
              1246,
              1245,
              1248,
              1245,
              1246,
              1246,
              1246,
              1247,
              1244,
              1242,
              1246,
              1243,
              1247,
              1243,
              1245,
              1243,
              1248,
              1243,
              1244,
              1245,
              1243,
              1245,
              1241,
              1243,
              1245,
              1243,
              1243,
              1239,
              1243,
              1241,
              1243
            ]
          }
        ],
        "data_raw": [

        ]
      }
    ]
  ],
  "app_os": "macOS 18.0.0",
  "app_name": "PhotosynQ",
  "app_version": "1.0.4",
  "app_device": "x64",
  "location": false,
  "time_offset": "America/Detroit"
}
Dave in cap img 4615
Created by

David M. Kramer


Protocol connections:
1
Latest Update:
Jan 2019