Skip to main content

educational activity for teaching how water is routed through a drainage basin

Project description

rain_table

Interactive rain table model written by Jeffrey Kwang at UIUC, refactored for SedEdu by Andrew J Moodie.

Build Status Build status

GitHub version Anaconda-Server Badge PyPI version

demo_gif

The version in this (SedEdu) repository is different than the original by Jeffrey. This version retains most of the functionality, but does not rely on the Pygame dependency. The cost is that this simulation runs a little bit slower, but is still fast enough to be fun. See Jeffrey's original implementation at here.

This repository is also linked into the SedEdu suite of education modules, and can be accessed there as well.

About the model

The model uses a D8 routing scheme to route rainfall over the surface of a DEM. All flow is assumed to be surface runoff. The hydrograph is scaled to the maximum baseflow equilibrium condition. These watersheds drain directly into the Columbia River in Washington state, (Lat 47°10'03.8"N, Lon 120°07'31.9"W).

Installing the module

This module depends on Python 3, tkinter, and the Python packages numpy, pillow, and matplotlib.

Installing Python 3

If you are new to Python, it is recommended that you install Anaconda, which is an open source distribution of Python which includes many basic scientific libraries, some of which are used in the module. Anaconda can be downloaded at https://www.anaconda.com/download/ for Windows, macOS, and Linux. If you do not have storage space on your machine for Anaconda or wish to install a smaller version of Python for another reason, see below on options for Miniconda or vanilla Python.

  1. Visit the website for Anaconda https://www.anaconda.com/download/ and select the installer for your operating system. Be sure to select the Python 3.x installation.
  2. Start the installer.
  3. If prompted, select to "install just for me", unless you know what you are doing.
  4. When prompted to add Anaconda to the path during installation, select yes if you know you do not have any other Python installed on your computer; otherwise select no.

See below for detailed instructions on installing rain_table for your operating system.

Installing the module

If you installed Anaconda Python or Miniconda, you can follow the instructions below for your operating system. Otherwise see the instructions for PyPi installation below.

Please open an issue if you encounter any troubles installing or any error messages along the way! Please include 1) operating system, 2) installation method, and 3) copy-paste the error.

Windows users

  1. Open your "start menu" and search for the "Anaconda prompt"; start this application.

  2. Install with the module type the following command and hit "enter":

conda install -c sededu rain_table

If asked to proceed, type Y and press "enter" to continue installation. 3. This process may take a few minutes as the necessary source code is downloaded. If the installation succeeds, proceed below to the "Run the module" section.

Note on permissions: you may need to run as administrator on Windows.

Mac OSX and Linux users

Linux users: you will need to also install tkinter before trying to install the module below package through conda or pip3. On Ubuntu this is done with sudo apt install python3-tk.

  1. Install the module by opening a terminal and typing the following command.
conda install -c sededu rain_table

If asked to proceed, type Y and press enter to continue installation.

  1. This process may take a few minutes as the necessary source code is downloaded. If the installation succeeds, proceed below to the "Run the module" section.

Note on permissions: you may need to use sudo on OSX and Linux.

Advanced user installations

To install with pip from Pypi use (not recommended for entry-level users):

pip3 install pyqt rain_table

or in the event of a failed install, try:

pip3 install pyqt5 sededu

See below instructions for downloading the source code if you wish to be able to modify the source code for development or for exploration.

Run the module

  1. Open a Python shell by typing python (or python3) at the terminal (OSX and Linux users) or at the Conda or Command Prompt (Windows users).
  2. Run the module from the Python shell with:
import rain_table

Instructions will indicate to use the following command to then run the module:

rain_table.run()

Alternatively, you can do this in one line from the standard terminal with:

python -c "import rain_table; rain_table.run()"

Alternatively, run the module with provided script (this is the hook used for launching from SedEdu):

python3 <path-to-installation>run_rain_table.py

Please open an issue if you encounter any additional error messages! Please include 1) operating system, 2) installation method, and 3) copy-paste the error.

Smaller Python installation options

Note that if you do not want to install the complete Anaconda Python distribution you can install Miniconda (a smaller version of Anaconda), or you can install Python alone and use a package manager called pip to do the installation. You can get Python and pip together here.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rain_table-3.0.4.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

rain_table-3.0.4-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file rain_table-3.0.4.tar.gz.

File metadata

  • Download URL: rain_table-3.0.4.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6

File hashes

Hashes for rain_table-3.0.4.tar.gz
Algorithm Hash digest
SHA256 e536fa2b5efcd798593348e8566cf0ccf4abb26eab175f53f5243c01b3b5c13a
MD5 7d0c0a81e7707a2d4f9c8682fd9c09a0
BLAKE2b-256 aeb512d4a9a60ef1f94deb69310c1edf3481d7975dd4b90c0dfd8cb4be0aeb59

See more details on using hashes here.

File details

Details for the file rain_table-3.0.4-py3-none-any.whl.

File metadata

  • Download URL: rain_table-3.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.5.6

File hashes

Hashes for rain_table-3.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9cff5593bf3614ce238b7bf999d0c20a944379ce87999a3acbe76fa3b38fc520
MD5 423ded1cefc8e52fb76a5c44baa8261d
BLAKE2b-256 634a02e1dfc07767715d1a322939f5eeef98e7d7f82be52d50733726ba9a54a5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page