3
3
==================
4
4
This module contains functions to calculate the intensity of
5
5
a rainfall event for a given duration and return period.
6
+
7
+ This function uses the Sherman intensity-duration-frequency curve.
8
+
9
+ References
10
+ ----------
11
+ - Aparicio, F. (1997): Fundamentos de Hidrología de Superficie.
12
+ Balderas, México, Limusa. 303 p.
13
+ - https://en.wikipedia.org/wiki/Intensity-duration-frequency_curve
6
14
"""
7
15
8
16
9
17
def rainfall_intensity (
10
- k : float , a : float , b : float , c : float , tr : float , t : float
18
+ coefficient_k : float ,
19
+ coefficient_a : float ,
20
+ coefficient_b : float ,
21
+ coefficient_c : float ,
22
+ return_period : float ,
23
+ duration : float ,
11
24
) -> float :
12
25
"""
13
26
Calculate the intensity of a rainfall event for a given duration and return period.
14
- The coefficients K, a, b, and c are obtained from the Sherman
15
- intensity-duration-frequency curve for a specific location.
27
+ It's based on the Sherman intensity-duration-frequency curve:
28
+
29
+ I = K * T^a / (D + b)^c
30
+
31
+ where:
32
+ I = Intensity of the rainfall event [mm/h]
33
+ k, a, b, c = Coefficients obtained through statistical distribution adjust
34
+ T = Return period in years
35
+ D = Rainfall event duration in minutes
16
36
17
37
Parameters
18
38
----------
19
- k : float
20
- Coefficient [adm] .
21
- a : float
22
- Coefficient [adm] .
23
- b : float
24
- Coefficient [adm] .
25
- c : float
26
- Coefficient [adm] .
27
- tr : float
39
+ coefficient_k : float
40
+ Coefficient obtained through statistical distribution adjust .
41
+ coefficient_a : float
42
+ Coefficient obtained through statistical distribution adjust .
43
+ coefficient_b : float
44
+ Coefficient obtained through statistical distribution adjust .
45
+ coefficient_c : float
46
+ Coefficient obtained through statistical distribution adjust .
47
+ return_period : float
28
48
Return period in years.
29
- t : float
49
+ duration : float
30
50
Rainfall event duration in minutes.
31
51
32
52
Returns
33
53
-------
34
54
intensity : float
35
55
Intensity of the rainfall event in mm/h.
36
56
37
- References
38
- ----------
39
- - Aparicio, F. (1997): Fundamentos de Hidrología de Superficie.
40
- Balderas, México, Limusa. 303 p.
41
- - https://en.wikipedia.org/wiki/Intensity-duration-frequency_curve
57
+ Raises
58
+ ------
59
+ ValueError
60
+ If any of the parameters are not positive.
42
61
43
62
Examples
44
63
--------
@@ -55,57 +74,66 @@ def rainfall_intensity(
55
74
>>> rainfall_intensity(0, 0.2, 11.6, 0.81, 10, 60)
56
75
Traceback (most recent call last):
57
76
...
58
- ValueError: Please ensure that all parameters are positive.
77
+ ValueError: All parameters must be positive.
59
78
60
79
>>> rainfall_intensity(1000, -0.2, 11.6, 0.81, 10, 60)
61
80
Traceback (most recent call last):
62
81
...
63
- ValueError: Please ensure that all parameters are positive.
82
+ ValueError: All parameters must be positive.
64
83
65
84
>>> rainfall_intensity(1000, 0.2, -11.6, 0.81, 10, 60)
66
85
Traceback (most recent call last):
67
86
...
68
- ValueError: Please ensure that all parameters are positive.
87
+ ValueError: All parameters must be positive.
69
88
70
89
>>> rainfall_intensity(1000, 0.2, 11.6, -0.81, 10, 60)
71
90
Traceback (most recent call last):
72
91
...
73
- ValueError: Please ensure that all parameters are positive.
92
+ ValueError: All parameters must be positive.
74
93
75
94
>>> rainfall_intensity(1000, 0, 11.6, 0.81, 10, 60)
76
95
Traceback (most recent call last):
77
96
...
78
- ValueError: Please ensure that all parameters are positive.
97
+ ValueError: All parameters must be positive.
79
98
80
99
>>> rainfall_intensity(1000, 0.2, 0, 0.81, 10, 60)
81
100
Traceback (most recent call last):
82
101
...
83
- ValueError: Please ensure that all parameters are positive.
102
+ ValueError: All parameters must be positive.
84
103
85
104
>>> rainfall_intensity(1000, 0.2, 11.6, 0, 10, 60)
86
105
Traceback (most recent call last):
87
106
...
88
- ValueError: Please ensure that all parameters are positive.
107
+ ValueError: All parameters must be positive.
89
108
90
109
>>> rainfall_intensity(0, 0.2, 11.6, 0.81, 10, 60)
91
110
Traceback (most recent call last):
92
111
...
93
- ValueError: Please ensure that all parameters are positive.
112
+ ValueError: All parameters must be positive.
94
113
95
114
>>> rainfall_intensity(1000, 0.2, 11.6, 0.81, 0, 60)
96
115
Traceback (most recent call last):
97
116
...
98
- ValueError: Please ensure that all parameters are positive.
117
+ ValueError: All parameters must be positive.
99
118
100
119
>>> rainfall_intensity(1000, 0.2, 11.6, 0.81, 10, 0)
101
120
Traceback (most recent call last):
102
121
...
103
- ValueError: Please ensure that all parameters are positive.
122
+ ValueError: All parameters must be positive.
104
123
105
124
"""
106
- if k <= 0 or a <= 0 or b <= 0 or c <= 0 or tr <= 0 or t <= 0 :
107
- raise ValueError ("Please ensure that all parameters are positive." )
108
- intensity = (k * (tr ** a )) / ((t + b ) ** c )
125
+ if (
126
+ coefficient_k <= 0
127
+ or coefficient_a <= 0
128
+ or coefficient_b <= 0
129
+ or coefficient_c <= 0
130
+ or return_period <= 0
131
+ or duration <= 0
132
+ ):
133
+ raise ValueError ("All parameters must be positive." )
134
+ intensity = (coefficient_k * (return_period ** coefficient_a )) / (
135
+ (duration + coefficient_b ) ** coefficient_c
136
+ )
109
137
return intensity
110
138
111
139
0 commit comments