Code Monkey home page Code Monkey logo

rascontrol's Introduction

rascontrol

Rascontrol is a Python wrapper for the HEC-RAS controller, described in Chris Goodell's book, Breaking the HEC-RAS Code, except you get to use Python instead of VBA! The library can be used to opening, running, and extracting model results from HEC-RAS models. Rascontrol is not recommended for modifying RAS model geometries, instead, use the parserasgeo library. The combination of rascontrol and parserasgeo can be used for sensitivity studies, Monte Carlo analyses, and real-time predication of floodwater depths when paired with appropriate rainfall data and hydrology.

Installation

The appropriate version of HEC-RAS must already be installed to use rascontrol.

c:\> git clone https://github.com/mikebannis/rascontrol.git

c:\> cd rascontrol

c:\rascontrol> pip install .

Basic Usage

>>> import rascontrol
>>> rc = rascontrol.RasController(version='506')
>>> rc.open_project('my_model.prj')
>>> rc.run_current_plan()
    
>>> # Get results
>>> profile = rc.get_profiles()[0]
>>> cross_sections = [100, 200, 300]  # Get results for cross sections 100, 200, & 300
>>> wsels = [rc.get_xs(xs).value(profile, rascontrol.WSEL) for xs in cross_sections]
>>> print(wsels)
[5002.3, 5003.5, 5005.1]

Known Issues

close() does not currently appear to be working. This does not typically cause problems during Monte Carlo simulations as rascontrol will use any RAS instance that is currently open. Because of this, rascontrol will simply reuse an open model if large numbers of simulations are required, versus opening multiple instances of RAS. Make sure you save any open models before using rascontrol!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.