{ "cells": [ { "cell_type": "markdown", "source": [ "# Example Commandline Use" ], "metadata": { "collapsed": false, "pycharm": { "name": "#%% md\n" } } }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "usage: __main__.py [-h] -i INPUT\n", " [-ws {ATV-A_121,DWA-A_531,DWA-A_531_advektiv}]\n", " [-kind {partial,annual}] [-t {>= 0.5 a and <= 100 a}]\n", " [-d {>= 5 min and <= 8640 min}] [-r {>= 0 L/s*ha}]\n", " [-h_N {>= 0 mm}] [--r_720_1] [--plot] [--export_table]\n", "\n", "heavy rain as a function of the duration and the return period acc. to DWA-A\n", "531 (2012) All files will be saved in the same directory of the input file but\n", "in a subfolder called like the inputfile + \"_idf_data\". Inside this folder a\n", "file called \"idf_parameter.yaml\"-file will be saved and contains interim-\n", "calculation-results and will be automatically reloaded on the next call.\n", "\n", "optional arguments:\n", " -h, --help show this help message and exit\n", " -i INPUT, --input INPUT\n", " input file with the rain time-series (csv or parquet)\n", " -ws {ATV-A_121,DWA-A_531,DWA-A_531_advektiv}, --worksheet {ATV-A_121,DWA-A_531,DWA-A_531_advektiv}\n", " From which worksheet the recommendations for\n", " calculating the parameters should be taken.\n", " -kind {partial,annual}, --series_kind {partial,annual}\n", " The kind of series used for the calculation.\n", " (Calculation with partial series is more precise and\n", " recommended.)\n", " -t {>= 0.5 a and <= 100 a}, --return_period {>= 0.5 a and <= 100 a}\n", " return period in years (If two of the three variables\n", " (rainfall (height or flow-rate), duration, return\n", " period) are given, the third variable is calculated.)\n", " -d {>= 5 min and <= 8640 min}, --duration {>= 5 min and <= 8640 min}\n", " duration in minutes (If two of the three variables\n", " (rainfall (height or flow-rate), duration, return\n", " period) are given, the third variable is calculated.)\n", " -r {>= 0 L/(s*ha)}, --flow_rate_of_rainfall {>= 0 L/(s*ha)}\n", " rainfall in Liter/(s * ha) (If two of the three\n", " variables (rainfall (height or flow-rate), duration,\n", " return period) are given, the third variable is\n", " calculated.)\n", " -h_N {>= 0 mm}, --height_of_rainfall {>= 0 mm}\n", " rainfall in mm or Liter/m^2 (If two of the three\n", " variables (rainfall (height or flow-rate), duration,\n", " return period) are given, the third variable is\n", " calculated.)\n", " --r_720_1 design rainfall with a duration of 720 minutes (=12 h)\n", " and a return period of 1 year\n", " --plot get a plot of the idf relationship\n", " --export_table get a table of the most frequent used values\n" ] } ], "source": [ "! python -m idf_analysis -h" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I used the rain-time-series from ehyd.gv.at with the ID 112086 (Graz-Andritz)" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using the subfolder \"ehyd_112086_idf_data\" for the interim- and final-results.\n", "Found existing interim-results in \"ehyd_112086_idf_data\\idf_parameters.yaml\" and using them for calculations.\n" ] } ], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using the subfolder \"ehyd_112086_idf_data\" for the interim- and final-results.\n", "Found existing interim-results in \"ehyd_112086_idf_data\\idf_parameters.yaml\" and using them for calculations.\n", "Resultierende Regenhöhe h_N(T_n=1.0a, D=720.0min) = 49.29 mm\n", "Resultierende Regenspende r_N(T_n=1.0a, D=720.0min) = 11.41 L/(s*ha)\n" ] } ], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet --r_720_1" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using the subfolder \"ehyd_112086_idf_data\" for the interim- and final-results.\n", "Found existing interim-results in \"ehyd_112086_idf_data\\idf_parameters.yaml\" and using them for calculations.\n", "Resultierende Regenhöhe h_N(T_n=1.0a, D=720.0min) = 49.29 mm\n", "Resultierende Regenspende r_N(T_n=1.0a, D=720.0min) = 11.41 L/(s*ha)\n" ] } ], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet -d 720 -t 1" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using the subfolder \"ehyd_112086_idf_data\" for the interim- and final-results.\n", "Found existing interim-results in \"ehyd_112086_idf_data\\idf_parameters.yaml\" and using them for calculations.\n", "The return period is 2.0 years.\n", "Resultierende Regenhöhe h_N(T_n=2.0a, D=720.0min) = 60.00 mm\n", "Resultierende Regenspende r_N(T_n=2.0a, D=720.0min) = 13.89 L/(s*ha)\n" ] } ], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet -d 720 -h_N 60" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet -t 5 -t 15" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using the subfolder \"ehyd_112086_idf_data\" for the interim- and final-results.\n", "Found existing interim-results in \"ehyd_112086_idf_data\\idf_parameters.yaml\" and using them for calculations.\n", "Created the IDF-curves-plot and saved the file as \"ehyd_112086_idf_data\\idf__curves_plot.png\".\n" ] } ], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet --plot" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Using the subfolder \"ehyd_112086_idf_data\" for the interim- and final-results.\n", "Found existing interim-results in \"ehyd_112086_idf_data\\idf_parameters.yaml\" and using them for calculations.\n", "return period (a) 1 2 3 5 10 20 25 30 50 75 100\n", "frequency (1/a) 1.000 0.500 0.333 0.200 0.100 0.050 0.040 0.033 0.020 0.013 0.010\n", "duration (min) \n", "5.0 9.39 10.97 11.89 13.04 14.61 16.19 16.69 17.11 18.26 19.18 19.83\n", "10.0 15.15 17.62 19.06 20.88 23.35 25.82 26.62 27.27 29.09 30.54 31.56\n", "15.0 19.03 22.25 24.13 26.51 29.72 32.94 33.98 34.83 37.20 39.08 40.42\n", "20.0 21.83 25.71 27.99 30.85 34.73 38.62 39.87 40.89 43.75 46.02 47.63\n", "30.0 25.60 30.66 33.62 37.35 42.41 47.47 49.10 50.43 54.16 57.12 59.22\n", "45.0 28.92 35.51 39.37 44.23 50.83 57.42 59.54 61.28 66.14 69.99 72.73\n", "60.0 30.93 38.89 43.54 49.40 57.36 65.31 67.88 69.97 75.83 80.49 83.79\n", "90.0 33.37 41.74 46.64 52.80 61.17 69.54 72.23 74.43 80.60 85.49 88.96\n", "180.0 38.01 47.13 52.46 59.18 68.30 77.42 80.36 82.76 89.48 94.81 98.60\n", "270.0 41.01 50.60 56.21 63.28 72.87 82.46 85.55 88.07 95.14 100.75 104.73\n", "360.0 43.29 53.23 59.04 66.37 76.31 86.25 89.45 92.06 99.39 105.20 109.33\n", "450.0 45.14 55.36 61.33 68.87 79.08 89.30 92.59 95.28 102.81 108.79 113.03\n", "600.0 47.64 58.23 64.43 72.23 82.82 93.41 96.82 99.61 107.42 113.61 118.01\n", "720.0 49.29 60.13 66.47 74.45 85.29 96.12 99.61 102.46 110.44 116.78 121.28\n", "1080.0 54.41 64.97 71.15 78.94 89.50 100.06 103.46 106.24 114.02 120.20 124.58\n", "1440.0 58.02 67.72 73.39 80.54 90.24 99.93 103.05 105.61 112.75 118.42 122.45\n", "2880.0 66.70 77.41 83.68 91.57 102.29 113.00 116.45 119.26 127.16 133.42 137.87\n", "4320.0 71.93 85.72 93.78 103.95 117.73 131.52 135.96 139.58 149.75 157.81 163.53\n", "5760.0 78.95 95.65 105.42 117.72 134.43 151.13 156.50 160.89 173.20 182.97 189.90\n", "7200.0 83.53 101.38 111.82 124.98 142.83 160.68 166.43 171.12 184.28 194.72 202.13\n", "8640.0 85.38 104.95 116.40 130.82 150.38 169.95 176.25 181.40 195.82 207.27 215.39\n", "Created the IDF-curves-plot and saved the file as \"ehyd_112086_idf_data\\idf_table.csv\".\n" ] } ], "source": [ "! python -m idf_analysis -i ehyd_112086.parquet --export_table" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.1" } }, "nbformat": 4, "nbformat_minor": 1 }