Skip to content

Commit 9d5267d

Browse files
committed
minor update
1 parent 11fedfb commit 9d5267d

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ ignore:
33
- "src/*/deprecated"
44
- "src/temp/*"
55
- "src/*/temp"
6-
- "src/findpeaks_allen.jl"
6+
- "src/Peaks/*"
File renamed without changes.

src/VegSeasons.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Statistics: mean, median
55

66

77
include("findpeaks.jl")
8-
include("findpeaks_allen.jl")
8+
include("Peaks/findpeaks_allen.jl")
99

1010

1111
end # module FindPeaks2

src/check_season.jl

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
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+
110
# 符合条件的两个相邻(t_diff <= 5) seasons, 合并endtime
211
# `rigth` merged into `left`
312
function RightCombine_season(y_peak, y_end, date_peak, date_end, i::Integer)
413
y_end[i] = y_end[i+1]
514
date_end[i] = date_end[i+1]
6-
# len[i] = date_end[i] - date_beg[i] + 1;
715

816
if (y_peak[i] < y_peak[i+1])
917
date_peak[i] = date_peak[i+1]
@@ -19,23 +27,19 @@ end
1927
# 3. (not used) 如果相邻生长季返青日期过短,则执行合并操作
2028
# 这里用max,而非min,意在保护A较小的生长季
2129

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-
3030
# 如下情景会触发融合
3131
# - 1. y_end[i] >= A * rtrough_max + T1_minVal
3232
# - 2. con_left
3333
# - 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
3834

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)
3943
# TODO: add a while for loop
4044
date_beg = d[!, 1]
4145
date_peak = d[!, 2]
@@ -128,6 +132,7 @@ function update_seasons(d)
128132
d
129133
end
130134

135+
131136
export check_season!
132137

133138
## 坡脚修复大法的功能已经在`seasons_union`中得到了体现

0 commit comments

Comments
 (0)