Skip to main content

Calculate waterdepths for 3Di results.

Project description

threedidepth

Calculate waterdepths for 3Di results.

  • Interpolated or gridcell-constant waterlevels

  • Interfaces with threediresults via threedigrid

  • Progress indicator support

  • Low memory consumption

For the interpolated mode, the ‘lizard’-method is used. For a detailed description, read the docstring for the LizardLevelCalculator.

Installation

Make sure GDAL is available as (from osgeo import gdal)

$ pip install threedidepth

Usage

From the cli:

$ threedidepth gridadmin.h5 results_3di.nc dem.tif waterdepth.tif

Or python:

>>> threedidepth.calculate_waterdepth(...)

Development installation with docker-compose

For development, clone the repository and use a docker-compose setup:

$ docker-compose build --build-arg uid=`id -u` --build-arg gid=`id -g` lib
$ docker-compose up --no-start
$ docker-compose start
$ docker-compose exec lib bash

Create a virtualenv:

# note that Dockerfile prepends .venv/bin to $PATH
(docker)$ virtualenv .venv --system-site-packages

Install dependencies & package and run tests:

(docker)$ pip install -r requirements.txt
(docker)$ pip install -e .[test]
(docker)$ pytest

Update packages:

(docker)$ rm -rf .venv
(docker)$ virtualenv .venv --system-site-packages
(docker)$ pip install -e .
(docker)$ pip freeze | grep -v threedidepth > requirements.txt

Changelog of threedidepth

0.4 (2021-03-23)

  • Enabled multiple calculation steps.

  • Added netCDF output option.

0.3 (2021-02-10)

  • Reorder to match the lizard triangulation.

0.2 (2020-12-10)

  • Implemented lizard method and set it as default.

0.1.2 (2020-09-21)

  • Fix off-by-one-pixel nodgrid.

0.1.1 (2020-09-11)

  • Fix flipped nodgrid.

0.1 (2020-09-03)

  • First version.

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

threedidepth-0.4.tar.gz (17.8 kB view hashes)

Uploaded Source

Built Distribution

threedidepth-0.4-py2.py3-none-any.whl (14.1 kB view hashes)

Uploaded Python 2 Python 3

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