-
Notifications
You must be signed in to change notification settings - Fork 1
/
rainratefunctions.py
122 lines (91 loc) · 2.07 KB
/
rainratefunctions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
"""
Functions for various Rain Rate estimators in the literature.
There are many more than these, but these may be useful
enough.
You'll need to have the processed data ready, as these are
made to only handle one sample at a time. You can use an
np.apply_along_axis though to apply them to the data all
at once if you like.
Author: Ryan Gooch, 11/30/15
"""
def R_ZDR_KDP (d) :
"""
R(ZDR, KDP)
Rainfall rate (RR) estimation based on KDP and ZDR. From
Bringi and Chandrasekar (2001), Section 8.1.3.
Input: Sample (row) from Kaggle Data
Output: RR Estimate, RR Actual
"""
import numpy as np
kdp = d[19]
zdr = d[15]
# Coeffecients
c = 90.8
a = 0.93
b = -1.69
# Return divided by 12 to get mm / (scan period)
# instead of mm / h
est = c * (np.abs(kdp) ** a) * 10 **(0.1 * b * zdr) / 12
return est,d[-1]
def R_Zh_marshall_palmer (d) :
"""
R(Zh)
Marshall Palmer RR estimator.
Input: Sample (row) from Kaggle Data
Output: RR Estimate, RR Actual
"""
import numpy as np
zh = d[3] # Ref
# Coefficients
c = 0.0365
a = 0.625
est = c * zh ** a / 12
return est, d[-1]
def R_Zh_nexrad (d) :
"""
R(Zh)
RR estimator used by WSR-88D radars
Input: Sample (row) from Kaggle Data
Output: RR Estimate, RR Actual
"""
import numpy as np
zh = d[3] # Ref
# Coefficients
c = 0.017
a = 0.714
est = c * zh ** a / 12
return est, d[-1]
def R_ZDR_Zh (d) :
"""
R(ZDR, Zh)
Rainfall rate (RR) estimation based on Zh and ZDR. From
Bringi and Chandrasekar (2001), Section 8.1.1.
Original Paper: Gorgucci et al, 1994
Input: Sample (row) from Kaggle Data
Output: RR Estimate, RR Actual
"""
import numpy as np
zh = d[3]
zdr = d[15]
# Coeffecients
c = 0.0067
a = 0.93
b = -3.43
# Return divided by 12 to get mm / (scan period)
# instead of mm / h
est = c * (zh ** a) * 10 **(0.1 * b * zdr) / 12
return est,d[-1]
def R_KDP (d) :
"""
R(KDP)
RR estimator using only KDP
Input: Sample (row) from Kaggle Data
Output: RR Estimate, RR Actual
"""
import numpy as np
kdp = d[19]
# Coefficients
c = 50.7
b = 0.85
est = c * kdp ** b / 12
return est, d[-1]