Skip to content

Commit

Permalink
integration flowering
Browse files Browse the repository at this point in the history
  • Loading branch information
dicombes committed Nov 2, 2020
1 parent 24f47ad commit bf7c43a
Show file tree
Hide file tree
Showing 4 changed files with 584 additions and 543 deletions.
2 changes: 1 addition & 1 deletion lgrass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
"""


__version__ = '3.0'
__version__ = '4.0'
73 changes: 38 additions & 35 deletions lgrass/flowering_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ def vernalisation_function(self, temperature):
if self.param.temp_vern_min <= temperature <= self.param.temp_vern_inter:
primary_induction_increment = self.param.daily_vern_rate * temperature + self.param.basic_vern_rate
elif self.param.temp_vern_inter < temperature <= self.param.temp_vern_max:
#primary_induction_increment = (self.param.daily_vern_rate * temperature + self.param.basic_vern_rate) * (self.param.temp_vern_max - temperature) / (self.param.temp_vern_max - self.param.temp_vern_inter)
primary_induction_increment = (-temperature + self.param.temp_vern_max) * (self.param.daily_vern_rate * self.param.temp_vern_inter + self.param.basic_vern_rate) / (self.param.temp_vern_max - self.param.temp_vern_inter)
# primary_induction_increment = (self.param.daily_vern_rate * temperature + self.param.basic_vern_rate) * (self.param.temp_vern_max - temperature) / (self.param.temp_vern_max - self.param.temp_vern_inter)
primary_induction_increment = (-temperature + self.param.temp_vern_max) * (
self.param.daily_vern_rate * self.param.temp_vern_inter + self.param.basic_vern_rate) / (
self.param.temp_vern_max - self.param.temp_vern_inter)
else:
primary_induction_increment = 0
return primary_induction_increment
Expand All @@ -30,41 +32,42 @@ def photoperiod_induction_function(self, daylength):
if daylength < self.param.photoperiod_min:
secondary_induction_increment = 0
else:
secondary_induction_increment = (daylength - self.param.photoperiod_min) / (self.param.photoperiod_max - self.param.photoperiod_min)
secondary_induction_increment = min(self.param.max_photo_ind_rate, self.param.max_photo_ind_rate * (
daylength - self.param.photoperiod_min) / (
self.param.photoperiod_max - self.param.photoperiod_min))
return secondary_induction_increment

# def final_phytomer_number



#
# def approx_final_leaf_number_calculation(self, daylength, potential_leaf_number):
# """
#
# :param daylength:
# :param potential_leaf_number:
# :return:
# """
# approx_final_leaf_number = min(potential_leaf_number, potential_leaf_number + self.param.sldl * (self.param.saturation_daylength - daylength))
# return approx_final_leaf_number
#
#
# def potential_leaf_number_calculation(self, primary_induction_index):
# """
#
# :self.param primary_induction_index:
# :return:
# """
# potential_leaf_number = self.param.absolute_max_leaf_number - (self.param.absolute_max_leaf_number - self.param.absolute_min_leaf_number) * primary_induction_index
# return potential_leaf_number
#
# def test_vernalisation(self, primary_induction_index, potential_leaf_number, primordia_number):
# """
#
# :self.param primary_induction_index:
# :self.param potential_leaf_number:
# :self.param primordia_number:
# :return:
# """
# if(primary_induction_index == 1 or potential_leaf_number == self.param.absolute_min_leaf_number or potential_leaf_number <= primordia_number):
# return True
#
# def approx_final_leaf_number_calculation(self, daylength, potential_leaf_number):
# """
#
# :param daylength:
# :param potential_leaf_number:
# :return:
# """
# approx_final_leaf_number = min(potential_leaf_number, potential_leaf_number + self.param.sldl * (self.param.saturation_daylength - daylength))
# return approx_final_leaf_number
#
#
# def potential_leaf_number_calculation(self, primary_induction_index):
# """
#
# :self.param primary_induction_index:
# :return:
# """
# potential_leaf_number = self.param.absolute_max_leaf_number - (self.param.absolute_max_leaf_number - self.param.absolute_min_leaf_number) * primary_induction_index
# return potential_leaf_number
#
# def test_vernalisation(self, primary_induction_index, potential_leaf_number, primordia_number):
# """
#
# :self.param primary_induction_index:
# :self.param potential_leaf_number:
# :self.param primordia_number:
# :return:
# """
# if(primary_induction_index == 1 or potential_leaf_number == self.param.absolute_min_leaf_number or potential_leaf_number <= primordia_number):
# return True
Loading

0 comments on commit bf7c43a

Please sign in to comment.