{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Res1D - Access static network data" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:22.827475Z", "iopub.status.busy": "2024-11-06T14:20:22.826696Z", "iopub.status.idle": "2024-11-06T14:20:24.245320Z", "shell.execute_reply": "2024-11-06T14:20:24.244846Z" } }, "outputs": [], "source": [ "import mikeio1d" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.247456Z", "iopub.status.busy": "2024-11-06T14:20:24.246999Z", "iopub.status.idle": "2024-11-06T14:20:24.489153Z", "shell.execute_reply": "2024-11-06T14:20:24.488477Z" } }, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res = mikeio1d.open(\"../tests/testdata/network.res1d\")\n", "res" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Useful representations show available names and quantities" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.491836Z", "iopub.status.busy": "2024-11-06T14:20:24.491170Z", "iopub.status.idle": "2024-11-06T14:20:24.496920Z", "shell.execute_reply": "2024-11-06T14:20:24.496246Z" } }, "outputs": [ { "data": { "text/html": [ "<ResultNodes>\n", " \n", "
Names (119)
Quantities (1)
Derived Quantities (3)
" ], "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.nodes" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.499218Z", "iopub.status.busy": "2024-11-06T14:20:24.498818Z", "iopub.status.idle": "2024-11-06T14:20:24.503753Z", "shell.execute_reply": "2024-11-06T14:20:24.503159Z" } }, "outputs": [ { "data": { "text/html": [ "<ResultReaches>\n", " \n", "
Names (118)
  • 100l1
  • 101l1
  • 102l1
  • 103l1
  • 104l1
  • 105l1
  • 106l1
  • 107l1
  • 108l1
  • 109l1
  • 10l1
  • 110l1
  • 111l1
  • 112l1
  • 113l1
  • 114l1
  • 116l1
  • 117l1
  • 118l1
  • 119l1
  • 11l1
  • 12l1
  • 13l1
  • 14l1
  • 15l1
  • 16l1
  • 17l1
  • 1l1
  • 20l1
  • 21l1
  • 22l1
  • 23l1
  • 24l1
  • 25l1
  • 26l1
  • 27l1
  • 28l1
  • 29l1
  • 2l1
  • 30l1
  • 31l1
  • 32l1
  • 33l1
  • 34l1
  • 35l1
  • 36l1
  • 37l1
  • 38l1
  • 39l1
  • 3l1
  • 40l1
  • 41l1
  • 42l1
  • 43l1
  • 44l1
  • 45l1
  • 46l1
  • 47l1
  • 48l1
  • 49l1
  • 4l1
  • 50l1
  • 51l1
  • 52l1
  • 53l1
  • 54l1
  • 55l1
  • 56l1
  • 57l1
  • 58l1
  • 59l1
  • 5l1
  • 60l1
  • 61l1
  • 62l1
  • 63l1
  • 64l1
  • 65l1
  • 66l1
  • 67l1
  • 68l1
  • 69l1
  • 6l1
  • 70l1
  • 71l1
  • 72l1
  • 73l1
  • 74l1
  • 75l1
  • 76l1
  • 77l1
  • 78l1
  • 79l1
  • 7l1
  • 80l1
  • 81l1
  • 82l1
  • 83l1
  • 84l1
  • 85l1
  • 86l1
  • 87l1
  • 88l1
  • 89l1
  • 8l1
  • 90l1
  • 91l1
  • 92l1
  • 93l1
  • 94l1
  • 95l1
  • 96l1
  • 97l1
  • 98l1
  • 99l1
  • 9l1
  • Weir:119w1
  • Pump:115p1
Quantities (2)
  • Water level (m)
  • Discharge (m^3/s)
Derived Quantities (6)
  • ReachAbsoluteDischarge
  • ReachFilling
  • ReachFlooding
  • ReachQQManning
  • ReachWaterDepth
  • ReachWaterLevelAboveCritical
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Specific locations also include static network data" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.505911Z", "iopub.status.busy": "2024-11-06T14:20:24.505536Z", "iopub.status.idle": "2024-11-06T14:20:24.509900Z", "shell.execute_reply": "2024-11-06T14:20:24.509333Z" } }, "outputs": [ { "data": { "text/html": [ "<Manhole: 101>\n", " \n", "
Attributes (8)
  • id: 101
  • type: Manhole
  • xcoord: -687859.5004882812
  • ycoord: -1056308.700012207
  • ground_level: 196.67999267578125
  • bottom_level: 195.92999267578125
  • critical_level: inf
  • diameter: 1.0
Quantities (1)
  • Water level (m)
Derived Quantities (3)
  • NodeFlooding
  • NodeWaterDepth
  • NodeWaterLevelAboveCritical
" ], "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.nodes[\"101\"]" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.511654Z", "iopub.status.busy": "2024-11-06T14:20:24.511356Z", "iopub.status.idle": "2024-11-06T14:20:24.515675Z", "shell.execute_reply": "2024-11-06T14:20:24.515166Z" } }, "outputs": [ { "data": { "text/plain": [ "(-687859.5004882812, -1056308.700012207)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.nodes[\"101\"].xcoord, res.nodes[\"101\"].ycoord" ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.517833Z", "iopub.status.busy": "2024-11-06T14:20:24.517333Z", "iopub.status.idle": "2024-11-06T14:20:24.521406Z", "shell.execute_reply": "2024-11-06T14:20:24.520770Z" } }, "outputs": [ { "data": { "text/plain": [ "(196.67999267578125, 195.92999267578125)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.nodes[\"101\"].ground_level, res.nodes[\"101\"].bottom_level" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.522984Z", "iopub.status.busy": "2024-11-06T14:20:24.522649Z", "iopub.status.idle": "2024-11-06T14:20:24.526634Z", "shell.execute_reply": "2024-11-06T14:20:24.526173Z" } }, "outputs": [ { "data": { "text/html": [ "<Reach: 100l1>\n", " \n", "
Attributes (9)
  • name: 100l1
  • length: 47.6827148432828
  • start_chainage: 0.0
  • end_chainage: 47.6827148432828
  • n_gridpoints: 3
  • start_node: 100
  • end_node: 99
  • height: 0.30000001192092896
  • full_flow_discharge: 0.12058743359507902
Quantities (2)
  • Water level (m)
  • Discharge (m^3/s)
Derived Quantities (6)
  • ReachAbsoluteDischarge
  • ReachFilling
  • ReachFlooding
  • ReachQQManning
  • ReachWaterDepth
  • ReachWaterLevelAboveCritical
" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"]" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.528051Z", "iopub.status.busy": "2024-11-06T14:20:24.527813Z", "iopub.status.idle": "2024-11-06T14:20:24.531666Z", "shell.execute_reply": "2024-11-06T14:20:24.531217Z" } }, "outputs": [ { "data": { "text/plain": [ "['0.000', '23.841', '47.683']" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"].chainages" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.533289Z", "iopub.status.busy": "2024-11-06T14:20:24.532966Z", "iopub.status.idle": "2024-11-06T14:20:24.536485Z", "shell.execute_reply": "2024-11-06T14:20:24.536002Z" } }, "outputs": [ { "data": { "text/plain": [ "'100'" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"].start_node" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.538055Z", "iopub.status.busy": "2024-11-06T14:20:24.537639Z", "iopub.status.idle": "2024-11-06T14:20:24.541015Z", "shell.execute_reply": "2024-11-06T14:20:24.540559Z" } }, "outputs": [ { "data": { "text/plain": [ "'99'" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"].end_node" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.542422Z", "iopub.status.busy": "2024-11-06T14:20:24.542057Z", "iopub.status.idle": "2024-11-06T14:20:24.545538Z", "shell.execute_reply": "2024-11-06T14:20:24.544980Z" } }, "outputs": [ { "data": { "text/plain": [ "0.12058743359507902" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"].full_flow_discharge" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.547249Z", "iopub.status.busy": "2024-11-06T14:20:24.546874Z", "iopub.status.idle": "2024-11-06T14:20:24.550400Z", "shell.execute_reply": "2024-11-06T14:20:24.549890Z" } }, "outputs": [ { "data": { "text/html": [ "<ResultGridPoint>\n", " \n", "
Attributes (5)
  • reach_name: 100l1
  • chainage: 47.6827148432828
  • xcoord: -687907.999206543
  • ycoord: -1056412.0
  • bottom_level: 194.66000366210938
Quantities (1)
  • Water level (m)
Derived Quantities (0)
    " ], "text/plain": [ "" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"][-1]" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.552497Z", "iopub.status.busy": "2024-11-06T14:20:24.552246Z", "iopub.status.idle": "2024-11-06T14:20:24.555917Z", "shell.execute_reply": "2024-11-06T14:20:24.555377Z" } }, "outputs": [ { "data": { "text/plain": [ "47.6827148432828" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"][-1].chainage" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.557454Z", "iopub.status.busy": "2024-11-06T14:20:24.557152Z", "iopub.status.idle": "2024-11-06T14:20:24.560553Z", "shell.execute_reply": "2024-11-06T14:20:24.560118Z" } }, "outputs": [ { "data": { "text/plain": [ "(-687907.999206543, -1056412.0)" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"][-1].xcoord, res.reaches[\"100l1\"][-1].ycoord" ] }, { "cell_type": "code", "execution_count": 16, "metadata": { "execution": { "iopub.execute_input": "2024-11-06T14:20:24.562010Z", "iopub.status.busy": "2024-11-06T14:20:24.561861Z", "iopub.status.idle": "2024-11-06T14:20:24.565903Z", "shell.execute_reply": "2024-11-06T14:20:24.564932Z" } }, "outputs": [ { "data": { "text/plain": [ "194.66000366210938" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res.reaches[\"100l1\"][-1].bottom_level" ] } ], "metadata": { "kernelspec": { "display_name": ".venv", "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.12.7" } }, "nbformat": 4, "nbformat_minor": 2 }