|
258 | 258 | "The lines from fit 1 to fit 5 are plotted as well to give an indication of the influence of certain peak discharges on the extrapolation. This will be useful later in the research, when the significance of the difference in future return periods with different climate change scenarios compared to the current return periods needs to be assessed. \n" |
259 | 259 | ] |
260 | 260 | }, |
261 | | - { |
262 | | - "cell_type": "code", |
263 | | - "execution_count": 8, |
264 | | - "id": "9dc2476f-dcba-4ed4-aa72-72c4acb29840", |
265 | | - "metadata": { |
266 | | - "jupyter": { |
267 | | - "source_hidden": true |
268 | | - } |
269 | | - }, |
270 | | - "outputs": [], |
271 | | - "source": [ |
272 | | - "# max(discharge)" |
273 | | - ] |
274 | | - }, |
275 | 261 | { |
276 | 262 | "cell_type": "code", |
277 | 263 | "execution_count": 9, |
|
289 | 275 | "# print(maxdischarge)" |
290 | 276 | ] |
291 | 277 | }, |
292 | | - { |
293 | | - "cell_type": "code", |
294 | | - "execution_count": 10, |
295 | | - "id": "e6693540-e767-4a18-af9e-e5b6113d8ae7", |
296 | | - "metadata": { |
297 | | - "jupyter": { |
298 | | - "source_hidden": true |
299 | | - } |
300 | | - }, |
301 | | - "outputs": [], |
302 | | - "source": [ |
303 | | - "# import scipy.stats as stats\n", |
304 | | - "# import math\n", |
305 | | - "# # # discharge data > 20 m³/s\n", |
306 | | - "# # data = [value for value in discharge if value > 20]\n", |
307 | | - "\n", |
308 | | - "# # all discharge data\n", |
309 | | - "# cleaned_discharge = [x for x in discharge if not math.isnan(x)]\n", |
310 | | - "# data = cleaned_discharge\n", |
311 | | - "\n", |
312 | | - "# # # maximum annual discharge\n", |
313 | | - "# # data = [x for x in maxdischarge if not math.isnan(x)]\n", |
314 | | - "# # # print(data)\n", |
315 | | - "\n", |
316 | | - "# # Generalized Extreme Value (GEV) distribution \n", |
317 | | - "# shape, loc, scale = stats.genextreme.fit(data)\n", |
318 | | - "\n", |
319 | | - "# # Define threshold value\n", |
320 | | - "# threshold = 530\n", |
321 | | - "\n", |
322 | | - "# # calculate exceedance probability in years\n", |
323 | | - "# p = 1 - stats.genextreme.cdf(threshold, shape, loc=loc, scale=scale)\n", |
324 | | - "# # calculate return period in years\n", |
325 | | - "# T = 1 / (p * 365.25)\n", |
326 | | - "# # print(T)\n", |
327 | | - "\n", |
328 | | - "# # calculate change threshold exceedance at least once in 1000 and 1100 years\n", |
329 | | - "# P_1000 = 1 - (1 - p) ** 1000\n", |
330 | | - "# P_1100 = 1 - (1 - p) ** 1100\n", |
331 | | - "\n", |
332 | | - "# # Results 1000\n", |
333 | | - "# print(f\"Returnperiod for 530 m³/s: {T:.2f} years\")\n", |
334 | | - "# print(f\"Chance of at least one exceedance in 1000 years: {P_1000:.5f} ({P_1000 * 100:.2f}%)\")\n", |
335 | | - "# print(f\"Chance of at least one exceedance in 1100 years: {P_1100:.5f} ({P_1100 * 100:.2f}%)\")\n", |
336 | | - "\n", |
337 | | - "# # expected amount of times threshold is exceeded in 1000 years\n", |
338 | | - "# expected_exceedances1000 = 1000 / T if T > 0 else 0\n", |
339 | | - "# print(f\"The discharge currently exceeds the threshold of 530 m³/s {expected_exceedances1000:.3f} times in 1000 years\")\n", |
340 | | - "\n", |
341 | | - "# # expected amount threshold is exceeded in 1100 years\n", |
342 | | - "# expected_exceedances1100 = 1100 / T if T > 0 else 0\n", |
343 | | - "# print(f\"The discharge currently exceeds the threshold of 530 m³/s {expected_exceedances1100:.3f} times in 1100 years\")" |
344 | | - ] |
345 | | - }, |
346 | 278 | { |
347 | 279 | "cell_type": "code", |
348 | 280 | "execution_count": 27, |
|
0 commit comments