Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flowering #17

Merged
merged 11 commits into from
Jun 14, 2021
Binary file modified example/MORPHOFLOR/inputs/Parametre_plante_Lgrass.xls
Binary file not shown.
17,976 changes: 9,461 additions & 8,515 deletions example/MORPHOFLOR/inputs/environnement_morphoflor.csv

Large diffs are not rendered by default.

33 changes: 29 additions & 4 deletions example/MORPHOFLOR/inputs/plan_simulation.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
temp_vern_min,temp_vern_inter,temp_vern_max,daily_vern_rate,basic_vern_rate,photoperiod_min,photoperiod_max,max_photo_ind_rate,coeff_primordia_emission_vegetative,coeff_primordia_emission_reproductive,derivationLength,option_tallage,option_senescence,option_floraison,meteo_filename,sowing_date,site,value_C,Premiecroiss,PS_compensation_point,leaf_primary_induction_coeff,leaf_secondary_induction_coeff,increase_growth_Premiecroiss,increase_growth_C,name,Scenario
0,6,13,0.00135,0.01,10,16,1,1,2,4400,False,False,False,environnement_morphoflor.csv,2018_01_16,treatment_4_bloc_1,2.4,81.92163517,14.1,1,1,1,1,simulation_sans_vern,0
0,6,13,0.00135,0.01,10,16,0.1,1,3,4800,False,False,True,environnement_morphoflor.csv,2018_11_13,treatment_2_bloc_1,1.8,93,14.1,1,0.1,0.5,1.17,simulation_nouvelle,1
0,6,13,0.00135,0.01,10,16,0.1,1,3,4800,False,False,True,environnement_morphoflor.csv,2018_11_13,treatment_2_bloc_1,1.8,93,14.1,1,0.1,0.5,1.17,simulation_ancienne,1000
temp_vern_min,temp_vern_inter,temp_vern_max,daily_vern_rate,basic_vern_rate,photoperiod_min,photoperiod_max,max_photo_ind_rate,coeff_primordia_emission_vegetative,coeff_primordia_emission_reproductive,derivationLength,option_tallage,option_senescence,option_floraison,meteo_filename,sowing_date,site,value_C,Premiecroiss,PS_compensation_point,leaf_primary_induction_coeff,leaf_secondary_induction_coeff,increase_growth_Premiecroiss,increase_growth_C,Scenario,name
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.5,60,14.1,1,1,1,1,160,simulation_160
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.5,65,14.1,1,1,1,1,161,simulation_161
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.5,70,14.1,1,1,1,1,162,simulation_162
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.5,75,14.1,1,1,1,1,163,simulation_163
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.75,60,14.1,1,1,1,1,164,simulation_164
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.75,65,14.1,1,1,1,1,165,simulation_165
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.75,70,14.1,1,1,1,1,166,simulation_166
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,5.75,75,14.1,1,1,1,1,167,simulation_167
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.0,60,14.1,1,1,1,1,168,simulation_168
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.0,65,14.1,1,1,1,1,169,simulation_169
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.0,70,14.1,1,1,1,1,170,simulation_170
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.0,75,14.1,1,1,1,1,171,simulation_171
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.25,60,14.1,1,1,1,1,172,simulation_172
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.25,65,14.1,1,1,1,1,173,simulation_173
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.25,70,14.1,1,1,1,1,174,simulation_174
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.25,75,14.1,1,1,1,1,175,simulation_175
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.5,60,14.1,1,1,1,1,176,simulation_176
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.5,65,14.1,1,1,1,1,177,simulation_177
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.5,70,14.1,1,1,1,1,178,simulation_178
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.5,75,14.1,1,1,1,1,179,simulation_179
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.75,60,14.1,1,1,1,1,180,simulation_180
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.75,65,14.1,1,1,1,1,181,simulation_181
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.75,70,14.1,1,1,1,1,182,simulation_182
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,6.75,75,14.1,1,1,1,1,183,simulation_183
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,7.0,60,14.1,1,1,1,1,184,simulation_184
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,7.0,65,14.1,1,1,1,1,185,simulation_185
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,7.0,70,14.1,1,1,1,1,186,simulation_186
0,6,13,0.00135,0,10,16,1,1,2,4400,False,False,True,environnement_morphoflor.csv,2019_01_16,treatment_4_all_blocks,7.0,75,14.1,1,1,1,1,187,simulation_187
6 changes: 4 additions & 2 deletions example/MORPHOFLOR/run_lgrass.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def run_lgrass(scenario_id=1, inputs_dir_path='inputs', outputs_dir_path='output
"""

# Scenario to be run
scenarii_df = pd.read_csv(os.path.join('inputs', 'plan_simulation.csv'), index_col='Scenario')
scenarii_df = pd.read_csv(os.path.join('inputs', 'plan_simulation_repro.csv'), index_col='Scenario')
scenario = scenarii_df.loc[scenario_id].to_dict()
scenario_name = scenario['name']

Expand All @@ -38,6 +38,8 @@ def run_lgrass(scenario_id=1, inputs_dir_path='inputs', outputs_dir_path='output
lsystem.option_tallage = scenario['option_tallage']
lsystem.option_senescence = scenario['option_senescence']
lsystem.option_floraison = scenario['option_floraison']
lsystem.cutting_height = scenario['cutting_height']
lsystem.cutting_end = scenario['cutting_end']
lsystem.meteo_path = os.path.join(inputs_dir_path, scenario['meteo_filename'])
lsystem.sowing_date = scenario['sowing_date']
lsystem.site = scenario['site']
Expand All @@ -60,7 +62,7 @@ def run_lgrass(scenario_id=1, inputs_dir_path='inputs', outputs_dir_path='output
if __name__ == '__main__':
inputs = 'inputs'
outputs = 'outputs'
scenario = 1000
scenario = 11101

try:
opts, args = getopt.getopt(sys.argv[1:], "i:o:s:d", ["inputs=", "outputs=", "scenario="])
Expand Down
32 changes: 16 additions & 16 deletions example/MORPHOFLOR/simulation_plan_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,27 @@
temp_vern_inter_list = [6]
temp_vern_max_list = [13]
daily_vern_rate_list = [0.00135]
basic_vern_rate_list = [0.01]
basic_vern_rate_list = [0]
photoperiod_min_list = [10]
photoperiod_max_list = [16]
max_photo_ind_rate_list = [1]
coeff_primordia_emission_vegetative_list = [1]
coeff_primordia_emission_reproductive_list = [2]
derivationLength_list = [3000]
derivationLength_list = [4400]
option_tallage_list = ["False"]
option_senescence_list = ["False"]
option_floraison_list = ["False"]
option_floraison_list = ["True"]
meteo_filename_list = ["environnement_morphoflor.csv"]
sowing_date_list = ["2019_01_16"]
treatment_bloc = list(itertools.product([4], [1, 2, 3, 4, 5, 6, 7, 8, 9]))
site_list = ["treatment_" + str(n[0]) + "_bloc_" + str(n[1]) for n in treatment_bloc]
cutting_dates_list = [np.nan]
value_C_list = np.round(np.arange(3.4, 6.1, 0.1), decimals=2)
Premiecroiss_list = np.round(np.arange(100, 105, 5), decimals=2)
site_list = ["treatment_" + "4" + "_all_blocks"]
value_C_list = np.round(np.arange(7.25, 8, 0.25), decimals=2)
Premiecroiss_list = np.round(np.arange(45, 75, 5), decimals=2)
PS_compensation_point_list = [14.1]
leaf_primary_induction_coeff_list = [1]
leaf_secondary_induction_coeff_list = [1]
increase_growth_Premiecroiss_list = [1]
increase_growth_C_list = [1]
HCOUP_list = [50]


simulation_plan = pd.DataFrame(columns=["temp_vern_min",
Expand All @@ -49,14 +48,14 @@
"meteo_filename",
"sowing_date",
"site",
"cutting_dates",
"value_C",
"Premiecroiss",
"PS_compensation_point",
"leaf_primary_induction_coeff",
"leaf_secondary_induction_coeff",
"increase_growth_Premiecroiss",
"increase_growth_C"])
"increase_growth_C",
"HCOUP"])

for i in itertools.product(temp_vern_min_list,
temp_vern_inter_list,
Expand All @@ -75,14 +74,14 @@
meteo_filename_list,
sowing_date_list,
site_list,
cutting_dates_list,
value_C_list,
Premiecroiss_list,
PS_compensation_point_list,
leaf_primary_induction_coeff_list,
leaf_secondary_induction_coeff_list,
increase_growth_Premiecroiss_list,
increase_growth_C_list):
increase_growth_C_list,
HCOUP_list):
simulation_plan = simulation_plan.append(pd.DataFrame([i], columns=["temp_vern_min",
"temp_vern_inter",
"temp_vern_max",
Expand All @@ -100,17 +99,18 @@
"meteo_filename",
"sowing_date",
"site",
"cutting_dates",
"value_C",
"Premiecroiss",
"PS_compensation_point",
"leaf_primary_induction_coeff",
"leaf_secondary_induction_coeff",
"increase_growth_Premiecroiss",
"increase_growth_C"]))
"increase_growth_C",
"HCOUP"]))


simulation_plan['Scenario'] = [i for i in range(4351, simulation_plan.shape[0] + 4351)]
id_first_simulation = 314
simulation_plan['Scenario'] = [i for i in range(id_first_simulation, simulation_plan.shape[0] + id_first_simulation)]
simulation_plan['name'] = 'simulation_' + simulation_plan['Scenario'].astype(str)

simulation_plan.to_csv(os.path.join('inputs', 'plan_simulation.csv'), index=False)
simulation_plan.to_csv(os.path.join('inputs', 'plan_simulation_veg.csv'), index=False)
17 changes: 17 additions & 0 deletions example/calibration_GEVES_2021/calcul_photoperiode_meteo_GEVES.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pandas as pd
from lgrass import meteo_ephem

meteo_data = pd.read_csv('D:/Simon/Python/lgrass/example/GEVES/Meteo_GEVES_sans_photoperiode.csv', sep=',')
meteo_data.date = pd.to_datetime(meteo_data.date, format='%Y_%m_%d')

new_meteo_data = pd.DataFrame()

for site in meteo_data.site.unique():
meteo_site = meteo_data.loc[meteo_data['site'] == site]
a = meteo_ephem.daylength_series(meteo_site)
new_meteo_data = new_meteo_data.append(a)

new_meteo_data.date = new_meteo_data.date.astype('string')
new_meteo_data['date'] = new_meteo_data['date'].str.replace('-', '_')

new_meteo_data.to_csv('D:/Simon/Python/lgrass/example/GEVES/Meteo_GEVES.csv', index=False)
4 changes: 4 additions & 0 deletions example/calibration_GEVES_2021/graphs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
Loading