https://github.com/alexlipp/flowaccum

Cython implementation of D8 FlowAccumulation on a grid

https://github.com/alexlipp/flowaccum

Science Score: 39.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (7.7%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Cython implementation of D8 FlowAccumulation on a grid

Basic Info
  • Host: GitHub
  • Owner: AlexLipp
  • Language: Python
  • Default Branch: main
  • Size: 339 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 2 years ago · Last pushed 9 months ago
Metadata Files
Readme

README.md

Python module for accumulating flow on a D8 flow grid. This class can be used to calculate drainage area and discharge, and to accumulate any other tracer across a drainage network.

Builds a network of nodes from a D8 flow grid. Uses a stack-based algorithm to traverse the network in topological order, modified from Braun & Willet (2013) DOI: 10.1016/j.geomorph.2012.10.008. This is faster than the recursive algorithm used in original Landlab implementation as we use an iterative build_stack algorithm (much faster). Most of the code is written in Cython for speed. The approach is linear w.r.t. the number of nodes in the network. Class is designed to be used with geospatial rasters, but can also be used with a numpy array of D8 flow directions.

Installation

To install run: python setup.py build_ext --inplace This compiles the Cython scripts and allows them to be imported into python scripts. Note this does not install a package so any scripts using this module must be in the same directory as the compiled files.

Example of use

An example of use is given in the script example.py which analyses the flow accumulation and drainage area of the domain covered by d8_eg.nc.

Owner

  • Name: Alex Lipp
  • Login: AlexLipp
  • Kind: user
  • Location: Oxford, UK
  • Company: Merton College, Oxford

Earth & Environmental Scientist at the University of Oxford

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1

Dependencies

setup.py pypi