@@ -69,15 +69,25 @@ class Config:
6969# pollen observations used to make sure that pollen calibration is only
7070# performed if pollen concentrations were high enough to ensure robust
7171# results of the pollen calibration.
72- thr_con_24 = {"ALNU" : 240 , "BETU" : 240 , "POAC" : 72 , "CORY" : 240 }
73- thr_con_120 = {"ALNU" : 720 , "BETU" : 720 , "POAC" : 216 , "CORY" : 720 }
72+ # TODO: these numbers should go into the config file # pylint: disable=fixme
73+ thr_con_24 = {"ALNU" : 120 , "BETU" : 240 , "POAC" : 72 , "CORY" : 120 }
74+ thr_con_120 = {"ALNU" : 360 , "BETU" : 720 , "POAC" : 216 , "CORY" : 360 }
7475
7576# failsafe is a limiter for the change applied to the phenological fields
76- # tthrs and tthre (and saisl for POAC instead of tthre).
77+ # tthrs and tthre (and saisl for POAC instead of tthre). The purpose is
78+ # to ensure the adaptation of tthrs and tthre is not too large.
79+ # TODO: these numbers should go into the config file # pylint: disable=fixme
7780failsafe = {"ALNU" : 1000 , "BETU" : 2500 , "POAC" : 6000 , "CORY" : 2500 }
7881
7982# jul_days_excl is the number of days since Dec. 1 to be excluded
80- # in the calculation of the temperature sum
83+ # in the calculation of the temperature sum.
84+ # These numbers have been determined using an optimization procedure
85+ # minimizing the mean absolute error (= difference between the observed
86+ # and the modelled start of flowering).
87+ # The methods used are described in Pauling et al. (2014): Toward
88+ # optimized temperature sum parameterizations for forecasting the
89+ # start of the pollen season, Aerobiologia, 30, 10.1007/s10453-013-9308-0
90+ # TODO: these numbers should go into the config file # pylint: disable=fixme
8191jul_days_excl = {"ALNU" : 14 , "BETU" : 40 , "POAC" : 46 , "CORY" : 3 }
8292
8393
@@ -338,6 +348,9 @@ def interpolate( # pylint: disable=R0913,R0914
338348 nstns = len (coord_stns )
339349 pollen_type = field [:4 ]
340350 if method == "multiply" :
351+ # max_param and min_param are limiters for the change applied to the
352+ # tuning factor. The purpose is to ensure the adaptations are not too large.
353+ # TODO: these numbers should go into the config file # pylint: disable=fixme
341354 max_param = {"ALNU" : 3.389 , "BETU" : 4.046 , "POAC" : 1.875 , "CORY" : 7.738 }
342355 min_param = {"ALNU" : 0.235 , "BETU" : 0.222 , "POAC" : 0.405 , "CORY" : 0.216 }
343356 else :
@@ -447,15 +460,22 @@ def get_change_tune( # pylint: disable=R0913
447460 f"Current tune value { tune_stns .values [0 ]} " ,
448461 f"and saisn: { saisn_stns .values [0 ]} " ,
449462 )
450- if (saisn_stns > 0 ) and ((sum_obs <= 720 ) or (sum_mod <= 720 )):
463+ if saisn_stns > 0 and (
464+ sum_obs <= thr_con_120 [pollen_type ] or sum_mod <= thr_con_120 [pollen_type ]
465+ ):
466+
451467 if verbose :
452468 print (
453469 "Season started but low observation or modeled concentrations, "
454470 "(tune)**(-1/24) = "
455471 f"{ (tune_pol_default / tune_stns .values [0 ]) ** (1 / 24 )} "
456472 )
457473 change_tune [istation ] = (tune_pol_default / tune_stns ) ** (1 / 24 )
458- if (saisn_stns > 0 ) and (sum_obs > 720 ) and (sum_mod > 720 ):
474+ if (
475+ saisn_stns > 0
476+ and sum_obs > thr_con_120 [pollen_type ]
477+ and sum_mod > thr_con_120 [pollen_type ]
478+ ):
459479 if verbose :
460480 print (
461481 "Season started and high observation " , "and modeled concentrations"
@@ -549,7 +569,8 @@ def get_change_phenol( # pylint: disable=R0912,R0914,R0915
549569 (0 <= sum_obs_24 < thr_con_24 [pollen_type ])
550570 and (0 <= sum_obs < thr_con_120 [pollen_type ])
551571 and (tthrs_stns < ctsum_stns )
552- and (0 < saisn_stns < 10 )
572+ and (0 < saisn_stns < 5 ) # restrict adaptation to the first 5 days of the
573+ # season. TODO: move the number to the config file # pylint: disable=fixme
553574 ):
554575 if pollen_type != "POAC" and ctsum_stns < tthre_stns :
555576 change_tthre [istation ] = t_2m_stns * (date - jul_days_excl [pollen_type ])
0 commit comments