Reference guide#

This manual details, for each module of openalea.cnwgrass.gasexchange, the functions and objects included in openalea.cnwgrass.gasexchange, describing what they are and what they do.

openalea.cnwgrass.gasexchange package#

gasexchange#

The model Gas-Exchange

openalea.cnwgrass.gasexchange.model module#

openalea.cnwgrass.gasexchange.model.calculate_Ci(ambient_CO2, An, gsw)[source]#

Calculates the internal CO2 concentration (Ci)

Parameters:
  • ambient_CO2 (float) – air CO2 (µmol mol-1)

  • An (float) – net assimilation rate of CO2 (µmol m-2 s-1)

  • gsw (float) – stomatal conductance to water vapour (mol m-2 s-1)

Returns:

Ci (µmol mol-1)

Return type:

float

openalea.cnwgrass.gasexchange.model.calculate_photosynthesis(PAR, surfacic_nitrogen, NSC_Retroinhibition, surfacic_NSC, Ts, Ci)[source]#

Computes photosynthesis rate following Farquhar’s model with regulation by organ temperature and nitrogen content. In this version, most of the parameters are derived from Braune et al. (2009) on barley and Evers et al. (2010) for N dependencies.

Parameters:
  • PAR (float) – PAR absorbed (µmol m-2 s-1)

  • surfacic_nitrogen (float) – surfacic nitrogen content(g m-2) including or not structural nitrogen depending on parameter.MODEL_VERSION

  • NSC_Retroinhibition (bool) – if True, Ag is inhibited by surfacic NSC (Non-Structural Carbohydrates).

  • surfacic_NSC (float) – surfacic content of NSC (Non-Structural Carbohydrates) (µmol C m-2).

  • Ts (float) – organ temperature (degree C)

  • Ci (float) – internal CO2 (µmol mol-1), Ci = 0.7*CO2air for the first iteration

Returns:

Ag (µmol m-2 s-1), An (µmol m-2 s-1), Rd (µmol m-2 s-1)

Return type:

(float, float, float)

openalea.cnwgrass.gasexchange.model.calculate_surfacic_WSC(sucrose, starch, fructan, green_area)[source]#

Surfacic content of water soluble carbohydrates # TODO: rename because starch is not water-soluble.

Parameters:
  • sucrose (float) – amount of sucrose (µmol C)

  • starch (float) – amount of starch (µmol C)

  • fructan (float) – amount of fructan (µmol C)

  • green_area (float) – green area (m-2)

Returns:

Surfacic content of water soluble carbohydrates (µmol C m-2)

Return type:

float

openalea.cnwgrass.gasexchange.model.calculate_surfacic_nitrogen(nitrates, amino_acids, proteins, Nstruct, green_area)[source]#

Surfacic content of nitrogen

Parameters:
  • nitrates (float) – amount of nitrates (µmol N)

  • amino_acids (float) – amount of amino_acids (µmol N)

  • proteins (float) – amount of proteins (µmol N)

  • Nstruct (float) – structural N (g)

  • green_area (float) – green area (m-2)

Returns:

Surfacic nitrogen (g m-2)

Return type:

float

openalea.cnwgrass.gasexchange.model.calculate_surfacic_nonstructural_nitrogen(nitrates, amino_acids, proteins, green_area)[source]#

Surfacic content of non-structural nitrogen

Parameters:
  • nitrates (float) – amount of nitrates (µmol N)

  • amino_acids (float) – amount of amino_acids (µmol N)

  • proteins (float) – amount of proteins (µmol N)

  • green_area (float) – green area (m-2)

Returns:

Surfacic non-structural nitrogen (g m-2)

Return type:

float

openalea.cnwgrass.gasexchange.model.calculate_surfacic_nonstructural_nitrogen_Farquhar(surfacic_photosynthetic_proteins)[source]#

Estimate of non structural SLN used in Farquhar

Parameters:

surfacic_photosynthetic_proteins (float) – surfacic proteins content (µmol N m-2)

Returns:

Surfacic non-structural nitrogen (g m-2)

Return type:

float

openalea.cnwgrass.gasexchange.model.calculate_surfacic_photosynthetic_proteins(proteins, green_area)[source]#

Surfacic content of photosynthetic proteins

Parameters:
  • proteins (float) – amount of proteins (µmol N)

  • green_area (float) – green area (m-2)

Returns:

Surfacic non-structural nitrogen (g m-2)

