|
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 | --------
|
@@ -103,9 +122,18 @@ def rainfall_intensity(
|
103 | 122 | ValueError: Please ensure that all parameters are 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