This is an advanced tutorial. This tutorial requires experience with SOBEK, a working hydraulic model and (basic) experience with Python. The following beginner and intermediate tutorials are recommended prior to trying this tutorial: If you are new to Python in general, consider following online courses to get acquainted with the basics, e.g.:
|
In this tutorial we will use DeltaShell's build-in Python scripting module to access results from a SOBEK (Flow1D) model. We will plot results using DeltaShell's graphing functionality and write results to csv file for easy access with your favourite text or spreadsheet editor.
We will use Python scripts from the OpenEarth repository, which make use of the standard library delivered with any DeltaShell distribution. If you are not familiar how to access the OpenEarth scripts, please see this tutorial first. |
Add the steps involved:
First we will import the necessary modules from the ModellerFunctions packages:
from ModellerFunctions import dsget # This module contains convenience functions for quick access from ModellerFunctions import dsplot as dpl # This module provides a more 'matplotlib' like plotting interface |
With the packages imported, we need to retrieve the flow model.
# Retrieve the flow model flow = dsget.GetFlow1DModel() # Check if you have the correct model: print 'Retrieving data from model: %s' % flow.Name |
Related articles appear here based on the labels you select. Click to edit the macro and add or change labels.