Fluorescence Light Curves¶
-
phyto_photo_utils._etr.
calculate_amplitude_etr
(fo, fm, sigma, par, alpha_phase=True, light_independent=True, dark_sigma=False, etrmax_fitting=True, serodio_sigma=False, light_step_size=None, last_steps_average=False, outlier_multiplier=3, return_data=False, bounds=True, alpha_lims=[0, 4], etrmax_lims=[0, 2000], method='trf', loss='soft_l1', f_scale=0.1, max_nfev=None, xtol=1e-09) Convert the processed transient data into an electron transport rate and perform a fit using the Webb Model.
Parameters: - fo (np.array, dtype=float, shape=[n,]) – The minimum fluorescence level.
- fm (np.array, dtype=float, shape=[n,]) – The maximum fluorescence level.
- sigma (np.array, dtype=float, shape=[n,]) – The effective absorption cross-section of PSII in Å2.
- par (np.array, dtype=float, shape=[n,]) – The actinic light levels in μE m2 s-1.
- alpha_phase (bool, default=True) – If True, will fit the data without photoinhibition. If False, will fit the data with the photoinhibition paramater β.
- light_independent (bool, default=True) – If True, will use the method outlined in Silsbe & Kromkamp 2012.
- dark_sigma (bool) – If True, will use mean of σPSII under 0 actinic light for calculation. If False, will use σPSII and σPSII’ for calculation.
- etrmax_fitting (bool) – If True, will fit αETR and ETRmax and manually calculate E:sub:’k’. If False, will fit αETR and E:sub:’k’ and manually calculate ETRmax.
- serodio_sigma (bool) – If True, will apply a Serodio correction for samples that have dark relaxation.
- light_step_size (int) – The number of measurements for initial light step.
- last_steps_average (bool, default=False,) – If True, means will be created from the last 3 measurements per light step. Else, mean will be created from entire light step excluding outliers.
- outlier_multiplier (int, default=3) – The multiplier to apply to the standard deviation for determining the upper and lower limits.
- return_data (bool, default=False) – If True, will return the final data used for the fit.
- bounds (bool, default=True) – If True, will set lower and upper limit bounds for the estimation, not suitable for methods ‘lm’.
- alpha_lims ([int, int], default=[0,4]) – The lower and upper limit bounds for fitting αETR.
- etrmax_lims ([int, int], default=[0,2000]) – The lower and upper limit bounds for fitting ETRmax.
- fit_method (str, default='trf') – The algorithm to perform minimization. See
scipy.optimize.least_squares
documentation for more information on non-linear least squares fitting options. - loss_method (str, default='soft_l1') – The loss function to be used. Note: Method ‘lm’ supports only ‘linear’ loss. See
scipy.optimize.least_squares
documentation for more information on non-linear least squares fitting options. - fscale (float, default=0.1) – The soft margin value between inlier and outlier residuals. See
scipy.optimize.least_squares
documentation for more information on non-linear least squares fitting options. - max_nfev (int, default=None) – The number of iterations to perform fitting routine. If None, the value is chosen automatically. See
scipy.optimize.least_squares
documentation for more information on non-linear least squares fitting options. - xtol (float, default=1e-9) – The tolerance for termination by the change of the independent variables. See
scipy.optimize.least_squares
documentation for more information on non-linear least squares fitting options.
Returns: - Results are returned as pd.Series with the following parameters.
- etr_max (float) – The maximum electron transport rate.
- alpha (float) – The light limited slope of electron transport.
- ek (float) – The photoacclimation of ETR.
- alpha_bias (float) – The bias of the alpha fit. If alpha_phase is False, value is not returned.
- alpha_rmse (float) – The root mean squared error of the alpha fit. If alpha_phase is False, value is not returned.
- alpha_nrmse (float) – The normalised root mean squared error of the alpha fit. If alpha_phase is False, value is not returned.
- beta_bias (float) – The bias of the alpha fit. If alpha_phase is True, value is not returned.
- beta_rmse (float) – The root mean squared error of the alpha fit. If alpha_phase is True, value is not returned.
- beta_nrmse (float) – The normalised root mean squared error of the alpha fit. If alpha_phase is True, value is not returned.
- etrmax_err (float) – The fit error of ETRmax. If etrmax_fitting is False, value returned is NaN.
- alpha_err (float) – The fit error of αETR.
- ek_err (float) – The fit error of Ek. If etrmax_fitting is True, value returned is NaN.
- alpha_nfev (np.array, dype=int, shape=[n,]) – The number of functional evaluations done on the alpha phase fitting routine.
- alpha_flag (np.array, dtype=int, shape=[n,]) – The code associated with the fitting routine success, positive values = SUCCESS, negative values = FAILURE. -1 : the ETR data is empty. 0 : the maximum number of function evaluations is exceeded. 1 : gtol termination condition is satisfied. 2 : ftol termination condition is satisfied. 3 : xtol termination condition is satisfied. 4 : Both ftol and xtol termination conditions are satisfied.
- alpha_success (np.array, dtype=bool, shape=[n,]) – A boolean array reporting whether fit was successful (TRUE) or if not successful (FALSE)
- beta_nfev (np.array, dype=int, shape=[n,]) – The number of functional evaluations done on the beta phase fitting routine. If alpha_phase is True, value returned is NaN.
- beta_flag (np.array, dtype=int, shape=[n,]) – The code associated with the fitting routine success, positive values = SUCCESS, negative values = FAILURE. If alpha_phase is True, value returned is NaN. -1 : the ETR data is empty. 0 : the maximum number of function evaluations is exceeded. 1 : gtol termination condition is satisfied. 2 : ftol termination condition is satisfied. 3 : xtol termination condition is satisfied. 4 : Both ftol and xtol termination conditions are satisfied.
- beta_success (np.array, dtype=bool, shape=[n,]) – A boolean array reporting whether fit was successful (TRUE) or if not successful (FALSE). If alpha_phase is True, value returned is NaN.
- data ([np.array, np.array]) – Optional, the final data used for the fitting procedure.
Example
>>> res = ppu.calculate_etr(fo, fm, sigma, par, return_data=False)