{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Res1D - Converting other result formats to res1d format" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import mikeio1d" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Any network result file that can be opened with mikeio1d can be saved into a res1d format." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'.crf', '.out', '.prf', '.res', '.res11', '.res1d', '.resx', '.whr', '.xrf'}" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mikeio1d.Res1D.get_supported_file_extensions()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Convert res11 to res1d as an example." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res = mikeio1d.open(\"../tests/testdata/network_cali.res11\")\n", "res" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "res.save(\"network_cali.res1d\")" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "res = mikeio1d.open(\"network_cali.res1d\")\n", "res" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Clean up" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "os.remove(\"network_cali.res1d\")" ] } ], "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 }