Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nens/raster-analysis
Various routines for analysis of rasters in raster stores.
https://github.com/nens/raster-analysis
Last synced: 4 days ago
JSON representation
Various routines for analysis of rasters in raster stores.
- Host: GitHub
- URL: https://github.com/nens/raster-analysis
- Owner: nens
- License: gpl-3.0
- Created: 2014-10-07T12:27:55.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-02-15T11:05:34.000Z (almost 4 years ago)
- Last Synced: 2024-04-12T01:12:29.497Z (7 months ago)
- Language: Python
- Homepage:
- Size: 86.9 KB
- Stars: 1
- Watchers: 36
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
How to calculate interpolated depth
===================================1. Know your bathymetry resolution::
$ gdalinfo dem.tif | grep 'Pixel Size'
2. Use it with the 'store-3di'\* command to build a set of derived 3Di
results, such as interpolated depth, maximum waterlevel, arrival times
and many more::$ mkdir raster
$ store-3di results_3di.nc dem.tif raster/storage raster/config -c 2 -w -a aggregate_results_3di.nchere the optional parameter '-c 2' indicates a cellsize of 2 and '-w'
enables the costly calculation of the wavefront map. Cellsize determines the
level of detail for interpolated variables and the wavefront map. Any time
aggregations found in the optional aggregate file will be available in the
results as well.3. Check the available period and frames using 'store-info'\*::
$ store-info raster/config/s1-dtri
4. Now you are ready to create geotiffs for your 3Di result. You need
a shapefile to provide the script with an area of interest. For example::$ mkdir output
$ lextract -c 5 5 -t 2014-07-28T18:00:00 shape raster/config/s1-quad output/s1-quad.tif
$ lextract -c 1 1 -t 2014-07-28T18:00:00 shape raster/config/depth-dtri output/depth-dtri.tifA note on the available configurations:
- raster/config/bathymetry: bathymetry
- raster/config/s1-quad: waterlevel (s1) in original computational cell layout
- raster/config/s1-dtri: waterlevel (s1) interpolated between computational cells
- raster/config/depth-quad: s1-quad minus bathymetry
- raster/config/depth-dtri: s1-dtri minus bathymetryAlso available are the variables derived from the per-quad maxima of the waterlevel:
- raster/config/s1-max-quad: temporal maximum of s1-quad
- raster/config/s1-max-dtri: temporal maximum of s1-dtri
- raster/config/depth-max-quad: temporal maximum of depth-quad
- raster/config/depth-max-dtri: temporal maximum of depth-dtriHere are some more exotic derivatives:
- raster/config/depth-first-dtri: Arrival time in seconds\*\*
- raster/config/rise-velocity-quad: Rise velocity in meters per second
- raster/config/ucr-max-quad: Maximum flow velocity in meters per second
- raster/config/vol-first-quad: Timestep(?) of arrival of first water in quadFurthermore, when supplying a aggregate_results_3di.nc file\*\*\*, a numer of
extra wrappers will be made available, depending on the contents of that
file. These will be (where [stat] could be something like 'avg'):- raster/config/s1_[stat]-max-quad: maximum waterlevel (s1) per quad
- raster/config/s1_[stat]-max-dtri: maximum waterlevel (s1) per quad, interpolated
- raster/config/depth_[stat]-max-quad: maximum waterdepth (s1 - bathymetry) per quad
- raster/config/depth_[stat]-max-dtri: maximum waterdepth (s1 - bathymetry) per quad, interpolated\*store-3di and store-info are commands from the nens/raster-store library.
\*\*only with the '-w' or '--wavefront' option.
\*\*\*with the '-a' or '--aggregate' option.
Development installation
========================For development, you can 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 bashCreate a virtualenv, install dependencies & package, run tests::
# note that Dockerfile prepends .venv/bin to $PATH
(docker)$ virtualenv --system-site-packages .venv
(docker)$ pip install -r requirements.txt --index-url https://packages.lizard.net
(docker)$ pip install -e .[test]
(docker)$ pytestUpdate packages::
(docker)$ rm -rf .venv
(docker)$ virtualenv --system-site-packages .venv
(docker)$ pip install -e . --index-url https://packages.lizard.net
(docker)$ pip freeze | grep -v raster-analysis > requirements.txtNow you are ready to run the scripts in the container.
Task server installation
------------------------One time server provisioning::
ansible-playbook -u arjan.verkerk ansible/provision.yml -i ansible/task.yml
Deploying new versions::
ansible-playbook ansible/deploy.yml -i ansible/task.yml
Be aware that if you provision a server for the first time, the authentication
needs to be setup. We may need a credentials file to access private packages on
packages.lizard.net, to be put in `deploy/files/nens_netrc` file.To enable users to use the raster-analysis scripts, append the absolute path to
``.venv/bin`` to the PATH in ``/etc/environment``.