Return type:

float

openalea.cnwgrass.gasexchange.model.organ_temperature(w, z, Zh, Ur, PAR, gsw, Ta, Ts, RH, organ_name)[source]#

Energy balance for the estimation of organ temperature

Parameters:
  • w (float) – organ characteristic dimension (m) to be considered for heat transfer through forced convection (by wind). For a leaf: its width (more related to wind direction than length), for cylindric stem elements: diameter.

  • z (float) – organ height from soil (m)

  • Zh (float) – canopy height (m)

  • Ur (float) – wind speed (m s-1) at the reference height (zr), e.g. top of the canopy + 2m (in the case of wheat, Ur can be approximated as the wind speed at 2m from soil)

  • PAR (float) – absorbed PAR (µmol m-2 s-1)

  • gsw (float) – stomatal conductance to water vapour (mol m-2 s-1)

  • Ta (float) – air temperature (degree C)

  • Ts (float) – organ temperature (degree C). Ts = Ta at the first iteration of the numeric resolution

  • RH (float) – Relative humidity (decimal fraction)

  • organ_name (str) – name of the organ to which belongs the element (used to distinguish lamina from cylindric organs)

Returns:

Ts (organ temperature, degree C), Tr (organ transpiration rate, mm s-1)

Return type:

(float, float)

openalea.cnwgrass.gasexchange.model.stomatal_conductance_BWB(Ag, An, surfacic_nitrogen, ambient_CO2, RH)[source]#

Ball, Woodrow, and Berry model of stomatal conductance (1987)

Parameters:
  • Ag (float) – gross assimilation rate (µmol m-2 s-1)

  • An (float) – net assimilation rate (µmol m-2 s-1)

  • surfacic_nitrogen (float) – surfacic nitrogen content(g m-2) including or not structural nitrogen depending on parameter.MODEL_VERSION

  • ambient_CO2 (float) – Air CO2 (µmol mol-1)

  • RH (float) – Relative humidity (decimal fraction)

Returns:

gsw (mol m-2 s-1)

Return type:

float

openalea.cnwgrass.gasexchange.model.stomatal_conductance_Leuning(Ag, An, Ta, ambient_CO2, RH)[source]#

Leuning model of stomatal conductance to water (1995)

Parameters:
  • Ag (float) – gross assimilation rate (µmol m-2 s-1)

  • An (float) – net assimilation rate (µmol m-2 s-1)

  • Ta (float) – air temperature (degree C)

  • ambient_CO2 (float) – Air CO2 (µmol mol-1)

  • RH (float) – Relative humidity (decimal fraction)

Returns:

gsw (mol m-2 s-1)

Return type:

float

openalea.cnwgrass.gasexchange.model.stomatal_conductance_Tuzet(Ag, An, Ta, ambient_CO2, water_potential)[source]#

Tuzet model of stomatal conductance to water (2003)

Parameters:
  • Ag (float) – gross assimilation rate (µmol m-2 s-1)

  • An (float) – net assimilation rate (µmol m-2 s-1)

  • Ta (float) – air temperature (degree C)

  • ambient_CO2 (float) – Air CO2 (µmol mol-1)

  • water_potential (float) – water potential of the organ (Mpa)

Returns:

gsw (mol m-2 s-1)

Return type:

float

openalea.cnwgrass.gasexchange.model.stomatal_conductance_hydraulics(Ag, An, Ta, ambient_CO2, RH, water_potential)[source]#

Model of stomatal conductance to water coupling Tuzet and Leuning

Parameters:
  • Ag (float) – gross assimilation rate (µmol m-2 s-1)

  • An (float) – net assimilation rate (µmol m-2 s-1)

  • Ta (float) – air temperature (degree C)

  • ambient_CO2 (float) – Air CO2 (µmol mol-1)

  • RH (float) – Relative humidity (decimal fraction)

  • water_potential (float) – water potential of the organ (Mpa)

Returns:

gsw (mol m-2 s-1)

Return type:

float

openalea.cnwgrass.gasexchange.simulation module#

class openalea.cnwgrass.gasexchange.simulation.Simulation(update_parameters=None, stomatal_model_name='BWB', hydraulics=False)[source]#

Bases: object

The Simulation class permits to initialize and run a simulation.

axes_inputs#

the inputs needed by Gas-Exchange at axis scale

elements_inputs#

the inputs needed by Gas-Exchange at element scale

