The pmodel module

The pmodel module includes the following submodules:

  • pmodel,

  • pmodel_environment,

  • optimal_chi and

  • jmax_limitation provide classes implementing the core calculations of the P Model.

  • The functions submodule provides key standalone functions for those calculations.

  • The isotopes submodule provides a class to estimate isotopic discrimination within the P Model.

  • The competition submodule provides a competition model for the C3 and C4 photosynthetic pathways.

Note that the documentation of functions and methods includes two lists of parameters:

Parameters

These are the arguments specific to the class, method or function signature.

Constants

These are shared parameters of the PModel , which are taken from the PModelConst dataclass. These can be changed by the user but are typically used to configure an entire analysis rather than a single function.

The pmodel_environment submodule

The module pmodel_environment provides the implementation of the PModelEnvironment class, which is used to check the data required to fit a P Model and calculates the key photosynthetic environment variables for the observations.

Classes:

PModelEnvironment(tc, vpd, co2, patm[, ...])

Create a PModelEnvironment instance.

class PModelEnvironment(tc: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, vpd: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, co2: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, fapar: ndarray[tuple[Any, ...], dtype[floating]] | DataArray = np.array([1.0]), ppfd: ndarray[tuple[Any, ...], dtype[floating]] | DataArray = np.array([1.0]), pmodel_const: PModelConst = PModelConst(), core_const: CoreConst = CoreConst(), bounds_checker: BoundsChecker = BoundsChecker(), **kwargs: ndarray[tuple[Any, ...], dtype[floating]] | DataArray)

Create a PModelEnvironment instance.

This class takes the temperature (°C), vapour pressure deficit (Pa), atmospheric pressure (Pa) and ambient CO2 concentration (ppm) and uses these four drivers to calculates four photosynthetic variables for those environmental conditions:

The PModelEnvironment will also accept values for the photosynthetic photon flux density (PPFD, µmol m-2 s-1) and the fraction of absorbed photosynthetically active radiation (FAPAR, unitless). These values are used to calculate the absorbed incident radiation, which is used to scale light use efficiency up to gross primary productivity.

An instance of PModelEnvironment can then be used to fit different P Models using the same environment but different method implementations. Note that the underlying constants of the P Model (PModelConst) are set when creating an instance of this class and will be used on all models fitted to the instance.

In addition to the main forcing variables above, the PModelEnvironment class can also be used to provide additional variables used by some methods. Any additional arguments provided to a PModelEnvironment instance should provide an array of data congruent with the shape of the other forcing variables. The array dimensions will be checked and the argument name will be used to add the data to the instance as an additional attribute.

Examples of additional variables include:

Note

Although the PModelEnvironment is typically used to estimate gross primary productivity using the P Model, not all uses require the estimation of absorbed incident radiation. The ppfd and fapar arguments both default to one, and you will need to input actual values to estimate gross primary productivity.

Parameters:
  • tc – Temperature, relevant for photosynthesis (°C)

  • vpd – Vapour pressure deficit (Pa)

  • co2 – Atmospheric \(\ce{CO2}\) concentration (ppm)

  • patm – Atmospheric pressure (Pa)

  • theta – Volumetric soil moisture (m3/m3)

  • rootzonestress – Root zone stress factor (-)

  • aridity_index – Climatological aridity index, expressed as PET/P (-)

  • mean_growth_temperature – Mean growth temperature (°C)

  • pmodel_const – An instance of PModelConst.

  • core_const – An instance of CoreConst.

  • **kwargs – Additional data variables

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
... )

Methods:

summarize([dp])

Prints a summary of PModelEnvironment variables.

Attributes:

ca

Ambient CO2 partial pressure, Pa

co2

CO2 concentration, ppm

core_const

Core constants used to calculate environment

fapar

The fraction of absorbed photosynthetically active radiation (FAPAR, -)

gammastar

Photorespiratory compensation point (\(\Gamma^\ast\), Pa)

kmm

Michaelis Menten coefficient, Pa

ns_star

Viscosity correction factor relative to standard temperature and pressure, unitless

patm

Atmospheric pressure, Pa

pmodel_const

PModel constants used to calculate environment

ppfd

The photosynthetic photon flux density (PPFD, µmol m-2 s-1)

shape

The shape of the environmental data arrays.

tc

The temperature at which to estimate photosynthesis, °C

tk

The temperature at which to estimate photosynthesis in Kelvin (K)

vpd

Vapour pressure deficit, Pa

summarize(dp: int = 2) None

Prints a summary of PModelEnvironment variables.

Prints a summary of the input and photosynthetic attributes in a instance of a PModelEnvironment including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

ca: ndarray[tuple[Any, ...], dtype[floating]]

Ambient CO2 partial pressure, Pa

co2: ndarray[tuple[Any, ...], dtype[floating]]

CO2 concentration, ppm

core_const: CoreConst

Core constants used to calculate environment

fapar: ndarray[tuple[Any, ...], dtype[floating]]

The fraction of absorbed photosynthetically active radiation (FAPAR, -)

gammastar: ndarray[tuple[Any, ...], dtype[floating]]

Photorespiratory compensation point (\(\Gamma^\ast\), Pa)

kmm: ndarray[tuple[Any, ...], dtype[floating]]

Michaelis Menten coefficient, Pa

ns_star

Viscosity correction factor relative to standard temperature and pressure, unitless

patm: ndarray[tuple[Any, ...], dtype[floating]]

Atmospheric pressure, Pa

pmodel_const: PModelConst

PModel constants used to calculate environment

ppfd: ndarray[tuple[Any, ...], dtype[floating]]

The photosynthetic photon flux density (PPFD, µmol m-2 s-1)

shape: tuple

The shape of the environmental data arrays.

tc: ndarray[tuple[Any, ...], dtype[floating]]

The temperature at which to estimate photosynthesis, °C

tk: ndarray[tuple[Any, ...], dtype[floating]]

The temperature at which to estimate photosynthesis in Kelvin (K)

vpd: ndarray[tuple[Any, ...], dtype[floating]]

Vapour pressure deficit, Pa

The jmax_limitation submodule

The jmax_limitation module provides the implementation of classes for calculation of \(J_{max}\) and \(V_{cmax}\) limitation. The module provides an abstract base dataclass (JmaxLimitationABC) which provides the core functionality for the implementation. Individual methods then are defined as subclasses that only need to add any additional data attributes and define the private _calculate_limitation_terms() method. This is automatically called by the __init__ method of the class and so the limitation terms are calculated when an instance is created.

The module defines a registry (JMAX_LIMITATION_CLASS_REGISTRY) to track defined subclasses. Subclasses are added to this dictionary, under a string set by the subclass method attribute, by the __init_subclass__ method of the base class, which allows implementations to be selected by a simple string method name.

Classes:

JmaxLimitationABC(optchi[, pmodel_const])

An abstract base class for JMaxLimitation implementations.

JmaxLimitationNone(optchi[, pmodel_const])

No limitation of \(J_{max}\) and \(V_{cmax}\).

JmaxLimitationSmith19(optchi[, pmodel_const])

Calculate limitation factors following (Smith et al., 2019).

JmaxLimitationWang17(optchi[, pmodel_const])

Calculate limitation factors following (Wang et al., 2017).

Data:

JMAX_LIMITATION_CLASS_REGISTRY

A registry for subclasses of JmaxLimitationABC.

class JmaxLimitationABC(optchi: OptimalChiABC, pmodel_const: PModelConst = PModelConst())

An abstract base class for JMaxLimitation implementations.

This base class defines the __init__ arguments, common data attributes and core methods for implementing JMaxLimitation methods. Subclasses should only need to define any additional data attributes that should be exposed to users and define the private _calculate_limitation_terms() method for the implementation. Subclass definitions should provide a method name string and a tuple of the data attributes to include when the summarize() method is called for the subclass.

See JmaxLimitationWang17 for an example.

Methods:

_calculate_limitation_terms()

Abstract method defined in subclasses to populate limitation attributes.

summarize([dp])

Print OptimalChi summary.

Attributes:

data_attrs

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j

\(J_{max}\) limitation factor.

f_v

\(V_{cmax}\) limitation factor.

method

A short name for the method of Jmax limitation implemented in the subclass.

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape

Records the common numpy array shape in the data.

abstract _calculate_limitation_terms() None

Abstract method defined in subclasses to populate limitation attributes.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

data_attrs: tuple[tuple[str, str], ...]

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j: ndarray[tuple[Any, ...], dtype[floating]]

\(J_{max}\) limitation factor.

f_v: ndarray[tuple[Any, ...], dtype[floating]]

\(V_{cmax}\) limitation factor.

method: str

A short name for the method of Jmax limitation implemented in the subclass.

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape: tuple[int, ...]

Records the common numpy array shape in the data.

class JmaxLimitationNone(optchi: OptimalChiABC, pmodel_const: PModelConst = PModelConst())

No limitation of \(J_{max}\) and \(V_{cmax}\).

This implementation simply sets \(f_v = f_j = 1\) to remove any \(J_{max}\) and \(V_{cmax}\) limitation.

Methods:

_calculate_limitation_terms()

Set limitation terms to one.

summarize([dp])

Print OptimalChi summary.

Attributes:

data_attrs

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j

\(J_{max}\) limitation factor.

f_v

\(V_{cmax}\) limitation factor.

method

A short name for the method of Jmax limitation implemented in the subclass.

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape

Records the common numpy array shape in the data.

_calculate_limitation_terms() None

Set limitation terms to one.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

data_attrs: tuple[tuple[str, str], ...] = (('f_j', '-'), ('f_v', '-'))

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j: ndarray[tuple[Any, ...], dtype[floating]]

\(J_{max}\) limitation factor.

f_v: ndarray[tuple[Any, ...], dtype[floating]]

\(V_{cmax}\) limitation factor.

method: str = 'none'

A short name for the method of Jmax limitation implemented in the subclass.

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape: tuple[int, ...]

Records the common numpy array shape in the data.

class JmaxLimitationSmith19(optchi: OptimalChiABC, pmodel_const: PModelConst = PModelConst())

Calculate limitation factors following (Smith et al., 2019).

The values are calculated as:

\[ \begin{align*} f_v &= \frac{\omega^*}{2\theta} \\ f_j &= \omega\\ \end{align*} \]

where,

\[ \begin{align*} \omega &= (1 - 2\theta) + \sqrt{(1-\theta) \left(\frac{1}{\frac{4c}{m}(1 - \theta\frac{4c}{m})}-4\theta\right)}\\ \omega^* &= 1 + \omega - \sqrt{(1 + \omega) ^2 -4\theta\omega} \end{align*} \]

given,

  • \(\theta\), (const.smith19_theta) captures the

    curved relationship between light intensity and photosynthetic capacity, and

  • \(c\), (const.smith19_c_cost) as a cost parameter

    for maintaining \(J_{max}\), equivalent to \(c^\ast = 4c\) in the JmaxLimitationWang17 limitation terms.

Examples

>>> from pyrealm.pmodel import PModelEnvironment
>>> from pyrealm.pmodel.optimal_chi import OptimalChiPrentice14
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
... )
>>> optchi = OptimalChiPrentice14(env=env)
>>> jmaxlim = JmaxLimitationSmith19(optchi=optchi)
>>> jmaxlim.f_j.round(4)
array([1.102])
>>> jmaxlim.f_v.round(4)
array([0.7544])

Methods:

_calculate_limitation_terms()

Limitation calculations for the smith19 method.

summarize([dp])

Print OptimalChi summary.

Attributes:

data_attrs

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j

\(J_{max}\) limitation factor.

f_v

\(V_{cmax}\) limitation factor.

method

A short name for the method of Jmax limitation implemented in the subclass.

omega

Values of the omega parameter ((Smith et al., 2019)).

omega_star

Values of the omega_star parameter ((Smith et al., 2019)).

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape

Records the common numpy array shape in the data.

_calculate_limitation_terms() None

Limitation calculations for the smith19 method.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

data_attrs: tuple[tuple[str, str], ...] = (('f_j', '-'), ('f_v', '-'), ('omega', '-'), ('omega_star', '-'))

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j: ndarray[tuple[Any, ...], dtype[floating]]

\(J_{max}\) limitation factor.

f_v: ndarray[tuple[Any, ...], dtype[floating]]

\(V_{cmax}\) limitation factor.

method: str = 'smith19'

A short name for the method of Jmax limitation implemented in the subclass.

omega: ndarray[tuple[Any, ...], dtype[floating]] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=False,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=None)

Values of the omega parameter ((Smith et al., 2019)).

omega_star: ndarray[tuple[Any, ...], dtype[floating]] = Field(name=None,type=None,default=<dataclasses._MISSING_TYPE object>,default_factory=<dataclasses._MISSING_TYPE object>,init=False,repr=True,hash=None,compare=True,metadata=mappingproxy({}),kw_only=<dataclasses._MISSING_TYPE object>,_field_type=None)

Values of the omega_star parameter ((Smith et al., 2019)).

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape: tuple[int, ...]

Records the common numpy array shape in the data.

class JmaxLimitationWang17(optchi: OptimalChiABC, pmodel_const: PModelConst = PModelConst())

Calculate limitation factors following (Wang et al., 2017).

These factors are described in Equation 49 of (Wang et al., 2017) as the square root term at the end of that equation:

\[ \begin{align*} f_v &= \sqrt{ 1 - \frac{c^*}{m} ^{2/3}} \\ f_j &= \sqrt{\frac{m}{c^*} ^{2/3} -1 } \\ \end{align*} \]

The variable \(c^*\) is a cost parameter for maintaining \(J_{max}\) and is set in PModelConsts.wang17_c. Note that both equations are undefined where \(m \le c^*\): where this condition is true, values will be returned as np.nan.

Examples

>>> from pyrealm.pmodel import PModelEnvironment
>>> from pyrealm.pmodel.optimal_chi import OptimalChiPrentice14
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
... )
>>> optchi = OptimalChiPrentice14(env=env)
>>> jmaxlim = JmaxLimitationWang17(optchi=optchi)
>>> jmaxlim.f_j.round(4)
array([0.6672])
>>> jmaxlim.f_v.round(4)
array([0.555])

Methods:

_calculate_limitation_terms()

Limitation calculations for the wang17 method.

summarize([dp])

Print OptimalChi summary.

Attributes:

data_attrs

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j

\(J_{max}\) limitation factor.

f_v

\(V_{cmax}\) limitation factor.

method

A short name for the method of Jmax limitation implemented in the subclass.

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape

Records the common numpy array shape in the data.

_calculate_limitation_terms() None

Limitation calculations for the wang17 method.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

data_attrs: tuple[tuple[str, str], ...] = (('f_j', '-'), ('f_v', '-'))

A tuple of names and units for the data attributes of the class to be reported by summarize.

f_j: ndarray[tuple[Any, ...], dtype[floating]]

\(J_{max}\) limitation factor.

f_v: ndarray[tuple[Any, ...], dtype[floating]]

\(V_{cmax}\) limitation factor.

method: str = 'wang17'

A short name for the method of Jmax limitation implemented in the subclass.

optchi

The optimal chi instance used to calculate limitation terms.

pmodel_const

The PModel constants instance used for the calculation.

shape: tuple[int, ...]

Records the common numpy array shape in the data.

JMAX_LIMITATION_CLASS_REGISTRY: dict[str, type[JmaxLimitationABC]] = {'none': <class 'pyrealm.pmodel.jmax_limitation.JmaxLimitationNone'>, 'smith19': <class 'pyrealm.pmodel.jmax_limitation.JmaxLimitationSmith19'>, 'wang17': <class 'pyrealm.pmodel.jmax_limitation.JmaxLimitationWang17'>}

A registry for subclasses of JmaxLimitationABC. Subclasses are automatically included in this registry dictionary under their defined method name.

The optimal_chi submodule

The module optimal_chi provides the abstract base class OptimalChiABC, which is used to support different implementations of the calculation of optimal chi.

Classes:

OptimalChiABC(env[, pmodel_const])

ABC for estimating optimal leaf internal \(\ce{CO2}\) concentration.

OptimalChiC4(env[, pmodel_const])

Estimate \(\chi\) for C4 plants following (Prentice et al., 2014).

OptimalChiC4NoGamma(env[, pmodel_const])

Calculate optimal chi for C4 plants assuming negligible photorespiration.

OptimalChiC4NoGammaRootzoneStress(env[, ...])

Calculate optimal chi for C4 plants assuming negligible photorespiration with

OptimalChiC4RootzoneStress(env[, pmodel_const])

Estimate \(\chi\) for C4 plants following (Prentice et al., 2014) with

OptimalChiLavergne20C3(env[, pmodel_const])

Estimate \(\chi\) for C3 plants using soil moisture corrected \(\beta\).

OptimalChiLavergne20C4(env[, pmodel_const])

Calculate soil moisture corrected \(\chi\) for C4 plants.

OptimalChiPrentice14(env[, pmodel_const])

Calculate \(\chi\) for C3 plants following (Prentice et al., 2014).

OptimalChiPrentice14RootzoneStress(env[, ...])

Calculate \(\chi\) for C3 plants following (Prentice et al., 2014) with root

Data:

OPTIMAL_CHI_CLASS_REGISTRY

A registry for optimal chi calculation classes.

