|
| 1 | +mutable struct st_season |
| 2 | + di |
| 3 | + r_max::Float64 |
| 4 | + r_min::Float64 |
| 5 | + # y_max::Float64 |
| 6 | + # y_min::Float64 |
| 7 | +end |
| 8 | + |
| 9 | + |
1 | 10 | # 符合条件的两个相邻(t_diff <= 5) seasons, 合并endtime
|
2 | 11 | # `rigth` merged into `left`
|
3 | 12 | function RightCombine_season(y_peak, y_end, date_peak, date_end, i::Integer)
|
4 | 13 | y_end[i] = y_end[i+1]
|
5 | 14 | date_end[i] = date_end[i+1]
|
6 |
| - # len[i] = date_end[i] - date_beg[i] + 1; |
7 | 15 |
|
8 | 16 | if (y_peak[i] < y_peak[i+1])
|
9 | 17 | date_peak[i] = date_peak[i+1]
|
|
19 | 27 | # 3. (not used) 如果相邻生长季返青日期过短,则执行合并操作
|
20 | 28 | # 这里用max,而非min,意在保护A较小的生长季
|
21 | 29 |
|
22 |
| -mutable struct st_season |
23 |
| - di |
24 |
| - r_max::Float64 |
25 |
| - r_min::Float64 |
26 |
| - # y_max::Float64 |
27 |
| - # y_min::Float64 |
28 |
| -end |
29 |
| - |
30 | 30 | # 如下情景会触发融合
|
31 | 31 | # - 1. y_end[i] >= A * rtrough_max + T1_minVal
|
32 | 32 | # - 2. con_left
|
33 | 33 | # - 3. con_right
|
34 |
| -function check_season!(d; r_max=0.1, r_min=0.02, rtrough_max=0.7) |
35 |
| - # t_diff <= DAYS_maxDIFF; # 相差在`DAYS_maxDIFF`天内认为相邻 |
36 |
| - DAYS_maxDIFF = 50 # days |
37 |
| - DAYS_max2GS = 650 # days, max length of two growing seasons being able to merge |
38 | 34 |
|
| 35 | +""" |
| 36 | + check_season!(d; r_max=0.1, r_min=0.02, rtrough_max=0.7, DAYS_maxDIFF=50, DAYS_max2GS=650) |
| 37 | +
|
| 38 | +# Arguements |
| 39 | +- `DAYS_maxDIFF`: t_diff <= DAYS_maxDIFF; # 相差在`DAYS_maxDIFF`天内认为相邻 |
| 40 | +- `DAYS_max2GS`: max length of two growing seasons being able to merge |
| 41 | +""" |
| 42 | +function check_season!(d; r_max=0.1, r_min=0.02, rtrough_max=0.7, DAYS_maxDIFF=50, DAYS_max2GS=650) |
39 | 43 | # TODO: add a while for loop
|
40 | 44 | date_beg = d[!, 1]
|
41 | 45 | date_peak = d[!, 2]
|
@@ -128,6 +132,7 @@ function update_seasons(d)
|
128 | 132 | d
|
129 | 133 | end
|
130 | 134 |
|
| 135 | + |
131 | 136 | export check_season!
|
132 | 137 |
|
133 | 138 | ## 坡脚修复大法的功能已经在`seasons_union`中得到了体现
|
|
0 commit comments