GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hellolulujiang/flowtopo: Serial orderings, parallel layerings and spatial partitions for D8 flow networks, computed once from the flow-direction grid and reused by any drainage-order computation. Python reference implementation.

BranchesTags
Open more actions menu

Latest commit

 

History

115 Commits
115 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
data
data
 
 
docs
docs
 
 
examples
examples
 
 
flowtopo
flowtopo
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
DATA_NOTICE.md
DATA_NOTICE.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
benchmark.py
benchmark.py
 
 
example.py
example.py
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

FlowTopo

FlowTopo builds reusable orderings, parallel layerings and spatial partitions from a D8 flow-direction grid.

topological sort from the sources
ordering="topo"
breadth-first from the pit
ordering="bfs"
depth-first from the pit
ordering="dfs"
a cell is appended once all its donors are donecells in order of hop count from the pitone tributary subtree at a time; best cache locality

Three serial orderings visit every cell once while respecting the flow dependencies.

Install

git clone https://github.com/hellolulujiang/flowtopo.git
cd flowtopo
pip install -e ".[speed]"

Python 3.10 or newer. The speed extra enables threaded kernels.

Quick start

import flowtopo

topo = flowtopo.FlowTopo.from_raster("data/dir_example.tif")
upa = topo.upstream_area(ordering="dfs")  # km²
upa_grid = topo.to_2d(upa)

The bundled MERIT Hydro basin has 93,432 valid cells. Input requirements.

Structures and propagation

Many threads: which cells together?

Three parallel layerings. Layers run in order; the cells of one layer run at the same time.

as-soon-as-possible
layering="asap"
conflict-free downstream
layering="cfds"
as-late-as-possible
layering="alap"
every cell in the earliest layer its donors allowas-soon-as-possible, plus: no two cells in a layer share a receiverevery cell as late as the longest flow path allows; the most evenly filled layers in practice

Several processors: which cells where?

Two basins onto two subregions: (a) whole basins, unbalanced; (b) the dominant basin cut along its mainstem, a tributary subtree moved; (c) balanced.

basin-level
level="basin"
subbasin-level
level="subbasin"
whole basins go to subregions; a dominant basin cannot be balancedthe basins that keep the parts from balancing, usually the dominant one, are opened along their mainstems; their tributary subtrees balance the load, and the held-back mainstem section runs in a separate stage

At a confluence: how does a value reach the receiver?

Three propagation manners. The structure decides when a cell runs; the manner decides who writes the result.

pull
manner="pull"
atomic push
manner="atomic_push"
push
manner="push"
each receiver reads its donors and writes only itself; needs the donor tabledonors write through atomics; correct, but float sums are not reproducibledonors write directly; deterministic, no locks; safe only under cfds

Data products

FullTopo v1.1 provides saved structures for the 90 MERIT Hydro regions of FullDivide v1.1. Contents and use.

Documentation

User guide · Methods and provenance · Notebook · Video · Animations · FullHydro tools

Tests · tests

Citing

Cite this repository with the release used and downloaded products by version. Code: FlowTopo code 1.1.3, 10.5281/zenodo.23732152. Paper: FlowTopo v1.0: a reusable computational foundation for hyperresolution hydrology on the global 90 m MERIT Hydro drainage network (Jiang et al., submitted to Geoscientific Model Development); it describes version 1.0, archived with its code at 10.5281/zenodo.22227621.

Acknowledgements

MERIT Hydro (Yamazaki et al., 2019) supplies the example grid. Foundational conventions follow pyflwdir (D. Eilander, Deltares; MIT); see provenance.

Licence

MIT; see LICENSE. The bundled MERIT Hydro excerpt retains its terms, CC BY-NC 4.0 or ODbL 1.0; see DATA_NOTICE.md.

About

Serial orderings, parallel layerings and spatial partitions for D8 flow networks, computed once from the flow-direction grid and reused by any drainage-order computation. Python reference implementation.

fullhydro.org/tools/flowtopo/

Topics

d8drainage-networkflow-directiongeotiffhydrologynumba

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.