Plant Communities

Run this notebook

Warning

This area of pyrealm is in active development.

from matplotlib import pyplot as plt
import numpy as np
import pandas as pd

from pyrealm.demography.flora import PlantFunctionalType, Flora
from pyrealm.demography.community import Cohorts, Community
short_pft = PlantFunctionalType(
    name="short", h_max=15, m=1.5, n=1.5, f_g=0, ca_ratio=380
)
tall_pft = PlantFunctionalType(name="tall", h_max=30, m=1.5, n=2, f_g=0.2, ca_ratio=500)

# Create the flora
flora = Flora([short_pft, tall_pft])

# Create a simply community with three cohorts
# - 15 saplings of the short PFT
# - 5 larger stems of the short PFT
# - 2 large stems of tall PFT

community = Community(
    flora=flora,
    cell_area=32,
    cell_id=1,
    cohorts=Cohorts(
        dbh_values=np.array([0.02, 0.20, 0.5]),
        n_individuals=np.array([15, 5, 2]),
        pft_names=np.array(["short", "short", "tall"]),
    ),
)
/home/docs/checkouts/readthedocs.org/user_builds/pyrealm/checkouts/latest/pyrealm/core/experimental.py:72: ExperimentalFeatureWarning: 'Be aware that Cohorts is an experimental feature of pyrealm and the implementation and API may change within major versions.'
  warn(qualname, ExperimentalFeatureWarning)
/home/docs/checkouts/readthedocs.org/user_builds/pyrealm/checkouts/latest/pyrealm/core/experimental.py:72: ExperimentalFeatureWarning: 'Be aware that Community is an experimental feature of pyrealm and the implementation and API may change within major versions.'
  warn(qualname, ExperimentalFeatureWarning)
/home/docs/checkouts/readthedocs.org/user_builds/pyrealm/checkouts/latest/pyrealm/core/experimental.py:72: ExperimentalFeatureWarning: 'Be aware that StemAllometry is an experimental feature of pyrealm and the implementation and API may change within major versions.'
  warn(qualname, ExperimentalFeatureWarning)
community
Community(cell_id=1, cell_area=32, flora=Flora with 2 functional types: short, tall, cohorts=Cohorts(n_individuals=array([15,  5,  2]), pft_names=array(['short', 'short', 'tall'], dtype='<U5'), _cohort_id=array(['e608c8db-29d6-4118-bbf8-fb616068a552',
       'ba9ad3b4-8e0e-4d3c-a3ed-d60823073fbc',
       '75888b44-e171-45d4-bf27-7cdd6cd5e9ff'], dtype='<U36'), _dbh_values=array([0.02, 0.2 , 0.5 ]), n_cohorts=3), n_cohorts=3, stem_traits=StemTraits(name=array(['short', 'short', 'tall'], dtype='<U5'), a_hd=array([116., 116., 116.]), ca_ratio=array([380, 380, 500]), h_max=array([15, 15, 30]), rho_s=array([200., 200., 200.]), lai=array([1.8, 1.8, 1.8]), sla=array([14., 14., 14.]), tau_f=array([4., 4., 4.]), tau_rt=array([1., 1., 1.]), tau_r=array([1.04, 1.04, 1.04]), par_ext=array([0.5, 0.5, 0.5]), yld=array([0.6, 0.6, 0.6]), zeta=array([0.17, 0.17, 0.17]), resp_r=array([0.913, 0.913, 0.913]), resp_s=array([0.044, 0.044, 0.044]), resp_f=array([0.1, 0.1, 0.1]), resp_rt=array([0., 0., 0.]), m=array([1.5, 1.5, 1.5]), n=array([1.5, 1.5, 2. ]), f_g=array([0. , 0. , 0.2]), q_m=array([1.28413734, 1.28413734, 1.5       ]), z_max_prop=array([0.54288352, 0.54288352, 0.70710678]), p_foliage_for_reproductive_tissue=array([0., 0., 0.]), gpp_topslice=array([0., 0., 0.]), validate=False, _n_stems=3), stem_allometry=StemAllometry: Prediction for 3 stems at 1 DBH values.)