class OptimalChiABC(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

ABC for estimating optimal leaf internal \(\ce{CO2}\) concentration.

This provides an abstract base class for the implementation of alternative approaches to calculating the optimal \(\chi\) and \(\ce{CO2}\) limitation factors. All implementations estimate the following values, which are attributes of the resulting class instance.

  • The ratio of carboxylation to transpiration cost factors (beta, \(\beta\)).

  • The variable xi (\(\xi\)), which captures the sensitivity of \(\chi\) to the vapour pressure deficit, and is related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

  • The optimal ratio of \(\ce{CO2}\) partial pressures within the leaf (ci, \(c_i\)) to the external environmental partial pressure (ca`, \(c_i\)) recorded. The optimal ratio chi (\(\chi = c_i/c_a\)) is stored as well as the resulting internal partial pressure (ci).

  • The \(\ce{CO2}\) limitation term for light-limited assimilation (mj, \(m_j\)), the \(\ce{CO2}\) limitation term for Rubisco-limited assimilation (mc, \(m_c\)) and their ratio (mjoc, \(m_j/m_c\)).

The abstract base class requires that implementations of specific approaches define two methods:

  • set_beta: This method defines the calculation of the beta values to be used. The method is called by the __init__ method when a subclass instance is created and should not change.

  • estimate_chi: This method defines the calculation of xi and then chi, ci, mj, mc and mjoc. This method is also called by the __init__ method when a subclass instance is created, using the default defined calculation of xi. However, it can also be called using modified values for xi to allow recalculation of these values. This is used primarily in fitting the P Model at subdaily scales, where the xi parameter acclimates slowly to changing environmental conditions.

Parameters:
  • env – An instance of PModelEnvironment providing the photosynthetic environment for the model.

  • pmodel_const – An instance of PModelConst.

Returns:

Instances of the abstract base class should not be created - use instances of specific subclasses.

Methods:

estimate_chi([xi_values])

Estimate xi, chi and other variables.

set_beta()

Set the beta values.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

abstract estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate xi, chi and other variables.

abstract set_beta() None

Set the beta values.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...]

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiC4(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Estimate \(\chi\) for C4 plants following (Prentice et al., 2014).

Optimal \(\chi\) is calculated as in OptimalChiPrentice14(), but using a C4 specific estimate of the unit cost ratio \(\beta\), see beta_cost_ratio_c4.

This method sets \(m_j = m_c = m_{joc} = 1.0\) to capture the boosted \(\ce{CO2}\) concentrations at the chloropolast in C4 photosynthesis.

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
... )
>>> vals = OptimalChiC4(env=env)
>>> vals.chi.round(5)
array([0.44962])
>>> vals.mj.round(5)
array([1.])
>>> vals.mc.round(5)
array([1.])

Methods:

estimate_chi([xi_values])

Estimate chi for C4 plants, setting mj and mc to 1.

set_beta()

Set beta to a constant C4 specific value.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C4 plants, setting mj and mc to 1.

set_beta() None

Set beta to a constant C4 specific value.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = True

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'c4'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ()

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiC4NoGamma(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Calculate optimal chi for C4 plants assuming negligible photorespiration.

Calculates \(\chi\) assuming that photorespiration (\(\Gamma^\ast\)) is negligible for C4 plants. This simplifies the calculation of \(\xi\) and \(\chi\) compared to OptimalChiC4(), but uses the same C4 specific estimate of the unit cost ratio \(\beta\), beta_cost_ratio_c4.

\[ \begin{align*} \chi &= \xi / (\xi + \sqrt D ), \text{where}\\ \xi &= \sqrt{(\beta K) / (1.6 \eta^{*}))} \end{align*} \]

In addition, \(m_j = 1.0\) because photorespiration is negligible in C4 photosynthesis, but \(m_c\) and hence \(m_{joc}\) are calculated, not set to one.

\[m_c = \dfrac{\chi}{\chi + \frac{K}{c_a}}\]

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
... )
>>> vals = OptimalChiC4NoGamma(env=env)
>>> vals.chi.round(5)
array([0.39184])
>>> vals.mj.round(5)
array([1.])
>>> vals.mc.round(5)
array([0.25623])

Methods:

estimate_chi([xi_values])

Estimate chi for C4 plants excluding photorespiration.

set_beta()

Set constant beta for C4 plants.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C4 plants excluding photorespiration.

set_beta() None

Set constant beta for C4 plants.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = True

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'c4_no_gamma'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ()

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiC4NoGammaRootzoneStress(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Calculate optimal chi for C4 plants assuming negligible photorespiration with

Experimental :class: Warning

Be aware that OptimalChiC4NoGammaRootzoneStress is an experimental feature and the API and any calculated values may change between major releases.

root zone stress penalty.

The calculations are identical to OptimalChiC4NoGamma but apply an experimental rootzone stress penalty (\(f_{rz}\)) to \(\beta\) in the calculation of \(\xi\):

\[\xi = \sqrt{(\beta f_{rz} K) / (1.6 \eta^{*}))}\]

Calculation of the root zone stress factor is not currently part of the pyrealm package.

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
...     rootzonestress=np.array([0.5])
... )
>>> vals = OptimalChiC4NoGammaRootzoneStress(env=env)
>>> vals.chi.round(5)
array([0.31299])
>>> vals.mj.round(5)
array([1.])
>>> vals.mc.round(5)
array([0.2158])

Methods:

estimate_chi([xi_values])

Estimate chi for C4 plants excluding photorespiration.

set_beta()

Set constant beta for C4 plants.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C4 plants excluding photorespiration.

set_beta() None

Set constant beta for C4 plants.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = True

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'c4_no_gamma_rootzonestress'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ('rootzonestress',)

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiC4RootzoneStress(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())
Estimate \(\chi\) for C4 plants following (Prentice et al., 2014) with

root zone stress penalty.

The calculations are identical to OptimalChiC4 but apply an experimental rootzone stress penalty (\(f_{rz}\)) to \(\beta\) in the calculation of \(\xi\):

\[\xi = \sqrt{(\beta f_{rz} (K+ \Gamma^{*}) / (1.6 \eta^{*}))}\]

Calculation of the root zone stress factor is not currently part of the pyrealm package.

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
...     rootzonestress=0.5
... )
>>> vals = OptimalChiC4RootzoneStress(env=env)
>>> vals.chi.round(5)
array([0.37654])
>>> vals.mj.round(5)
array([1.])
>>> vals.mc.round(5)
array([1.])

Methods:

estimate_chi([xi_values])

Estimate chi for C4 plants, setting mj and mc to 1.

set_beta()

Set beta to a constant C4 specific value.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C4 plants, setting mj and mc to 1.

set_beta() None

Set beta to a constant C4 specific value.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = True

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'c4_rootzonestress'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ('rootzonestress',)

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiLavergne20C3(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Estimate \(\chi\) for C3 plants using soil moisture corrected \(\beta\).

Optimal \(\chi\) is calculated using a definition of the unit cost ratio $beta$ as a function of soil moisture ($theta$, m3 m-3), following (Lavergne et al., 2020):

\[ \beta = e ^ {b\theta + a}, \]

The coefficients are experimentally derived values with defaults taken from Figure 6a of (Lavergne et al., 2020) (\(a\), lavergne_2020_c3; \(b\), lavergne_2020_c3).

Values of \(\chi\) and other predictions are then calculated as in OptimalChiPrentice14(). This method requires that env includes estimates of \(\theta\).

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
...     theta=np.array([0.5])
... )
>>> vals = OptimalChiLavergne20C3(env=env)
>>> vals.beta.round(5)
array([224.75255])
>>> vals.chi.round(5)
array([0.73659])
>>> vals.mc.round(5)
array([0.34909])
>>> vals.mj.round(5)
array([0.72578])
>>> vals.mjoc.round(5)
array([2.07906])

Methods:

estimate_chi([xi_values])

Estimate chi for C3 plants.

set_beta()

Set beta with soil moisture corrections.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C3 plants.

set_beta() None

Set beta with soil moisture corrections.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = False

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'lavergne20_c3'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ('theta',)

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiLavergne20C4(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Calculate soil moisture corrected \(\chi\) for C4 plants.

Experimental

Be aware that OptimalChiLavergne20C4 is an experimental feature and the API and any calculated values may change between major releases.

This method calculates \(\beta\) as a function of soil moisture following the equation described in the OptimalChiLavergne20C3() method. However, the default coefficients of the moisture scaling from (Lavergne et al., 2020) for C3 plants are adjusted to match the theoretical expectation that \(\beta\) for C4 plants is nine times smaller than \(\beta\) for C3 plants (see OptimalChiC4()): \(b\) (lavergne_2020_c4) is unchanged but \(a_{C4} = a_{C3} - log(9)\) (lavergne_2020_c4) .

Following the calculation of \(\beta\), this method then follows the calculations described in OptimalChiC4NoGamma() :\(m_j = 1.0\) because photorespiration is negligible, but \(m_c\) and hence \(m_{joc}\) are calculated.

Note

The research underlying (Lavergne et al., 2020), found no relationship between C4 \(\beta\) values and soil moisture in leaf gas exchange measurements. This implementation asserts that there is a relationship and that the relationship is consistent with the patterns found for C3 plants.

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
...     theta=np.array([0.5])
... )
>>> vals = OptimalChiLavergne20C4(env=env)
>>> vals.beta.round(5)
array([24.97251])
>>> vals.chi.round(5)
array([0.44426])
>>> vals.mc.round(5)
array([0.28088])
>>> vals.mj.round(5)
array([1.])
>>> vals.mjoc.round(5)
array([3.56024])

Methods:

estimate_chi([xi_values])

Estimate chi for C4 plants excluding photorespiration.

set_beta()

Set beta with soil moisture corrections.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C4 plants excluding photorespiration.

set_beta() None

Set beta with soil moisture corrections.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = True

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'lavergne20_c4'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ('theta',)

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiPrentice14(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Calculate \(\chi\) for C3 plants following (Prentice et al., 2014).

Optimal \(\chi\) is calculated following Equation 8 in (Prentice et al., 2014):

\[ \begin{align*} \chi &= \Gamma^{*} / c_a + (1- \Gamma^{*} / c_a) \xi / (\xi + \sqrt D ), \text{where}\\ \xi &= \sqrt{(\beta (K+ \Gamma^{*}) / (1.6 \eta^{*}))} \end{align*} \]

The \(\ce{CO2}\) limitation term of light use efficiency (\(m_j\)) is calculated following Equation 3 in (Wang et al., 2017):

\[m_j = \frac{c_a - \Gamma^{*}} {c_a + 2 \Gamma^{*}}\]

Finally, \(m_c\) is calculated, following Equation 7 in (Stocker et al., 2020), as:

\[m_c = \frac{c_i - \Gamma^{*}}{c_i + K},\]

where \(K\) is the Michaelis Menten coefficient of Rubisco-limited assimilation.

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
... )
>>> vals = OptimalChiPrentice14(env=env)
>>> vals.chi.round(5)
array([0.6943])
>>> vals.mc.round(5)
array([0.33407])
>>> vals.mj.round(5)
array([0.71229])
>>> vals.mjoc.round(5)
array([2.13218])

Methods:

estimate_chi([xi_values])

Estimate chi for C3 plants.

set_beta()

Set beta to a constant C3 specific value.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C3 plants.

set_beta() None

Set beta to a constant C3 specific value.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = False

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'prentice14'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ()

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

class OptimalChiPrentice14RootzoneStress(env: PModelEnvironment, pmodel_const: PModelConst = PModelConst())

Calculate \(\chi\) for C3 plants following (Prentice et al., 2014) with root

Experimental

Be aware that OptimalChiPrentice14RootzoneStress is an experimental feature and the API and any calculated values may change between major releases.

zone stress penalty.

The calculations are identical to OptimalChiPrentice14 but apply an experimental rootzone stress penalty (\(f_{rz}\)) to \(\beta\) in the calculation of \(\xi\):

\[\xi = \sqrt{(\beta f_{rz} (K+ \Gamma^{*}) / (1.6 \eta^{*}))}\]

Calculation of the root zone stress factor is not currently part of the pyrealm package.

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]), vpd=np.array([1000]),
...     co2=np.array([400]), patm=np.array([101325.0]),
...     fapar=np.array([1]), ppfd=np.array([800]),
...     rootzonestress=0.5
... )
>>> vals = OptimalChiPrentice14RootzoneStress(env=env)
>>> vals.chi.round(5)
array([0.6201])

Methods:

estimate_chi([xi_values])

Estimate chi for C3 plants.

set_beta()

Set beta to a constant C3 specific value.

summarize([dp])

Print OptimalChi summary.

Attributes:

beta

The ratio of carboxylation to transpiration cost factors.

chi

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4

A flag indicating if the method captures the C4 photosynthetic pathway.

mc

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc

Ratio of \(m_j/m_c\).

pmodel_const

The PModelParams used for optimal chi estimation

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

xi

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

estimate_chi(xi_values: ArrayType[np.floating] | None = None) None

Estimate chi for C3 plants.

set_beta() None

Set beta to a constant C3 specific value.

summarize(dp: int = 2) None

Print OptimalChi summary.

Prints a summary of the variables calculated within an instance of OptimalChi including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

beta: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of carboxylation to transpiration cost factors.

chi: ndarray[tuple[Any, ...], dtype[floating]]

The ratio of leaf internal to ambient \(\ce{CO2}\) partial pressure (\(\chi\)).

ci: ndarray[tuple[Any, ...], dtype[floating]]

The leaf internal \(\ce{CO2}\) partial pressure (\(c_i\)).

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

is_c4: bool = False

A flag indicating if the method captures the C4 photosynthetic pathway.

mc: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)).

method: str = 'prentice14_rootzonestress'

A short method name used to identify the class in OPTIMAL_CHI_CLASS_REGISTRY.

mj: ndarray[tuple[Any, ...], dtype[floating]]

\(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

mjoc: ndarray[tuple[Any, ...], dtype[floating]]

Ratio of \(m_j/m_c\).

pmodel_const: PModelConst

The PModelParams used for optimal chi estimation

required_env_variables: tuple[str, ...] = ('rootzonestress',)

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

xi: ndarray[tuple[Any, ...], dtype[floating]]

Defines the sensitivity of \(\chi\) to the vapour pressure deficit, related to the carbon cost of water (Medlyn et al. 2011; Prentice et 2014).

OPTIMAL_CHI_CLASS_REGISTRY: dict[str, type[OptimalChiABC]] = {'c4': <class 'pyrealm.pmodel.optimal_chi.OptimalChiC4'>, 'c4_no_gamma': <class 'pyrealm.pmodel.optimal_chi.OptimalChiC4NoGamma'>, 'c4_no_gamma_rootzonestress': <class 'pyrealm.pmodel.optimal_chi.OptimalChiC4NoGammaRootzoneStress'>, 'c4_rootzonestress': <class 'pyrealm.pmodel.optimal_chi.OptimalChiC4RootzoneStress'>, 'lavergne20_c3': <class 'pyrealm.pmodel.optimal_chi.OptimalChiLavergne20C3'>, 'lavergne20_c4': <class 'pyrealm.pmodel.optimal_chi.OptimalChiLavergne20C4'>, 'prentice14': <class 'pyrealm.pmodel.optimal_chi.OptimalChiPrentice14'>, 'prentice14_rootzonestress': <class 'pyrealm.pmodel.optimal_chi.OptimalChiPrentice14RootzoneStress'>}

A registry for optimal chi calculation classes.

Different implementations of the calculation of optimal chi must all be subclasses of OptimalChiABC abstract base class. This dictionary is used as a registry for defined subclasses and a method name is used to retrieve a particular implementation from this registry. For example:

prentice14_opt_chi = OPTIMAL_CHI_CLASS_REGISTRY['prentice14']

The arrhenius submodule

Arrhenius enzyme reaction models.

The reaction rates of enzyme systems of photosynthesis respond to temperature in a way that is estimate using an Arrhenius relationship. There are alternative ways of parameterizing this temperature scaling and this module defines functions implementing different approaches to calculating Arrhenius factors for a given temperature, relative to a reference temperature, given a set of coefficients for a specific enzyme system.

It also provides the pyrealm.pmodel.arrhenius.ArrheniusFactorABC abstract base class. This provides a framework that allows different scaling functions to be called from the PModel and SubdailyPModel classes, and hence allows the models to use different temperature relationships for enzyme rates.

Classes:

ArrheniusFactorABC(env)

Abstract base class for implementations of Arrhenius factors.

KattgeKnorrArrhenius(env)

Class providing Kattge Knorr Arrhenius scaling.

SimpleArrhenius(env)

Class providing simple Arrhenius scaling.

Data:

ARRHENIUS_METHOD_REGISTRY

A registry for Arrhenius factor calculation classes.

class ArrheniusFactorABC(env: PModelEnvironment)

Abstract base class for implementations of Arrhenius factors.

This abstract base class provides a framework for implementing Arrhenius calculations within a PModel or SubdailyPModel. Individual subclasses are registered by a method name that can then be used with the method_arrhenius argument to those classes.

The __init__ method uses the PModelEnvironment to provide temperature and any other required variables to the calculation, along with the reference temperature to be used. The calculate_arrhenius_factor method provides validation to check that the coefficients required by a particular implementation are provided.

Subclasses only need to implement the private abstract method _calculate_values, which should implement the actual calculation from the data and coefficients supplied to the instance, and should return an array of calculated factor values.

Methods:

calculate_arrhenius_factor(coefficients)

Calculate the Arrhenius factor.

Attributes:

env

The PModelEnvironment containing the photosynthetic environment for the model.

method

A short method name used to identify the class in ARRHENIUS_METHOD_REGISTRY.

required_coefficients

A set of the names of coefficients required to calculate factor values.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

calculate_arrhenius_factor(coefficients: dict) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the Arrhenius factor.

This method calculates the Arrhenius factor for the model environment, given a dictionary providing the required enzyme coefficients.

Parameters:

coefficients – A dictionary providing any required coefficients for a given enzyme system.

Raises:

ValueError – where the method name is not found in the coefficients dictionary or the required coefficients are not found in that matched dictionary.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

method: str

A short method name used to identify the class in ARRHENIUS_METHOD_REGISTRY. This name is also used to select a matching dictionary of coefficients from inputs.

required_coefficients: set[str]

A set of the names of coefficients required to calculate factor values. These must be present in the coefficients dictionary matching the method name.

required_env_variables: tuple[str, ...]

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

class KattgeKnorrArrhenius(env: PModelEnvironment)

Class providing Kattge Knorr Arrhenius scaling.

Experimental

Be aware that KattgeKnorrArrhenius is an experimental feature and the API and any calculated values may change between major releases.

This method implements the peaked Arrhenius scaling model of Kattge and Knorr (2007). It requires that the PModelEnvironment also provides values for the mean growth temperature of plants as mean_growth_temperature in °C. It also requires a coefficients dictionary providing:

  • the intercept (entropy_intercept) and slope (entropy_slope) of activation entropy as a function of the mean growth temperature in °C (J/mol/°C),

  • the deactivation energy constant (hd, \(H_d\), J/mol) and

  • the activation energy constant (ha, \(H_a\), J/mol).

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]),
...     patm=np.array([101325]),
...     co2=np.array([400]),
...     vpd=np.array([1000]),
...     mean_growth_temperature=np.array([10]),
... )
>>> arrh = KattgeKnorrArrhenius(env=env)
>>> # Kattge and Knorr Arrhenius scaling factor using V_cmax coefficients
>>> arrh.calculate_arrhenius_factor(
...     coefficients={"kattge_knorr":
...         {
...             'entropy_intercept': 668.39,
...             'entropy_slope': -1.07,
...             'ha': 71513,
...             'hd': 200000,
...         }
...     }
...  ).round(5)
array([0.70109])

Methods:

calculate_arrhenius_factor(coefficients)

Calculate the Arrhenius factor.

Attributes:

env

The PModelEnvironment containing the photosynthetic environment for the model.

method

A short method name used to identify the class in ARRHENIUS_METHOD_REGISTRY.

required_coefficients

A set of the names of coefficients required to calculate factor values.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

calculate_arrhenius_factor(coefficients: dict) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the Arrhenius factor.

This method calculates the Arrhenius factor for the model environment, given a dictionary providing the required enzyme coefficients.

Parameters:

coefficients – A dictionary providing any required coefficients for a given enzyme system.

Raises:

ValueError – where the method name is not found in the coefficients dictionary or the required coefficients are not found in that matched dictionary.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

method: str = 'kattge_knorr'

A short method name used to identify the class in ARRHENIUS_METHOD_REGISTRY. This name is also used to select a matching dictionary of coefficients from inputs.

required_coefficients: set[str] = {'entropy_intercept', 'entropy_slope', 'ha', 'hd'}

A set of the names of coefficients required to calculate factor values. These must be present in the coefficients dictionary matching the method name.

required_env_variables: tuple[str, ...] = ('mean_growth_temperature',)

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

class SimpleArrhenius(env: PModelEnvironment)

Class providing simple Arrhenius scaling.

This class provides an implementation of simple Arrhenius scaling for the data in a PModelEnvironment. It requires no variables other than the standard temperature and requires that a coefficient dictionary providing only ha (the activation energy constant, \(H_a\), J/mol).

Examples

>>> import numpy as np
>>> env = PModelEnvironment(
...     tc=np.array([20]),
...     patm=np.array([101325]),
...     co2=np.array([400]),
...     vpd=np.array([1000]),
... )
>>> arrh = SimpleArrhenius(env=env)
>>> # Simple Arrhenius scaling factor using V_cmax coefficients
>>> arrh.calculate_arrhenius_factor(
...     coefficients={'simple': {'ha': 65330}}
... ).round(5)
array([0.63795])

Methods:

calculate_arrhenius_factor(coefficients)

Calculate the Arrhenius factor.

Attributes:

env

The PModelEnvironment containing the photosynthetic environment for the model.

method

A short method name used to identify the class in ARRHENIUS_METHOD_REGISTRY.

required_coefficients

A set of the names of coefficients required to calculate factor values.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

calculate_arrhenius_factor(coefficients: dict) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the Arrhenius factor.

This method calculates the Arrhenius factor for the model environment, given a dictionary providing the required enzyme coefficients.

Parameters:

coefficients – A dictionary providing any required coefficients for a given enzyme system.

Raises:

ValueError – where the method name is not found in the coefficients dictionary or the required coefficients are not found in that matched dictionary.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

method: str = 'simple'

A short method name used to identify the class in ARRHENIUS_METHOD_REGISTRY. This name is also used to select a matching dictionary of coefficients from inputs.

required_coefficients: set[str] = {'ha'}

A set of the names of coefficients required to calculate factor values. These must be present in the coefficients dictionary matching the method name.

required_env_variables: tuple[str, ...] = ()

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

ARRHENIUS_METHOD_REGISTRY: dict[str, type[ArrheniusFactorABC]] = {'kattge_knorr': <class 'pyrealm.pmodel.arrhenius.KattgeKnorrArrhenius'>, 'simple': <class 'pyrealm.pmodel.arrhenius.SimpleArrhenius'>}

A registry for Arrhenius factor calculation classes.

This dictionary is used as a registry for subclasses of the ArrheniusFactorABC abstract base class. The different subclasses are keyed by a method name that can be used to retrieve a particular implementation from this registry. For example:

arrh_simple = ARRHENIUS_METHOD_REGISTRY['simple']

The quantum_yield submodule

The module quantum_yield provides the abstract base class QuantumYieldABC, which is used to support different implementations of the calculation of the intrinsic quantum yield efficiency of photosynthesis (\(\phi_0\), unitless). The module then provides subclasses of the ABC implementing different approaches.

Note that \(\phi_0\) is sometimes used to refer to the quantum yield of electron transfer, which is exactly four times larger, so check definitions here.

Classes:

QuantumYieldABC(env[, reference_kphio, use_c4])

ABC for calculating the intrinsic quantum yield of photosynthesis.

QuantumYieldFixed(env[, reference_kphio, use_c4])

Apply a fixed value for \(\phi_0\).

QuantumYieldSandoval(env[, reference_kphio, ...])

Calculate aridity and mean growth temperature effects on quantum yield.

QuantumYieldTemperature(env[, ...])

Calculate temperature dependent of quantum yield efficiency.

Data:

QUANTUM_YIELD_CLASS_REGISTRY

A registry for intrinsic quantum yield of photosynthesis calculation classes.

class QuantumYieldABC(env: PModelEnvironment, reference_kphio: float | ArrayType[np.floating] | None = None, use_c4: bool = False)

ABC for calculating the intrinsic quantum yield of photosynthesis.

This provides an abstract base class for the implementation of alternative approaches to calculating the the intrinsic quantum yield of photosynthesis. All implementations estimate the \(\phi_{0}\) following values, which is then stored in the kphio attribute of the resulting class instance.

The abstract base class requires that implementations of specific approaches defines the calculate_kphio method. The provides the approach specific calculation of kphio and is automatically called by the __init__ method when a subclass instance is created.

Subclasses must define several class attributes when created:

class QuantumYieldFixed(
    QuantumYieldABC,
    method="method_name",
    required_env_variables=("an_environment_variable",),
    array_reference_kphio_ok=True,
):
  • The method argument sets the name of the method, which can then be used to select the implemented class from the QUANTUM_YIELD_CLASS_REGISTRY.

  • The required_env_variables argument sets a list of variables that must be present in the PModelEnvironment to use this approach. The core tc, vpd, patm and co2 variables do not need to be included in this list.

  • The array_reference_kphio_ok argument sets whether the method can accept an array of \(\phi_0\) values or whether a single global reference value should be used.

The definition of the _calculate_kphio method for subclasses can also provide C3 and C4 implementations for calculate \(\phi_0\) - or possibly raise an error for one pathway - using the use_c4 attribute.

Parameters:
  • env – An instance of PModelEnvironment providing the photosynthetic environment for the model.

  • reference_kphio – An optional value to be used instead of the global constant value . This is typically a single float but some approaches may support an array of values here.

  • use_c4 – Should the calculation use parameterisation for C4 photosynthesis rather than C3 photosynthesis.

Returns:

Instances of the abstract base class should not be created - use instances of specific subclasses.

Methods:

summarize([dp])

Print QuantumYield summary.

Attributes:

array_reference_kphio_ok

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env

The PModelEnvironment containing the photosynthetic environment for the model.

kphio

The calculated intrinsic quantum yield of photosynthesis.

method

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio

The kphio reference value for the method.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

use_c4

Use a C4 parameterisation if available.

summarize(dp: int = 2) None

Print QuantumYield summary.

Prints a summary of the variables calculated within an instance of QuantumYield including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

array_reference_kphio_ok: bool

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

kphio: ndarray[tuple[Any, ...], dtype[floating]]

The calculated intrinsic quantum yield of photosynthesis.

method: str

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio: ndarray[tuple[Any, ...], dtype[floating]]

The kphio reference value for the method.

required_env_variables: tuple[str, ...]

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

use_c4: bool

Use a C4 parameterisation if available.

class QuantumYieldFixed(env: PModelEnvironment, reference_kphio: float | ArrayType[np.floating] | None = None, use_c4: bool = False)

Apply a fixed value for \(\phi_0\).

This implementation applies a fixed value for the quantum yield without any environmental variation. It will accept an array of values to allow externally estimated values of phi_0 to be passed to a P Model.

Methods:

summarize([dp])

Print QuantumYield summary.

Attributes:

array_reference_kphio_ok

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env

The PModelEnvironment containing the photosynthetic environment for the model.

kphio

The calculated intrinsic quantum yield of photosynthesis.

method

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio

The kphio reference value for the method.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

use_c4

Use a C4 parameterisation if available.

summarize(dp: int = 2) None

Print QuantumYield summary.

Prints a summary of the variables calculated within an instance of QuantumYield including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

array_reference_kphio_ok: bool = True

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

kphio: ndarray[tuple[Any, ...], dtype[floating]]

The calculated intrinsic quantum yield of photosynthesis.

method: str = 'fixed'

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio: ndarray[tuple[Any, ...], dtype[floating]]

The kphio reference value for the method.

required_env_variables: tuple[str, ...] = ()

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

use_c4: bool

Use a C4 parameterisation if available.

class QuantumYieldSandoval(env: PModelEnvironment, reference_kphio: float | ArrayType[np.floating] | None = None, use_c4: bool = False)

Calculate aridity and mean growth temperature effects on quantum yield.

Experimental

Be aware that QuantumYieldSandoval is an experimental feature and the API and any calculated values may change between major releases.

This experimental approach implements the method of Sandoval (in_prep). This approach modifies the maximum possible \(\phi_0\) as a function of the climatological aridity index. It then also adjusts the temperature at which the highest \(\phi_0\) can be attained as a function of the mean growth temperature for an observation. It then calculates the expected \(\phi_0\) as a function of temperature via a modified Arrhenius relationship.

The reference kphio for this approach is the theoretical maximum quantum yield, defaulting to the ratio of 1/9 in the absence of a Q cycle (Long et al., 1993).

Methods:

peak_quantum_yield(aridity_index)

Calculate the peak quantum yield as a function of the aridity index.

summarize([dp])

Print QuantumYield summary.

Attributes:

array_reference_kphio_ok

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env

The PModelEnvironment containing the photosynthetic environment for the model.

kphio

The calculated intrinsic quantum yield of photosynthesis.

method

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio

The kphio reference value for the method.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

use_c4

Use a C4 parameterisation if available.

peak_quantum_yield(aridity_index: pyrealm.core.xarray.ArrayType) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the peak quantum yield as a function of the aridity index.

Parameters:

aridity_index – An array of aridity index values.

summarize(dp: int = 2) None

Print QuantumYield summary.

Prints a summary of the variables calculated within an instance of QuantumYield including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

array_reference_kphio_ok: bool = False

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

kphio: ndarray[tuple[Any, ...], dtype[floating]]

The calculated intrinsic quantum yield of photosynthesis.

method: str = 'sandoval'

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio: ndarray[tuple[Any, ...], dtype[floating]]

The kphio reference value for the method.

required_env_variables: tuple[str, ...] = ('aridity_index', 'mean_growth_temperature')

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

use_c4: bool

Use a C4 parameterisation if available.

class QuantumYieldTemperature(env: PModelEnvironment, reference_kphio: float | ArrayType[np.floating] | None = None, use_c4: bool = False)

Calculate temperature dependent of quantum yield efficiency.

This implementation calculates temperature dependent quantum yield efficiency, as a quadratic function of temperature (\(T\)).

\[\phi(T) = a + b T - c T^2\]

The values of \(a, b, c\) are dependent on whether \(\phi_0\) is being estimated for C3 or C4 photosynthesis. For C3 photosynthesis, the default values use the temperature dependence of the maximum quantum yield of photosystem II in light-adapted tobacco leaves determined by Bernacchi et al. (2003). For C4 photosynthesis, the default values are taken from Cai and Prentice (2020).

Methods:

summarize([dp])

Print QuantumYield summary.

Attributes:

array_reference_kphio_ok

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env

The PModelEnvironment containing the photosynthetic environment for the model.

kphio

The calculated intrinsic quantum yield of photosynthesis.

method

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio

The kphio reference value for the method.

required_env_variables

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape

The shape of the input environment data.

use_c4

Use a C4 parameterisation if available.

summarize(dp: int = 2) None

Print QuantumYield summary.

Prints a summary of the variables calculated within an instance of QuantumYield including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

array_reference_kphio_ok: bool = False

Does the implementation handle arrays inputs to the reference_kphio __init__ argument.

env: PModelEnvironment

The PModelEnvironment containing the photosynthetic environment for the model.

kphio: ndarray[tuple[Any, ...], dtype[floating]]

The calculated intrinsic quantum yield of photosynthesis.

method: str = 'temperature'

A short method name used to identify the class in QUANTUM_YIELD_CLASS_REGISTRY.

reference_kphio: ndarray[tuple[Any, ...], dtype[floating]]

The kphio reference value for the method.

required_env_variables: tuple[str, ...] = ()

A tuple of names of additional variables that must be included in a PModelEnvironment instance to use a particular method.

shape: tuple[int, ...]

The shape of the input environment data.

use_c4: bool

Use a C4 parameterisation if available.

QUANTUM_YIELD_CLASS_REGISTRY: dict[str, type[QuantumYieldABC]] = {'fixed': <class 'pyrealm.pmodel.quantum_yield.QuantumYieldFixed'>, 'sandoval': <class 'pyrealm.pmodel.quantum_yield.QuantumYieldSandoval'>, 'temperature': <class 'pyrealm.pmodel.quantum_yield.QuantumYieldTemperature'>}

A registry for intrinsic quantum yield of photosynthesis calculation classes.

Different implementations of the calculation of the intrinsic quantum yield of photosynthesis (\(\phi_{0}\)) must all be subclasses of QuantumYieldABC abstract base class. This dictionary is used as a registry for defined subclasses and a method name is used to retrieve a particular implementation from this registry. For example:

temperature_phio = QUANTUM_YIELD_CLASS_REGISTRY['temperature']

The functions submodule

The functions submodule contains the main standalone functions used for calculating the photosynthetic behaviour of plants. The documentation describes the key equations used in each function.

Functions:

calculate_co2_to_ca(co2, patm)

Convert \(\ce{CO2}\) ppm to Pa.

calculate_ftemp_inst_rd(tc[, tc_ref, coef])

Calculate temperature scaling of dark respiration.

calculate_gammastar(tk, patm[, tk_ref, ...])

Calculate the photorespiratory CO2 compensation point.

calculate_kattge_knorr_arrhenius_factor(...)

Calculate an Arrhenius factor following Kattge and Knorr (2007).

calculate_kmm(tk, patm[, tk_ref, k_co, k_R, ...])

Calculate the Michaelis Menten coefficient of Rubisco-limited assimilation.

calculate_ns_star(tk, patm[, core_const])

Calculate the relative viscosity of water.

calculate_simple_arrhenius_factor(tk, tk_ref, ha)

Calculate an Arrhenius scaling factor using activation energy.

calculate_soilmstress_mengoli([soilm, ...])

Calculate the Mengoli et al. empirical soil moisture stress factor.

calculate_soilmstress_stocker(soilm[, ...])

Calculate Stocker's empirical soil moisture stress factor.

calculate_co2_to_ca(co2: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) ndarray[tuple[Any, ...], dtype[floating]]

Convert \(\ce{CO2}\) ppm to Pa.

Converts ambient \(\ce{CO2}\) (\(c_a\)) in part per million to Pascals, accounting for atmospheric pressure.

Parameters:
  • co2 – atmospheric \(\ce{CO2}\), ppm

  • patm (float) – atmospheric pressure, Pa

Returns:

Ambient \(\ce{CO2}\) in units of Pa

Examples

>>> np.round(calculate_co2_to_ca(413.03, 101325), 6)
np.float64(41.850265)
calculate_ftemp_inst_rd(tc: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, tc_ref: float = PModelConst().tc_ref, coef: tuple[float, float] = PModelConst().heskel_rd) ndarray[tuple[Any, ...], dtype[floating]]

Calculate temperature scaling of dark respiration.

Calculates the temperature-scaling factor for dark respiration at a given temperature (tc, \(T\) in °C), relative to the standard reference temperature \(T_o\), given the parameterisation in Heskel et al. (2016).

\[fr = \exp( b (T_o - T) - c ( T_o^2 - T^2 ))\]
Parameters:
  • tc – Temperature (\(T\), °C)

  • tc_ref – standard reference temperature for photosynthetic processes (\(T_o\),°C)

  • coef – A two tuple of floats providing the linear and quadratic coefficients (\(b\) and \(c\))

Examples

>>> # Relative instantaneous change in Rd going from 10 to 25 degrees
>>> pmod_consts = PModelConst()
>>> (
...     calculate_ftemp_inst_rd(
...         tc=25, tc_ref=pmod_consts.tc_ref, coef=pmod_consts.heskel_rd
...     )
...     / calculate_ftemp_inst_rd(
...         tc=10, tc_ref=pmod_consts.tc_ref, coef=pmod_consts.heskel_rd
...     )
...     - 1
... ).round(4)
np.float64(2.5096)
calculate_gammastar(tk: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, tk_ref: float = PModelConst().tk_ref, k_Po: float = CoreConst().k_Po, k_R: float = CoreConst().k_R, coef: dict[str, float] = PModelConst().bernacchi_gs) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the photorespiratory CO2 compensation point.

Calculates the photorespiratory CO2 compensation point in absence of dark respiration (\(\Gamma^{*}\), Farquhar et al., 1980) as:

\[\Gamma^{*} = \Gamma^{*}_{0} \cdot \frac{p}{p_0} \cdot f(T, H_a)\]

where \(f(T, H_a)\) modifies the activation energy to the the local temperature in Kelvin following the Arrhenius-type temperature response function (see calculate_simple_arrhenius_factor()). By default, estimates of \(\Gamma^{*}_{0}\) and \(H_a\) are taken from Bernacchi et al. (2001) (see PModelConst.bernacchi_gs)

Parameters:
  • tk – Temperature relevant for photosynthesis in Kelvin(\(T\), K)

  • patm – Atmospheric pressure (\(p\), Pascals)

  • tk_ref – The reference temperature of the coefficients in Kelvin.

  • k_Po – The standard atmospheric pressure, defaulting to the value from k_Po.

  • k_R – The universal gas constant, defaulting to the value from k_R.

  • coef – A dictionary providing the enzyme kinetic coefficients for the reaction (dha and gs25_0).

Returns:

A float value or values for \(\Gamma^{*}\) (in Pa)

Examples

>>> # CO2 compensation point at 20 °C  (293.15 K) and standard pressure
>>> calculate_gammastar(np.array([293.15]), np.array([101325])).round(5)
array([3.33925])
calculate_kattge_knorr_arrhenius_factor(tk_leaf: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, tk_ref: float, tc_growth: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, coef: dict[str, float], k_R: float = CoreConst().k_R) ndarray[tuple[Any, ...], dtype[floating]]

Calculate an Arrhenius factor following Kattge and Knorr (2007).

This implements a “peaked” version of the Arrhenius relationship, describing a decline in reaction rates at higher temperatures. In addition to the activation energy (see calculate_simple_arrhenius_factor()), this implementation adds an entropy term and the deactivation energy of the enzyme system. The rate is given for a given instantaneous temperature \(T\) relative to a reference temperature :math:T_0`, both given in Kelvin, but the entropy is calculated using a separate estimate of the growth temperature for a plant, expressed in °C.

\[ \begin{align*} f &= \exp \left( \frac{ H_a (T - T_0)}{T_0 R T}\right) \left( \frac{1 + \exp \left( \frac{T_0 \Delta S - H_d }{ R T_0}\right)} {1 + \exp \left( \frac{T \Delta S - H_d}{R T} \right)} \right) \left(\frac{T}{T_0}\right) \end{align*} \text{where,} \Delta S = a + b * t_g \]

The coefficients dictionary must provide entries for:

  • ha: The activation energy of the enzyme (\(H_a\))

  • hd: The deactivation energy of the enzyme (\(H_d\))

  • entropy_intercept: The intercept of the entropy relationship (\(a\))

  • entropy_slope: The slope of the entropy relationship (\(b\))

Parameters:
  • tk_leaf – The instantaneous temperature in Kelvin (K) at which to calculate the factor (\(T\))

  • tk_ref – The reference temperature in Kelvin for the process (\(T_0\))

  • tc_growth – The growth temperature of the plants in °C (\(t_g\))

  • coef – A dictionary providing values of the coefficients ha, hd, entropy_intercept and entropy_slope.

  • k_R – The universal gas constant, defaulting to the value from attr:~pyrealm.constants.core_const.CoreConst.k_R.

Returns:

Values for \(f\)

Examples

>>> # Calculate the factor for the relative rate of Vcmax at 10 °C (283.15K)
>>> # compared to the rate at the reference temperature of 25°C (298.15K).
>>> from pyrealm.constants import PModelConst
>>> pmodel_const = PModelConst()
>>> # Get enzyme kinetics parameters
>>> coef = pmodel_const.arrhenius_vcmax['kattge_knorr']
>>> # Calculate the arrhenius factor
>>> val = calculate_kattge_knorr_arrhenius_factor(
...     tk_leaf= np.array([283.15]),
...     tc_growth = 10,
...     tk_ref=298.15,
...     coef=coef,
... )
>>> np.round(val, 4)
array([0.261])
calculate_kmm(tk: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, tk_ref: float = PModelConst().tk_ref, k_co: float = CoreConst().k_co, k_R: float = CoreConst().k_R, coef: dict[str, float] = PModelConst().bernacchi_kmm) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the Michaelis Menten coefficient of Rubisco-limited assimilation.

Calculates the Michaelis Menten coefficient of Rubisco-limited assimilation (\(K\), Farquhar et al., 1980) as a function of temperature (\(T, Kelvin) and atmospheric pressure (:math:`p\), Pa) as:

\[K = K_c ( 1 + p_{\ce{O2}} / K_o),\]

where, \(p_{\ce{O2}} = 0.209476 \cdot p\) is the partial pressure of oxygen. \(f(T, H_a)\) is the simple Arrhenius temperature response of activation energies (see calculate_simple_arrhenius_factor()) used to correct Michalis constants at standard temperature for both \(\ce{CO2}\) and \(\ce{O2}\) to the local temperature. The default values for the enzyme coefficients are taken from Table 1 of Bernacchi et al. (2001) (see attr:PModelConst.bernacchi_kmm<pyrealm.constants.pmodel_const.PModelConst.bernacchi_kmm>)

\[ \begin{align*} K_c &= K_{c25} \cdot f(T, H_{kc})\\ K_o &= K_{o25} \cdot f(T, H_{ko}) \end{align*} \]
Parameters:
  • tk – Temperature relevant for photosynthesis in Kelvin (\(T\), K)

  • patm – Atmospheric pressure (\(p\), Pa)

  • tk_ref – The reference temperature of the coefficients in Kelvin.

  • k_co – The partial pressure of \(\ce{O2}\) at standard pressure, defaulting to the values from attr:~pyrealm.constants.core_const.CoreConst.k_co.

  • k_R – The universal gas constant, defaulting to the value from attr:~pyrealm.constants.core_const.CoreConst.k_R.

  • coef – A dictionary providing the enzyme kinetic coefficients for the reaction (kc25, ko25, dhac, dhao).

Returns:

A numeric value for \(K\) (in Pa)

Examples

>>> # Michaelis-Menten coefficient at 20°C (293.15K) and standard pressure (Pa)
>>> calculate_kmm(np.array([293.15]), np.array([101325])).round(5)
array([46.09928])
calculate_ns_star(tk: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, core_const: CoreConst = CoreConst()) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the relative viscosity of water.

Calculates the relative viscosity of water (\(\mu^*\)), given the standard temperature and pressure, using calculate_viscosity_h2o() (\(\mu(t,p)\)) as:

\[\eta^* = \frac{\mu(t,p)}{\mu(t_0,p_0)}\]
Parameters:
  • tk – Temperature, relevant for photosynthesis (\(T\), K)

  • patm – Atmospheric pressure (\(p\), Pa)

  • core_const – Instance of CoreConst.

PModel Parameters:
  • To – standard temperature (\(t0\), k_To, 298.15 K, 25 °C)

  • Po – standard pressure (\(p_0\), k_Po, 101325 Pa)

Returns:

A numeric value for \(\eta^*\) (a unitless ratio)

Examples

>>> # Relative viscosity at 293.15 K (20°C):
>>> round(calculate_ns_star(293.15, 101325), 5)
np.float64(1.12592)
calculate_simple_arrhenius_factor(tk: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, tk_ref: float, ha: float, k_R: float = CoreConst().k_R) ndarray[tuple[Any, ...], dtype[floating]]

Calculate an Arrhenius scaling factor using activation energy.

Calculates the temperature-scaling factor \(f\) for enzyme kinetics following a simple Arrhenius response governed solely by the activation energy for an enzyme (ha, \(H_a\)). The rate is given for a temperature \(T\) relative to a reference temperature :math:T_0`, both given in Kelvin.

Arrhenius kinetics are described as:

\[x(T) = \exp(c - H_a / (T R))\]

The temperature-correction function \(f(T, H_a)\) is:

\[ \begin{align*} f &= \frac{x(T)}{x(T_0)} \\ &= \exp \left( \frac{ H_a (T - T_0)}{T_0 R T}\right) \text{, or equivalently}\\ &= \exp \left( \frac{ H_a}{R} \cdot \left(\frac{1}{T_0} - \frac{1}{T}\right)\right) \end{align*} \]
Parameters:
  • tk – Temperature (K)

  • tk_ref – The reference temperature for the reaction (K).

  • ha – Activation energy (in \(J \text{mol}^{-1}\))

  • k_R – The universal gas constant, defaulting to the value from attr:~pyrealm.constants.core_const.CoreConst.k_R.

Examples

>>> # Percentage rate change from 25 to 10 degrees Celsius
>>> at_10C = calculate_simple_arrhenius_factor(
...     np.array([283.15]) , 298.15, 100000
... )
>>> np.round((1.0 - at_10C) * 100, 4)
array([88.1991])
calculate_soilmstress_mengoli(soilm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray = np.array(1.0), aridity_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray = np.array(1.0), coef: dict[str, float] = PModelConst().soilmstress_mengoli) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the Mengoli et al. empirical soil moisture stress factor.

This function calculates a penalty factor \(\beta(\theta)\) for well-watered GPP estimates as an empirically derived stress factor (Mengoli et al., 2023). The factor is calculated from relative soil moisture as a fraction of field capacity (\(\theta\)) and the long-run climatological aridity index for a site (\(\textrm{AI}\)), calculated as (total PET)/(total precipitation) for a suitable time period.

The factor is calculated using two constrained power functions for the maximal level (\(y\)) of productivity and the threshold (\(psi\)) at which that maximal level is reached.

\[ \begin{align*} y &= \min( a \textrm{AI} ^ {b}, 1)\\ \psi &= \min( a \textrm{AI} ^ {b}, 1)\\ \beta(\theta) &= \begin{cases} y, & \theta \ge \psi \\ \dfrac{y}{\psi} \theta, & \theta \lt \psi \\ \end{cases}\\ \end{align*} \]

Important

The parameterisation of this water stress penalty was estimated from empirical data using the subdaily form of the PModel (SubdailyPModel in pyrealm) with temperature dependence of the standard maximum quantum yield of photosynthesis (phi_0, \(\phi_0=1/8\)).

There are minor differences in the implementation of the Subdaily P Model in pyrealm from that used to calibrate this function in (Mengoli et al., 2023). To get the closest match when applying this soil moisture correction, use the following settings:

SubdailyPModel(
    ...
    method_kphio="temperature",
    method_arrhenius="simple",
    method_jmaxlim="wang17",
    method_optchi="prentice14",
    reference_kphio=1/8,
)

The reference_kphio=1/8 value here is in fact the default value used when method_kphio="temperature" but is restated here for clarity.

Parameters:
  • soilm – Relative soil moisture (unitless).

  • aridity_index – The climatological aridity index.

  • coef – A dictionary providing values of the coefficients y_a, y_b, psi_a and psi_b, defaulting to the values from attr:~pyrealm.constants.pmodel_const.PModelConst.soilmstress_mengoli.

Returns:

A numeric value or values for \(f(\theta)\)

Examples

>>> import numpy as np
>>> # Proportion of well-watered GPP available with soil moisture and aridity
>>> # index values of 0.6
>>> calculate_soilmstress_mengoli(np.array([0.6]), np.array([0.6])).round(5)
array([0.78023])
calculate_soilmstress_stocker(soilm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, meanalpha: ndarray[tuple[Any, ...], dtype[floating]] | DataArray = np.array(1.0), coef: dict[str, float] = PModelConst().soilmstress_stocker) ndarray[tuple[Any, ...], dtype[floating]]

Calculate Stocker’s empirical soil moisture stress factor.

This function calculates a penalty factor \(\beta(\theta)\) for well-watered GPP estimates as an empirically derived stress factor (Stocker et al., 2020). The factor is calculated as a function of relative soil moisture (\(m_s\), fraction of field capacity) and average aridity, quantified by the local annual mean ratio of actual over potential evapotranspiration (\(\bar{\alpha}\)).

The value of \(\beta\) is defined relative to two soil moisture thresholds (\(\theta_0, \theta^{*}\)) as:

\[ \beta = \begin{cases} q(m_s - \theta^{*})^2 + 1, & \theta_0 < m_s <= \theta^{*} \\ 1, & \theta^{*} < m_s, \end{cases} \]

where \(q\) is an aridity sensitivity parameter setting the stress factor at \(\theta_0\):

\[q=(1 - (a + b \bar{\alpha}))/(\theta^{*} - \theta_{0})^2\]

Important

The default parameterisation of this water stress penalty (\(a=0\), \(b=0.7330\)) was estimated from empirical data using the standard form of the PModel (PModel in pyrealm).

These parameters were then further calibrated against empirical data by tuning the quantum yield of photosynthesis. This tuning aimed to capture include incomplete leaf absorption in the realised value of \(\phi_0\), and Stocker et al. (2020) argue that, within their model representation, \(\phi_0\) should be treated as a parameter representing canopy-scale effective quantum yield. To duplicate the model settings used with this soil moisture correction in Table 1 of Stocker et al. (2020), use the following code:

# The 'BRC' model setup
PModel(
    ...
    method_kphio="temperature",
    method_arrhenius="simple",
    method_jmaxlim="wang17",
    method_optchi="prentice14",
    reference_kphio=0.081785,
)

# The 'ORG' model setup
PModel(
    ...
    method_kphio="fixed",
    method_arrhenius="simple",
    method_jmaxlim="wang17",
    method_optchi="prentice14",
    reference_kphio=0.049977,
)

The pyrealm.pmodel module treats this factor purely as a penalty that can be applied after the estimation of GPP. In contrast, the rpmodel implementation uses the penalised GPP to back-calculate realistic \(J_{max}\) and \(V_{cmax}\) values that would give rise to the penalised GPP.

Parameters:
  • soilm – Relative soil moisture as a fraction of field capacity (unitless). Defaults to 1.0 (no soil moisture stress).

  • meanalpha – Local annual mean ratio of actual over potential evapotranspiration, measure for average aridity. Defaults to 1.0.

  • coef – A dictionary providing values of the coefficients theta0, thetastar, a and b, defaulting to the values from attr:~pyrealm.constants.pmodel_const.PModelConst.soilmstress_stocker.

Returns:

A numeric value or values for \(\beta\)

Examples

>>> # Proportion of well-watered GPP available at soil moisture of 0.2
>>> calculate_soilmstress_stocker(np.array([0.2])).round(5)
array([0.88133])

The isotopes submodule

The isotopes submodule provides the CarbonIsotopes class, which is used to calculate isotopic discrimination within the PModel

Classes:

CarbonIsotopes(pmodel, D14CO2, d13CO2[, ...])

Calculate \(\ce{CO2}\) isotopic discrimination.

class CarbonIsotopes(pmodel: PModel, D14CO2: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, d13CO2: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, isotopes_const: IsotopesConst = IsotopesConst())

Calculate \(\ce{CO2}\) isotopic discrimination.

This class estimates the fractionation of atmospheric CO2 by photosynthetic pathways to calculate the isotopic compositions and discrimination given the predicted optimal chi from a PModel instance.

Discrimination against carbon 13 (\(\Delta\ce{^{13}C}\)) is calculated using C3 and C4 pathways specific methods, and then discrimination against carbon 14 is estimated as \(\Delta\ce{^{14}C} \approx 2 \times \Delta\ce{^{13}C}\) (Graven et al., 2020). For C3 plants, \(\Delta\ce{^{13}C}\) is calculated both including and excluding photorespiration, but these are assumed to be equal for C4 plants. The class also reports the isotopic composition of leaves and wood.

Parameters:
  • pmodel – A PModel instance providing the photosynthetic pathway and estimated optimal chi.

  • d13CO2 – Atmospheric isotopic ratio for Carbon 13 (\(\delta\ce{^{13}C}\), permil).

  • D14CO2 – Atmospheric isotopic ratio for Carbon 14 (\(\Delta\ce{^{14}C}\), permil).

  • isotopes_const – An instance of IsotopesConst, parameterizing the calculations.

Methods:

calculate_c3_discrimination(pmodel)

Calculate C3 isotopic discrimination.

calculate_c4_discrimination(pmodel)

Calculate C4 isotopic discrimination.

calculate_c4_discrimination_vonC(pmodel)

Calculate C4 isotopic discrimination.

summarize([dp])

Print summary of values estimated in CarbonIsotopes.

Attributes:

Delta13C

Discrimination against carbon 14 (\(\Delta\ce{^{14}C}\), permil) including photorespiration.

Delta13C_simple

Discrimination against carbon 13 (\(\Delta\ce{^{13}C}\), permil) excluding photorespiration.

Delta14C

Discrimination against carbon 13 (\(\Delta\ce{^{13}C}\), permil) including photorespiration.

c4

Indicates if estimates calculated for C3 or C4 photosynthesis.

d13C_leaf

Isotopic ratio of carbon 13 in leaves (\(\delta\ce{^{13}C}\), permil).

d13C_wood

Isotopic ratio of carbon 13 in wood (\(\delta\ce{^{13}C}\), permil), given a parameterized post-photosynthetic fractionation.

d14C_leaf

Isotopic ratio of carbon 14 in leaves (\(\delta\ce{^{14}C}\), permil).

isotopes_const

The IsotopesParams instance used to calculate estimates.

shape

Records the common numpy array shape of array inputs.

calculate_c3_discrimination(pmodel: PModel) None

Calculate C3 isotopic discrimination.

This method calculates the isotopic discrimination for \(\Delta\ce{^{13}C}\) both with and without the photorespiratory effect following (Farquhar et al., 1982).

Examples

>>> import numpy as np
>>> from pyrealm.pmodel import PModelEnvironment
>>> from pyrealm.pmodel.pmodel import PModel
>>> env = PModelEnvironment(
...              tc=np.array([20]), patm=np.array([101325]),
...              co2=np.array([400]), vpd=np.array([1000]),
...              fapar=np.array([1]), ppfd=np.array([800]),
...              theta=np.array([0.4])
... )
>>> mod_c3 = PModel(env, method_optchi='lavergne20_c3')
>>> mod_c3_delta = CarbonIsotopes(mod_c3, d13CO2= -8.4, D14CO2 = 19.2)
>>> mod_c3_delta.Delta13C.round(4)
array([20.4045])
>>> mod_c3_delta.d13C_leaf.round(4)
array([-28.2285])
calculate_c4_discrimination(pmodel: PModel) None

Calculate C4 isotopic discrimination.

In this method, \(\delta\ce{^{13}C}\) is calculated from optimal \(\chi\) using an empirical relationship estimated by (Lavergne et al., 2022).

Examples

>>> import numpy as np
>>> from pyrealm.pmodel.pmodel import PModel
>>> from pyrealm.pmodel import PModelEnvironment
>>> from pyrealm.constants import PModelConst
>>> pmodel_const = PModelConst(beta_cost_ratio_c4=35)
>>> env = PModelEnvironment(
...     tc=np.array([20]),
...     patm=np.array([101325]),
...     co2=np.array([400]),
...     vpd=np.array([1000]),
...     fapar=np.array([1]),
...     ppfd=np.array([800]),
...     pmodel_const=pmodel_const
... )
>>> mod_c4 = PModel(env, method_optchi='c4_no_gamma')
>>> mod_c4_delta = CarbonIsotopes(mod_c4, d13CO2= -8.4, D14CO2 = 19.2)
>>> mod_c4_delta.Delta13C.round(4)
array([5.6647])
>>> mod_c4_delta.d13C_leaf.round(4)
array([-13.9855])
calculate_c4_discrimination_vonC(pmodel: PModel) None

Calculate C4 isotopic discrimination.

In this method, \(\delta\ce{^{13}C}\) is calculated from optimal \(\chi\) following Equation 1 in (von Caemmerer et al., 2014).

This method is not yet reachable - it needs a method selection argument to switch approaches and check C4 methods are used with C4 pmodels. The method is preserving experimental code provided by Alienor Lavergne. A temperature sensitive correction term is provided in commented code but not used.

Examples

>>> import numpy as np
>>> from pyrealm.pmodel.pmodel import PModel
>>> from pyrealm.pmodel import PModelEnvironment
>>> from pyrealm.constants import PModelConst
>>> pmodel_const = PModelConst(beta_cost_ratio_c4=35)
>>> env = PModelEnvironment(
...     tc=np.array([20]),
...     patm=np.array([101325]),
...     co2=np.array([400]),
...     vpd=np.array([1000]),
...     fapar=np.array([1]),
...     ppfd=np.array([800]),
...     pmodel_const=pmodel_const
... )
>>> mod_c4 = PModel(env, method_optchi='c4_no_gamma')
>>> mod_c4_delta = CarbonIsotopes(mod_c4, d13CO2= -8.4, D14CO2 = 19.2)
>>> # mod_c4_delta.Delta13C.round(4)
>>> # array([5.2753])
>>> # mod_c4_delta.d13C_leaf.round(4)
>>> # array([-13.6036])
summarize(dp: int = 2) None

Print summary of values estimated in CarbonIsotopes.

Prints a summary of the variables calculated within an instance of CarbonIsotopes including the mean, range and number of nan values.

Parameters:

dp – The number of decimal places used in rounding summary stats.

Delta13C: ndarray[tuple[Any, ...], dtype[floating]]

Discrimination against carbon 14 (\(\Delta\ce{^{14}C}\), permil) including photorespiration.

Delta13C_simple: ndarray[tuple[Any, ...], dtype[floating]]

Discrimination against carbon 13 (\(\Delta\ce{^{13}C}\), permil) excluding photorespiration.

Delta14C: ndarray[tuple[Any, ...], dtype[floating]]

Discrimination against carbon 13 (\(\Delta\ce{^{13}C}\), permil) including photorespiration.

c4: bool

Indicates if estimates calculated for C3 or C4 photosynthesis.

d13C_leaf: ndarray[tuple[Any, ...], dtype[floating]]

Isotopic ratio of carbon 13 in leaves (\(\delta\ce{^{13}C}\), permil).

d13C_wood: ndarray[tuple[Any, ...], dtype[floating]]

Isotopic ratio of carbon 13 in wood (\(\delta\ce{^{13}C}\), permil), given a parameterized post-photosynthetic fractionation.

d14C_leaf: ndarray[tuple[Any, ...], dtype[floating]]

Isotopic ratio of carbon 14 in leaves (\(\delta\ce{^{14}C}\), permil).

isotopes_const: IsotopesConst

The IsotopesParams instance used to calculate estimates.

shape: tuple

Records the common numpy array shape of array inputs.

The competition submodule

The competition submodule provides the C3C4Competition class, which is used to estimate the expected fraction of C4 plants given the relative photosynthetic advantages of the two pathways in locations.

Classes:

C3C4Competition(gpp_c3, gpp_c4, treecover, ...)

Implementation of the C3/C4 competition model.

Functions:

calculate_tree_proportion(gppc3[, c3c4_const])

Calculate the proportion of GPP from C3 trees.

convert_gpp_advantage_to_c4_fraction(...[, ...])

Convert C4 GPP advantage to C4 fraction.

class C3C4Competition(gpp_c3: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, gpp_c4: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, treecover: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, below_t_min: ndarray[tuple[Any, ...], dtype[bool]] | DataArray, cropland: ndarray[tuple[Any, ...], dtype[bool]] | DataArray, c3c4_const: C3C4Const = C3C4Const())

Implementation of the C3/C4 competition model.

Experimental

Be aware that C3C4Competition is an experimental feature and the API and any calculated values may change between major releases.

This class provides an implementation of the calculations of C3/C4 competition, described by Lavergne et al. (2020). The key inputs ggp_c3 and gpp_c4 are gross primary productivity (GPP) estimates for C3 or C4 pathways alone using the PModel

These estimates are used to calculate the relative advantage of C4 over C3 photosynthesis (\(A_4\)), the expected fraction of C4 plants in the community (\(F_4\)) and hence fraction of GPP from C4 plants as follows:

  1. The proportion advantage in GPP for C4 plants is calculated as:

    \[ A_4 = \frac{\text{GPP}_{C4} - \text{GPP}_{C3}}{\text{GPP}_{C3}} \]
  2. The proportion GPP advantage \(A_4\) is converted to an expected fraction of C4 \(F_4\) plants using the function convert_gpp_advantage_to_c4_fraction().

  3. A model of tree cover from C3 trees is then used to penalise the fraction of C4 plants due to shading. The function calculate_tree_proportion() is used to estimate the proportion (\(h\)) and the C4 fraction is then discounted as \(F_4 = F_4 (1 - h)\).

  4. Two masks are applied. First, \(F_4 = 0\) in locations where the mean air temperature of the coldest month is too low for C4 plants. Second, \(F_4\) is set as unknown for croplands, where the fraction is set by agricultural management, not competition.

Parameters:
  • gpp_c3 – Total annual GPP (gC m-2 yr-1) from C3 plants alone.

  • gpp_c4 – Total annual GPP (gC m-2 yr-1) from C4 plants alone.

  • treecover – Percentage tree cover (%).

  • below_t_min – A boolean mask, temperatures too low for C4 plants.

  • cropland – A boolean mask indicating cropland locations.

  • c3c4_const – An instance of C3C4Const providing parameterisation for the competition model.

Methods:

estimate_isotopic_discrimination(d13CO2, ...)

Estimate CO2 isotopic discrimination values.

summarize([dp])

Print summary of estimates of C3/C4 competition.

Attributes:

Delta13C_C3

Contribution from C3 plants to (\(\Delta\ce{^13C}\), permil).

Delta13C_C4

Contribution from C4 plants to (\(\Delta\ce{^13C}\), permil).

d13C_C3

Contribution from C3 plants to (\(d\ce{^13C}\), permil).

d13C_C4

Contribution from C3 plants to (\(d\ce{^13C}\), permil).

frac_c4

The estimated fraction of C4 plants.

gpp_adv_c4

The proportional advantage in GPP of C4 over C3 plants

gpp_c3_contrib

The estimated contribution of C3 plants to GPP (gC m-2 yr-1)

gpp_c4_contrib

The estimated contribution of C4 plants to GPP (gC m-2 yr-1)

estimate_isotopic_discrimination(d13CO2: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, Delta13C_C3_alone: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, Delta13C_C4_alone: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) None

Estimate CO2 isotopic discrimination values.

Creating an instance of CarbonIsotopes from a PModel instance provides estimated total annual descrimination against Carbon 13 (\(\Delta\ce{^13C}\)) for a single photosynthetic pathway.

This method allows predictions from C3 and C4 pathways to be combined to calculate the contribution from C3 and C4 plants given the estimated fraction of C4 plants. It also calculates the contributions to annual stable carbon isotopic composition (\(d\ce{^13C}\)).

Calling this method populates the attributes Delta13C_C3, Delta13C_C4, d13C_C3, and d13C_C4.

Parameters:
  • d13CO2 – stable carbon isotopic composition of atmospheric CO2 (permil)

  • Delta13C_C3_alone – annual discrimination against 13C for C3 plants (permil)

  • Delta13C_C4_alone – annual discrimination against 13C for C4 plants (permil)

summarize(dp: int = 2) None

Print summary of estimates of C3/C4 competition.

Prints a summary of the calculated values in a C3C4Competition instance including the mean, range and number of nan values. This will always show fraction of C4 and GPP estaimates and isotopic estimates are shown if estimate_isotopic_discrimination() has been run.

Parameters:

dp – The number of decimal places used in rounding summary stats.

Delta13C_C3: ndarray[tuple[Any, ...], dtype[floating]]

Contribution from C3 plants to (\(\Delta\ce{^13C}\), permil).

Delta13C_C4: ndarray[tuple[Any, ...], dtype[floating]]

Contribution from C4 plants to (\(\Delta\ce{^13C}\), permil).

d13C_C3: ndarray[tuple[Any, ...], dtype[floating]]

Contribution from C3 plants to (\(d\ce{^13C}\), permil).

d13C_C4: ndarray[tuple[Any, ...], dtype[floating]]

Contribution from C3 plants to (\(d\ce{^13C}\), permil).

frac_c4: ndarray[tuple[Any, ...], dtype[floating]]

The estimated fraction of C4 plants.

gpp_adv_c4: ndarray[tuple[Any, ...], dtype[floating]]

The proportional advantage in GPP of C4 over C3 plants

gpp_c3_contrib: ndarray[tuple[Any, ...], dtype[floating]]

The estimated contribution of C3 plants to GPP (gC m-2 yr-1)

gpp_c4_contrib

The estimated contribution of C4 plants to GPP (gC m-2 yr-1)

calculate_tree_proportion(gppc3: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, c3c4_const: C3C4Const = C3C4Const()) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the proportion of GPP from C3 trees.

This function estimates the proportion of C3 trees in the community, which can then be used to penalise the fraction of C4 plants due to shading of C4 plants by canopy closure, even when C4 photosynthesis is advantageous. The estimated tree cover function is:

\[ TC(\text{GPP}_{C3}) = a \cdot \text{GPP}_{C3} ^ b - c \]

with parameters set in the const instance (\(a\), gpp_to_tc_a; \(b\), gpp_to_tc_b; \(c\), gpp_to_tc_c). The proportion of GPP from C3 trees (\(h\)) is then estimated using the predicted tree cover in locations relative to a threshold GPP value (\(\text{GPP}_{CLO}\), c3_forest_closure_gpp) above which canopy closure occurs. The value of \(h\) is clamped in \([0, 1]\):

\[ h = \max\left(0, \min\left( \frac{TC(\text{GPP}_{C3})}{TC(\text{GPP}_{CLO})}\right), 1 \right) \]
Parameters:
  • gppc3 – The estimated GPP for C3 plants. The input values here must be expressed as kilograms per metre squared per year (kg m-2 yr-1).

  • c3c4_const – Instance of C3C4Const.

Returns:

The estimated proportion of GPP resulting from C3 trees.

convert_gpp_advantage_to_c4_fraction(gpp_adv_c4: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, treecover: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, c3c4_const: C3C4Const = C3C4Const()) ndarray[tuple[Any, ...], dtype[floating]]

Convert C4 GPP advantage to C4 fraction.

This function calculates an initial estimate of the fraction of C4 plants based on the proportional GPP advantage from C4 photosynthesis. The proportion GPP advantage \(A_4\) is converted to an expected fraction of C4 \(F_4\) plants using a logistic equation of \(A_4\), where \(A_4\) is first modulated by percentage tree cover (TC):

\[ \begin{align*} A_4^\prime &= \frac{A_4}{e^ {1 / 1 + \text{TC}}} \\ F_4 &= \frac{1}{1 + e^{k A_4^\prime} - q} \end{align*} \]

The parameters are set in the params instance and are the slope of the equation (\(k\), adv_to_frac_k) and \(A_4\) value at the midpoint of the curve (\(q\), adv_to_frac_q).

Parameters:
  • gpp_adv_c4 – The proportional GPP advantage of C4 photosynthesis.

  • treecover – The proportion tree cover.

  • c3c4_const – Instance of C3C4Const.

Returns:

The estimated fraction of C4 plants given the estimated C4 GPP advantage and tree cover.

The acclimation submodule

The acclimation module provides the AcclimationModel class, which is a required input to the SubdailyPModel class for fitting the P Model at subdaily time scales.

Classes:

AcclimationModel(datetimes[, ...])

Define the acclimation model to be used for the subdaily P Model.

class AcclimationModel(datetimes: ndarray[tuple[Any, ...], dtype[datetime64]] | DataArray, allow_partial_data: bool = False, alpha: float = 1 / 15, allow_holdover: bool = False, update_point: str = 'max', fill_method: str = 'previous')

Define the acclimation model to be used for the subdaily P Model.

This class provides methods that allow data to be converted between photsynthetically ‘fast’ and ‘slow’ timescales. Many plant responses to changing environments are ‘fast’ - on the scale of minutes to seconds - but other responses are slow - over the scale of days or weeks, capturing the timescales over which plants will acclimate to changing conditions.

An instance of this class is created using an array of numpy.datetime64 values that provide the observation datetimes for a dataset to be used in a SubdailyPModel. These datetimes need to be:

  • sampled at a subdaily frequency,

  • be strictly increasing,

  • be evenly spaced, using a spacing that evenly divides a day.

The model can handle incomplete days at the start and end of the time series and will internally pad the datetimes to complete days in order to ensure correct sampling. The values in datetimes are assumed to be the precise times of the observations. If the datetimes represent the start or end of a sampling time span, then they should first be converted to a reasonable choice of observation time, such as the midpoint of the timespan.

An acclimation window must then be set, defining a period of the day representing the environmental conditions that plants will acclimate to. This will typically be the time of day with highest productivity - usually around noon - when the light use efficiency of the plant can best make use of high levels of sunlight. This window is set using one of the following methods:

  • The set_window() method sets a window centred on a given time during the day with a fixed width.

  • The set_nearest() method sets the acclimation window as the single observation closest to a given time of day.

  • The set_include() method allows the user to set an arbitrary selection of observations during the day as the acclimation window.

Once a set_ method has been applied then the other methods of the class can be used to:

  • Extract conditions within the acclimation window from time series for subdaily data as either mean daily values (get_daily_means()) or as individual observations ( get_window_values())

  • Apply acclimation lags (apply_acclimation()) to generate daily realised values of acclimating variables from the daily optimal values.

  • Fill daily realised values for an acclimating variable back on to the subdaily scale (fill_daily_to_subdaily()), giving the actual acclimated responses used to calculate GPP at the subdaily scale.

Important

Many of the arguments to the AcclimationModel instance are used to control the behaviour of the methods described above. They are set as attributes of the AcclimationModel rather than as method arguments to ensure that the same settings are shared for all variables to which the given Acclimation model is applied.

The argument description below describes the role of each setting but more details are also provided in the linked method descriptions.

Parameters:
  • datetimes – A sequence of datetimes for observations at a subdaily scale.

  • allow_partial_data – Allows the get_daily_means() method to switch between using numpy.mean() and numpy.nanmean(), so that daily mean values can be calculated even if the data in the acclimation window is incomplete.

  • alpha – A float value that controls the speed of acclimation in the apply_acclimation() method. The value must be in the range [0, 1], with smaller values giving slower acclimation and larger values giving quicker acclimation.

  • allow_holdover – Allows the apply_acclimation() method to adapt to missing values in the acclimation time series.

  • update_point – Used in the fill_daily_to_subdaily() method to set when plant behaviour updates to the conditions within the acclimation window. One of max (default) or mean.

  • fill_method – Used in the fill_daily_to_subdaily() method to set the interpolation method used to fill subdaily observations. One of previous (default) or linear.

Methods:

apply_acclimation(values[, initial_values])

Apply acclimation to optimal values.

fill_daily_to_subdaily(values[, previous_values])

Resample daily variables onto the subdaily time scale.

get_daily_means(values)

Get the daily means of a variable during the acclimation window.

get_window_values(values)

Extract acclimation window values for a variable.

set_include(include)

Set the acclimation conditions using a logical array.

set_nearest(time)

Set the acclimation conditions to a single value closest to a target time.

set_window(window_center, half_width)

Set the acclimation conditions to a daily time window.

Attributes:

allow_holdover

Sets whether apply_acclimation() will attempt to handle missing data.

allow_partial_data

Sets whether get_daily_means() will ignore missing data.

alpha

Sets the speed of acclimation in apply_acclimation().

datetimes

The datetimes used to create the instance.

fill_method

The interpolation method to be used in fill_daily_to_subdaily()

include

Logical index of which daily observations are included in daily samples.

n_days

The number of days covered by the observations

n_obs

The number of daily observations

observation_dates

The dates covered by the observations

observation_times

The times of observations through the day as timedelta64 values in seconds

padded_datetimes

The datetime sequence padded to complete days.

padding

The number of missing observations on the first and last days.

sample_datetimes

Datetimes included in daily samples.

sample_datetimes_max

The maximum datetime of for each daily sample.

sample_datetimes_mean

The mean datetime of for each daily sample.

spacing

The time interval between observations

update_point

The update point to be used fill_daily_to_subdaily().

apply_acclimation(values: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, initial_values: ndarray[tuple[Any, ...], dtype[floating]] | DataArray | None = None) ndarray[tuple[Any, ...], dtype[floating]]

Apply acclimation to optimal values.

Three key photosynthetic parameters (\(\xi\), \(V_{cmax25}\) and \(J_{max25}\)) show slow responses to changing environmental conditions and do not instantaneously adopt optimal values. This function applies exponential weighted averaging to the input values in order to calculate a lagged response.

Two attributes of the AcclimationModel class are used to tune the behaviour of this method:

  • The alpha attribute controls the speed of acclimation. This value must be between 0 and 1 and is used as the weight term in an exponential moving average of daily values. Values closer to 1 lead to faster acclimation, with 1 giving instantaneous acclimation and 0 giving no acclimation.

  • The allow_holdover attribute is used to allow the exponential weighted average function to handle missing data. Incomplete forcing data is common and both \(V_{cmax}\) and \(J_{max}\) are not estimable in some conditions (namely when \(m \le c^{\ast}\), see OptimalChiPrentice14) and so missing values in P Model predictions can arise even when the forcing data is complete. Since the weighted average process iterates over daily observations, it cannot normally be calculated with missing data but, with allow_holdover=True, the underlying exponential_moving_average() attempts to fill gaps within the daily time series.

Parameters:
  • values – An array of daily optimal values

  • initial_values – Alternative starting values for the acclimated values

fill_daily_to_subdaily(values: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, previous_values: ndarray[tuple[Any, ...], dtype[floating]] | DataArray | None = None) ndarray[tuple[Any, ...], dtype[floating]]

Resample daily variables onto the subdaily time scale.

This method takes an array representing daily values and interpolates those values back onto the subdaily timescale used to create the AcclimationModel instance. The first axis of the values must be the same length as the number of days in the time series used to create the instance.

Two attributes of the AcclimationModel class are used to tune the behaviour of this method:

  • The update_point attribute sets the point on the subdaily scale at which the plant updates acclimating variables to the new daily realised value. The default is max - the plant starts to acclimate to a new value at the end of the acclimation window - but this can also be set to mean to start acclimation from the middle of the acclimation window. Note that this setting implies the plant can predict the daily values between the mean and max observation time.

  • The fill_method attribute controls the interpolation used when filling data from daily to subdaily scales. Two interpolation kinds are currently implemented:

    1. The default option of previous interpolates the daily value as a constant, until updating to the next daily value. This option will fill values until the end of the time series.

    2. The alternative linear interpolates linearly between the update points of the daily values. The interpolated values are held constant for the first day and then interpolated linearly: this is to avoid plants adapting optimally to future conditions. Values will also not be filled beyond the end of the last window as the subsequent daily acclimated value is unknown.

Subdaily observations before the update point on the first day of the time series are filled with np.nan. The previous_values argument can be used to provide estimates of previous values of the variable at the start of the time series. These values can be used to avoid initial np.nan values and allow time series to be processed in blocks. This option is only currently implemented for interpolation using the fill_method='previous' option.

Parameters:
  • values – An array with the first dimension matching the number of days in the AcclimationModel instance.

  • previous_values – An array of previous values from which to fill the variable.

get_daily_means(values: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) ndarray[tuple[Any, ...], dtype[floating]]

Get the daily means of a variable during the acclimation window.

This method extracts values from a given variable during a defined acclimation window set using one of the set_ methods, and then calculates the daily mean of those values. The values can have any number of dimensions, but the first dimension must represent the time axis and have the same length as the original set of observation times.

One attribute of the AcclimationModel class is used to tune the behaviour of this method:

  • The allow_partial_data attribute allows the method to switch between using numpy.mean() and numpy.nanmean(), so that daily mean values can be calculated even if the data in the acclimation window is incomplete. Note that this will still return np.nan if _no_ data is present in the acclimation window.

Parameters:

values – An array of values to reduce to daily averages.

Returns:

An array of mean daily values during the acclimation window

get_window_values(values: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) ndarray[tuple[Any, ...], dtype[floating]]

Extract acclimation window values for a variable.

This method takes an array of values which has the same shape along the first axis as the datetimes used to create the instance and extracts the values from the acclimation window set using one of the set_ methods.

Parameters:

values – An array of values for each observation.

Returns:

An array of the values within the defined acclimation window

set_include(include: ndarray[tuple[Any, ...], dtype[bool]] | DataArray) None

Set the acclimation conditions using a logical array.

This method sets which daily values will be sampled directly, by providing a boolean array for the daily observation times. The include array must be of the same length as the number of daily observations.

Parameters:

include – A boolean array indicating which daily observations to include.

set_nearest(time: timedelta64) None

Set the acclimation conditions to a single value closest to a target time.

This method finds the daily observation time closest to a value provided as a timedelta64 value since midnight. If the provided time is exactly between two observation times, the earlier observation will be used. The resulting single observation will then be used as the daily sample.

Parameters:

time – A timedelta64 value.

set_window(window_center: timedelta64, half_width: timedelta64) None

Set the acclimation conditions to a daily time window.

This method sets the daily values to sample using a time window, given the time of the window centre and its width. Both of these values must be provided as timedelta64 values.

Parameters:
  • window_center – A timedelta since midnight to use as the window center

  • half_width – A timedelta to use as a window width on each side of the center

allow_holdover: bool

Sets whether apply_acclimation() will attempt to handle missing data.

allow_partial_data: bool

Sets whether get_daily_means() will ignore missing data.

alpha: float

Sets the speed of acclimation in apply_acclimation().

datetimes: ndarray[tuple[Any, ...], dtype[datetime64]]

The datetimes used to create the instance.

fill_method: str

The interpolation method to be used in fill_daily_to_subdaily()

include: ndarray[tuple[Any, ...], dtype[bool]]

Logical index of which daily observations are included in daily samples.

n_days: int

The number of days covered by the observations

n_obs: int

The number of daily observations

observation_dates: ndarray[tuple[Any, ...], dtype[datetime64]]

The dates covered by the observations

observation_times: ndarray[tuple[Any, ...], dtype[timedelta64]]

The times of observations through the day as timedelta64 values in seconds

padded_datetimes: ndarray[tuple[Any, ...], dtype[datetime64]]

The datetime sequence padded to complete days.

padding: tuple[int, int]

The number of missing observations on the first and last days.

Provides the number of observations to add to the start and end of the provided datetime sequence to give complete days.

sample_datetimes: ndarray[tuple[Any, ...], dtype[datetime64]]

Datetimes included in daily samples.

This array is two-dimensional: the first axis is of length n_days and the second axis is of length n_samples.

sample_datetimes_max: ndarray[tuple[Any, ...], dtype[datetime64]]

The maximum datetime of for each daily sample.

sample_datetimes_mean: ndarray[tuple[Any, ...], dtype[datetime64]]

The mean datetime of for each daily sample.

spacing: timedelta64

The time interval between observations

update_point: str

The update point to be used fill_daily_to_subdaily().

The two_leaf submodule

This module implements a version of the two leaf, two stream model of assimilation (De Pury and Farquhar, 1997). The implementation is intended to align closely with the similar implementation in the BESS model.

The module provides two core classes:

  • The TwoLeafIrradiance class can be used to estimate the irradiance absorbed by sunlit and shaded leaves, given the solar elevation angle, the atmospheric pressure, the leaf area index and the photosynthetic photon flux density.

  • The TwoLeafAssimilation then takes an instance of the irradiance class and a fitted PModel or SubdailyPModel. The carboxylation rate and optimal chi calculations from the P Model are then used to calculate the total assimilation by sunlit and shaded leaves.

The irradiance calculations are independent of the subsequent calculation of assimilation, so these classes are separated to allow the same irradiance estimates to be reused with different assimilation models.

Classes:

TwoLeafAssimilation(pmodel, irradiance)

Estimate gross primary production using the two-leaf, two-stream model.

TwoLeafIrradiance(solar_elevation, ppfd, ...)

Calculate the irradiance absorbed by sunlit and shaded leaves.

Functions:

calculate_beam_extinction_coef(solar_elevation)

Calculate the beam extinction coefficient.

calculate_beam_reflectance(beam_extinction)

Calculate the beam irradiance for leaves with a uniform angle distribution.

calculate_canopy_extinction_coef(vcmax[, coef])

Calculate the canopy extinction coefficient.

calculate_canopy_irradiance(...[, ...])

Calculate the canopy irradiance.

calculate_canopy_vcmax25(leaf_area_index, ...)

Calculate standardised carboxylation rate in the canopy.

calculate_electron_transport_rate(jmax, ...)

Calculate electron transport rate.

calculate_fraction_of_diffuse_radiation(...)

Calculate the fraction of diffuse radiation.

calculate_jmax25(vcmax25[, coef])

Calculate the maximum rate of electron transport.

calculate_sun_vcmax25(leaf_area_index, ...)

Calculate standardised carboxylation rate of sunlit leaves.

calculate_sunlit_beam_irradiance(...[, ...])

Calculate the sunlit beam irradiance.

calculate_sunlit_diffuse_irradiance(...[, ...])

Calculate the sunlit diffuse irradiance.

calculate_sunlit_scattered_irradiance(...[, ...])

Calculate the sunlit scattered irradiance.

class TwoLeafAssimilation(pmodel: PModel | SubdailyPModel, irradiance: TwoLeafIrradiance)

Estimate gross primary production using the two-leaf, two-stream model.

Experimental

Be aware that TwoLeafAssimilation is an experimental feature and the API and any calculated values may change between major releases.

The two leaf, two stream model of De Pury and Farquhar (1997) estimates irradiance within the canopy from diffuse, scattered and direct beam light radiation and then separately estimates the assimilation by sunlit and shaded leaves.

The class requires an estimate of the irradiances absorbed by the sunlit and shaded leaves, calculated using the TwoLeafIrradiance class. It also requires a PModel or SubdailyPModel instance, which is used to provide estimates of four parameters:

  • the maximum carboxylation rate (\(V_{cmax}\)),

  • the maximum carboxylation rate at standard temperature (\(V_{cmax25}\)),

  • the \(\ce{CO2}\) limitation factor for RuBisCO-limited assimilation (\(m_c\)), and

  • the \(\ce{CO2}\) limitation factor for light-limited assimilation (\(m_j\)).

The model then calculate assimilation as follows:

  • An extinction coefficient (\(k_v\)) is calculated to account for changes in \(V_{cmax}\) with depth in the canopy, following an empirical function in Lloyd et al. (2010) (see calculate_canopy_extinction_coef()) and using leaf area index (\(L\)) as a proxy for canopy depth.

  • The value for \(V_{cmax25}\) from the P Model is adjusted to give a representative through the canopy (\(V_{cmax25\_C}\)) using \(L\) and \(k_v\) (see calculate_canopy_vcmax25()). This carboxylation capacity is then partitioned between sunlit and shaded leaves: \(V_{cmax25\_Sn}\) is estimated using calculate_sun_vcmax25() and then \(V_{cmax25\_Sd} = V_{cmax25\_C} - V_{cmax25\_Sn}\).

  • Values for \(J_{max25}\) are then calculated using an empirical function of \(V_{cmax25\)}` for both sunlit (\(J_{max25\_Sn}\)) and shaded (\(J_{max25\_Sd}\)) leaves (see calculate_jmax25()).

  • The Arrhenius scaling method used with the P Model is then used to adjust these estimates to the observed temperatures, giving \(V_{cmax\_Sn}, V_{cmax\_Sd}, J_{max\_Sn}, J_{max\_Sd}\).

  • The maximum assimilation rate via the carboxylation pathway is then found as \(A_v = V_{cmax} m_c\) for each leaf type, giving \(A_{v\_Sn}\) and \(A_{v\_Sd}\).

  • The realised electron transport rate \(J\) is calculated using an epmirical function (see calculate_electron_transport_rate()) and then used to calculate the maximum assimilation rate via the electron transfer pathway as \(A_j = m_j J / 4\), giving \(A_{j\_Sn}\) and \(A_{j\_Sd}\).

  • The realised assimilation is the minimum of \(A_{c}\) and \(A_{j}\) for each leaf type, giving:

    • \(A_{Sn} = \min \left( A_{v\_Sn}, A_{j\_Sn} \right)\),

    • \(A_{Sd} = \min \left( A_{v\_Sd}, A_{j\_Sd} \right)\).

  • The gross primary productivity (gC m-2 s-1) is then calculated as \((A_{Sn} + A_{Sd}) * M_C\), where \(M_C\) is the molar mass of carbon.

Parameters:
  • pmodel – A PModel or SubdailyPModel.

  • irrad – An instance of TwoLeafIrradiance.

Attributes:

A_shade

The realised assimilation rate for shaded leaves (\(A_{Sd}\)).

A_sun

The realised assimilation rate for sunlit leaves (\(A_{Sn}\)).

Aj_shade

The potential rate of assimilation associated with electron transfer in shaded leaves (\(A_{j\_Sn}\)).

Aj_sun

The potential rate of assimilation associated with electron transfer in sunlit leaves (\(A_{j\_Sn}\)).

Av_shade

The potential rate of assimilation associated with carboxylation in shaded leaves (\(A_{v\_Sd}\)).

Av_sun

The potential rate of assimilation associated with carboxylation in sunlit leaves (\(A_{v\_Sn}\)).

J_shade

The realised rate of electron transfer within sunlit leaves (\(J_{Sd}\)

J_sun

The realised rate of electron transfer within sunlit leaves (\(J_{Sn}\)

Jmax25_shade

The maximum rate of electron transfer at standard temperature within shaded leaves (\(J_{max25\_Sd}\))

Jmax25_sun

The maximum rate of electron transfer at standard temperature within sunlit leaves (\(J_{max25\_Sn}\))

Jmax_shade

The maximum rate of electron transfer at the observed temperature within shaded leaves (\(J_{max25\_Sn}\))

Jmax_sun

The maximum rate of electron transfer at the observed temperature within sunlit leaves (\(J_{max\_Sn}\))

Vcmax25_canopy

The total canopy carboxylation capacity at standard temperature \(V_{cmax25\_C}\)

Vcmax25_shade

The maximum rate of carboxylation at standard temperature within shaded leaves (\(V_{cmax25\_Sd}\))

Vcmax25_sun

The maximum rate of carboxylation at standard temperature within sunlit leaves (\(V_{cmax25\_Sn}\))

Vcmax_shade

The maximum rate of carboxylation at the observed temperature within shaded leaves (\(V_{cmax\_Sd}\))

Vcmax_sun

The maximum rate of carboxylation at the observed temperature within sunlit leaves (\(V_{cmax\_Sn}\))

canopy_extinction_coef

An extinction coefficient capturing the vertical structure of carboxylation capacity within the canopy (\(k_v\)).

gpp

The gross primary productivity across the sunlit and shaded leaves.

irradiance

A TwoLeafIrradiance instance

pmodel

A PModel or SubdailyPModel instance.

A_shade: ndarray[tuple[Any, ...], dtype[floating]]

The realised assimilation rate for shaded leaves (\(A_{Sd}\)).

A_sun: ndarray[tuple[Any, ...], dtype[floating]]

The realised assimilation rate for sunlit leaves (\(A_{Sn}\)).

Aj_shade: ndarray[tuple[Any, ...], dtype[floating]]

The potential rate of assimilation associated with electron transfer in shaded leaves (\(A_{j\_Sn}\)).

Aj_sun: ndarray[tuple[Any, ...], dtype[floating]]

The potential rate of assimilation associated with electron transfer in sunlit leaves (\(A_{j\_Sn}\)).

Av_shade: ndarray[tuple[Any, ...], dtype[floating]]

The potential rate of assimilation associated with carboxylation in shaded leaves (\(A_{v\_Sd}\)).

Av_sun: ndarray[tuple[Any, ...], dtype[floating]]

The potential rate of assimilation associated with carboxylation in sunlit leaves (\(A_{v\_Sn}\)).

J_shade: ndarray[tuple[Any, ...], dtype[floating]]

The realised rate of electron transfer within sunlit leaves (\(J_{Sd}\)

J_sun: ndarray[tuple[Any, ...], dtype[floating]]

The realised rate of electron transfer within sunlit leaves (\(J_{Sn}\)

Jmax25_shade: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of electron transfer at standard temperature within shaded leaves (\(J_{max25\_Sd}\))

Jmax25_sun: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of electron transfer at standard temperature within sunlit leaves (\(J_{max25\_Sn}\))

Jmax_shade: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of electron transfer at the observed temperature within shaded leaves (\(J_{max25\_Sn}\))

Jmax_sun: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of electron transfer at the observed temperature within sunlit leaves (\(J_{max\_Sn}\))

Vcmax25_canopy: ndarray[tuple[Any, ...], dtype[floating]]

The total canopy carboxylation capacity at standard temperature \(V_{cmax25\_C}\)

Vcmax25_shade: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of carboxylation at standard temperature within shaded leaves (\(V_{cmax25\_Sd}\))

Vcmax25_sun: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of carboxylation at standard temperature within sunlit leaves (\(V_{cmax25\_Sn}\))

Vcmax_shade: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of carboxylation at the observed temperature within shaded leaves (\(V_{cmax\_Sd}\))

Vcmax_sun: ndarray[tuple[Any, ...], dtype[floating]]

The maximum rate of carboxylation at the observed temperature within sunlit leaves (\(V_{cmax\_Sn}\))

canopy_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]]

An extinction coefficient capturing the vertical structure of carboxylation capacity within the canopy (\(k_v\)).

gpp: ndarray[tuple[Any, ...], dtype[floating]]

The gross primary productivity across the sunlit and shaded leaves.

irradiance

A TwoLeafIrradiance instance

pmodel

A PModel or SubdailyPModel instance.

class TwoLeafIrradiance(solar_elevation: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, ppfd: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, core_constants: CoreConst = CoreConst(), two_leaf_constants: TwoLeafConst = TwoLeafConst(), bounds_checker: BoundsChecker = BoundsChecker())

Calculate the irradiance absorbed by sunlit and shaded leaves.

Experimental

Be aware that TwoLeafIrradiance is an experimental feature and the API and any calculated values may change between major releases.

The two leaf, two stream model of De Pury and Farquhar (1997) partitions the irradiance absorbed by the canopy into the irradiance absorbed by sunlit (\(I_{csun}\)) and shaded (\(I_{cshade}\)) leaves.

These irradiances are calculated using the canopy leaf area index (\(L\)) and then the solar elevation (\(\beta\)), photosynthetic photon flux density (PPFD) and atmospheric pressure (\(P\)) as follows:

  • The fraction of diffuse light (\(f_d\)) is calculated (see calculate_fraction_of_diffuse_radiation()) and used to partition the incoming PPFD into the beam (\(I_b = \textrm{PPFD}(1-f_d)\)) and diffuse (\(I_d=PPFD f_d\)) irradiances reaching the canopy.

  • Extinction coefficients are calculated for both beam (\(k_b\)) and scattered light (\(k_b'\)) reaching the canopy, given the solar elevation \(\beta\) (see calculate_beam_extinction_coef()).

  • Canopy reflectance coefficients are calculated for both beam and diffuse light. The beam reflectance (\(\rho_{cb}\)) varies with solar elevation through the beam extinction coefficient (\(k_b\)) but diffuse reflectance (\(\rho_{cd}\)) is a constant property of the canopy (diffuse_reflectance).

  • The irradiances for sunlit leaves are then calculated, including components from direct beam (\(I_{sb}\), see calculate_sunlit_beam_irradiance()), scattered (\(I_{ss}\), see calculate_sunlit_scattered_irradiance()) and diffuse (\(I_{sd}\), see calculate_sunlit_diffuse_irradiance()) light. The total radiation absorbed by the sunlit leaves (\(I_csun\)) is the sum of these three components.

  • The irradiance for shaded leaves (\(I_cshade\)) is then calculated as the difference between the total canopy irradiance (\(I_c\)) and the sunlit absorbed irradiance (\(I_csun\)).

Parameters:
  • solar_elevation – Array of solar elevation angles (radians).

  • ppfd – Array of photosynthetic photon flux density values (µmol m-2 s-1).

  • leaf_area_index – Array of leaf area index values.

  • patm – Array of atmospheric pressure values (pascals).

  • core_constants – An instance of the core constants class.

  • two_leaf_constants – An instance of the two leaf constants class.

  • bounds_checker – A bounds checker instance used to validate the input data.

Attributes:

beam_extinction_coef

The beam extinction coefficient (\(k_{b}\))

beam_irradiance

The beam irradiance (\(I_b\)) reaching the canopy.

beam_reflectance

The canopy beam reflectance for leaves with uniform angle distribution (\(\rho_{cb}\))

canopy_irradiance

The total canopy irradiance (\(I_c\)).

core_constants

An instance of the core constants class.

diffuse_irradiance

The diffuse irradiance (\(I_d\)) reaching the canopy.

fraction_of_diffuse_radiation

The fraction of diffuse radiation (\(f_d\))

leaf_area_index

The leaf area index inputs (\(L\), unitless)

patm

The atmospheric pressure (\(P\), pascals)

ppfd

The photosynthetic photon flux density inputs (PPFD, µmol m-2 s-1)

scattered_beam_extinction_coef

The scattered beam extinction coefficient (\(k_{b}'\))

shaded_absorbed_irradiance

The shaded leaf absorbed irradiance (\(I_{cshade}\)).

solar_elevation

The solar elevation inputs (\(\beta\), radians)

sunlit_absorbed_irradiance

The sunlit leaf absorbed irradiance (\(I_{csun}\)).

sunlit_beam_irradiance

The sunlit beam irradiance (\(I_{sb}\)).

sunlit_diffuse_irradiance

The sunlit diffuse irradiance (\(I_{sd}\)).

sunlit_scattered_irradiance

The sunlit scattered irradiance (\(I_{ss}\)).

two_leaf_constants

An instance of the two leaf constants class.

beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]]

The beam extinction coefficient (\(k_{b}\))

beam_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The beam irradiance (\(I_b\)) reaching the canopy.

beam_reflectance: ndarray[tuple[Any, ...], dtype[floating]]

The canopy beam reflectance for leaves with uniform angle distribution (\(\rho_{cb}\))

canopy_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The total canopy irradiance (\(I_c\)).

core_constants: CoreConst

An instance of the core constants class.

diffuse_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The diffuse irradiance (\(I_d\)) reaching the canopy.

fraction_of_diffuse_radiation: ndarray[tuple[Any, ...], dtype[floating]]

The fraction of diffuse radiation (\(f_d\))

leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]]

The leaf area index inputs (\(L\), unitless)

patm: ndarray[tuple[Any, ...], dtype[floating]]

The atmospheric pressure (\(P\), pascals)

ppfd: ndarray[tuple[Any, ...], dtype[floating]]

The photosynthetic photon flux density inputs (PPFD, µmol m-2 s-1)

scattered_beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]]

The scattered beam extinction coefficient (\(k_{b}'\))

shaded_absorbed_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The shaded leaf absorbed irradiance (\(I_{cshade}\)).

solar_elevation: ndarray[tuple[Any, ...], dtype[floating]]

The solar elevation inputs (\(\beta\), radians)

sunlit_absorbed_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The sunlit leaf absorbed irradiance (\(I_{csun}\)).

sunlit_beam_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The sunlit beam irradiance (\(I_{sb}\)).

sunlit_diffuse_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The sunlit diffuse irradiance (\(I_{sd}\)).

sunlit_scattered_irradiance: ndarray[tuple[Any, ...], dtype[floating]]

The sunlit scattered irradiance (\(I_{ss}\)).

two_leaf_constants: TwoLeafConst

An instance of the two leaf constants class.

calculate_beam_extinction_coef(solar_elevation: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, solar_obscurity_angle: float = TwoLeafConst().solar_obscurity_angle, extinction_numerator: float = TwoLeafConst().direct_beam_extinction_numerator) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the beam extinction coefficient.

The beam extinction coefficient (\(k_b\)) captures changes in the the attenuation of direct sunlight through the canopy with variation in the solar elevation angle.

\[k_b = \frac{n}{\sin\left(\max\left(\beta, \beta_{ob} \right)\right)}\]
Parameters:
  • solar_elevation – Array of solar elevation angles (\(\beta\))

  • solar_obscurity_angle – Threshold angle at which the beam extinction coefficient reaches a maximum (\(\beta_{ob}\)).

  • extinction_numerator – The numerator used in the calculation (\(n\)).

Returns:

An array of beam extinction coefficients.

calculate_beam_reflectance(beam_extinction: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, horizontal_leaf_reflectance: float = TwoLeafConst().horizontal_leaf_reflectance) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the beam irradiance for leaves with a uniform angle distribution.

The beam irradiance with a uniform leaf angle distribution (\(\rho_{cb}\)) captures different leaf orientations within the canopy, following equation A19 of De Pury and Farquhar (1997)

\[\rho_{cb} = 1 - \exp \left(-\frac{2 \rho_h \, k_b}{1 + k_b}\right)\]
Parameters:
  • beam_extinction – Array of beam extinction coefficients (\(k_b\)).

  • horizontal_leaf_reflectance – The reflectance coefficient horizontal leaves (\(\rho_h\)).

Returns:

Array of beam irradiances.

calculate_canopy_extinction_coef(vcmax: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, coef: tuple[float, float] = TwoLeafConst().vcmax_lloyd_coef) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the canopy extinction coefficient.

The extinction coefficient (\(k_v\)) captures the decrease in photosynthetic capacity (\(V_{cmax}\)) with depth in the plant canopy.

The exponential model used here is taken from Figure 10 of (Lloyd et al., 2010), which presents an empirical model of the vertical profile in photosynthetic capacity, using data from the Amazon forest.

\[kv_{Lloyd} = \exp(0.00963 \cdot vcmax_{pmod} - 2.43)\]
Parameters:
  • vcmax – The vcmax attribute from a P Model (\(V_{cmax}\)).

  • coef – The coefficients of the exponential momdel.

Returns:

The calculated \(kv_Lloyd\) values.

calculate_canopy_irradiance(beam_reflectance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, beam_irradiance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, scattered_beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, diffuse_radiation: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, diffuse_reflectance: float = TwoLeafConst().diffuse_reflectance, diffuse_extinction_coef: float = TwoLeafConst().diffuse_extinction_coef) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the canopy irradiance.

The canopy irradiance (\(I_c\)) is the total irradiance within the canopy, including both direct and diffuse radiation components.

\[I_c = (1 - \rho_{cb}) I_b (1 - \exp(-k_b' L)) + (1 - \rho_{cd}) I_d (1 - \exp(-k_d' L))\]
Parameters:
  • beam_reflectance – The beam reflectance of leaves with uniform angle distribution (\(\rho_{cb}\)).

  • beam_irradiance – Beam irradiance values (\(I_b\)).

  • scattered_beam_extinction_coef – Scattered beam extinction coefficients (\(k_b'\)).

  • diffuse_radiation – Diffuse radiation values (\(I_d\)).

  • leaf_area_index – The leaf area index (\(L\)).

  • diffuse_reflectance – The canopy reflectance of diffuse radiation (\(\rho_{cd}\)).

  • diffuse_extinction_coef – The diffuse light extinction coefficients (\(k_d'\)).

Returns:

Canopy irradiance values.

calculate_canopy_vcmax25(leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, vcmax25: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, canopy_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) ndarray[tuple[Any, ...], dtype[floating]]

Calculate standardised carboxylation rate in the canopy.

This function calculates the maximum carboxylation rate of the canopy at a reference temperature of 25°C (\(V_{cmax25\_C}\)), given the depth of the canopy as estimated using leaf area index and the rate of decrease in carboxylation rate through the canopy, as calculated using calculate_canopy_extinction_coef().

\[V_{cmax25\_C} = L \, V_{cmax25} \left(\frac{1 - \exp(-k_v)}{k_v}\right)\]
Parameters:
  • leaf_area_index – The leaf area index (\(L\)).

  • vcmax25 – The vcmax25 parameter from a P Model (\(V_{cmax25}\)).

  • canopy_extinction_coef – The canopy extinction coefficient (\(k_v\)).

Returns:

The calculated Vmax25 canopy values.

calculate_electron_transport_rate(jmax: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, absorbed_irradiance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) ndarray[tuple[Any, ...], dtype[floating]]

Calculate electron transport rate.

This function calculates the realised electron transport rate (\(J\)), given absorbed irradiance and the maximum electron transport rate \(J_{max}\).

\[J = J_{max} I_c \frac{(1 - 0.15)}{(I_c + 2.2 J_{max})}\]
Parameters:
  • jmax – The maximum rate of electron transport (\(J_{max}\)).

  • absorbed_irradiance – The abbsorbed irradiance (\(I_c\))

Returns:

The calculated J values.

calculate_fraction_of_diffuse_radiation(patm: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, solar_elevation: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, standard_pressure: float = CoreConst().k_Po, atmospheric_scattering: float = TwoLeafConst().atmospheric_scattering_coef, atmos_transmission_par: float = TwoLeafConst().atmos_transmission_par) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the fraction of diffuse radiation.

The fraction of diffuse radiation (\(f_d\)) captures the proportion of sunlight that is scattered before reaching the canopy, following equation A23 and A25 of De Pury and Farquhar (1997).

\[ \begin{align*} m &= \left(P / P_0 \right) / \sin \beta \\ f_d &= \frac{1 - a^m}{1 + a^m \left(1 / f_a - 1\right)} \end{align*} \]
Parameters:
  • patm – Atmospheric pressure values (\(P\), pascals).

  • solar_elevation – Solar elevation angles (:math:beta`, radians).

  • standard_pressure – Standard atmospheric pressure (\(P_0\), pascals).

  • atmospheric_scattering – Atmospheric scattering factor (\(f_a\)).

  • atmos_transmission_par – The atmospheric transmission coefficient of photosynthetically active radiation (\(a\)).

Returns:

Array of fractions of diffuse radiation.

calculate_jmax25(vcmax25: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, coef: tuple[float, float] = TwoLeafConst().jmax25_wullschleger_coef) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the maximum rate of electron transport.

This function calculates the maximum rate of electron transport (\(J_{max25}\)) at 25°C as an linear function of the carboxylation rate (\(V_{cmax25}\)), following the fitted model in Figure 2 of (Wullschleger, 1993). The default values for the coefficients (\(a=29,b=1.64\)) come from the same source.

\[J_{max25} = a + b V_{cmax25}\]
Parameters:
  • vcmax25 – An estimate of \(V_{cmax25}\).

  • coef – The coefficients of the empirical relationship between \(V_{cmax25}\) and \(J_{max25}\).

Returns:

The calculated values of \(J_{max25}\).

calculate_sun_vcmax25(leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, vcmax25: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, canopy_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray) ndarray[tuple[Any, ...], dtype[floating]]

Calculate standardised carboxylation rate of sunlit leaves.

Calculates the maximum carboxylation rate for sunlit leaves at the standard temperature of 25°C (\(V_{cmax25\_Sn}\)) as:

\[V_{cmax25\_Sn} = L \, V_{cmax25} \left( \frac{1 - \exp{-k_v - k_b} L )} {k_v + k_b L} \right)\]
Parameters:
  • leaf_area_index – The leaf area index (LAI, \(L\)).

  • vcmax25 – The vcmax25 parameter from a P Model (\(V_{cmax25}\)).

  • canopy_extinction_coef – The canopy extinction coefficient (\(k_v\)).

  • beam_extinction_coef – The beam extinction coefficient from the irradiance model (\(k_b\)).

Returns:

The calculated Vmax25 sun values.

calculate_sunlit_beam_irradiance(beam_irradiance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_scattering_coef: float = TwoLeafConst().leaf_scattering_coef) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the sunlit beam irradiance.

The sunlit beam irradiance (\(I_{sun_beam}\)) is the direct sunlight received by the sunlit portion of the canopy.

\[I_{sun\_beam} = I_b (1 - \sigma) (1 - \exp{-k_b L})\]
Parameters:
  • beam_irradiance – The irradiance by direct beam light (\(I_b\))

  • beam_extinction_coef – Beam extinction coefficients (\(k_b\))

  • leaf_area_index – The leaf area index for the canopy (\(L\))

  • leaf_scattering_coef – The scattering coefficient of PAR by leaves (\(\sigma\)).

Returns:

Array of sunlit beam irradiance values.

calculate_sunlit_diffuse_irradiance(diffuse_irradiance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, diffuse_reflectance: float = TwoLeafConst().diffuse_reflectance, diffuse_extinction_coef: float = TwoLeafConst().diffuse_extinction_coef) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the sunlit diffuse irradiance.

The sunlit diffuse irradiance (\(I_{s_d}\)) is the diffuse radiation received by the sunlit portion of the canopy.

\[I_{sd} = I_d (1 - \rho_{cd}) (1 - \exp(-(k_d' + k_b) L \frac{k_d'}{k_d' + k_b}\]
Parameters:
  • diffuse_irradiance – Array of diffuse radiation values (\(I_d\))

  • beam_extinction_coef – Array of beam extinction coefficients (\(k_b\))

  • leaf_area_index – Array of leaf area index values (\(L\))

  • diffuse_reflectance – The canopy reflectance of diffuse radiation (\(\rho_{cd}\)).

  • diffuse_extinction_coef – Constant for calculating the sunlit diffuse irradiance (\(k_d'\))

Returns:

Array of sunlit diffuse irradiance values.

calculate_sunlit_scattered_irradiance(beam_irradiance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, beam_reflectance: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, scattered_beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, beam_extinction_coef: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_area_index: ndarray[tuple[Any, ...], dtype[floating]] | DataArray, leaf_scattering_coef: float = TwoLeafConst().leaf_scattering_coef) ndarray[tuple[Any, ...], dtype[floating]]

Calculate the sunlit scattered irradiance.

The sunlit scattered irradiance (\(I_{ss}\)) is the scattered radiation received by the sunlit portion of the canopy.

\[I_{ss} = I_b ((1 - \rho_{cb}) (1 - \exp(-(k_b' + k_b) L)) \frac{k_b'}{k_b' + k_b} - (1 - \sigma) (1 - \exp(-2 k_b L)) / 2)\]
Parameters:
  • beam_irradiance – Array of beam irradiance values (\(I_b\))

  • beam_reflectance – The beam reflectance of leaves with uniform angle distribution (\(\rho_{cb}\)).

  • scattered_beam_extinction_coef – Array of scattered beam extinction coefficients (\(k_b'\))

  • beam_extinction_coef – Array of beam extinction coefficients (\(k_b\))

  • leaf_area_index – Array of leaf area index values (\(L\))

  • leaf_scattering_coef – The scattering coefficient of PAR by leaves (\(\sigma\)).

Returns:

Array of sunlit scattered irradiance values.

The pmodel submodule

The module pmodel provides the implementation of the following classes:

  • PModelABC: An abstract base class providing some of the core functionality for initialising PModel subclasses.

  • PModel: A subclass providing the standard implementation of the P Model.

  • SubdailyPModel: A subclass providing the subdaily implementation of the P Model, which accounts for slow acclimation of core photosynthetic processes.

Classes:

PModel(env[, method_optchi, method_jmaxlim, ...])

Fit a standard P Model.

PModelABC(env[, method_kphio, ...])

Abstract base class for the PModel and SubdailyPModel.

SubdailyPModel(env, acclim_model[, ...])

Fit a P Model incorporating acclimation in photosynthetic responses.

class PModel(env: PModelEnvironment, method_optchi: str = 'prentice14', method_jmaxlim: str = 'wang17', method_kphio: str = 'temperature', method_arrhenius: str = 'simple', reference_kphio: float | ArrayType[np.floating] | None = None)

Fit a standard P Model.

This class fits the P Model to a given set of environmental and photosynthetic parameters. An extended description with typical use cases is given in The Standard P Model but the basic flow of the model is:

  1. Estimate \(\ce{CO2}\) limitation factors and optimal internal to ambient \(\ce{CO2}\) partial pressure ratios (\(\chi\)), using one of the methods based on OptimalChiABC.

  2. Estimate limitation factors to \(V_{cmax}\) and \(J_{max}\) using one of the methods implemented using JmaxLimitationABC.

Soil moisture effects:

The lavergne20_c3, lavergne20_c4, prentice14_rootzonestress, c4_rootzonestress and c4_no_gamma_rootzonestress options to method_optchi implement different approaches to soil moisture effects on photosynthesis. See also the alternative GPP penalty factors that can be applied after fitting the P Model (pyrealm.pmodel.functions.calculate_soilmstress_stocker() and pyrealm.pmodel.functions.calculate_soilmstress_mengoli()).

Parameters:
  • env – An instance of PModelEnvironment

  • method_kphio – The method to use for calculating the quantum yield efficiency of photosynthesis (\(\phi_0\), unitless). The method name must be included in the QUANTUM_YIELD_CLASS_REGISTRY.

  • method_optchi – (Optional, default=`prentice14`) Selects the method to be used for calculating optimal \(chi\). The choice of method also sets the choice of C3 or C4 photosynthetic pathway (see OptimalChiABC).

  • method_jmaxlim – (Optional, default=`wang17`) Method to use for \(J_{max}\) limitation.

  • method_arrhenius – (Optional, default=`simple`) Method to set the form of Arrhenius scaling used for vcmax and jmax.

  • reference_kphio – An optional alternative reference value for the quantum yield efficiency of photosynthesis (\(\phi_0\), -) to be passed to the kphio calculation method.

Methods:

apply_gpp_conversion_factor(...)

Apply the gpp conversion factor to the input daily gpp.

apply_gpp_penalty_factor(penalty_factor)

Apply a post-hoc GPP penalty factor to GPP predictions.

remove_gpp_penalty_factor()

Removes a post-hoc GPP penalty factor.

summarize([dp])

Prints a summary of data attributes.

to_subdaily(acclim_model[, previous_realised])

Convert a standard PModel to a subdaily P Model.

Attributes:

A_c

Maximum assimilation rate limited by carboxylation.

A_j

Maximum assimilation rate limited by electron transport.

J

Electron transfer rate.

c4

Boolean flag showing if the optimal chi method approximates a C3 or C4 pathway.

core_const

The CoreConst instance used to create the model environment.

env

The PModelEnvironment used to fit the P Model.

gpp

Gross primary productivity (µg C m-2 s-1).

gpp_conversion_factor

Penalty to apply to gpp when moving to daily gpp

gpp_penalty_factor

An optional post-hoc GPP penalty factor applied to the model.

gs

Stomatal conductance (µmol m-2 s-1), calculated as:

iwue

Intrinsic water use efficiency (iWUE, µmol mol-1), calculated as:

jmax

Maximum rate of electron transport at the growth temperature (µmol m-2 s-1), calculated as:

jmax25

Maximum rate of electron transport at standard temperature (µmol m-2 s-1), estimated from \(J_{max}\) using the selected method for Arrhenius scaling.

jmaxlim

The Jmax limitation terms calculated for the model.

kphio

The quantum yield (\(\phi_0\)) calculations for the fitted P Model.

lue

Light use efficiency (LUE, g C mol-1), calculated as:

method_arrhenius

The method used to calculate Arrhenius factors.

method_jmaxlim

Records the method used to calculate Jmax limitation.

method_kphio

The method used to calculate kphio.

method_optchi

The method used to calculate optimal chi.

optchi

The optimal chi (\(\chi\)) calculations for the fitted P Model.

pmodel_const

The PModelConst instance used to create the model environment.

reference_kphio

The value of the the reference kphio to be used in the model.

shape

Records the common numpy array shape of array inputs.

vcmax

Maximum rate of carboxylation at the growth temperature (µmol m-2 s-1), calculated as:

vcmax25

Maximum rate of carboxylation at standard temperature (µmol m-2 s-1), estimated from \(V_{cmax}\) using the selected method for Arrhenius scaling.

apply_gpp_conversion_factor(daily_mean_pmodel_gpp: ndarray[tuple[Any, ...], dtype[_ScalarT]]) ndarray[tuple[Any, ...], dtype[_ScalarT]]

Apply the gpp conversion factor to the input daily gpp.

apply_gpp_penalty_factor(penalty_factor: pyrealm.core.xarray.ArrayType) None

Apply a post-hoc GPP penalty factor to GPP predictions.

Some productivity models apply a post-hoc penalty factor to the predicted GPP of the P Model to correct for other influences on productivity. Examples included the soil moisture penalty factors implemented as pyrealm.pmodel.functions.calculate_soilmstress_mengoli() and pyrealm.pmodel.functions.calculate_soilmstress_stocker().

This method allows such a factor (\(f \in [0,1]\)) to be applied to a fitted P Model instance. The gpp attribute of the model will then return the product of the raw GPP predictions and the provided penalty factor.

The main use of this method is to allow penalised GPP to be used with other pyrealm methods that take a P Model as an input.

Parameters:

penalty_factor – An array of GPP penalty value.

remove_gpp_penalty_factor() None

Removes a post-hoc GPP penalty factor.

This method removes a previously applied GPP penalty factor.

summarize(dp: int = 2) None

Prints a summary of data attributes.

Parameters:

dp – The number of decimal places used in rounding summary stats.

to_subdaily(acclim_model: AcclimationModel, previous_realised: tuple[pyrealm.core.xarray.ArrayType, pyrealm.core.xarray.ArrayType, pyrealm.core.xarray.ArrayType] | None = None) SubdailyPModel

Convert a standard PModel to a subdaily P Model.

This method converts a PModel instance to a to a SubdailyPModel instance with the same settings.

Parameters:
  • acclim_model – An AcclimationModel instance for the subdaily model.

  • previous_realised – An optional set of arrays giving previous realised values for xi, vcmax25 and jmax25.

A_c: ndarray[tuple[Any, ...], dtype[floating]]

Maximum assimilation rate limited by carboxylation.

A_j: ndarray[tuple[Any, ...], dtype[floating]]

Maximum assimilation rate limited by electron transport.

J: ndarray[tuple[Any, ...], dtype[floating]]

Electron transfer rate.

c4: bool

Boolean flag showing if the optimal chi method approximates a C3 or C4 pathway.

core_const: CoreConst

The CoreConst instance used to create the model environment.

env: PModelEnvironment

The PModelEnvironment used to fit the P Model.

property gpp: ndarray[tuple[Any, ...], dtype[floating]]

Gross primary productivity (µg C m-2 s-1).

If a post-hoc GPP penalty factor has been applied to the model (see apply_gpp_penalty_factor()) then the value returned is the penalised GPP.

gpp_conversion_factor

Penalty to apply to gpp when moving to daily gpp

gpp_penalty_factor: ndarray[tuple[Any, ...], dtype[floating]] | None

An optional post-hoc GPP penalty factor applied to the model.

gs: ndarray[tuple[Any, ...], dtype[floating]]

Stomatal conductance (µmol m-2 s-1), calculated as:

\[g_s = \frac{A}{c_a - c_i},\]

where \(A\) is assimilation in µmol C m-2 s-1. The standard P Model uses the coordination hypothesis and hence \(A=A_c=A_j\).

When C4 photosynthesis is being used, the true partial pressure of CO2 in the substomatal cavities (\(c_i\)) is used following the calculation of \(\chi\) using beta_cost_ratio_c4. Note that \(g_s \to \infty\) as VPD \(\to 0\) and hence \((c_a - c_i) \to 0\) and the reported values will be set to np.nan under these conditions.

iwue: ndarray[tuple[Any, ...], dtype[floating]]

Intrinsic water use efficiency (iWUE, µmol mol-1), calculated as:

\[( 5/8 * (c_a - c_i)) / P,\]

where \(c_a\) and \(c_i\) are measured in Pa and \(P\) is atmospheric pressure in megapascals.

jmax: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of electron transport at the growth temperature (µmol m-2 s-1), calculated as:

\[J_{max} = 4 \phi_{0} I_{abs} f_{j}\]

where \(f_j\) is a limitation term calculated via the method selected in method_jmaxlim.

jmax25: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of electron transport at standard temperature (µmol m-2 s-1), estimated from \(J_{max}\) using the selected method for Arrhenius scaling.

jmaxlim: JmaxLimitationABC

The Jmax limitation terms calculated for the model.

kphio: QuantumYieldABC

The quantum yield (\(\phi_0\)) calculations for the fitted P Model.

lue: ndarray[tuple[Any, ...], dtype[floating]]

Light use efficiency (LUE, g C mol-1), calculated as:

\[\text{LUE} = \phi_0 \cdot m_j \cdot f_v \cdot M_C\]

where \(f_v\) is a limitation factor defined in JmaxLimitationABC and \(M_C\) is the molar mass of carbon.

method_arrhenius

The method used to calculate Arrhenius factors.

method_jmaxlim

Records the method used to calculate Jmax limitation.

method_kphio: str

The method used to calculate kphio.

method_optchi: str

The method used to calculate optimal chi.

optchi: OptimalChiABC

The optimal chi (\(\chi\)) calculations for the fitted P Model.

pmodel_const: PModelConst

The PModelConst instance used to create the model environment.

reference_kphio

The value of the the reference kphio to be used in the model.

shape: tuple

Records the common numpy array shape of array inputs.

vcmax: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of carboxylation at the growth temperature (µmol m-2 s-1), calculated as:

\[V_{cmax} = \phi_{0} I_{abs} \frac{m}{m_c} f_{v}\]

where \(f_v\) is a limitation term calculated via the method selected in method_jmaxlim.

vcmax25: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of carboxylation at standard temperature (µmol m-2 s-1), estimated from \(V_{cmax}\) using the selected method for Arrhenius scaling.

class PModelABC(env: PModelEnvironment, method_kphio: str = 'temperature', method_optchi: str = 'prentice14', method_jmaxlim: str = 'wang17', method_arrhenius: str = 'simple', reference_kphio: float | ArrayType[np.floating] | None = None, **kwargs: dict[str, Any])

Abstract base class for the PModel and SubdailyPModel.

The base class __init__ implements the core arguments to the PModel subclasses: the forcing data to be used for the model and various methodological options for the calculation of the model parameters.

Subclasses should define an __init__ method that first calls super().__init__(...) to run the shared core functionality and then define any model specific attributes. The abstract base method _fit_model should then be defined and used to execute the model specific logic of the base class.

Parameters:
  • env – A PModelEnvironment instance

  • method_kphio – The method to use for calculating the quantum yield efficiency of photosynthesis (\(\phi_0\), unitless). The method name must be included in the QUANTUM_YIELD_CLASS_REGISTRY.

  • method_optchi – (Optional, default=`prentice14`) Selects the method to be used for calculating optimal \(chi\). The choice of method also sets the choice of C3 or C4 photosynthetic pathway (see OptimalChiABC).

  • method_jmaxlim – (Optional, default=`wang17`) Method to use for \(J_{max}\) limitation.

  • method_arrhenius – (Optional, default=`simple`) Method to set the form of Arrhenius scaling used for vcmax and jmax.

  • reference_kphio – An optional alternative reference value for the quantum yield efficiency of photosynthesis (\(\phi_0\), -) to be passed to the kphio calculation method.

Methods:

apply_gpp_conversion_factor(...)

Apply the gpp conversion factor to the input daily gpp.

apply_gpp_penalty_factor(penalty_factor)

Apply a post-hoc GPP penalty factor to GPP predictions.

remove_gpp_penalty_factor()

Removes a post-hoc GPP penalty factor.

summarize([dp])

Prints a summary of data attributes.

Attributes:

A_c

Maximum assimilation rate limited by carboxylation.

A_j

Maximum assimilation rate limited by electron transport.

J

Electron transfer rate.

c4

Boolean flag showing if the optimal chi method approximates a C3 or C4 pathway.

core_const

The CoreConst instance used to create the model environment.

env

The PModelEnvironment used to fit the P Model.

gpp

Gross primary productivity (µg C m-2 s-1).

gpp_conversion_factor

Penalty to apply to gpp when moving to daily gpp

gpp_penalty_factor

An optional post-hoc GPP penalty factor applied to the model.

gs

Stomatal conductance (µmol m-2 s-1), calculated as:

iwue

Intrinsic water use efficiency (iWUE, µmol mol-1), calculated as:

jmax

Maximum rate of electron transport at the growth temperature (µmol m-2 s-1), calculated as:

jmax25

Maximum rate of electron transport at standard temperature (µmol m-2 s-1), estimated from \(J_{max}\) using the selected method for Arrhenius scaling.

jmaxlim

The Jmax limitation terms calculated for the model.

kphio

The quantum yield (\(\phi_0\)) calculations for the fitted P Model.

lue

Light use efficiency (LUE, g C mol-1), calculated as:

method_arrhenius

The method used to calculate Arrhenius factors.

method_jmaxlim

Records the method used to calculate Jmax limitation.

method_kphio

The method used to calculate kphio.

method_optchi

The method used to calculate optimal chi.

optchi

The optimal chi (\(\chi\)) calculations for the fitted P Model.

pmodel_const

The PModelConst instance used to create the model environment.

reference_kphio

The value of the the reference kphio to be used in the model.

shape

Records the common numpy array shape of array inputs.

vcmax

Maximum rate of carboxylation at the growth temperature (µmol m-2 s-1), calculated as:

vcmax25

Maximum rate of carboxylation at standard temperature (µmol m-2 s-1), estimated from \(V_{cmax}\) using the selected method for Arrhenius scaling.

apply_gpp_conversion_factor(daily_mean_pmodel_gpp: ndarray[tuple[Any, ...], dtype[_ScalarT]]) ndarray[tuple[Any, ...], dtype[_ScalarT]]

Apply the gpp conversion factor to the input daily gpp.

apply_gpp_penalty_factor(penalty_factor: pyrealm.core.xarray.ArrayType) None

Apply a post-hoc GPP penalty factor to GPP predictions.

Some productivity models apply a post-hoc penalty factor to the predicted GPP of the P Model to correct for other influences on productivity. Examples included the soil moisture penalty factors implemented as pyrealm.pmodel.functions.calculate_soilmstress_mengoli() and pyrealm.pmodel.functions.calculate_soilmstress_stocker().

This method allows such a factor (\(f \in [0,1]\)) to be applied to a fitted P Model instance. The gpp attribute of the model will then return the product of the raw GPP predictions and the provided penalty factor.

The main use of this method is to allow penalised GPP to be used with other pyrealm methods that take a P Model as an input.

Parameters:

penalty_factor – An array of GPP penalty value.

remove_gpp_penalty_factor() None

Removes a post-hoc GPP penalty factor.

This method removes a previously applied GPP penalty factor.

summarize(dp: int = 2) None

Prints a summary of data attributes.

Parameters:

dp – The number of decimal places used in rounding summary stats.

A_c: ndarray[tuple[Any, ...], dtype[floating]]

Maximum assimilation rate limited by carboxylation.

A_j: ndarray[tuple[Any, ...], dtype[floating]]

Maximum assimilation rate limited by electron transport.

J: ndarray[tuple[Any, ...], dtype[floating]]

Electron transfer rate.

c4: bool

Boolean flag showing if the optimal chi method approximates a C3 or C4 pathway.

core_const: CoreConst

The CoreConst instance used to create the model environment.

env: PModelEnvironment

The PModelEnvironment used to fit the P Model.

property gpp: ndarray[tuple[Any, ...], dtype[floating]]

Gross primary productivity (µg C m-2 s-1).

If a post-hoc GPP penalty factor has been applied to the model (see apply_gpp_penalty_factor()) then the value returned is the penalised GPP.

gpp_conversion_factor

Penalty to apply to gpp when moving to daily gpp

gpp_penalty_factor: ndarray[tuple[Any, ...], dtype[floating]] | None

An optional post-hoc GPP penalty factor applied to the model.

gs: ndarray[tuple[Any, ...], dtype[floating]]

Stomatal conductance (µmol m-2 s-1), calculated as:

\[g_s = \frac{A}{c_a - c_i},\]

where \(A\) is assimilation in µmol C m-2 s-1. The standard P Model uses the coordination hypothesis and hence \(A=A_c=A_j\).

When C4 photosynthesis is being used, the true partial pressure of CO2 in the substomatal cavities (\(c_i\)) is used following the calculation of \(\chi\) using beta_cost_ratio_c4. Note that \(g_s \to \infty\) as VPD \(\to 0\) and hence \((c_a - c_i) \to 0\) and the reported values will be set to np.nan under these conditions.

iwue: ndarray[tuple[Any, ...], dtype[floating]]

Intrinsic water use efficiency (iWUE, µmol mol-1), calculated as:

\[( 5/8 * (c_a - c_i)) / P,\]

where \(c_a\) and \(c_i\) are measured in Pa and \(P\) is atmospheric pressure in megapascals.

jmax: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of electron transport at the growth temperature (µmol m-2 s-1), calculated as:

\[J_{max} = 4 \phi_{0} I_{abs} f_{j}\]

where \(f_j\) is a limitation term calculated via the method selected in method_jmaxlim.

jmax25: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of electron transport at standard temperature (µmol m-2 s-1), estimated from \(J_{max}\) using the selected method for Arrhenius scaling.

jmaxlim: JmaxLimitationABC

The Jmax limitation terms calculated for the model.

kphio: QuantumYieldABC

The quantum yield (\(\phi_0\)) calculations for the fitted P Model.

lue: ndarray[tuple[Any, ...], dtype[floating]]

Light use efficiency (LUE, g C mol-1), calculated as:

\[\text{LUE} = \phi_0 \cdot m_j \cdot f_v \cdot M_C\]

where \(f_v\) is a limitation factor defined in JmaxLimitationABC and \(M_C\) is the molar mass of carbon.

method_arrhenius

The method used to calculate Arrhenius factors.

method_jmaxlim

Records the method used to calculate Jmax limitation.

method_kphio: str

The method used to calculate kphio.

method_optchi: str

The method used to calculate optimal chi.

optchi: OptimalChiABC

The optimal chi (\(\chi\)) calculations for the fitted P Model.

pmodel_const: PModelConst

The PModelConst instance used to create the model environment.

reference_kphio

The value of the the reference kphio to be used in the model.

shape: tuple

Records the common numpy array shape of array inputs.

vcmax: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of carboxylation at the growth temperature (µmol m-2 s-1), calculated as:

\[V_{cmax} = \phi_{0} I_{abs} \frac{m}{m_c} f_{v}\]

where \(f_v\) is a limitation term calculated via the method selected in method_jmaxlim.

vcmax25: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of carboxylation at standard temperature (µmol m-2 s-1), estimated from \(V_{cmax}\) using the selected method for Arrhenius scaling.

class SubdailyPModel(env: PModelEnvironment, acclim_model: AcclimationModel, method_optchi: str = 'prentice14', method_jmaxlim: str = 'wang17', method_kphio: str = 'temperature', method_arrhenius: str = 'simple', reference_kphio: float | ArrayType[np.floating] | None = None, previous_realised: dict[str, ArrayType[np.floating]] | None = None)

Fit a P Model incorporating acclimation in photosynthetic responses.

The PModel implementation of the P Model assumes that plants instantaneously adopt optimal behaviour, which is reasonable where the data represents average conditions over longer timescales and the plants can be assumed to have acclimated to optimal behaviour. Over shorter timescales, this assumption is unwarranted and photosynthetic slow responses need to be included. This class implements the weighted-average approach of {cite:t}`mengoli:2022a`, but is extended to include the slow response of \(\xi\) in addition to \(V_{cmax25}\) and \(J_{max25}\).

The workflow of the model:

  • The first dimension of the data arrays used to create the PModelEnvironment instance must represent the time axis of the observations. The acclim_model argument is used to provide a AcclimationModel instance that sets the dates and time of those observations. One of the set_ methods to that class must also be used to define a daily acclimation window that will be used to estimate the optimal daily behaviour of the plant.

  • The AcclimationModel.get_daily_means method is then used to extract daily average values for forcing variables from within the acclimation window, setting the conditions that the plant will optimise to.

  • A standard P Model is then run on those daily forcing values to generate predicted states for photosynthetic parameters that give rise to optimal productivity in that window.

  • The AcclimationModel.apply_acclimation method is then used to calculate acclimating values for \(\xi\), \(V_{cmax25}\) and \(J_{max25}\). These values are the actual realised values that will be used in calculating the P Model and which reflect the slow responses of those parameters to changing conditions. The speed of acclimation is controlled by the AcclimationModel.alpha attribute, which sets the weight \(\alpha \in [0,1]\) for an exponential moving average (see pyrealm.core.utilities.exponential_moving_average()) Higher values of alpha give more rapid acclimation: \(\alpha=1\) results in immediate acclimation and \(\alpha=0\) results in no acclimation at all, with values pinned to the initial estimates.

  • By default, the initial values of the acclimated variables are taken to be the same as the initial optimal values. The previous_realised argument can be used to provide alternative initial realised values. This allows subdaily P models to be restarted using estimates of acclimated values.

  • The realised values are then filled back onto the original subdaily timescale, using the AcclimationModel.fill_daily_to_subdaily method. The subdaily values of \(V_{cmax}\) and \(J_{max}\) are calculated by using Arrhenius scaling to convert the acclimated values of \(V_{cmax25}\) and \(J_{max25}\) to the actual subdaily temperature observations. The value of \(c_i\) is calculated using the acclimating values of \(\xi\) but the actual subdaily values of temperature and vapour pressure deficit.

  • Predictions of GPP are then made as in the standard P Model.

  • The coordination hypothesis does not apply to the subdaily P Model and so stomatal conductance (gs) is calculated using assimilation as \(A=min(A_c, A_j)\).

As with the PModel, the values of the kphio argument _can_ be provided as an array of values, potentially varying through time and space. The behaviour of the daily model that drives acclimation here is to take the daily mean kphio value for each time series within the acclimation window, as for the other variables. This is an experimental solution!

Missing values:

Missing data can arise in a number of ways: actual gaps in the forcing data, the observations starting part way through a day and missing some or all of the acclimation window for the day, or undefined values in P Model predictions. Some options include:

  • The allow_partial_data argument is passed on to the get_daily_means() method to allow daily optimum conditions to be calculated when the data in the acclimation window is incomplete. This does not fix problems when no data is present in the window or when the P Model predictions for a day are undefined.

  • The allow_holdover argument is passed on to the apply_acclimation() method to set whether missing values in the optimal predictions can be filled by holding over previous valid values.

Parameters:
  • env – An instance of PModelEnvironment. The first dimension of the data must be time with an equal length to the acclimation model or a length of 1 if constant in time.

  • acclim_model – An instance of AcclimationModel

  • method_kphio – The method to use for calculating the quantum yield efficiency of photosynthesis (\(\phi_0\), unitless). The method name must be included in the QUANTUM_YIELD_CLASS_REGISTRY.

  • method_optchi – (Optional, default=`prentice14`) Selects the method to be used for calculating optimal \(chi\). The choice of method also sets the choice of C3 or C4 photosynthetic pathway (see OptimalChiABC).

  • method_jmaxlim – (Optional, default=`wang17`) Method to use for \(J_{max}\) limitation.

  • method_arrhenius – (Optional, default=`simple`) Method to set the form of Arrhenius scaling used for vcmax and jmax.

  • reference_kphio – An optional alternative reference value for the quantum yield efficiency of photosynthesis (\(\phi_0\), -) to be passed to the kphio calculation method.

  • previous_realised – A tuple of previous realised values of three NumPy arrays (xi_real, vcmax25_real, jmax25_real).

Methods:

apply_gpp_conversion_factor(...)

Apply the gpp conversion factor to the input daily gpp.

apply_gpp_penalty_factor(penalty_factor)

Apply a post-hoc GPP penalty factor to GPP predictions.

remove_gpp_penalty_factor()

Removes a post-hoc GPP penalty factor.

summarize([dp])

Prints a summary of data attributes.

Attributes:

A_c

Maximum assimilation rate limited by carboxylation.

A_j

Maximum assimilation rate limited by electron transport.

J

Electron transfer rate.

acclim_model

The acclimation model used in the subdaily P Model.

c4

Boolean flag showing if the optimal chi method approximates a C3 or C4 pathway.

core_const

The CoreConst instance used to create the model environment.

env

The PModelEnvironment used to fit the P Model.

gpp

Gross primary productivity (µg C m-2 s-1).

gpp_conversion_factor

Penalty to apply to gpp when moving to daily gpp

gpp_penalty_factor

An optional post-hoc GPP penalty factor applied to the model.

gs

Stomatal conductance (µmol m-2 s-1), calculated as:

iwue

Intrinsic water use efficiency (iWUE, µmol mol-1), calculated as:

jmax

Maximum rate of electron transport at the growth temperature (µmol m-2 s-1), calculated as:

jmax25

Maximum rate of electron transport at standard temperature (µmol m-2 s-1), estimated from \(J_{max}\) using the selected method for Arrhenius scaling.

jmax25_daily_optimal

Daily optimal values in acclimation window for \(J_{max}\), scaled to standard temperature (\(J_{max25}\)).

jmax25_daily_realised

Realised daily responses in \(J_{max25}\)

jmaxlim

The Jmax limitation terms calculated for the model.

kphio

The quantum yield (\(\phi_0\)) calculations for the fitted P Model.

lue

The Subdaily P Model does not predict light use efficiency.

method_arrhenius

The method used to calculate Arrhenius factors.

method_jmaxlim

Records the method used to calculate Jmax limitation.

method_kphio

The method used to calculate kphio.

method_optchi

The method used to calculate optimal chi.

optchi

The optimal chi (\(\chi\)) calculations for the fitted P Model.

pmodel_acclim

P Model predictions for the daily acclimation conditions.

pmodel_const

The PModelConst instance used to create the model environment.

previous_realised

A dictionary of arrays of previous realised values for the acclimating variables 'xi', 'jmax25' and 'vcmax25'.

reference_kphio

The value of the the reference kphio to be used in the model.

shape

Records the common numpy array shape of array inputs.

vcmax

Maximum rate of carboxylation at the growth temperature (µmol m-2 s-1), calculated as:

vcmax25

Maximum rate of carboxylation at standard temperature (µmol m-2 s-1), estimated from \(V_{cmax}\) using the selected method for Arrhenius scaling.

vcmax25_daily_optimal

Daily optimal values in acclimation window for \(V_{cmax}\), scaled to standard temperature (\(V_{cmax25}\)).

vcmax25_daily_realised

Realised daily responses in \(V_{cmax25}\)

xi_daily_optimal

Daily optimal values in acclimation window for \(\xi\)

xi_daily_realised

Realised daily responses in \(\xi\)

apply_gpp_conversion_factor(daily_mean_pmodel_gpp: ndarray[tuple[Any, ...], dtype[_ScalarT]]) ndarray[tuple[Any, ...], dtype[_ScalarT]]

Apply the gpp conversion factor to the input daily gpp.

apply_gpp_penalty_factor(penalty_factor: pyrealm.core.xarray.ArrayType) None

Apply a post-hoc GPP penalty factor to GPP predictions.

Some productivity models apply a post-hoc penalty factor to the predicted GPP of the P Model to correct for other influences on productivity. Examples included the soil moisture penalty factors implemented as pyrealm.pmodel.functions.calculate_soilmstress_mengoli() and pyrealm.pmodel.functions.calculate_soilmstress_stocker().

This method allows such a factor (\(f \in [0,1]\)) to be applied to a fitted P Model instance. The gpp attribute of the model will then return the product of the raw GPP predictions and the provided penalty factor.

The main use of this method is to allow penalised GPP to be used with other pyrealm methods that take a P Model as an input.

Parameters:

penalty_factor – An array of GPP penalty value.

remove_gpp_penalty_factor() None

Removes a post-hoc GPP penalty factor.

This method removes a previously applied GPP penalty factor.

summarize(dp: int = 2) None

Prints a summary of data attributes.

Parameters:

dp – The number of decimal places used in rounding summary stats.

A_c: ndarray[tuple[Any, ...], dtype[floating]]

Maximum assimilation rate limited by carboxylation.

A_j: ndarray[tuple[Any, ...], dtype[floating]]

Maximum assimilation rate limited by electron transport.

J: ndarray[tuple[Any, ...], dtype[floating]]

Electron transfer rate.

acclim_model: AcclimationModel

The acclimation model used in the subdaily P Model.

c4: bool

Boolean flag showing if the optimal chi method approximates a C3 or C4 pathway.

core_const: CoreConst

The CoreConst instance used to create the model environment.

env: PModelEnvironment

The PModelEnvironment used to fit the P Model.

property gpp: ndarray[tuple[Any, ...], dtype[floating]]

Gross primary productivity (µg C m-2 s-1).

If a post-hoc GPP penalty factor has been applied to the model (see apply_gpp_penalty_factor()) then the value returned is the penalised GPP.

gpp_conversion_factor

Penalty to apply to gpp when moving to daily gpp

gpp_penalty_factor: ndarray[tuple[Any, ...], dtype[floating]] | None

An optional post-hoc GPP penalty factor applied to the model.

gs: ndarray[tuple[Any, ...], dtype[floating]]

Stomatal conductance (µmol m-2 s-1), calculated as:

\[g_s = \frac{A}{c_a - c_i},\]

where \(A\) is assimilation in µmol C m-2 s-1. The standard P Model uses the coordination hypothesis and hence \(A=A_c=A_j\).

When C4 photosynthesis is being used, the true partial pressure of CO2 in the substomatal cavities (\(c_i\)) is used following the calculation of \(\chi\) using beta_cost_ratio_c4. Note that \(g_s \to \infty\) as VPD \(\to 0\) and hence \((c_a - c_i) \to 0\) and the reported values will be set to np.nan under these conditions.

iwue: ndarray[tuple[Any, ...], dtype[floating]]

Intrinsic water use efficiency (iWUE, µmol mol-1), calculated as:

\[( 5/8 * (c_a - c_i)) / P,\]

where \(c_a\) and \(c_i\) are measured in Pa and \(P\) is atmospheric pressure in megapascals.

jmax: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of electron transport at the growth temperature (µmol m-2 s-1), calculated as:

\[J_{max} = 4 \phi_{0} I_{abs} f_{j}\]

where \(f_j\) is a limitation term calculated via the method selected in method_jmaxlim.

jmax25: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of electron transport at standard temperature (µmol m-2 s-1), estimated from \(J_{max}\) using the selected method for Arrhenius scaling.

jmax25_daily_optimal: ndarray[tuple[Any, ...], dtype[floating]]

Daily optimal values in acclimation window for \(J_{max}\), scaled to standard temperature (\(J_{max25}\)).

jmax25_daily_realised: ndarray[tuple[Any, ...], dtype[floating]]

Realised daily responses in \(J_{max25}\)

jmaxlim: JmaxLimitationABC

The Jmax limitation terms calculated for the model.

kphio: QuantumYieldABC

The quantum yield (\(\phi_0\)) calculations for the fitted P Model.

property lue: None

The Subdaily P Model does not predict light use efficiency.

method_arrhenius

The method used to calculate Arrhenius factors.

method_jmaxlim

Records the method used to calculate Jmax limitation.

method_kphio: str

The method used to calculate kphio.

method_optchi: str

The method used to calculate optimal chi.

optchi: OptimalChiABC

The optimal chi (\(\chi\)) calculations for the fitted P Model.

pmodel_acclim: PModel

P Model predictions for the daily acclimation conditions.

A PModel instance providing the predictions of the P Model for the daily acclimation conditions set for the SubdailyPModel. The model is used to obtain predictions of the instantaneous optimal estimates of \(V_{cmax}\), \(J_{max}\) and \(\xi\) during the acclimation window. These are then used to estimate realised values of those parameters given slow responses to acclimation.

pmodel_const: PModelConst

The PModelConst instance used to create the model environment.

previous_realised: Mapping[str, ndarray[tuple[Any, ...], dtype[floating]] | None]

A dictionary of arrays of previous realised values for the acclimating variables ‘xi’, ‘jmax25’ and ‘vcmax25’. If none were provided, the dictionary values are None.

reference_kphio

The value of the the reference kphio to be used in the model.

shape: tuple

Records the common numpy array shape of array inputs.

vcmax: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of carboxylation at the growth temperature (µmol m-2 s-1), calculated as:

\[V_{cmax} = \phi_{0} I_{abs} \frac{m}{m_c} f_{v}\]

where \(f_v\) is a limitation term calculated via the method selected in method_jmaxlim.

vcmax25: ndarray[tuple[Any, ...], dtype[floating]]

Maximum rate of carboxylation at standard temperature (µmol m-2 s-1), estimated from \(V_{cmax}\) using the selected method for Arrhenius scaling.

vcmax25_daily_optimal: ndarray[tuple[Any, ...], dtype[floating]]

Daily optimal values in acclimation window for \(V_{cmax}\), scaled to standard temperature (\(V_{cmax25}\)).

vcmax25_daily_realised: ndarray[tuple[Any, ...], dtype[floating]]

Realised daily responses in \(V_{cmax25}\)

xi_daily_optimal: ndarray[tuple[Any, ...], dtype[floating]]

Daily optimal values in acclimation window for \(\xi\)

xi_daily_realised: ndarray[tuple[Any, ...], dtype[floating]]

Realised daily responses in \(\xi\)