Reference guide¶
This manual details, for each module of cnwheat,
the functions and objects included in cnwheat,
describing what they are and what they do.
Contents
- Reference guide
cnwheatpackagecnwheat.simulationmodulecnwheat.modelmodulecnwheat.parametersmodulecnwheat.toolsmodulecnwheat.convertermodulecnwheat.postprocessingmodule
cnwheat.simulation module¶
-
exception
cnwheat.simulation.SimulationError[source]¶ Bases:
ExceptionAbstract class for the management of simulation errors. Do not instance it directly.
-
exception
cnwheat.simulation.SimulationConstructionError[source]¶ Bases:
cnwheat.simulation.SimulationErrorException raised when a problem occurs in the constructor, in particular when the arguments are not consistent with each other.
-
exception
cnwheat.simulation.SimulationInitializationError[source]¶ Bases:
cnwheat.simulation.SimulationErrorException raised when a problem occurs at initialization time, in particular when checking the consistency of inputs population and soils (see
initialize()).
-
exception
cnwheat.simulation.SimulationRunError[source]¶ Bases:
cnwheat.simulation.SimulationErrorException raised when running a simulation, for example when a problem occurs during the integration of the system of differential equations.
-
class
cnwheat.simulation.Simulation(respiration_model, delta_t=1, culm_density=None, interpolate_forcings=False, senescence_forcings_delta_t=None, photosynthesis_forcings_delta_t=None)[source]¶ Bases:
objectThe Simulation class permits to initialize and run the model.
User should use method
initialize()to initialize the model, and methodrun()to run the model.Parameters: - respiration_model (class) –
the model of respiration to use. This model must define a class implementing these functions:
- R_phloem(sucrose_loading, sucrose, mstruct): Phloem loading respiration
- R_Nnit_red(s_amino_acids, sucrose, mstruct, root=False): Nitrate reduction-linked respiration
Distinction is made between nitrate realised in roots or in shoots where a part of the energy required is derived from ATP
and reducing power obtained directly from photosynthesis (rather than C substrate)
- Parameters:
- s_amino_acids (
float) - consumption of N for the synthesis of amino acids (µmol` N g-1 mstruct) (in the present version, this is used to approximate nitrate reduction needed in the original model of Thornley and Cannell, 2000) - sucrose (
float) - amount of C sucrose in organ (µmol` C) - mstruct (
float) - structural dry mass of organ (g) - root (
bool) - specifies if the nitrate reduction-linked respiration is computed for shoot (False) or root (True) tissues.
- s_amino_acids (
- Returns: _R_Nnit_upt (µmol` C respired)
- Returns Type:
float
- R_residual(sucrose, mstruct, Ntot, delta_t, Ts): Residual maintenance respiration (cost from protein turn-over, cell ion gradients, futile cycles…)
- R_grain_growth(mstruct_growth, starch_filling, mstruct): Grain growth respiration
- Returns: R_grain_growth (µmol` C respired)
- Returns Type:
float
- delta_t (int) – the delta t of the simulation (in seconds) ; default is 1.
- [int, int] culm_density (dict) – culm density (culm m-2).
- interpolate_forcings (bool) – if True: interpolate senescence and photosynthesis forcings from values of senescence_forcings_delta_t`and `senescence_forcings_delta_t. Default is False (do not interpolate the forcings).
- senescence_forcings_delta_t (int) –
- the delta t of the senescence forcings (in seconds) ; default is None.
- If the user sets interpolate_forcings to True, then he/she must also set senescence_forcings_delta_t to an integer value greater or equal to delta_t. For example, if interpolate_forcings is True and delta_t==3600, then senescence_forcings_delta_t must be greater or equal to 3600, that is for example 7200.
param int photosynthesis_forcings_delta_t: - the delta t of the photosynthesis forcings (in seconds) ; default is None.
- If the user sets interpolate_forcings to True, then he/she must also set photosynthesis_forcings_delta_t to an integer value greater or equal to delta_t. For example, if interpolate_forcings is True and delta_t==3600, then photosynthesis_forcings_delta_t must be greater or equal to 3600, that is for example 7200.
- interpolate_forcings (
bool) - if True: interpolate senescence and photosynthesis forcings from values of senescence_forcings_delta_t and senescence_forcings_delta_t. Default is False (do not interpolate the forcings). - senescence_forcings_delta_t (
int) - the delta t of the senescence forcings (in seconds) ; default is None. If the user sets interpolate_forcings to True, then he/she must also set senescence_forcings_delta_t to an integer value greater or equal to delta_t. For example, if interpolate_forcings is True and delta_t==3600, then senescence_forcings_delta_t must be greater or equal to 3600, that is for example 7200. - photosynthesis_forcings_delta_t (
int) - the delta t of the photosynthesis forcings (in seconds) ; default is None. If the user sets interpolate_forcings to True, then he/she must also set photosynthesis_forcings_delta_t to an integer value greater or equal to delta_t. For example, if interpolate_forcings is True and delta_t==3600, then photosynthesis_forcings_delta_t must be greater or equal to 3600, that is for example 7200.
-
MODEL_COMPARTMENTS_NAMES= {<class 'cnwheat.model.Plant'>: [], <class 'cnwheat.model.Axis'>: ['C_exudated', 'sum_respi_shoot', 'sum_respi_roots'], <class 'cnwheat.model.Phytomer'>: [], <class 'cnwheat.model.Organ'>: ['age_from_flowering', 'amino_acids', 'cytokinins', 'nitrates', 'proteins', 'starch', 'structure', 'sucrose'], <class 'cnwheat.model.HiddenZone'>: ['amino_acids', 'fructan', 'proteins', 'sucrose'], <class 'cnwheat.model.PhotosyntheticOrganElement'>: ['amino_acids', 'cytokinins', 'fructan', 'nitrates', 'proteins', 'starch', 'sucrose', 'triosesP'], <class 'cnwheat.model.Soil'>: ['nitrates']}¶ the name of the compartments attributes in the model, for objects of types
model.Plant,model.Axis,model.Phytomer,model.Organ,model.HiddenZone,model.PhotosyntheticOrganElement, andmodel.Soil.
-
T_INDEX= ['t']¶ the time index
-
PLANTS_INDEXES= ['plant']¶ the index to locate the plants in the modeled system
-
PLANTS_T_INDEXES= ['t', 'plant']¶ concatenation of
T_INDEXandPLANTS_INDEXES
-
PLANTS_STATE_PARAMETERS= ['Tair']¶ the parameters which define the state of the modeled system at plant scale
-
PLANTS_STATE= ['Tair']¶ the variables which define the state of the modeled system at plant scale, formed be the concatenation of
PLANTS_STATE_PARAMETERSand the names of the compartments associated to each plant (seeMODEL_COMPARTMENTS_NAMES)
-
PLANTS_INTERMEDIATE_VARIABLES= []¶ the variables that we need to compute in order to compute fluxes and/or compartments values at plant scale
-
PLANTS_FLUXES= []¶ the fluxes exchanged between the compartments at plant scale
-
PLANTS_INTEGRATIVE_VARIABLES= []¶ the variables computed by integrating values of plant components parameters/variables recursively
-
PLANTS_RUN_VARIABLES= ['Tair']¶ all the variables computed during a run step of the simulation at plant scale
-
AXES_INDEXES= ['plant', 'axis']¶ the indexes to locate the axes in the modeled system
-
AXES_T_INDEXES= ['t', 'plant', 'axis']¶ concatenation of
T_INDEXandAXES_INDEXES
-
AXES_STATE_PARAMETERS= ['mstruct', 'senesced_mstruct']¶ the parameters which define the state of the modeled system at axis scale
-
AXES_STATE= ['mstruct', 'senesced_mstruct', 'C_exudated', 'sum_respi_shoot', 'sum_respi_roots']¶ the variables which define the state of the modeled system at axis scale, formed be the concatenation of
AXES_STATE_PARAMETERSand the names of the compartments associated to each axis (seeMODEL_COMPARTMENTS_NAMES)
-
AXES_INTERMEDIATE_VARIABLES= []¶ the variables that we need to compute in order to compute fluxes and/or compartments values at axis scale
-
AXES_FLUXES= []¶ the fluxes exchanged between the compartments at axis scale
-
AXES_INTEGRATIVE_VARIABLES= ['Total_Transpiration']¶ the variables computed by integrating values of axis components parameters/variables recursively
-
AXES_RUN_VARIABLES= ['mstruct', 'senesced_mstruct', 'C_exudated', 'sum_respi_shoot', 'sum_respi_roots', 'Total_Transpiration']¶ all the variables computed during a run step of the simulation at axis scale
-
PHYTOMERS_INDEXES= ['plant', 'axis', 'metamer']¶ the indexes to locate the phytomers in the modeled system
-
PHYTOMERS_T_INDEXES= ['t', 'plant', 'axis', 'metamer']¶ concatenation of
T_INDEXandPHYTOMERS_INDEXES
-
PHYTOMERS_STATE_PARAMETERS= ['mstruct']¶ the parameters which define the state of the modeled system at phytomer scale
-
PHYTOMERS_STATE= ['mstruct']¶ the variables which define the state of the modeled system at phytomer scale, formed be the concatenation of
PHYTOMERS_STATE_PARAMETERSand the names of the compartments associated to each phytomer (seeMODEL_COMPARTMENTS_NAMES)
-
PHYTOMERS_INTERMEDIATE_VARIABLES= []¶ the variables that we need to compute in order to compute fluxes and/or compartments values at phytomer scale
-
PHYTOMERS_FLUXES= []¶ the fluxes exchanged between the compartments at phytomer scale
-
PHYTOMERS_INTEGRATIVE_VARIABLES= []¶ the variables computed by integrating values of phytomer components parameters/variables recursively
-
PHYTOMERS_RUN_VARIABLES= ['mstruct']¶ all the variables computed during a run step of the simulation at phytomer scale
-
ORGANS_INDEXES= ['plant', 'axis', 'organ']¶ the indexes to locate the organs in the modeled system
-
ORGANS_T_INDEXES= ['t', 'plant', 'axis', 'organ']¶ concatenation of
T_INDEXandORGANS_INDEXES
-
ORGANS_STATE_PARAMETERS= ['mstruct', 'Nstruct', 'senesced_mstruct']¶ the parameters which define the state of the modeled system at organ scale
-
ORGANS_STATE= ['mstruct', 'Nstruct', 'senesced_mstruct', 'age_from_flowering', 'amino_acids', 'cytokinins', 'nitrates', 'proteins', 'starch', 'structure', 'sucrose']¶ the variables which define the state of the modeled system at organ scale, formed be the concatenation of
ORGANS_STATE_PARAMETERSand the names of the compartments associated to each organ (seeMODEL_COMPARTMENTS_NAMES)
-
ORGANS_INTERMEDIATE_VARIABLES= ['C_exudation', 'HATS_LATS', 'N_exudation', 'RGR_Structure', 'R_Nnit_red', 'R_Nnit_upt', 'Respi_growth', 'R_grain_growth_starch', 'R_grain_growth_struct', 'R_residual', 'regul_transpiration', 'sum_respi']¶ the variables that we need to compute in order to compute fluxes and/or compartments values at organ scale
-
ORGANS_FLUXES= ['Export_Amino_Acids', 'Export_Nitrates', 'Export_cytokinins', 'S_Amino_Acids', 'S_cytokinins', 'S_grain_starch', 'S_grain_structure', 'S_Proteins', 'Unloading_Amino_Acids', 'Unloading_Sucrose', 'Uptake_Nitrates']¶ the fluxes exchanged between the compartments at organ scale
-
ORGANS_INTEGRATIVE_VARIABLES= ['Total_Organic_Nitrogen']¶ the variables computed by integrating values of organ components parameters/variables recursively
-
ORGANS_RUN_VARIABLES= ['mstruct', 'Nstruct', 'senesced_mstruct', 'age_from_flowering', 'amino_acids', 'cytokinins', 'nitrates', 'proteins', 'starch', 'structure', 'sucrose', 'C_exudation', 'HATS_LATS', 'N_exudation', 'RGR_Structure', 'R_Nnit_red', 'R_Nnit_upt', 'Respi_growth', 'R_grain_growth_starch', 'R_grain_growth_struct', 'R_residual', 'regul_transpiration', 'sum_respi', 'Export_Amino_Acids', 'Export_Nitrates', 'Export_cytokinins', 'S_Amino_Acids', 'S_cytokinins', 'S_grain_starch', 'S_grain_structure', 'S_Proteins', 'Unloading_Amino_Acids', 'Unloading_Sucrose', 'Uptake_Nitrates', 'Total_Organic_Nitrogen']¶ all the variables computed during a run step of the simulation at organ scale
-
HIDDENZONE_INDEXES= ['plant', 'axis', 'metamer']¶ the indexes to locate the hidden zones in the modeled system
-
HIDDENZONE_T_INDEXES= ['t', 'plant', 'axis', 'metamer']¶ concatenation of
T_INDEXandHIDDENZONE_INDEXES
-
HIDDENZONE_STATE_PARAMETERS= ['Nstruct', 'mstruct', 'ratio_DZ']¶ the parameters which define the state of the modeled system at hidden zone scale
-
HIDDENZONE_STATE= ['Nstruct', 'mstruct', 'ratio_DZ', 'amino_acids', 'fructan', 'proteins', 'sucrose']¶ the variables which define the state of the modeled system at hidden zone scale, formed be the concatenation of
HIDDENZONE_STATE_PARAMETERSand the names of the compartments associated to each hidden zone (seeMODEL_COMPARTMENTS_NAMES)
-
HIDDENZONE_INTERMEDIATE_VARIABLES= ['nb_replications']¶ the variables that we need to compute in order to compute fluxes and/or compartments values at hidden zone scale
-
HIDDENZONE_FLUXES= ['D_Fructan', 'D_Proteins', 'S_Fructan', 'S_Proteins', 'Unloading_Amino_Acids', 'Unloading_Sucrose']¶ the fluxes exchanged between the compartments at hidden zone scale
-
HIDDENZONE_INTEGRATIVE_VARIABLES= []¶ the variables computed by integrating values of hidden zone components parameters/variables recursively
-
HIDDENZONE_RUN_VARIABLES= ['Nstruct', 'mstruct', 'ratio_DZ', 'amino_acids', 'fructan', 'proteins', 'sucrose', 'nb_replications', 'D_Fructan', 'D_Proteins', 'S_Fructan', 'S_Proteins', 'Unloading_Amino_Acids', 'Unloading_Sucrose']¶ all the variables computed during a run step of the simulation at plnat scale
-
ELEMENTS_INDEXES= ['plant', 'axis', 'metamer', 'organ', 'element']¶ the indexes to locate the elements in the modeled system
-
ELEMENTS_T_INDEXES= ['t', 'plant', 'axis', 'metamer', 'organ', 'element']¶ concatenation of
T_INDEXandELEMENTS_INDEXES
-
ELEMENTS_STATE_PARAMETERS= ['Ag', 'Nstruct', 'Tr', 'Ts', 'green_area', 'is_growing', 'mstruct', 'senesced_mstruct']¶ the parameters which define the state of the modeled system at element scale
-
ELEMENTS_STATE= ['Ag', 'Nstruct', 'Tr', 'Ts', 'green_area', 'is_growing', 'mstruct', 'senesced_mstruct', 'amino_acids', 'cytokinins', 'fructan', 'nitrates', 'proteins', 'starch', 'sucrose', 'triosesP']¶ the variables which define the state of the modeled system at element scale, formed be the concatenation of
ELEMENTS_STATE_PARAMETERSand the names of the compartments associated to each element (seeMODEL_COMPARTMENTS_NAMES)
-
ELEMENTS_INTERMEDIATE_VARIABLES= ['Photosynthesis', 'R_Nnit_red', 'R_phloem_loading', 'R_residual', 'Transpiration', 'sum_respi', 'nb_replications']¶ the variables that we need to compute in order to compute fluxes and/or compartments values at element scale
-
ELEMENTS_FLUXES= ['Amino_Acids_import', 'D_Fructan', 'D_Proteins', 'D_Starch', 'D_cytokinins', 'Loading_Amino_Acids', 'Loading_Sucrose', 'Nitrates_import', 'Regul_S_Fructan', 'S_Fructan', 'S_Starch', 'S_Sucrose', 'S_Amino_Acids', 'S_Proteins', 'cytokinins_import']¶ the fluxes exchanged between the compartments at element scale
-
ELEMENTS_INTEGRATIVE_VARIABLES= ['Total_Organic_Nitrogen']¶ the variables computed by integrating values of element components parameters/variables recursively
-
ELEMENTS_RUN_VARIABLES= ['Ag', 'Nstruct', 'Tr', 'Ts', 'green_area', 'is_growing', 'mstruct', 'senesced_mstruct', 'amino_acids', 'cytokinins', 'fructan', 'nitrates', 'proteins', 'starch', 'sucrose', 'triosesP', 'Photosynthesis', 'R_Nnit_red', 'R_phloem_loading', 'R_residual', 'Transpiration', 'sum_respi', 'nb_replications', 'Amino_Acids_import', 'D_Fructan', 'D_Proteins', 'D_Starch', 'D_cytokinins', 'Loading_Amino_Acids', 'Loading_Sucrose', 'Nitrates_import', 'Regul_S_Fructan', 'S_Fructan', 'S_Starch', 'S_Sucrose', 'S_Amino_Acids', 'S_Proteins', 'cytokinins_import', 'Total_Organic_Nitrogen']¶ all the variables computed during a run step of the simulation at element scale
-
SOILS_INDEXES= ['plant', 'axis']¶ the indexes to locate the soils in the modeled system
-
SOILS_T_INDEXES= ['t', 'plant', 'axis']¶ concatenation of
T_INDEXandSOILS_INDEXES
-
SOILS_STATE_PARAMETERS= ['Tsoil', 'volume']¶ the parameters which define the state of the modeled system at soil scale
-
SOILS_STATE= ['Tsoil', 'volume', 'nitrates']¶ the variables which define the state of the modeled system at soil scale, formed be the concatenation of
SOILS_STATE_PARAMETERSand the names of the compartments associated to each soil (seeMODEL_COMPARTMENTS_NAMES)
-
SOILS_INTERMEDIATE_VARIABLES= ['Conc_Nitrates_Soil', 'mineralisation']¶ the variables that we need to compute in order to compute fluxes and/or compartments values at soil scale
-
SOILS_FLUXES= []¶ the fluxes exchanged between the compartments at soil scale
-
SOILS_INTEGRATIVE_VARIABLES= []¶ the variables computed by integrating values of soil components parameters/variables recursively
-
SOILS_RUN_VARIABLES= ['Tsoil', 'volume', 'nitrates', 'Conc_Nitrates_Soil', 'mineralisation']¶ all the variables computed during a run step of the simulation at soil scale
-
ALL_STATE_PARAMETERS= {<class 'cnwheat.model.Plant'>: ['Tair'], <class 'cnwheat.model.Axis'>: ['mstruct', 'senesced_mstruct'], <class 'cnwheat.model.Phytomer'>: ['mstruct'], <class 'cnwheat.model.Organ'>: ['mstruct', 'Nstruct', 'senesced_mstruct'], <class 'cnwheat.model.HiddenZone'>: ['Nstruct', 'mstruct', 'ratio_DZ'], <class 'cnwheat.model.PhotosyntheticOrganElement'>: ['Ag', 'Nstruct', 'Tr', 'Ts', 'green_area', 'is_growing', 'mstruct', 'senesced_mstruct'], <class 'cnwheat.model.Soil'>: ['Tsoil', 'volume']}¶ a dictionary of all the variables which define the state of the modeled system, for each scale
-
ROOTS_FORCINGS= ('Nstruct', 'mstruct')¶ the names of the roots (scenescence) forcings
-
ELEMENTS_PHOTOSYNTHESIS_FORCINGS= ('Ag', 'Tr', 'Ts')¶ the names of the elements photosynthesis forcings
-
ELEMENTS_SENESCENCE_FORCINGS= ('Nstruct', 'green_area', 'mstruct')¶ the names of the elements scenescence forcings
-
ELEMENTS_FORCINGS= ('Ag', 'Tr', 'Ts', 'Nstruct', 'green_area', 'mstruct')¶ the names of the elements photosynthesis and scenescence forcings
-
LOGGERS_NAMES= {'compartments': {<class 'cnwheat.model.Plant'>: 'cnwheat.compartments.plants', <class 'cnwheat.model.Axis'>: 'cnwheat.compartments.axes', <class 'cnwheat.model.Phytomer'>: 'cnwheat.compartments.phytomers', <class 'cnwheat.model.Organ'>: 'cnwheat.compartments.organs', <class 'cnwheat.model.HiddenZone'>: 'cnwheat.compartments.hiddenzones', <class 'cnwheat.model.PhotosyntheticOrganElement'>: 'cnwheat.compartments.elements', <class 'cnwheat.model.Soil'>: 'cnwheat.compartments.soils'}, 'derivatives': {<class 'cnwheat.model.Plant'>: 'cnwheat.derivatives.plants', <class 'cnwheat.model.Axis'>: 'cnwheat.derivatives.axes', <class 'cnwheat.model.Phytomer'>: 'cnwheat.derivatives.phytomers', <class 'cnwheat.model.Organ'>: 'cnwheat.derivatives.organs', <class 'cnwheat.model.HiddenZone'>: 'cnwheat.derivatives.hiddenzones', <class 'cnwheat.model.PhotosyntheticOrganElement'>: 'cnwheat.derivatives.elements', <class 'cnwheat.model.Soil'>: 'cnwheat.derivatives.soils'}}¶ the name of the loggers for compartments and derivatives
-
respiration_model= None¶ the model of respiration to use
-
population= None¶ the population to simulate on
-
soils= None¶ The inputs of the soils.
- soils is a dictionary of objects of type
model.Soil: - {(plant_index, axis_label): soil_object, …}
- soils is a dictionary of objects of type
-
initial_conditions= None¶ the initial conditions of the compartments in the population and soils
-
initial_conditions_mapping= None¶ dictionary to map the compartments to their indexes in
initial_conditions
-
progressbar= None¶ progress bar to show the progress of the solver
-
show_progressbar= None¶ True: show the progress bar ; False: DO NOT show the progress bar
-
delta_t= None¶ the delta t of the simulation (in seconds)
-
time_step= None¶ time step of the simulation (in hours)
-
time_grid= None¶ the time grid of the simulation (in hours)
-
culm_density= None¶ culm density (culm m-2)
-
interpolate_forcings= None¶ a boolean flag which indicates if we want to interpolate or not the forcings (True: interpolate, False: do not interpolate)
-
t_offset= None¶ the absolute time offset elapsed from the beginning of the simulation
-
senescence_forcings_delta_t_ratio= None¶ the ratio between the delta t of the senescence forcings and the delta t of the simulation
-
photosynthesis_forcings_delta_t_ratio= None¶ the ratio between the delta t of the photosynthesis forcings and the delta t of the simulation
-
previous_forcings_values= None¶ previous values of the forcings
-
new_forcings_values= None¶ new values of the forcings
-
interpolation_functions= None¶ functions to interpolate the forcings
-
nfev_total= None¶ cumulative number of RHS function evaluations
-
initialize(population, soils, Tair=12, Tsoil=12)[source]¶ - Initialize:
from population and soils.
Parameters: - population (model.Population) – a population of plants.
- soils (dict) – the soil associated to each axis. soils must be a dictionary with the same structure as
soils - Tair (float) – air temperature (°C)
- Tsoil (float) – soil temperature (°C)
- respiration_model (class) –
cnwheat.model module¶
-
class
cnwheat.model.EcophysiologicalConstants[source]¶ Bases:
objectEcophysiological constants.
-
C_MOLAR_MASS= 12¶ Molar mass of carbon (g mol-1)
-
NB_C_TRIOSEP= 3¶ Number of C in 1 mol of trioseP
-
NB_C_HEXOSES= 6¶ Number of C in 1 mol of hexoses (glucose, fructose)
-
NB_C_SUCROSE= 12¶ Number of C in 1 mol of sucrose
-
HEXOSE_MOLAR_MASS_C_RATIO= 0.42¶ Contribution of C in hexose mass
-
TRIOSESP_MOLAR_MASS_C_RATIO= 0.21¶ Contribution of C in triosesP mass
-
RATIO_C_mstruct= 0.44¶ Mean contribution of carbon to structural dry mass (g C g-1 mstruct)
-
AMINO_ACIDS_C_RATIO= 4.15¶ Mean number of mol of C in 1 mol of the major amino acids of plants (Glu, Gln, Ser, Asp, Ala, Gly)
-
AMINO_ACIDS_N_RATIO= 1.25¶ Mean number of mol of N in 1 mol of the major amino acids of plants (Glu, Gln, Ser, Asp, Ala, Gly)
-
PROTEINS_MOLAR_MASS_N_RATIO= 0.151¶ Mean contribution of N in protein mass (Penning De Vries 1989)
-
AMINO_ACIDS_MOLAR_MASS_N_RATIO= 0.135¶ Mean contribution of N in amino acids mass of the major amino acids of plants (Glu, Gln, Ser, Asp, Ala, Gly)
-
NITRATES_MOLAR_MASS_N_RATIO= 0.23¶ Contribution of N in amino acids mass
-
N_MOLAR_MASS= 14¶ Molar mass of nitrogen (g mol-1)
-
AMINO_ACIDS_MOLAR_MASS_C_RATIO= 0.38¶ (Penning De Vries 1989)
-
PROTEINS_MOLAR_MASS_C_RATIO= 0.38¶ As for AA
-
-
class
cnwheat.model.Population(plants=None)[source]¶ Bases:
objectThe class
Populationdefines the CN exchanges at population scale.A
populationmust have at least oneplant.-
PARAMETERS= <cnwheat.parameters.PopulationParameters object>¶ the internal parameters of the population
-
plants= None¶ the list of plants
-
-
class
cnwheat.model.Plant(index=None, axes=None)[source]¶ Bases:
objectThe class
Plantdefines the CN exchanges at plant scale.A
plantmust have at least oneaxis.-
PARAMETERS= <cnwheat.parameters.PlantParameters object>¶ the internal parameters of the plants
-
index= None¶ the index of the plant
-
axes= None¶ the list of axes
-
cohorts= None¶ list of cohort values - Hack to treat tillering cases : TEMPORARY
-
calculate_aggregated_variables()[source]¶ Calculate the integrative variables of the plant recursively.
-
static
calculate_temperature_effect_on_conductivity(Tair)[source]¶ Effect of the temperature on phloeme translocation conductivity (Farrar 1988) Should multiply the rate at 20°C
Parameters: Tair (float) – Air temperature (°C) Returns: Correction to apply to conductivity coefficients. Return type: float
-
-
class
cnwheat.model.Axis(label=None, roots=None, phloem=None, grains=None, phytomers=None, C_exudated=0, sum_respi_shoot=0, sum_respi_roots=0.001)[source]¶ Bases:
objectThe class
Axisdefines the CN exchanges at axis scale.- An
axismust have: - one
set of roots, - one
phloem, - zero or one
set of grains, - at least one
phytomer.
- one
-
PARAMETERS= <cnwheat.parameters.AxisParameters object>¶ the internal parameters of the axes
-
INIT_COMPARTMENTS= <cnwheat.parameters.AxisInitCompartments object>¶ the initial values of compartments and state parameters
-
label= None¶ the label of the axis
-
roots= None¶ the roots
-
phloem= None¶ the phloem
-
grains= None¶ the grains
-
phytomers= None¶ the list of phytomers
-
Total_Transpiration= None¶ the total transpiration (mmol s-1)
-
mstruct= None¶ structural mass of the axis (g)
-
senesced_mstruct= None¶ senesced structural mass of the axis (g)
-
nitrates= None¶ nitrates in the axis (µmol N)
-
calculate_aggregated_variables()[source]¶ Calculate the integrative variables of the axis recursively.
- An
-
class
cnwheat.model.Phytomer(index=None, chaff=None, peduncle=None, lamina=None, internode=None, sheath=None, hiddenzone=None, cohorts=None, cohorts_replications=None)[source]¶ Bases:
objectThe class
Phytomerdefines the CN exchanges at phytomer scale.- A
phytomermust have at least:
-
PARAMETERS= <cnwheat.parameters.PhytomerParameters object>¶ the internal parameters of the phytomers
-
index= None¶ the index of the phytomer
-
chaff= None¶ the chaff
-
peduncle= None¶ the peduncle
-
lamina= None¶ the lamina
-
internode= None¶ the internode
-
sheath= None¶ the sheath
the hidden zone
-
mstruct= None¶ the structural mass of the phytomer (g)
-
senesced_mstruct= None¶ senesced structural mass of the phytomer (g)
-
nitrates= None¶ nitrates of the phytomer (µmol N)
-
cohorts= None¶ list of cohort values - Hack to treat tillering cases : TEMPORARY. Devrait être porté à l’échelle de la plante uniquement mais je ne vois pas comment faire mieux
-
cohorts_replications= None¶ dictionary of number of replications per cohort rank
-
calculate_aggregated_variables()[source]¶ Calculate the integrative variables of the phytomer recursively.
-
nb_replications¶
- A
-
class
cnwheat.model.Organ(label)[source]¶ Bases:
objectThe class
Organdefines the CN exchanges at organ scale.Organis the base class of all organs. DO NOT INSTANTIATE IT.-
label= None¶ the label of the organ
-
-
class
cnwheat.model.HiddenZone(label='hiddenzone', mstruct=6.39e-08, Nstruct=2.06e-09, sucrose=0.001, fructan=0, amino_acids=0.001, proteins=0, ratio_DZ=1, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
cnwheat.model.OrganThe class
HiddenZonedefines the CN exchanges in an hidden zone.-
PARAMETERS= <cnwheat.parameters.HiddenZoneParameters object>¶ the internal parameters of the hidden zone
-
INIT_COMPARTMENTS= <cnwheat.parameters.HiddenZoneInitCompartments object>¶ the initial values of compartments and state parameters
-
cohorts= None¶ list of cohort values - Hack to treat tillering cases : TEMPORARY. Devrait être porté à l’échelle de la plante uniquement mais je ne vois pas comment faire mieux
-
cohorts_replications= None¶ dictionary of number of replications per cohort rank
-
index= None¶ the index of the phytomer TEMPORARY
-
mstruct= None¶ g
-
Nstruct= None¶ g
-
sucrose= None¶ µmol` C
-
fructan= None¶ µmol` C
-
amino_acids= None¶ µmol` N
-
proteins= None¶ µmol` N
-
Unloading_Sucrose= None¶ current Unloading of sucrose from phloem to hiddenzone integrated over delta t (µmol` C)
-
Unloading_Amino_Acids= None¶ current Unloading of amino acids from phloem to hiddenzone integrated over delta t (µmol` N)
-
S_Proteins= None¶ protein synthesis (µmol` N g-1 mstruct)
-
S_Fructan= None¶ fructan synthesis (µmol` C g-1 mstruct)
-
D_Fructan= None¶ fructan degradation (µmol` C g-1 mstruct)
-
D_Proteins= None¶ protein degradation (µmol` N g-1 mstruct)
-
R_residual= None¶ Residual maintenance respiration (cost from protein turn-over, cell ion gradients, futile cycles…) (µmol` C respired)
-
Total_Organic_Nitrogen= None¶ current total nitrogen amount (µmol` N)
-
nb_replications¶
-
calculate_aggregated_variables()[source]¶ Calculate the integrative variables of the organ recursively.
-
static
calculate_Total_Organic_Nitrogen(amino_acids, proteins, Nstruct)[source]¶ Total amount of organic N (amino acids + proteins + Nstruct). Used to calculate residual respiration.
Parameters: Returns: Total amount of organic N (µmol` N)
Return type:
-
calculate_Unloading_Sucrose(sucrose, sucrose_phloem, mstruct_axis, T_effect_conductivity)[source]¶ Rate of sucrose Unloading from phloem to the hidden zone (µmol` C sucrose unloaded h-1). Transport-resistance equation
Parameters: Returns: Rate of Sucrose Unloading (µmol` C h-1)
Return type:
-
calculate_Unloading_Amino_Acids(amino_acids, amino_acids_phloem, mstruct_axis, T_effect_conductivity)[source]¶ Rate of amino acids Unloading from phloem to the hidden zone (µmol` N amino acids unloaded h-1). Transport-resistance equation
Parameters: Returns: Rate of Amino_acids Unloading (µmol` N h-1)
Return type:
-
calculate_S_proteins(amino_acids, T_effect_Vmax)[source]¶ Rate of protein synthesis (µmol` N proteins h-1 g-1 MS). Michaelis-Menten function of amino acids.
Parameters: Returns: Rate of Protein synthesis (µmol` N g-1 mstruct h-1)
Return type:
-
calculate_D_Proteins(proteins, T_effect_Vmax)[source]¶ Rate of protein degradation (µmol` N proteins h-1 g-1 MS). First order kinetic
Parameters: Returns: Rate of Protein degradation (µmol` N g-1 mstruct h-1)
Return type:
-
calculate_Regul_S_Fructan(Unloading_Sucrose)[source]¶ Regulating function for fructan maximal rate of synthesis. Negative regulation by the loading of sucrose from the phloem (“swith-off” sigmoïdal kinetic).
Parameters: Unloading_Sucrose (float) – Sucrose unloading (µmol` C) Returns: Maximal rate of fructan synthesis (µmol` C g-1 mstruct) Return type: float
-
calculate_S_Fructan(sucrose, Regul_S_Fructan, T_effect_Vmax)[source]¶ Rate of fructan synthesis (µmol` C fructan g-1 mstruct h-1). Sigmoïdal function of sucrose.
Parameters: Returns: Rate of Fructan synthesis (µmol` C g-1 mstruct)
Return type:
-
calculate_D_Fructan(sucrose, fructan, T_effect_Vmax)[source]¶ Rate of fructan degradation (µmol` C fructan g-1 mstruct h-1). Inhibition function by the end product i.e. sucrose (Bancal et al., 2012).
Parameters: Returns: Rate of Fructan degradation (µmol` C g-1 mstruct)
Return type:
-
calculate_sucrose_derivative(Unloading_Sucrose, S_Fructan, D_Fructan, hiddenzone_Loading_Sucrose_contribution, R_residual)[source]¶ delta sucrose of hidden zone.
Parameters: - Unloading_Sucrose (float) – Sucrose unloaded (µmol` C)
- S_Fructan (float) – Fructan synthesis (µmol` C g-1 mstruct)
- D_Fructan (float) – Fructan degradation (µmol` C g-1 mstruct)
- hiddenzone_Loading_Sucrose_contribution (float) – Sucrose imported from the emerged tissues (µmol` C)
- R_residual (float) – Residual respiration (µmol` C)
Returns: delta sucrose (µmol` C sucrose)
Return type:
-
calculate_amino_acids_derivative(Unloading_Amino_Acids, S_Proteins, D_Proteins, hiddenzone_Loading_Amino_Acids_contribution)[source]¶ delta amino acids of hidden zone.
Parameters: Returns: delta amino acids (µmol` N amino acids)
Return type:
-
-
class
cnwheat.model.Phloem(label='phloem', sucrose=500, amino_acids=100)[source]¶ Bases:
cnwheat.model.OrganThe class
Phloemdefines the CN exchanges in a phloem.-
PARAMETERS= <cnwheat.parameters.PhloemParameters object>¶ the internal parameters of the phloem
-
INIT_COMPARTMENTS= <cnwheat.parameters.PhloemInitCompartments object>¶ the initial values of compartments and state parameters
-
sucrose= None¶ µmol` C sucrose
-
amino_acids= None¶ µmol` N amino acids
-
-
class
cnwheat.model.Grains(label='grains', age_from_flowering=0, starch=0, structure=1, proteins=0)[source]¶ Bases:
cnwheat.model.OrganThe class
Grainsdefines the CN exchanges in a set of grains.-
AMINO_ACIDS_MOLAR_MASS_N_RATIO= 0.136¶ Mean contribution of N in amino acids mass contained in gluten (Glu, Gln and Pro)
-
PARAMETERS= <cnwheat.parameters.GrainsParameters object>¶ the internal parameters of the grains
-
INIT_COMPARTMENTS= <cnwheat.parameters.GrainsInitCompartments object>¶ the initial values of compartments and state parameters
-
age_from_flowering= None¶ seconds
-
starch= None¶ µmol` of C starch
-
structure= None¶ µmol` of C sucrose
-
proteins= None¶ µmol` of N proteins
-
structural_dry_mass= None¶ g of MS
-
S_grain_structure= None¶ current synthesis of grain structure integrated over a delta t (µmol` C)
-
S_grain_starch= None¶ current synthesis of grain starch integrated over a delta t (µmol` C g-1 mstruct)
-
S_Proteins= None¶ current synthesis of grain proteins integrated over a delta t (µmol` N)
-
RGR_Structure= None¶ RGR of grain structure (dimensionless?)
-
R_grain_growth_struct= None¶ grain struct respiration (µmol` C respired)
-
R_grain_growth_starch= None¶ grain starch growth respiration (µmol` C respired)
-
static
calculate_structural_dry_mass(structure)[source]¶ Grain structural dry mass.
Parameters: structure (float) – Grain structural C mass (µmol` C) Returns: Grain structural dry mass (g) Return type: float
-
static
modified_Arrhenius_equation(temperature)[source]¶ Return value of equation from Johnson and Lewin (1946) for temperature. The equation is modified to return zero below zero degree.
Parameters: temperature (float) – organ temperature (degree Celsius) Returns: Return value of Eyring equation from Johnson and Lewin (1946) for temperature (dimensionless). The equation is modified to return zero below zero degree. Return type: float
-
calculate_temperature_effect_on_growth(Tair)[source]¶ Effect of the temperature on elongation. Return value of equation from Johnson and Lewin (1946) for temperature. The equation is modified to return zero below zero degree. Identical to modified_Arrhenius_equation in ElongWheat. Should multiply the rate at 20°C
Parameters: Tair (float) – Air temperature(°C) Returns: Correction to apply to RGR Structure of the grains (dimensionless) Return type: float
-
static
calculate_RGR_Structure(sucrose_phloem, mstruct_axis, T_effect_growth)[source]¶ Relative Growth Rate of grain structure, regulated by sucrose concentration in phloem.
Parameters: Returns: RGR of grain structure at 20°C (s-1)
Return type:
-
calculate_S_grain_structure(prec_structure, RGR_Structure)[source]¶ Rate of grain structure synthesis (µmol` C structure h-1). Exponential function, RGR regulated by sucrose concentration in the phloem.
Parameters: Returns: Rate of Synthesis of grain structure (µmol` C h-1)
Return type:
-
calculate_S_grain_starch(sucrose_phloem, mstruct_axis, T_effect_Vmax)[source]¶ Rate of starch synthesis in grains (i.e. grain filling) (µmol` C starch g-1 mstruct h-1). Michaelis-Menten function of sucrose concentration in the phloem.
Parameters: Returns: Rate of Synthesis of grain starch (µmol` C g-1 mstruct h-1)
Return type:
-
static
calculate_S_proteins(S_grain_structure, S_grain_starch, amino_acids_phloem, sucrose_phloem, structural_dry_mass)[source]¶ Protein synthesis in grains. N is assumed to be co-transported along with the unloaded sucrose from phloem (using the ratio amino acids:sucrose of phloem).
Parameters: - S_grain_structure (float) – Synthesis of grain structure (µmol` C)
- S_grain_starch (float) – Synthesis of grain starch (µmol` C g-1 mstruct)
- amino_acids_phloem (float) – Amino acids concentration in phloem (µmol` N g-1 mstruct)
- sucrose_phloem (float) – Sucrose concentration in phloem (µmol` C g-1 mstruct)
- structural_dry_mass (float) – Grain structural dry mass (g)
Returns: Synthesis of grain proteins (µmol` N)
Return type:
-
static
calculate_structure_derivative(S_grain_structure, R_growth)[source]¶ delta grain structure.
Parameters: Returns: delta grain structure (µmol` C structure)
Return type:
-
-
class
cnwheat.model.Roots(label='roots', mstruct=0.15, senesced_mstruct=0, Nstruct=0.0045, sucrose=0, nitrates=0, amino_acids=0, cytokinins=0)[source]¶ Bases:
cnwheat.model.OrganThe class
Rootsdefines the CN exchanges in a set of roots.-
PARAMETERS= <cnwheat.parameters.RootsParameters object>¶ the internal parameters of the roots
-
INIT_COMPARTMENTS= <cnwheat.parameters.RootsInitCompartments object>¶ the initial values of compartments and state parameters
-
mstruct= None¶ Structural mass (g)
-
senesced_mstruct= None¶ Senesced structural mass (g)
-
Nstruct= None¶ Structural N mass (g)
-
sucrose= None¶ µmol` C sucrose
-
nitrates= None¶ µmol` N nitrates
-
amino_acids= None¶ µmol` N amino acids
-
cytokinins= None¶ AU cytokinins
-
Unloading_Sucrose= None¶ current Unloading of sucrose from phloem to roots
-
Unloading_Amino_Acids= None¶ current Unloading of amino acids from phloem to roots
-
Export_Nitrates= None¶ Total export of nitrates from roots to shoot organs integrated over a delta t (µmol` N)
-
Export_Amino_Acids= None¶ Total export of amino acids from roots to shoot organs integrated over a delta t (µmol` N)
-
S_Amino_Acids= None¶ Rate of amino acid synthesis in roots integrated over a delta t (µmol` N g-1 mstruct)
-
Uptake_Nitrates= None¶ Rate of nitrate uptake by roots integrated over a delta t (µmol` N nitrates)
-
S_cytokinins= None¶ Rate of cytokinin synthesis integrated over a delta t (AU g-1 mstruct)
-
Export_cytokinins= None¶ Total export of cytokinin from roots to shoot organs integrated over a delta t (AU)
-
Total_Organic_Nitrogen= None¶ current amount of organic N (µmol` N)
-
R_Nnit_upt= None¶ Nitrate uptake respiration (µmol` C respired)
-
R_Nnit_red= None¶ Nitrate reduction-linked respiration (µmol` C respired)
-
R_residual= None¶ Residual maintenance respiration (cost from protein turn-over, cell ion gradients, futile cycles…) (µmol` C respired)
-
C_exudation= None¶ C sucrose lost by root exudation integrated over a delta t (µmol` C g-1 mstruct)
-
N_exudation= None¶ N amino acids lost by root exudation integrated over a delta t (µmol` N g-1 mstruct)
-
regul_transpiration= None¶ Dimensionless regulating factor of metabolite exports from roots by shoot transpiration
-
HATS_LATS= None¶ Nitrate influx (µmol` N)
-
sum_respi= None¶ Sum of respirations for roots i.e. related to N uptake, amino acids synthesis and residual (µmol` C)
-
calculate_aggregated_variables()[source]¶ Calculate the integrative variables of the organ recursively.
-
static
calculate_Total_Organic_Nitrogen(amino_acids, Nstruct)[source]¶ Total amount of organic N (amino acids + Nstruct). Used to calculate residual respiration.
Parameters: Returns: Total amount of organic N (µmol` N)
Return type:
-
static
calculate_regul_transpiration(total_transpiration)[source]¶ A function to regulate metabolite exports from roots by shoot transpiration
Parameters: total_transpiration (float) – Total transpiration (mmol s-1) Returns: Dimensionless regulating factor Return type: float
-
calculate_Unloading_Sucrose(sucrose_roots, sucrose_phloem, mstruct_axis, T_effect_conductivity)[source]¶ Rate of sucrose Unloading from phloem to roots (µmol` C sucrose unloaded g-1 mstruct h-1).
Parameters: Returns: Rate of Sucrose Unloading (µmol` C g-1 mstruct h-1)
Return type:
-
static
calculate_Unloading_Amino_Acids(Unloading_Sucrose, sucrose_phloem, amino_acids_phloem)[source]¶ Unloading of amino_acids from phloem to roots. Amino acids are assumed to be co-transported along with the unloaded sucrose from phloem (using the ratio amino acids:sucrose of phloem).
Parameters: Returns: Amino acids Unloading (µmol` N g-1 mstruct)
Return type:
-
calculate_Uptake_Nitrates(Conc_Nitrates_Soil, nitrates_roots, sucrose_roots, T_effect_Vmax)[source]¶ - Rate of nitrate uptake by roots
- Nitrate uptake is calculated as the sum of the 2 transport systems: HATS and LATS
- HATS and LATS parameters are calculated as a function of root nitrate concentration (negative regulation)
- Nitrate uptake is finally regulated by the total culm transpiration and sucrose concentration (positive regulation)
Parameters: Returns: Nitrate uptake (µmol` N nitrates) and nitrate influxes HATS and LATS (µmol` N h-1)
Return type:
-
calculate_S_amino_acids(nitrates, sucrose, T_effect_Vmax)[source]¶ Rate of amino acid synthesis in roots (µmol` N amino acids g-1 mstruct h-1). Bi-substrate Michaelis-Menten function of nitrates and sucrose.
Parameters: Returns: Amino acids synthesis (µmol` N g-1 mstruct h-1)
Return type:
-
calculate_Export_Nitrates(nitrates, regul_transpiration)[source]¶ Total export of nitrates from roots to shoot organs Export is calculated as a function on nitrate concentration and culm transpiration.
Parameters: Returns: Rate of Export of nitrates (µmol` N h-1)
Return type:
-
calculate_Export_Amino_Acids(amino_acids, regul_transpiration)[source]¶ Total export of amino acids from roots to shoot organs Amino acids export is calculated as a function of nitrate export using the ratio amino acids:nitrates in roots.
Parameters: Returns: Rate of Export of amino acids (µmol` N h-1)
Returns Type:
-
static
calculate_exudation(Unloading_Sucrose, sucrose_roots, amino_acids_roots, amino_acids_phloem)[source]¶ - C sucrose and N amino acids lost by root exudation (µmol` C or N g-1 mstruct).
- C exudation is calculated as a fraction of C Unloading from phloem
- N exudation is calculated from C exudation using the ratio amino acids:sucrose of the phloem
Parameters: Returns: Rates of C exudated (µmol` C g-1 mstruct h-1) and N_exudation (µmol` N g-1 mstruct h-1)
Return type:
-
calculate_S_cytokinins(sucrose_roots, nitrates_roots, T_effect_Vmax)[source]¶ Rate of cytokinin synthesis (AU cytokinins g-1 mstruct h-1). Cytokinin synthesis regulated by both root sucrose and nitrates. As a signal molecule, cytokinins are assumed have a neglected effect on sucrose. Thus, no cost in C is applied to the sucrose pool.
Parameters: Returns: Rate of Cytokinin synthesis (AU g-1 mstruct h-1)
Return type:
-
calculate_Export_cytokinins(cytokinins, regul_transpiration)[source]¶ Total export of cytokinin from roots to shoot organs Cytokinin export is calculated as a function of cytokinin concentration and culm transpiration.
Parameters: Returns: Rate of Cytokinin export (AU h-1)
Return type:
-
calculate_sucrose_derivative(Unloading_Sucrose, S_Amino_Acids, C_exudation, sum_respi)[source]¶ delta root sucrose.
Parameters: - Unloading_Sucrose (float) – Sucrose Unloading (µmol` C g-1 mstruct)
- S_Amino_Acids (float) – Amino acids synthesis (µmol` N g-1 mstruct)
- C_exudation (float) – C exudation (µmol` C g-1 mstruct)
- sum_respi (float) – Sum of respirations for roots i.e. related to N uptake, amino acids synthesis and residual (µmol` C)
Returns: delta root sucrose (µmol` C sucrose)
Return type:
-
calculate_nitrates_derivative(Uptake_Nitrates, Export_Nitrates, S_Amino_Acids)[source]¶ delta root nitrates.
Parameters: Returns: delta root nitrates (µmol` N nitrates)
Return type:
-
-
class
cnwheat.model.PhotosyntheticOrgan(label, exposed_element, enclosed_element)[source]¶ Bases:
cnwheat.model.OrganThe class
PhotosyntheticOrgandefines the CN exchanges in a photosynthetic organ.A
photosynthetic organmust have at least 1photosynthetic organ element:chaff element,lamina element,internode element,peduncle element, orsheath element.PhotosyntheticOrganis the base class of all photosynthetic organs. DO NOT INSTANTIATE IT.-
PARAMETERS= <cnwheat.parameters.PhotosyntheticOrganParameters object>¶ the internal parameters of the photosynthetic organs
-
exposed_element= None¶ the exposed element
-
enclosed_element= None¶ the enclosed element
-
mstruct= None¶ the structural dry mass
-
senesced_mstruct= None¶ senesced structural dry mass
-
nitrates= None¶ nitrates (µmol N)
-
-
class
cnwheat.model.Chaff(label=None, exposed_element=None, enclosed_element=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganThe class
Chaffdefines the CN exchanges in a chaff.-
PARAMETERS= <cnwheat.parameters.ChaffParameters object>¶ the internal parameters of the chaffs
-
-
class
cnwheat.model.Lamina(label=None, exposed_element=None, enclosed_element=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganThe class
Laminadefines the CN exchanges in a lamina.-
PARAMETERS= <cnwheat.parameters.LaminaParameters object>¶ the internal parameters of the laminae
-
-
class
cnwheat.model.Internode(label=None, exposed_element=None, enclosed_element=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganThe class
Internodedefines the CN exchanges in an internode.-
PARAMETERS= <cnwheat.parameters.InternodeParameters object>¶ the internal parameters of the internodes
-
-
class
cnwheat.model.Peduncle(label=None, exposed_element=None, enclosed_element=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganThe class
Peduncledefines the CN exchanges in a peduncle.-
PARAMETERS= <cnwheat.parameters.PeduncleParameters object>¶ the internal parameters of the peduncles
-
-
class
cnwheat.model.Sheath(label=None, exposed_element=None, enclosed_element=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganThe class
Sheathdefines the CN exchanges in a sheath.-
PARAMETERS= <cnwheat.parameters.SheathParameters object>¶ the internal parameters of the sheaths
-
-
class
cnwheat.model.PhotosyntheticOrganElement(label=None, green_area=0.0001, mstruct=0.005, senesced_mstruct=0, Nstruct=0.001, triosesP=0, starch=0, sucrose=0, fructan=0, nitrates=0, amino_acids=0, proteins=0, cytokinins=0, Tr=0, Ag=0, Ts=12, is_growing=False, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
objectThe class
PhotosyntheticOrganElementdefines the CN exchanges in a photosynthetic organ element.An element must belong to an organ of the same type (e.g. a class:LaminaElement must belong to a class:Lamina).
PhotosyntheticOrganElementis the base class of all photosynthetic organs elements. DO NOT INSTANTIATE IT.-
PARAMETERS= <cnwheat.parameters.PhotosyntheticOrganElementParameters object>¶ the internal parameters of the photosynthetic organs elements
-
INIT_COMPARTMENTS= <cnwheat.parameters.PhotosyntheticOrganElementInitCompartments object>¶ the initial values of compartments and state parameters
-
label= None¶ the label of the element
-
cohorts= None¶ list of cohort values - Hack to treat tillering cases : TEMPORARY. Devrait être porté à l’échelle de la plante uniquement mais je ne vois pas comment faire mieux
-
cohorts_replications= None¶ dictionary of number of replications per cohort rank
-
index= None¶ the index of the phytomer TEMPORARY
-
mstruct= None¶ Structural dry mass (g)
-
senesced_mstruct= None¶ Senesced structural dry mass (g)
-
Nstruct= None¶ Structural N mass (g)
-
green_area= None¶ green area (m-2)
-
Tr= None¶ Transpiration rate (mmol m-2 s-1)
-
Ag= None¶ Gross assimilation (µmol` m-2 s-1)
-
Ts= None¶ Organ temperature (°C)
-
triosesP= None¶ µmol` C
-
starch= None¶ µmol` C
-
sucrose= None¶ µmol` C
-
fructan= None¶ µmol` C
-
nitrates= None¶ µmol` N
-
amino_acids= None¶ µmol` N
-
proteins= None¶ µmol` N
-
cytokinins= None¶ AU
-
Loading_Sucrose= None¶ Rate of sucrose loading to phloem (µmol` C)
-
Loading_Amino_Acids= None¶ Rate of amino acids loading to phloem (µmol` N)
-
S_Proteins= None¶ Rate of protein synthesis (µmol` N g-1 mstruct)
-
S_Amino_Acids= None¶ Rate of amino acids synthesis (µmol` N g-1 mstruct)
-
Regul_S_Fructan= None¶ Maximal rate of fructan synthesis (µmol` C g-1 mstruct)
-
S_Starch= None¶ Rate of starch synthesis (µmol` C g-1 mstruct)
-
D_Starch= None¶ Rate of starch degradation (µmol` C g-1 mstruct)
-
S_Sucrose= None¶ Rate of sucrose synthesis (µmol` C g-1 mstruct)
-
S_Fructan= None¶ Rate of fructan synthesis (µmol` C g-1 mstruct)
-
D_Fructan= None¶ Rate of fructan degradation ((µmol` C g-1 mstruct)
-
Nitrates_import= None¶ Total nitrates imported from roots (µmol` N nitrates)
-
Amino_Acids_import= None¶ Total amino acids imported from roots (µmol` N amino acids)
-
D_Proteins= None¶ Rate of protein degradation (µmol` N g-1 mstruct)
-
cytokinins_import= None¶ Import of cytokinins (AU)
-
D_cytokinins= None¶ Rate of cytokinins degradation (AU g-1 mstruct)
-
Total_Organic_Nitrogen= None¶ current total nitrogen amount (µmol` N)
-
R_Nnit_red= None¶ Nitrate reduction-linked respiration (µmol` C respired)
-
R_residual= None¶ Residual maintenance respiration (cost from protein turn-over, cell ion gradients, futile cycles…) (µmol` C respired)
-
Transpiration= None¶ Surfacic transpiration rate of an element (mmol H2O s-1)
-
R_phloem_loading= None¶ Phloem loading respiration (µmol` C respired)
-
Photosynthesis= None¶ Total Photosynthesis of an element integrated over a delta t (µmol` C)
-
sum_respi= None¶ Sum of respirations for the element i.e. related to C loading to phloem, amino acids synthesis and residual (µmol` C)
-
nb_replications¶
-
static
calculate_total_Photosynthesis(Ag, green_area)[source]¶ Total Photosynthesis of an element (µmol` C m-2 h-1 * m2).
Parameters: Returns: Rate of Total Photosynthesis (µmol` C h-1)
Return type:
-
static
calculate_Total_Transpiration(Tr, green_area)[source]¶ Surfacic transpiration rate of an element
Parameters: Returns: Total transpiration (mmol H2O s-1)
Return type:
-
calculate_Regul_S_Fructan(Loading_Sucrose)[source]¶ Regulating function for fructan maximal rate of synthesis. Negative regulation by the loading of sucrose from the phloem (“swith-off” sigmoïdal kinetic).
Parameters: Loading_Sucrose (float) – Sucrose loading (µmol` C) Returns: Maximal rate of fructan synthesis (µmol` C g-1 mstruct h-1) Return type: float
-
static
calculate_Total_Organic_Nitrogen(amino_acids, proteins, Nstruct)[source]¶ Total amount of organic N (amino acids + proteins + Nstruct). Used to calculate residual respiration.
Parameters: Returns: Total amount of organic N (µmol` N)
Return type:
-
calculate_S_Starch(triosesP, T_effect_Vmax)[source]¶ Rate of starch synthesis (µmol` C starch g-1 mstruct h-1). Michaelis-Menten function of triose phosphates.
Parameters: Returns: Rate of Starch synthesis (µmol` C g-1 mstruct h-1)
Return type:
-
calculate_D_Starch(starch, T_effect_Vmax)[source]¶ Rate of starch degradation (µmol` C starch g-1 mstruct h-1). First order kinetic.
Parameters: Returns: Starch degradation (µmol` C g-1 mstruct h-1)
Return type:
-
calculate_S_Sucrose(triosesP, T_effect_Vmax)[source]¶ Rate of sucrose synthesis (µmol` C sucrose g-1 mstruct h-1). Michaelis-Menten function of triose phosphates.
Parameters: Returns: Rate of Sucrose synthesis (µmol` C g-1 mstruct h-1)
Return type:
-
calculate_Loading_Sucrose(sucrose, sucrose_phloem, mstruct_axis, T_effect_conductivity)[source]¶ Rate of sucrose loading to phloem (µmol` C sucrose h-1). Transport-resistance model.
Parameters: Returns: Rate of Sucrose loading (µmol` C h-1)
Return type:
-
calculate_export_sucrose(sucrose, sucrose_hiddenzone, mstruct_hiddenzone, T_effect_conductivity)[source]¶ Rate of sucrose exportation to hidden zone (µmol` C sucrose h-1). Transport-resistance model.
Parameters: Returns: Rate of Sucrose export (µmol` C h-1)
Return type:
-
calculate_S_Fructan(sucrose, Regul_S_Fructan, T_effect_Vmax)[source]¶ Rate of fructan synthesis (µmol` C fructan g-1 mstruct h-1). Sigmoïdal function of sucrose.
Parameters: Returns: Rate of Fructan synthesis (µmol` C g-1 mstruct h-1)
Return type:
-
calculate_D_Fructan(sucrose, fructan, T_effect_Vmax)[source]¶ Rate of fructan degradation (µmol` C fructan g-1 mstruct h-1). Inhibition function by the end product i.e. sucrose (Bancal et al., 2012).
Parameters: Returns: Rate of Fructan degradation (µmol` C g-1 mstruct h-1)
Return type:
-
static
calculate_Nitrates_import(Export_Nitrates, element_transpiration, Total_Transpiration)[source]¶ Total nitrates imported from roots (µmol` N nitrates). Nitrates coming from roots (fraction of uptake + direct export) are distributed according to the contribution of the element to culm transpiration.
Parameters: Returns: Total nitrates import (µmol` N nitrates)
Return type:
-
static
calculate_Amino_Acids_import(roots_exported_amino_acids, element_transpiration, Total_Transpiration)[source]¶ Total amino acids imported from roots (µmol` N amino acids). Amino acids exported by roots are distributed according to the contribution of the element to culm transpiration.
Parameters: Returns: Total amino acids import (µmol` N amino acids)
Return type:
-
calculate_S_amino_acids(nitrates, triosesP, T_effect_Vmax)[source]¶ Rate of amino acids synthesis (µmol` N amino acids h-1 g-1 MS). Bi-substrate Michaelis-Menten function of nitrates and triose phosphates.
Parameters: Returns: Rate of Amino acids synthesis (µmol` N h-1 g-1 mstruct)
Return type:
-
calculate_S_proteins(amino_acids, T_effect_Vmax)[source]¶ Rate of protein synthesis (µmol` N proteins h-1 g-1 MS). Michaelis-Menten function of amino acids.
Parameters: Returns: Protein synthesis (µmol` N h-1 g-1 mstruct)
Return type:
-
calculate_D_Proteins(proteins, cytokinins, T_effect_Vmax)[source]¶ Rate of protein degradation (µmol` N proteins s-1 g-1 MS h-1). First order kinetic regulated by cytokinins concentration.
Parameters: Returns: Rate of protein degradation (µmol` N g-1 mstruct)
Return type:
-
calculate_Loading_Amino_Acids(amino_acids, amino_acids_phloem, mstruct_axis, T_effect_conductivity)[source]¶ Rate of amino acids loading to phloem (µmol` N amino acids h-1). Transport-resistance model.
Parameters: Returns: Amino acids loading (µmol` N h-1)
Return type:
-
calculate_Export_Amino_Acids(amino_acids, amino_acids_hiddenzone, mstruct_hiddenzone, T_effect_conductivity)[source]¶ Rate of amino acids exportation to hidden zone (µmol` N amino acids h-1). Transport-resistance model.
Parameters: - amino_acids (float) – Amount of amino acids in the element (µmol` N)
- amino_acids_hiddenzone (float) – Amino acids amount in the hidden zone (µmol` N)
- mstruct_hiddenzone (float) – mstruct of the hidden zone (g)
- T_effect_conductivity (float) – Effect of the temperature on the conductivity rate at 20°C (AU)
Returns: Rate of Amino acids export (µmol` N h-1)
Return type:
-
static
calculate_cytokinins_import(roots_exporteD_cytokinins, element_transpiration, Total_Transpiration)[source]¶ Import of cytokinins (AU). Cytokinin exported by roots are distributed according to the contribution of the element to culm transpiration.
Parameters: Returns: Cytokinin import (AU)
Return type:
-
calculate_D_cytokinins(cytokinins, T_effect_Vmax)[source]¶ Rate of cytokinins degradation (AU g-1 mstruct h-1). First order kinetic. Vary with organ temperature.
Parameters: Returns: Rate of Cytokinin degradation (AU g-1 mstruct h-1)
Return type:
-
calculate_triosesP_derivative(Photosynthesis, S_Sucrose, S_Starch, S_Amino_Acids)[source]¶ delta triose phosphates of element.
Parameters: Returns: delta triose phosphates (µmol` C triose phosphates)
Return type:
-
calculate_starch_derivative(S_Starch, D_Starch)[source]¶ delta starch of element.
Parameters: Returns: delta starch (µmol` C starch)
Return type:
-
calculate_sucrose_derivative(S_Sucrose, D_Starch, Loading_Sucrose, S_Fructan, D_Fructan, sum_respi)[source]¶ delta sucrose of element.
Parameters: - S_Sucrose (float) – Sucrose synthesis (µmol` C g-1 mstruct)
- D_Starch (float) – Starch degradation (µmol` C g-1 mstruct)
- Loading_Sucrose (float) – Sucrose loading (µmol` C)
- S_Fructan (float) – Fructan synthesis (µmol` C g-1 mstruct)
- D_Fructan (float) – Fructan degradation (µmol` C g-1 mstruct)
- sum_respi (float) – Sum of respirations for the element i.e. related to C loading to phloem, amino acids synthesis and residual (µmol` C)
Returns: delta sucrose (µmol` C sucrose)
Return type:
-
calculate_fructan_derivative(S_Fructan, D_Fructan)[source]¶ delta fructan of element.
Parameters: Returns: delta fructan (µmol` C fructan)
Return type:
-
calculate_nitrates_derivative(Nitrates_import, S_Amino_Acids)[source]¶ delta nitrates of element.
Parameters: Returns: delta nitrates (µmol` N nitrates)
Return type:
-
calculate_amino_acids_derivative(Amino_Acids_import, S_Amino_Acids, S_Proteins, D_Proteins, Loading_Amino_Acids)[source]¶ delta amino acids of element.
Parameters: - Amino_Acids_import (float) – Amino acids import from roots (µmol` N)
- S_Amino_Acids (float) – Amino acids synthesis (µmol` N g-1 mstruct)
- S_Proteins (float) – Protein synthesis (µmol` N g-1 mstruct)
- D_Proteins (float) – Protein degradation (µmol` N g-1 mstruct)
- Loading_Amino_Acids (float) – Amino acids loading (µmol` N)
Returns: delta amino acids (µmol` N amino acids)
Return type:
-
-
class
cnwheat.model.ChaffElement(label=None, green_area=0.0001, mstruct=0.005, senesced_mstruct=0, Nstruct=0.001, triosesP=0, starch=0, sucrose=0, fructan=0, nitrates=0, amino_acids=0, proteins=0, cytokinins=0, Tr=0, Ag=0, Ts=12, is_growing=False, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganElementThe class
ChaffElementdefines the CN exchanges in a chaff element.-
PARAMETERS= <cnwheat.parameters.ChaffElementParameters object>¶ the internal parameters of the chaffs elements
-
-
class
cnwheat.model.LaminaElement(label=None, green_area=0.0001, mstruct=0.005, senesced_mstruct=0, Nstruct=0.001, triosesP=0, starch=0, sucrose=0, fructan=0, nitrates=0, amino_acids=0, proteins=0, cytokinins=0, Tr=0, Ag=0, Ts=12, is_growing=False, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganElementThe class
LaminaElementdefines the CN exchanges in a lamina element.-
PARAMETERS= <cnwheat.parameters.LaminaElementParameters object>¶ the internal parameters of the laminae elements
-
-
class
cnwheat.model.InternodeElement(label=None, green_area=0.0001, mstruct=0.005, senesced_mstruct=0, Nstruct=0.001, triosesP=0, starch=0, sucrose=0, fructan=0, nitrates=0, amino_acids=0, proteins=0, cytokinins=0, Tr=0, Ag=0, Ts=12, is_growing=False, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganElementThe class
InternodeElementdefines the CN exchanges in an internode element.-
PARAMETERS= <cnwheat.parameters.InternodeElementParameters object>¶ the internal parameters of the internodes elements
-
-
class
cnwheat.model.PeduncleElement(label=None, green_area=0.0001, mstruct=0.005, senesced_mstruct=0, Nstruct=0.001, triosesP=0, starch=0, sucrose=0, fructan=0, nitrates=0, amino_acids=0, proteins=0, cytokinins=0, Tr=0, Ag=0, Ts=12, is_growing=False, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganElementThe class
PeduncleElementdefines the CN exchanges in a peduncle element.-
PARAMETERS= <cnwheat.parameters.PeduncleElementParameters object>¶ the internal parameters of the peduncles elements
-
-
class
cnwheat.model.SheathElement(label=None, green_area=0.0001, mstruct=0.005, senesced_mstruct=0, Nstruct=0.001, triosesP=0, starch=0, sucrose=0, fructan=0, nitrates=0, amino_acids=0, proteins=0, cytokinins=0, Tr=0, Ag=0, Ts=12, is_growing=False, cohorts=None, cohorts_replications=None, index=None)[source]¶ Bases:
cnwheat.model.PhotosyntheticOrganElementThe class
SheathElementdefines the CN exchanges in a sheath element.-
PARAMETERS= <cnwheat.parameters.SheathElementParameters object>¶ the internal parameters of the sheaths elements
-
-
class
cnwheat.model.Soil(volume=None, nitrates=None, Tsoil=None)[source]¶ Bases:
objectThe class
Soildefines the amount of nitrogen in the volume of soil explored by roots.-
PARAMETERS= <cnwheat.parameters.SoilParameters object>¶ the internal parameters of the soil
-
volume= None¶ volume of soil explored by roots (m3)
-
Tsoil= None¶ soil temperature (°C)
-
constant_Conc_Nitrates= None¶ If True, the model run with a constant soil nitrate concentration (bool)
-
nitrates= None¶ µmol` N nitrates
-
Conc_Nitrates_Soil= None¶ soil nitrate concentration Unloading (µmol` N m-3 soil)
-
mineralisation= None¶ mineralisation on organic N into nitrates in soil (µmol`)
-
static
calculate_temperature_effect_on_Vmax(Tsoil)[source]¶ Effect of the temperature on maximal enzyme activity Should multiply the rate at 20°C
Parameters: Tsoil (float) – Soil temperature (°C) Returns: Correction to apply to enzyme activity Return type: float
-
static
calculate_temperature_effect_on_conductivity(Tsoil)[source]¶ Effect of the temperature on phloeme translocation conductivity (Farrar 1988) Should multiply the rate at 20°C
Parameters: Tsoil (float) – Soil temperature (°C) Returns: Correction to apply to conductivity coefficients. Return type: float
-
calculate_Conc_Nitrates(nitrates)[source]¶ Nitrate concentration in soil.
Parameters: nitrates (float) – Amount of nitrates (µmol` N) Returns: Nitrate concentration (µmol` nitrates m-3) Return type: float
-
static
calculate_mineralisation(T_effect_Vmax)[source]¶ Mineralisation on organic N into nitrates in soil.
Parameters: T_effect_Vmax (float) – Correction to apply to enzyme activity Returns: Rate of Nitrate mineralisation (µmol` h-1) Return type: float
-
static
calculate_nitrates_derivative(mineralisation, soil_contributors, culm_density, constant_Conc_Nitrates)[source]¶ delta soil nitrates.
Parameters: - mineralisation (float) – N mineralisation in soil (µmol` m-2 N nitrates)
- int) soil_contributors ((float,) – A tuple with (Nitrate uptake per axis (µmol` N nitrates), the plant id)
- [plant_id, culm_density] culm_density (dict) – A dictionary of culm density (culm_density = {plant_id: culm_density, …})
- constant_Conc_Nitrates (bool) – If True, the model run with a constant soil nitrate concentration.
Returns: delta nitrates (µmol` N nitrates)
Return type:
-
cnwheat.parameters module¶
-
cnwheat.parameters.from_dataframe(object_, dataframe_)[source]¶ Set attributes of object_ from data in dataframe_.
Parameters: object_ (
object) - The object to set.dataframe_ (
pandas.DataFrame) - The dataframe used to set the attribute(s) of object_. dataframe_ must have only 2 rows:- one row is for the header and contains the name of each attribute,
- and one row contains the value of each attribute.
-
cnwheat.parameters.to_dataframe(object_)[source]¶ Create and return a dataframe from attributes of object_.
Parameters: - object_ (
object) - The object used to create the dataframe.
Returns: A dataframe which contains the attributes of object_, with only 2 rows:
- one row is for the header and contains the name of each attribute,
- and one row contains the value of each attribute.
Returns Type: - object_ (
-
class
cnwheat.parameters.PopulationParameters[source]¶ Bases:
objectInternal parameters of populations.
-
cnwheat.parameters.POPULATION_PARAMETERS= <cnwheat.parameters.PopulationParameters object>¶ The instance of class
cnwheat.parameters.PopulationParametersfor current process
-
cnwheat.parameters.PLANT_PARAMETERS= <cnwheat.parameters.PlantParameters object>¶ The instance of class
cnwheat.parameters.PlantParametersfor current process
-
class
cnwheat.parameters.AxisParameters[source]¶ Bases:
objectInternal parameters of axes.
-
ALPHA= None¶ Proportion of the structural mass containing the substrates
-
-
cnwheat.parameters.AXIS_PARAMETERS= <cnwheat.parameters.AxisParameters object>¶ The instance of class
cnwheat.parameters.AxisParametersfor current process
-
class
cnwheat.parameters.AxisInitCompartments[source]¶ Bases:
objectInitial values for compartments of axis.
-
C_exudated= None¶ initial value of C exudated by the roots (\(\mu\) mol C)
-
sum_respi_shoot= None¶ initial value of C respired by the shoot (exept leaf and internode growth respiration) (\(\mu\) mol C)
-
sum_respi_roots= None¶ initial value of C respired by the roots (exept root growth respiration) (\(\mu\) mol C)
-
-
cnwheat.parameters.AXIS_INIT_COMPARTMENTS= <cnwheat.parameters.AxisInitCompartments object>¶ The instance of class
cnwheat.parameters.HiddenZoneInitCompartmentsfor current process
-
class
cnwheat.parameters.PhytomerParameters[source]¶ Bases:
objectInternal parameters of phytomers.
-
cnwheat.parameters.PHYTOMER_PARAMETERS= <cnwheat.parameters.PhytomerParameters object>¶ The instance of class
cnwheat.parameters.PhytomerParametersfor current process
-
class
cnwheat.parameters.HiddenZoneParameters[source]¶ Bases:
objectInternal parameters of hidden growing zones.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
BETA= None¶ Kind of volumetric mass density at power -2/3 ((g m-3)**(-2/3))
-
SIGMA= None¶ Coefficient of surface diffusion. Used in Fick’s law (g m-2 s-1).
-
VMAX_SFRUCTAN_POT= None¶ Potential maximal rate of fructan synthesis (\(\mu\) mol C s-1 g-1 MS)
-
VMAX_SFRUCTAN_RELATIVE= None¶ Maximal rate of fructan synthesis in the division zone relative to the rate in mature tissus (\(\mu\) mol C s-1 g-1 MS)
-
K_SFRUCTAN= None¶ Affinity coefficient of fructan synthesis (\(\mu\) mol C g-1 MS)
-
K_REGUL_SFRUCTAN= None¶ Affinity coefficient of the regulation function of fructan synthesis (\(\mu\) mol g-1 MS)
-
N_REGUL_SFRUCTAN= None¶ Parameter of the regulation function of fructan synthesis (dimensionless)
-
VMAX_DFRUCTAN= None¶ Maximal rate of fructan degradation (\(\mu\) mol C s-1 g-1 MS)
-
K_DFRUCTAN= None¶ Affinity coefficient of fructan degradation (\(\mu\) mol C g-1 MS)
-
delta_Dproteins= None¶ Relative rate of proteins degradation (s-1)
-
VMAX_SPROTEINS_DZ= None¶ Maximal rate of protein synthesis in the division zone (\(\mu\) mol N s-1 g-1 MS)
-
VMAX_SPROTEINS_EMZ= None¶ Maximal rate of protein synthesis in the elongation and mature zones (\(\mu\) mol N s-1 g-1 MS)
-
K_SPROTEINS= None¶ Affinity coefficient of protein synthesis (\(\mu\) mol N g-1 MS)
-
-
cnwheat.parameters.HIDDEN_ZONE_PARAMETERS= <cnwheat.parameters.HiddenZoneParameters object>¶ The instance of class
cnwheat.parameters.HiddenZoneParametersfor current process
-
class
cnwheat.parameters.HiddenZoneInitCompartments[source]¶ Bases:
objectInitial values for compartments of hidden zones.
-
sucrose= None¶ initial value of sucrose (\(\mu\) mol C)
-
fructan= None¶ initial value of fructan (\(\mu\) mol C)
-
amino_acids= None¶ initial value of amino_acids (\(\mu\) mol N)
-
proteins= None¶ initial value of proteins (\(\mu\) mol N)
-
mstruct= None¶ initial value of mstruct (g)
-
Nstruct= None¶ initial value of Nstruct (g)
-
ratio_DZ= None¶ initial value of ratio of Division Zone into the HiddenZone
-
-
cnwheat.parameters.HIDDEN_ZONE_INIT_COMPARTMENTS= <cnwheat.parameters.HiddenZoneInitCompartments object>¶ The instance of class
cnwheat.parameters.HiddenZoneInitCompartmentsfor current process
-
class
cnwheat.parameters.PhloemParameters[source]¶ Bases:
objectInternal parameters of phloems.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
-
cnwheat.parameters.PHLOEM_PARAMETERS= <cnwheat.parameters.PhloemParameters object>¶ The instance of class
cnwheat.parameters.PhloemParametersfor current process
-
class
cnwheat.parameters.PhloemInitCompartments[source]¶ Bases:
objectInitial values for compartments of phloem.
-
sucrose= None¶ initial value of sucrose (\(\mu\) mol C)
-
amino_acids= None¶ initial value of amino_acids (\(\mu\) mol N)
-
-
cnwheat.parameters.PHLOEM_INIT_COMPARTMENTS= <cnwheat.parameters.PhloemInitCompartments object>¶ The instance of class
cnwheat.parameters.PhloemInitCompartmentsfor current process
-
class
cnwheat.parameters.GrainsParameters[source]¶ Bases:
objectInternal parameters of grains.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
VMAX_RGR= None¶ Maximal value of the Relative Growth Rate of grain structure (s-1 at 20°C)
-
K_RGR= None¶ Affinity coefficient of the Relative Growth Rate of grain structure (\(\mu\) mol C)
-
Arrhenius_ref= None¶
-
VMAX_STARCH= None¶ Maximal rate of grain filling of starch (\(\mu\) mol C s-1 at 20°C g-1 MS)
-
K_STARCH= None¶ Affinity coefficient of grain filling of starch (\(\mu\) mol C g-1 MS)
-
FILLING_INIT= None¶ Time (s at 20°C) at which phloem loading switch from grain structure to accumulation of starch
-
FILLING_END= None¶ Time (s at 20°C) at which grains filling stops. (Bertheloot et al., 2011)
-
-
cnwheat.parameters.GRAINS_PARAMETERS= <cnwheat.parameters.GrainsParameters object>¶ The instance of class
cnwheat.parameters.GrainsParametersfor current process
-
class
cnwheat.parameters.GrainsInitCompartments[source]¶ Bases:
objectInitial values for compartments of grains.
-
age_from_flowering= None¶ initial value of age_from_flowering (s)
-
starch= None¶ initial value of starch (\(\mu\) mol C)
-
structure= None¶ initial value of structure (\(\mu\) mol C)
-
proteins= None¶ initial value of proteins (\(\mu\) mol N)
-
-
cnwheat.parameters.GRAINS_INIT_COMPARTMENTS= <cnwheat.parameters.GrainsInitCompartments object>¶ The instance of class
cnwheat.parameters.GrainsInitCompartmentsfor current process
-
class
cnwheat.parameters.RootsParameters[source]¶ Bases:
objectInternal parameters of roots.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
SIGMA_SUCROSE= None¶ Conductivity of the roots-phloem pathway (g2 \(\mu\) mol-1 m-2 s-1) ; used to compute the sucrose loaded to the phloem
-
BETA= None¶ Kind of volumetric mass density at power -2/3 ((g m-3)**(-2/3))
-
K_C= None¶ Affinity coefficient for the regulation function by root C (\(\mu\) mol C sucrose g-1 MS)
-
NET_INFLUX_UPTAKE_RATIO= None¶ ratio (net uptake : nitrate influx)
-
MIN_INFLUX_FOR_UPTAKE= None¶ Minimum influx rate below wich no net absorption happens (\(\mu\) mol C sucrose g-1 mstruct s-1)
-
A_VMAX_HATS= None¶ Parameter for estimating the maximal rate of nitrates uptake at saturating soil N concentration;HATS (\(\mu\) mol g-1 s-1)
-
B_VMAX_HATS= None¶ Parameter for estimating the maximal rate of nitrates uptake at saturating soil N concentration;HATS (g \(\mu\) mol-1)
-
A_K_HATS= None¶ Parameter for estimating the affinity coefficient of nitrates uptake at saturating soil N concentration;HATS (\(\mu\) mol m-3)
-
B_K_HATS= None¶ Parameter for estimating the affinity coefficient of nitrates uptake at saturating soil N concentration;HATS (g \(\mu\) mol-1)
-
A_LATS= None¶ Parameter for estimating the rate of nitrates uptake at low soil N concentration; LATS (m3 g-1 s-1)
-
B_LATS= None¶ Parameter for estimating the rate of nitrates uptake at low soil N concentration; LATS (g \(\mu\) mol-1)
-
K_NITRATE_EXPORT= None¶ Relative rate of nitrate export from roots (s-1)
-
VMAX_AMINO_ACIDS= None¶ Maximal rate of amino acid synthesis (\(\mu\) mol N s-1 g-1 MS)
-
K_AMINO_ACIDS_NITRATES= None¶ Affinity coefficient of amino acid synthesis from nitrates (\(\mu\) mol N g-1 MS)
-
K_AMINO_ACIDS_SUCROSE= None¶ Affinity coefficient of amino acid synthesis from sucrose (\(\mu\) mol C g-1 MS)
-
K_AMINO_ACIDS_EXPORT= None¶ Relative rate of amino acids export from roots (s-1)
-
C_EXUDATION= None¶ Proportion of C exudated from C sucrose unloaded to roots (Keith et al., 1986)
-
N_EXUDATION_MAX= None¶ Parameter used to limit the rate of N exudation (dimensionless)
-
VMAX_S_CYTOKININS= None¶ Maximal rate of cytokinins synthesis (UA g-1 mstruct s-1)
-
K_NITRATES_CYTOKININS= None¶ Affinity coefficient of cytokinins synthesis for nitrates (\(\mu\) mol N nitrates g-1 mstruct)
-
K_SUCROSE_CYTOKININS= None¶ Affinity coefficient of cytokinins synthesis for sucrose (\(\mu\) mol C sucrose g-1 mstruct)
-
N_SUC_CYTOKININS= None¶ A parameter for cytokinins synthesis (dimensionless)
-
N_NIT_CYTOKININS= None¶ A parameter for cytokinins synthesis (dimensionless)
-
K_CYTOKININS_EXPORT= None¶ Relative rate of cytokinins export from roots (s-1)
-
-
cnwheat.parameters.ROOTS_PARAMETERS= <cnwheat.parameters.RootsParameters object>¶ The instance of class
cnwheat.parameters.RootsParametersfor current process
-
class
cnwheat.parameters.RootsInitCompartments[source]¶ Bases:
objectInitial values for compartments of roots.
-
sucrose= None¶ initial value of sucrose (\(\mu\) mol C)
-
nitrates= None¶ initial value of nitrates (\(\mu\) mol C)
-
amino_acids= None¶ initial value of amino_acids (\(\mu\) mol N)
-
cytokinins= None¶ initial value of cytokinins (AU)
-
mstruct= None¶ initial value of mstruct (g)
-
senesced_mstruct= None¶ initial value of senesced_mstruct (g)
-
Nstruct= None¶ initial value of Nstruct (g)
-
-
cnwheat.parameters.ROOTS_INIT_COMPARTMENTS= <cnwheat.parameters.RootsInitCompartments object>¶ The instance of class
cnwheat.parameters.RootsInitCompartmentsfor current process
-
class
cnwheat.parameters.PhotosyntheticOrganParameters[source]¶ Bases:
objectInternal parameters of photosynthetic organs.
-
VMAX_SUCROSE= None¶ Maximal rate of sucrose synthesis (\(\mu\) mol C s-1 g-1 MS)
-
K_SUCROSE= None¶ Affinity coefficient of sucrose synthesis (\(\mu\) mol C g-1 MS)
-
VMAX_STARCH= None¶ Maximal rate of starch synthesis (\(\mu\) mol C s-1 g-1 MS)
-
K_STARCH= None¶ Affinity coefficient of starch synthesis (\(\mu\) mol C g-1 MS)
-
DELTA_DSTARCH= None¶ Relative rate of starch degradation (s-1)
-
VMAX_SFRUCTAN_POT= None¶ Potential maximal rate of fructan synthesis (\(\mu\) mol C s-1 g-1 MS)
-
K_SFRUCTAN= None¶ Affinity coefficient of fructan synthesis (\(\mu\) mol C g-1 MS)
-
K_REGUL_SFRUCTAN= None¶ Affinity coefficient of the regulation function of fructan synthesis (\(\mu\) mol g-1 MS)
-
N_REGUL_SFRUCTAN= None¶ Parameter of the regulation function of fructan synthesis (dimensionless)
-
VMAX_DFRUCTAN= None¶ Maximal rate of fructan degradation (\(\mu\) mol C s-1 g-1 MS)
-
K_DFRUCTAN= None¶ Affinity coefficient of fructan degradation (\(\mu\) mol C g-1 MS)
-
SIGMA_SUCROSE= None¶ Conductivity of an organ-phloem pathway (g2 \(\mu\) mol-1 m-2 s-1) ; used to compute the sucrose loaded to the phloem
-
SIGMA_AMINO_ACIDS= None¶ Conductivity of an organ-phloem pathway (g2 \(\mu\) mol-1 m-2 s-1) ; used to compute the amino acids loaded to the phloem
-
BETA= None¶ Kind of volumetric mass density at power -2/3 ((g m-3)**(-2/3))
-
VMAX_AMINO_ACIDS= None¶ Maximal rate of amino acid synthesis (\(\mu\) mol N s-1 g-1 MS)
-
K_AMINO_ACIDS_NITRATES= None¶ Affinity coefficient of amino acid synthesis from nitrates (\(\mu\) mol N g-1 MS)
-
K_AMINO_ACIDS_TRIOSESP= None¶ Affinity coefficient of amino acid synthesis from triosesP (\(\mu\) mol C g-1 MS)
-
VMAX_SPROTEINS= None¶ Maximal rate of protein synthesis (\(\mu\) mol N s-1 g-1 MS)
-
K_SPROTEINS= None¶ Affinity coefficient of protein synthesis (\(\mu\) mol N g-1 MS)
-
VMAX_DPROTEINS_CYTOK= None¶ Maximal regulation of protein degradation by cytokinins (\(\mu\) mol g-1 mstruct s-1)
-
K_DPROTEINS_CYTOK= None¶ Affinity coefficient with cytokinins for protein degradation (UA g-1 mstruct)
-
N_DPROTEINS= None¶ A coefficient for the regulation of protein degradation by cytokines (dimensionless)
-
VMAX_DPROTEINS= None¶ Maximal rate of protein degradation (\(\mu\) mol g-1 mstruct s-1)
-
K_DPROTEINS= None¶ Affinity coefficient for protein degradation (\(\mu\) g-1 mstruct)
-
DELTA_D_CYTOKININS= None¶ Relative rate of cytokinins degradation (s-1)
-
-
cnwheat.parameters.PHOTOSYNTHETIC_ORGAN_PARAMETERS= <cnwheat.parameters.PhotosyntheticOrganParameters object>¶ The instance of class
cnwheat.parameters.PhotosyntheticOrganParametersfor current process
-
class
cnwheat.parameters.ChaffParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganParametersInternal parameters of chaffs.
-
cnwheat.parameters.CHAFF_PARAMETERS= <cnwheat.parameters.ChaffParameters object>¶ The instance of class
cnwheat.parameters.ChaffParametersfor current process
-
class
cnwheat.parameters.LaminaParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganParametersInternal parameters of laminae.
-
cnwheat.parameters.LAMINA_PARAMETERS= <cnwheat.parameters.LaminaParameters object>¶ The instance of class
cnwheat.parameters.LaminaParametersfor current process
-
class
cnwheat.parameters.InternodeParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganParametersInternal parameters of internodes.
-
cnwheat.parameters.INTERNODE_PARAMETERS= <cnwheat.parameters.InternodeParameters object>¶ The instance of class
cnwheat.parameters.InternodeParametersfor current process
-
class
cnwheat.parameters.PeduncleParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganParametersInternal parameters of peduncles.
-
cnwheat.parameters.PEDUNCLE_PARAMETERS= <cnwheat.parameters.PeduncleParameters object>¶ The instance of class
cnwheat.parameters.PeduncleParametersfor current process
-
class
cnwheat.parameters.SheathParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganParametersInternal parameters of sheaths.
-
cnwheat.parameters.SHEATH_PARAMETERS= <cnwheat.parameters.SheathParameters object>¶ The instance of class
cnwheat.parameters.SheathParametersfor current process
-
class
cnwheat.parameters.PhotosyntheticOrganElementParameters[source]¶ Bases:
objectInternal parameters of photosynthetic organs elements.
-
cnwheat.parameters.PHOTOSYNTHETIC_ORGAN_ELEMENT_PARAMETERS= <cnwheat.parameters.PhotosyntheticOrganElementParameters object>¶ The instance of class
cnwheat.parameters.PhotosyntheticOrganElementParametersfor current process
-
class
cnwheat.parameters.PhotosyntheticOrganElementInitCompartments[source]¶ Bases:
objectInitial values for compartments of photosynthetic organ elements.
-
green_area= None¶ initial value of green_area (m2)
-
mstruct= None¶ initial value of mstruct (g)
-
senesced_mstruct= None¶ initial value of senesced_mstruct (g)
-
Nstruct= None¶ initial value of Nstruct (g)
-
triosesP= None¶ initial value of triosesP (\(\mu\) mol C)
-
starch= None¶ initial value of starch (\(\mu\) mol C)
-
sucrose= None¶ initial value of sucrose (\(\mu\) mol C)
-
fructan= None¶ initial value of fructan (\(\mu\) mol C)
-
nitrates= None¶ initial value of nitrates (\(\mu\) mol N)
-
amino_acids= None¶ initial value of amino_acids (\(\mu\) mol N)
-
proteins= None¶ initial value of proteins (\(\mu\) mol N)
-
cytokinins= None¶ initial value of cytokinins (AU)
-
is_growing= None¶ initial value of is_growing (Flag indicating if the element is growing or not (
bool)
-
Tr= None¶ initial value of Tr (Transpiration rate (mmol m-2 s-1)
-
Ts= None¶ initial value of Ts (Organ temperature)
-
Ag= None¶ initial value of Ag (Gross assimilation (\(\mu\) mol m-2 s-1)
-
-
cnwheat.parameters.PHOTOSYNTHETIC_ORGAN_ELEMENT_INIT_COMPARTMENTS= <cnwheat.parameters.PhotosyntheticOrganElementInitCompartments object>¶ The instance of class
cnwheat.parameters.PhotosyntheticOrganElementInitCompartmentsfor current process
-
class
cnwheat.parameters.ChaffElementParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganElementParametersInternal parameters of chaffs elements.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
-
cnwheat.parameters.CHAFF_ELEMENT_PARAMETERS= <cnwheat.parameters.ChaffElementParameters object>¶ The instance of class
cnwheat.parameters.ChaffElementParametersfor current process
-
class
cnwheat.parameters.LaminaElementParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganElementParametersInternal parameters of laminae elements.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
-
cnwheat.parameters.LAMINA_ELEMENT_PARAMETERS= <cnwheat.parameters.LaminaElementParameters object>¶ The instance of class
cnwheat.parameters.LaminaElementParametersfor current process
-
class
cnwheat.parameters.InternodeElementParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganElementParametersInternal parameters of internodes elements.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
-
cnwheat.parameters.INTERNODE_ELEMENT_PARAMETERS= <cnwheat.parameters.InternodeElementParameters object>¶ The instance of class
cnwheat.parameters.InternodeElementParametersfor current process
-
class
cnwheat.parameters.PeduncleElementParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganElementParametersInternal parameters of peduncles elements.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
-
cnwheat.parameters.PEDUNCLE_ELEMENT_PARAMETERS= <cnwheat.parameters.PeduncleElementParameters object>¶ The instance of class
cnwheat.parameters.PeduncleElementParametersfor current process
-
class
cnwheat.parameters.SheathElementParameters[source]¶ Bases:
cnwheat.parameters.PhotosyntheticOrganElementParametersInternal parameters of sheaths elements.
-
ALPHA= None¶ Proportion of structural mass containing substrate
-
-
cnwheat.parameters.SHEATH_ELEMENT_PARAMETERS= <cnwheat.parameters.SheathElementParameters object>¶ The instance of class
cnwheat.parameters.SheathElementParametersfor current process
-
cnwheat.parameters.SOIL_PARAMETERS= <cnwheat.parameters.SoilParameters object>¶ The instance of class
cnwheat.parameters.SoilParametersfor current process
cnwheat.tools module¶
-
cnwheat.tools.OUTPUTS_INDEXES= ['t', 'plant', 'axis', 'metamer', 'organ', 'element']¶ All the possible indexes of CN-Wheat outputs
-
exception
cnwheat.tools.DataWarning(variable, keys)[source]¶ Bases:
UserWarningRaised when there is no data to plot for a variable.
-
cnwheat.tools.plot_cnwheat_ouputs(outputs, x_name, y_name, x_label='', y_label='', x_lim=None, title=None, filters={}, plot_filepath=None, colors=[], linestyles=[], explicit_label=True, kwargs={})[source]¶ Plot outputs, with x=`x_name` and y=`y_name`.
The general algorithm is:
- find the scale of outputs and keep only the needed columns,
- apply filters to outputs and make groups according to the scale,
- plot each group as a new line,
- save or display the plot.
Parameters: - outputs (pandas.DataFrame) – The outputs of CN-Wheat.
- x_name (str) – x axis of the plot.
- y_name (str) – y axis of the plot.
- x_label (str) – The x label of the plot. Default is ‘’.
- or unicode y_label (str) – The y label of the plot. Default is ‘’.
- x_lim (float) – the x-axis limit.
- title (str) – the title of the plot. If None (default), create a title which is the concatenation of y_name and each scales which cardinality is one.
- filters (dict) – A dictionary whose keys are the columns of outputs for which we want to apply a specific filter.
These columns can be one or more element of
OUTPUTS_INDEXES. The value associated to each key is a criteria that the rows of outputs must satisfy to be plotted. The values can be either one value or a list of values. If no value is given for any column, then all rows are plotted (default). - colors (list) – The colors for lines. If empty, let matplotlib default line colors.
- linestyles (list) – The styles for lines. If empty, let matplotlib default line styles.
- plot_filepath (str) – The file path to save the plot. If None, do not save the plot but display it.
- explicit_label (bool) – True: makes the line label from concatenation of each scale id (default). - False: makes the line label from concatenation of scales containing several distinct elements.
- kwargs (dict) – key arguments to be passed to matplolib
Examples: >>> import pandas as pd >>> cnwheat_output_df = pd.read_csv('cnwheat_output.csv') # in this example, 'cnwheat_output.csv' must contain at least the columns 't' and 'Conc_Sucrose'. >>> plot(cnwheat_output_df, x_name = 't', y_name = 'Conc_Sucrose', x_label='Time (Hour)', y_label=u'[Sucrose] (µmol g$^{-1}$ mstruct)', title='{} = f({})'.format('Conc_Sucrose', 't'), filters={'plant': 1, 'axis': 'MS', 'organ': 'Lamina', 'element': 1})
-
cnwheat.tools.setup_logging(config_filepath='logging.json', level=20, log_model=False, log_compartments=False, log_derivatives=False, remove_old_logs=False)[source]¶ Setup logging configuration.
Parameters: - config_filepath (str) – The file path of the logging configuration.
- level (int) – The global level of the logging. Use either logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR or logging.CRITICAL.
- log_model (bool) – if True, log the messages from
cnwheat.model. False otherwise. - log_compartments (bool) – if True, log the values of the compartments. False otherwise.
- log_derivatives (bool) – if True, log the values of the derivatives. False otherwise.
- remove_old_logs (bool) – if True, remove all files in the logs directory documented in config_filepath.
-
cnwheat.tools.compare_actual_to_desired(data_dirpath, actual_data_df, desired_data_filename, actual_data_filename=None, precision=4, overwrite_desired_data=False)[source]¶ Compare
difference = actual_data_df - desired_data_dfto
tolerance = 10**-precision * (1 + abs(desired_data_df))where
desired_data_df = pd.read_csv(os.path.join(data_dirpath, desired_data_filename))If difference > tolerance, then raise an AssertionError.
Parameters: - data_dirpath (str) – The path of the directory where to find the data to compare.
- actual_data_df (pandas.DataFrame) – The computed data.
- desired_data_filename (str) – The file name of the expected data.
- actual_data_filename (str) – If not None, save the computed data to actual_data_filename, in directory data_dirpath. Default is None.
- precision (int) – The precision to use for the comparison. Default is 4.
- overwrite_desired_data (bool) – If True the comparison between actual and desired data is not run. Instead, the desired data will be overwritten using actual data. To be used with caution.
-
class
cnwheat.tools.ProgressBar(bar_length=20, title='', block_character='#', uncomplete_character='-')[source]¶ Bases:
objectDisplay a console progress bar.
-
bar_length= None¶ the number of blocks in the progress bar. MUST BE GREATER THAN ZERO !
-
t_max= None¶ the maximum t that the progress bar can display. MUST BE GREATER THAN ZERO !
-
block_interval= None¶ the time interval of each block. MUST BE GREATER THAN ZERO !
-
last_upper_t= None¶ the last upper t displayed by the progress bar
-
progress_mapping= None¶ a mapping to optimize the refresh rate
-
title= None¶ the title to write on the left side of the progress bar
-
block_character= None¶ the character to represent a block
-
uncomplete_character= None¶ the character to represent the uncompleted part of the progress bar
-
cnwheat.converter module¶
-
cnwheat.converter.PLANTS_VARIABLES= ['plant', 'Tair']¶ the columns of the outputs dataframe at PLANT scale
-
cnwheat.converter.AXES_VARIABLES= ['plant', 'axis', 'mstruct', 'senesced_mstruct', 'C_exudated', 'sum_respi_shoot', 'sum_respi_roots', 'Total_Transpiration']¶ the columns of the outputs dataframe at AXIS scale
-
cnwheat.converter.PHYTOMERS_VARIABLES= ['plant', 'axis', 'metamer', 'mstruct']¶ the columns of the outputs dataframe at PHYTOMER scale
-
cnwheat.converter.ORGANS_VARIABLES= ['plant', 'axis', 'organ', 'mstruct', 'Nstruct', 'senesced_mstruct', 'age_from_flowering', 'amino_acids', 'cytokinins', 'nitrates', 'proteins', 'starch', 'structure', 'sucrose', 'C_exudation', 'HATS_LATS', 'N_exudation', 'RGR_Structure', 'R_Nnit_red', 'R_Nnit_upt', 'Respi_growth', 'R_grain_growth_starch', 'R_grain_growth_struct', 'R_residual', 'regul_transpiration', 'sum_respi', 'Export_Amino_Acids', 'Export_Nitrates', 'Export_cytokinins', 'S_Amino_Acids', 'S_cytokinins', 'S_grain_starch', 'S_grain_structure', 'S_Proteins', 'Unloading_Amino_Acids', 'Unloading_Sucrose', 'Uptake_Nitrates', 'Total_Organic_Nitrogen']¶ the columns of the outputs dataframe at ORGAN scale
-
cnwheat.converter.HIDDENZONE_VARIABLES= ['plant', 'axis', 'metamer', 'Nstruct', 'mstruct', 'ratio_DZ', 'amino_acids', 'fructan', 'proteins', 'sucrose', 'nb_replications', 'D_Fructan', 'D_Proteins', 'S_Fructan', 'S_Proteins', 'Unloading_Amino_Acids', 'Unloading_Sucrose']¶ the columns of the outputs dataframe at HIDDEN ZONE scale
-
cnwheat.converter.ELEMENTS_VARIABLES= ['plant', 'axis', 'metamer', 'organ', 'element', 'Ag', 'Nstruct', 'Tr', 'Ts', 'green_area', 'is_growing', 'mstruct', 'senesced_mstruct', 'amino_acids', 'cytokinins', 'fructan', 'nitrates', 'proteins', 'starch', 'sucrose', 'triosesP', 'Photosynthesis', 'R_Nnit_red', 'R_phloem_loading', 'R_residual', 'Transpiration', 'sum_respi', 'nb_replications', 'Amino_Acids_import', 'D_Fructan', 'D_Proteins', 'D_Starch', 'D_cytokinins', 'Loading_Amino_Acids', 'Loading_Sucrose', 'Nitrates_import', 'Regul_S_Fructan', 'S_Fructan', 'S_Starch', 'S_Sucrose', 'S_Amino_Acids', 'S_Proteins', 'cytokinins_import', 'Total_Organic_Nitrogen']¶ the columns of the outputs dataframe at ELEMENT scale
-
cnwheat.converter.SOILS_VARIABLES= ['plant', 'axis', 'Tsoil', 'volume', 'nitrates', 'Conc_Nitrates_Soil', 'mineralisation']¶ the columns of the outputs dataframe at SOIL scale
-
cnwheat.converter.CNWHEAT_CLASSES_TO_DATAFRAME_ORGANS_MAPPING= {<class 'cnwheat.model.Internode'>: 'internode', <class 'cnwheat.model.Lamina'>: 'blade', <class 'cnwheat.model.Sheath'>: 'sheath', <class 'cnwheat.model.Peduncle'>: 'peduncle', <class 'cnwheat.model.Chaff'>: 'ear', <class 'cnwheat.model.Roots'>: 'roots', <class 'cnwheat.model.Grains'>: 'grains', <class 'cnwheat.model.Phloem'>: 'phloem', <class 'cnwheat.model.HiddenZone'>: 'hiddenzone'}¶ the mapping of the CN-Wheat organ classes to organ names in MTG
-
cnwheat.converter.DATAFRAME_TO_CNWHEAT_ELEMENTS_NAMES_MAPPING= {'HiddenElement': 'enclosed_element', 'LeafElement1': 'exposed_element', 'StemElement': 'exposed_element'}¶ the mapping of the name of each element, from Dataframe to CN-Wheat
-
cnwheat.converter.from_dataframes(organs_inputs=None, hiddenzones_inputs=None, elements_inputs=None, soils_inputs=None, update_parameters=None)[source]¶ If organs_inputs, hiddenzones_inputs and elements_inputs are not None, convert organs_inputs, hiddenzones_inputs and elements_inputs to a
population. If soils_inputs is not None, convert soils_inputs to a dictionary ofsoils.Parameters: - organs_inputs (pandas.DataFrame) – Organs inputs, with one line by organ.
- hiddenzones_inputs (pandas.DataFrame) – Hidden zones inputs, with one line by hidden zone.
- elements_inputs (pandas.DataFrame) – Elements inputs, with one line by element.
- soils_inputs (pandas.DataFrame) – Soils inputs, with one line by soil.
- update_parameters (dict) – A dictionary with the parameters to update, should have the form {‘Organ_label1’: {‘param1’: value1, ‘param2’: value2}, …}.
Returns: If organs_inputs, hiddenzones_inputs and elements_inputs are not None, return a
population, and/or if soils_inputs is not None, return adictofsoils.Return type: (pandas.DataFrame, dict) or dict
-
cnwheat.converter.to_dataframes(population=None, soils=None)[source]¶ Convert a CN-Wheat
populationand/or a dictionary ofsoilsto Pandas dataframes.If population is not None, convert population to Pandas dataframes. If soils is not None, convert soils to Pandas dataframe.
Parameters: - population (model.Population) – The CN-Wheat population to convert.
- soils (dict) – The soils to convert.
Returns: If population is not None, return
dataframesdescribing the internal state and compartments of the population at each scale:- plant scale: plant index, state parameters, state variables, intermediate variables, fluxes and integrative variables of each plant (see
PLANTS_VARIABLES) - axis scale: plant index, axis id, state parameters, state variables, intermediate variables, fluxes and integrative variables of each axis (see
AXES_VARIABLES) - phytomer scale: plant index, axis id, phytomer index, state parameters, state variables, intermediate variables, fluxes and integrative variables of
each phytomer (see
PHYTOMERS_VARIABLES) * organ scale:- hidden zones: plant index, axis id, phytomer index, state parameters, state variables, intermediate variables, fluxes and integrative variables of
each hidden zone (see
HIDDENZONE_VARIABLES) * roots, phloem and grains: plant index, axis id, organ type, state parameters, state variables, intermediate variables, fluxes and integrative variables of each organ (seeORGANS_VARIABLES)- and element scale: plant index, axis id, phytomer index, organ type, element type, state parameters, state variables, intermediate variables, fluxes and integrative variables of
each element (see
ELEMENTS_VARIABLES)and/or
if soils is not None, return a
dataframedescribing internal state and compartments of the soils, with one line per soil:- plant index, axis id, state parameters, state variables, intermediate variables, fluxes and integrative variables of each soil (see
SOILS_RUN_VARIABLES)
Return type: