![]() |
0.1.39
|
High-level interface for stomatal conductance modeling and gas exchange calculations. More...
High-level interface for stomatal conductance modeling and gas exchange calculations.
This class provides a user-friendly wrapper around the native Helios stomatal conductance plugin with automatic plugin availability checking and graceful error handling.
The stomatal conductance model implements five different stomatal response models:
The plugin includes a species library with pre-calibrated coefficients for common plant species (Almond, Apple, Avocado, Grape, Lemon, Olive, Walnut, etc.).
Both steady-state and dynamic (time-stepping) calculations are supported, with configurable time constants for stomatal opening and closing dynamics.
System requirements:
Definition at line 108 of file StomatalConductance.py.
Public Member Functions | |
| __init__ (self, Context context) | |
| Initialize StomatalConductanceModel with graceful plugin handling. | |
| __enter__ (self) | |
| Context manager entry. | |
| __exit__ (self, exc_type, exc_value, traceback) | |
| Context manager exit with proper cleanup. | |
| __del__ (self) | |
| Destructor to ensure C++ resources freed even without 'with' statement. | |
| getNativePtr (self) | |
| Get the native pointer for advanced operations. | |
| None | enableMessages (self) |
| Enable console output messages from the stomatal conductance model. | |
| None | disableMessages (self) |
| Disable console output messages from the stomatal conductance model. | |
| None | run (self, Optional[List[int]] uuids=None, Optional[float] dt=None) |
| Run the stomatal conductance model. | |
| None | setBWBCoefficients (self, BWBCoefficients coeffs, Optional[List[int]] uuids=None, Optional[str] material_label=None) |
| Set Ball-Woodrow-Berry model coefficients. | |
| None | setBBLCoefficients (self, BBLCoefficients coeffs, Optional[List[int]] uuids=None, Optional[str] material_label=None) |
| Set Ball-Berry-Leuning model coefficients. | |
| None | setMOPTCoefficients (self, MOPTCoefficients coeffs, Optional[List[int]] uuids=None, Optional[str] material_label=None) |
| Set Medlyn et al. | |
| None | setBMFCoefficients (self, Union[BMFCoefficients, List[BMFCoefficients]] coeffs, Optional[List[int]] uuids=None, Optional[str] material_label=None) |
| Set Buckley-Mott-Farquhar model coefficients. | |
| None | setBBCoefficients (self, BBCoefficients coeffs, Optional[List[int]] uuids=None, Optional[str] material_label=None) |
| Set Bailey model coefficients. | |
| None | setBMFCoefficientsFromLibrary (self, str species, Optional[List[int]] uuids=None, Optional[str] material_label=None) |
| Set BMF model coefficients using the built-in species library. | |
| BMFCoefficients | getBMFCoefficientsFromLibrary (self, str species) |
| Return the library BMF coefficients for a species without applying them. | |
| None | setDynamicTimeConstants (self, float tau_open, float tau_close, Optional[List[int]] uuids=None) |
| Set time constants for dynamic stomatal opening and closing. | |
| None | optionalOutputPrimitiveData (self, str label) |
| Add optional output primitive data to the Context. | |
| None | printDefaultValueReport (self, Optional[List[int]] uuids=None) |
| Print a report detailing usage of default input values. | |
| bool | is_available (self) |
| Check if StomatalConductanceModel is available in current build. | |
Public Attributes | |
| context = context | |
| stomatal_model = None | |
Protected Member Functions | |
| _check_context_alive (self) | |
| Raise if the owning Context has been destroyed (see Context.check_context_alive). | |
Static Protected Member Functions | |
| None | _validate_target (str method, uuids, material_label) |
| None | _validate_bmf ("BMFCoefficients" coeffs) |
| pyhelios.StomatalConductance.StomatalConductanceModel.__init__ | ( | self, | |
| Context | context ) |
Initialize StomatalConductanceModel with graceful plugin handling.
| context | Helios Context instance |
| TypeError | If context is not a Context instance |
| StomatalConductanceModelError | If stomatal conductance plugin is not available |
Definition at line 120 of file StomatalConductance.py.
| pyhelios.StomatalConductance.StomatalConductanceModel.__del__ | ( | self | ) |
Destructor to ensure C++ resources freed even without 'with' statement.
Definition at line 201 of file StomatalConductance.py.
| pyhelios.StomatalConductance.StomatalConductanceModel.__enter__ | ( | self | ) |
Context manager entry.
Definition at line 186 of file StomatalConductance.py.
| pyhelios.StomatalConductance.StomatalConductanceModel.__exit__ | ( | self, | |
| exc_type, | |||
| exc_value, | |||
| traceback ) |
Context manager exit with proper cleanup.
Definition at line 190 of file StomatalConductance.py.
|
protected |
Raise if the owning Context has been destroyed (see Context.check_context_alive).
Definition at line 182 of file StomatalConductance.py.
|
staticprotected |
Definition at line 304 of file StomatalConductance.py.
|
staticprotected |
Definition at line 291 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.disableMessages | ( | self | ) |
Disable console output messages from the stomatal conductance model.
| StomatalConductanceModelError | If operation fails |
Definition at line 233 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.enableMessages | ( | self | ) |
Enable console output messages from the stomatal conductance model.
| StomatalConductanceModelError | If operation fails |
Definition at line 220 of file StomatalConductance.py.
| BMFCoefficients pyhelios.StomatalConductance.StomatalConductanceModel.getBMFCoefficientsFromLibrary | ( | self, | |
| str | species ) |
Return the library BMF coefficients for a species without applying them.
The result can be modified and passed to :meth:`setBMFCoefficients`.
| species | Species name from the library (e.g., "Almond", "Walnut"). An unrecognized name raises, and the error message lists the valid names. |
| ValueError | If species name is empty or not a str |
| StomatalConductanceModelError | If the species is not in the library, or the operation fails |
Definition at line 611 of file StomatalConductance.py.
| pyhelios.StomatalConductance.StomatalConductanceModel.getNativePtr | ( | self | ) |
Get the native pointer for advanced operations.
Definition at line 211 of file StomatalConductance.py.
| bool pyhelios.StomatalConductance.StomatalConductanceModel.is_available | ( | self | ) |
Check if StomatalConductanceModel is available in current build.
Definition at line 720 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.optionalOutputPrimitiveData | ( | self, | |
| str | label ) |
Add optional output primitive data to the Context.
| label | Name of primitive data to output (e.g., "Ci", "gs", "E") |
| ValueError | If label is invalid |
| StomatalConductanceModelError | If operation fails |
Definition at line 678 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.printDefaultValueReport | ( | self, | |
| Optional[List[int]] | uuids = None ) |
Print a report detailing usage of default input values.
| uuids | Optional list of primitive UUIDs. If None, reports on all primitives. |
| StomatalConductanceModelError | If operation fails |
Definition at line 704 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.run | ( | self, | |
| Optional[List[int]] | uuids = None, | ||
| Optional[float] | dt = None ) |
Run the stomatal conductance model.
This method supports multiple execution modes: - Steady state for all primitives: run() - Dynamic with timestep for all primitives: run(dt=60.0) - Steady state for specific primitives: run(uuids=[1, 2, 3]) - Dynamic with timestep for specific primitives: run(uuids=[1, 2, 3], dt=60.0)
| uuids | Optional list of primitive UUIDs to process. If None, processes all primitives. |
| dt | Optional timestep in seconds for dynamic simulation. If None, runs steady-state. |
| ValueError | If parameters are invalid |
| StomatalConductanceModelError | If calculation fails |
Definition at line 270 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setBBCoefficients | ( | self, | |
| BBCoefficients | coeffs, | ||
| Optional[List[int]] | uuids = None, | ||
| Optional[str] | material_label = None ) |
Set Bailey model coefficients.
| coeffs | BB model coefficients (pi_0, pi_m, theta, sigma, chi) |
| uuids | Optional list of primitive UUIDs. If None and material_label is also None, applies to all primitives. |
| material_label | Optional Context material label; applies to every primitive that references the material at run() time. Mutually exclusive with uuids. |
| ValueError | If coefficients are invalid, or both ``uuids`` and ``material_label`` are given |
| StomatalConductanceModelError | If operation fails |
Definition at line 521 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setBBLCoefficients | ( | self, | |
| BBLCoefficients | coeffs, | ||
| Optional[List[int]] | uuids = None, | ||
| Optional[str] | material_label = None ) |
Set Ball-Berry-Leuning model coefficients.
| coeffs | BBL model coefficients (gs0, a1, D0) |
| uuids | Optional list of primitive UUIDs. If None and material_label is also None, applies to all primitives. |
| material_label | Optional Context material label; applies to every primitive that references the material at run() time. Mutually exclusive with uuids. |
| ValueError | If coefficients are invalid, or both ``uuids`` and ``material_label`` are given |
| StomatalConductanceModelError | If operation fails |
Definition at line 376 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setBMFCoefficients | ( | self, | |
| Union[BMFCoefficients, List[BMFCoefficients]] | coeffs, | ||
| Optional[List[int]] | uuids = None, | ||
| Optional[str] | material_label = None ) |
Set Buckley-Mott-Farquhar model coefficients.
``coeffs`` may be a single :class:`BMFCoefficients` (applied to all primitives, to ``uuids``, or to ``material_label``), or a list of :class:`BMFCoefficients` with one entry per UUID in ``uuids`` (``coeffs[i]`` is applied to ``uuids[i]``).
| coeffs | BMF model coefficients (Em, i0, k, b), or a list of them (per-UUID form) |
| uuids | Optional list of primitive UUIDs. Required for the per-UUID list form. If None and material_label is also None, applies to all primitives. |
| material_label | Optional Context material label; applies to every primitive that references the material at run() time. Mutually exclusive with uuids and not accepted with the per-UUID list form. |
| ValueError | If coefficients are invalid, list and UUID lengths differ, or both uuids and material_label are given |
| StomatalConductanceModelError | If operation fails |
Definition at line 466 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setBMFCoefficientsFromLibrary | ( | self, | |
| str | species, | ||
| Optional[List[int]] | uuids = None, | ||
| Optional[str] | material_label = None ) |
Set BMF model coefficients using the built-in species library.
| species | Species name from the library (e.g., "Almond", "Apple", "Grape", "Walnut"). An unrecognized name raises, and the error message lists the valid names. |
| uuids | Optional list of primitive UUIDs. If None and material_label is also None, applies to all primitives. |
| material_label | Optional Context material label; applies to every primitive that references the material at run() time. Mutually exclusive with uuids. |
| ValueError | If species name is not a non-empty str, or both ``uuids`` and ``material_label`` are given |
| StomatalConductanceModelError | If the species is not in the library, or the operation fails |
Definition at line 574 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setBWBCoefficients | ( | self, | |
| BWBCoefficients | coeffs, | ||
| Optional[List[int]] | uuids = None, | ||
| Optional[str] | material_label = None ) |
Set Ball-Woodrow-Berry model coefficients.
| coeffs | BWB model coefficients (gs0, a1) |
| uuids | Optional list of primitive UUIDs. If None and material_label is also None, applies to all primitives. |
| material_label | Optional Context material label. The coefficients are stored on the material and apply to every primitive that references it when run() is called. Mutually exclusive with uuids. See "Coefficient precedence" in the Stomatal Conductance plugin documentation. |
| ValueError | If coefficients are invalid, or both ``uuids`` and ``material_label`` are given |
| StomatalConductanceModelError | If operation fails (e.g. the material does not exist) |
Definition at line 336 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setDynamicTimeConstants | ( | self, | |
| float | tau_open, | ||
| float | tau_close, | ||
| Optional[List[int]] | uuids = None ) |
Set time constants for dynamic stomatal opening and closing.
| tau_open | Time constant (seconds) for stomatal opening |
| tau_close | Time constant (seconds) for stomatal closing |
| uuids | Optional list of primitive UUIDs. If None, applies to all primitives. |
| ValueError | If time constants are invalid |
| StomatalConductanceModelError | If operation fails |
Definition at line 641 of file StomatalConductance.py.
| None pyhelios.StomatalConductance.StomatalConductanceModel.setMOPTCoefficients | ( | self, | |
| MOPTCoefficients | coeffs, | ||
| Optional[List[int]] | uuids = None, | ||
| Optional[str] | material_label = None ) |
Set Medlyn et al.
optimality model coefficients.
| coeffs | MOPT model coefficients (gs0, g1) |
| uuids | Optional list of primitive UUIDs. If None and material_label is also None, applies to all primitives. |
| material_label | Optional Context material label; applies to every primitive that references the material at run() time. Mutually exclusive with uuids. |
| ValueError | If coefficients are invalid, or both ``uuids`` and ``material_label`` are given |
| StomatalConductanceModelError | If operation fails |
Definition at line 418 of file StomatalConductance.py.
| pyhelios.StomatalConductance.StomatalConductanceModel.context = context |
Definition at line 127 of file StomatalConductance.py.
| pyhelios.StomatalConductance.StomatalConductanceModel.stomatal_model = None |
Definition at line 128 of file StomatalConductance.py.