elements_outputs#

the outputs computed by Gas-Exchange

initialize(inputs)[source]#

Initialize inputs from inputs.

Parameters:

inputs (dict) –

Dictionary of two dictionaries :
  • elements : The inputs by element.

  • axes : The inputs by axis.

inputs must be a dictionary with the same structure as inputs.

See Model.run

for more information about the inputs.

inputs#

inputs is a dictionary of dictionaries: {(plant_index, axis_label, metamer_index, organ_label, element_label): {element_input_name: element_input_value, …}, …}

outputs#

outputs is a dictionary of dictionaries: {(plant_index, axis_label, metamer_index, organ_label, element_label): {element_output_name: element_output_value, …}, …}

run(Ta, ambient_CO2, RH, Ur)[source]#

Compute Farquhar variables for each element in inputs and put the results in outputs.

Parameters:
  • Ta (float) – air temperature at t (degree Celsius)

  • ambient_CO2 (float) – air CO2 at t (µmol mol-1)

  • RH (float) – relative humidity at t (decimal fraction)

  • Ur (float) – wind speed at the top of the canopy at t (m s-1)

exception openalea.cnwgrass.gasexchange.simulation.SimulationError[source]#

Bases: Exception

exception openalea.cnwgrass.gasexchange.simulation.SimulationInputsError[source]#

Bases: SimulationError

openalea.cnwgrass.gasexchange.converter module#

openalea.cnwgrass.gasexchange.converter.AXIS_TOPOLOGY_COLUMNS = ['plant', 'axis']#

the columns which define the topology in the input/output elements dataframe

openalea.cnwgrass.gasexchange.converter.ELEMENT_TOPOLOGY_COLUMNS = ['plant', 'axis', 'metamer', 'organ', 'element']#

the columns which define the topology in the input/output elements dataframe

openalea.cnwgrass.gasexchange.converter.from_dataframe(element_inputs, axes_inputs)[source]#

Convert inputs/outputs from Pandas dataframe to Gas-Exchange format.

Parameters:
  • element_inputs (pandas.DataFrame) – Emerging and mature element inputs dataframe to convert, with one line by element.

  • axes_inputs (pandas.DataFrame) – axes inputs dataframe to convert, with one line per axis (Shoot Apical Meristem)

Returns:

The inputs/outputs in a dictionary.

Return type:

dict [dict]

see also:: see simulation.Simulation.inputs and simulation.Simulation.outputs

for the structure of Gas-Exchange inputs/outputs.

openalea.cnwgrass.gasexchange.converter.to_dataframe(data_dict, element_outputs)[source]#

Convert inputs/outputs from Gas-Exchange format to Pandas dataframe.

Parameters:
  • data_dict (dict) – The inputs/outputs in Gas-Exchange format.

  • element_outputs (list) – The list of output names for elements

Returns:

one dataframe for element outputs

Return type:

pandas.DataFrame

see also:: see simulation.Simulation.inputs and simulation.Simulation.outputs

for the structure of Gas-Exchange inputs/outputs.

openalea.cnwgrass.gasexchange.parameters module#

gasexchange.parameters#

The module gasexchange.parameters defines the constant parameters.

openalea.cnwgrass.gasexchange.parameters.DELTA_CONVERGENCE = 0.01#

The relative delta for Ci and Ts convergence.

class openalea.cnwgrass.gasexchange.parameters.ElementDefaultProperties[source]#

Bases: object

Properties by default for the elements. Used in Gas-Exchange facade.

PARa_prim#

For calculations at primitive scale

area_prim#

For calculations at primitive scale

openalea.cnwgrass.gasexchange.parameters.KELVIN_DEGREE = 273.15#

Conversion factor from degree C to Kelvin

openalea.cnwgrass.gasexchange.parameters.NSC_Retroinhibition = True#

If True, NSC (Non-Structural Carbohydrates) downregulate photosynthesis

openalea.cnwgrass.gasexchange.parameters.Psurf_to_SLNnonstruct = 1.06#

Conversion factor from surfacic protein content to non-structural SLN (estimation from NEMA and Ljutovac simulations)

openalea.cnwgrass.gasexchange.parameters.SurfacicProteins = True#

If True, surfacic proteins used to regulate photosynthesis ; if not total N

openalea.cnwgrass.gasexchange.parameters.prim_scale = False#

If True, photosynthesis calculated at primitive scale, if not at organ scale