Giter Club home page Giter Club logo

mfdrouting's Introduction

mfdrouting - Multiple Flow Direction (MFD) flow routing

This Python 3 module implements the Multiple Flow Direction (MFD) flow accumulation as proposed by Freeman (1991). As suggested by Freeman the free parameter p, the exponent that scales the fractions of flows, is tuned to the divergent flows of cones with p = 1.1, but can optionally be specified. It is written in C and based on the code by Pelletier (2008).

Install

git clone https://github.com/UP-RS-ESP/mfdrouting.git
cd mfdrouting
sudo python3 setup.py install

Alternatively, use the Cython version in the cython folder.

Usage

import numpy as np
import mfdrouting
help(mfdrouting)

will show:

SCA(z, cellwidth, exponent = 1.1)
Returns the specific catchment area of the topography (DEM) in z.

Parameters
----------
z : array_like
    A 2-D array containing the elevations of the topography (DEM).
cellwidth : float
    The cell width of the grid in meters.
exponent : float, optional
    The exponent determining the flow divergence in relation to the slope.
    See http://dx.doi.org/10.1016/0098-3004(91)90048-i.

Returns
-------
a : ndarray
    The specific catchment area matrix on the same grid as z (DEM).

Bugs

The in-build sink-filling routine is not able to handle NaN values or negative elevations. However, the Cython version converts all elevations so that the lowest is zero and converts NaN values to zeros. After flow accumulation NaN values are filled back in.

In case you receive a segmentation fault it is likely that the cause is a stack overflow. Please try running your Python scripts in a shell with an unlimited stack size. On Linux run

$ ulimit -s unlimited

in your shell of choice.

mfdrouting's People

Contributors

rheinwalt avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.