Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nens/lizard-raster-reducer
Lizard raster reducer is a tool to auto-generate regional reports from Lizard data. It "reduces" raster data to aggregate statistics for multiple regions.
https://github.com/nens/lizard-raster-reducer
Last synced: 4 days ago
JSON representation
Lizard raster reducer is a tool to auto-generate regional reports from Lizard data. It "reduces" raster data to aggregate statistics for multiple regions.
- Host: GitHub
- URL: https://github.com/nens/lizard-raster-reducer
- Owner: nens
- License: mit
- Created: 2019-03-20T14:36:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-17T14:19:57.000Z (about 5 years ago)
- Last Synced: 2024-11-09T16:47:07.188Z (8 days ago)
- Language: Jupyter Notebook
- Size: 110 KB
- Stars: 0
- Watchers: 21
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
lizard-raster-reducer
==========================================Introduction
------------Lizard raster reducer is a tool to auto-generate regional reports from Lizard data.
It "reduces" raster data to aggregate statistics for multiple regions.
Lizard API endpoints are used to retrieve data. The main ones are search, rasters, regions and raster-aggregates.
To prevent API overload, the tool creates and fills a 'lizard_cache' folder by default.Multiple rasters can be specified. The first raster will act as the scope raster.
The scope raster determines the spatial extent and temporal behaviour of the result. Rasters can be temporal or static. Rasters can contain continuous values or discrete classes. Regions of one region type are used for the result. Regions within the spatial extent of the scope raster are used in the result. A configuration file is used to customize the output.The results are aggregate numbers of data per region.
When the data type is interval or ratio, the average of the region is returned.
When data are classes, the area fraction per class are returned.
The output format can be specified to be CSV, JSON or HTML.Installation
------------We can be installed with::
$ pip install lizard-raster-reducer
Usage (iPython notebook example)
--------------------------------`This example notebook (link) `_ exemplifies how the Lizard raster reducer can be used.
Usage (command line example)
----------------------------Create .yml configuration files from templates::
$ run-lizard-raster-reducer
1. Specify reducer options in reducer_options.yml.
2. Specify Lizard credentials in credentials.yml
3. Review optional arguments to pass: run-lizard-raster-reducer -h
4. Run the code: run-lizard-raster-reducer
5. Find result(s) in local sub-folder /reducer_results
Development installation of this project itself
-----------------------------------------------We're installed with `pipenv `_, a handy wrapper
around pip and virtualenv. Install that first with ``pip install
pipenv``. Then run::$ PIPENV_VENV_IN_PROJECT=1 pipenv --three
$ pipenv install --devThere will be a script you can run like this::
$ pipenv run run-lizard-raster-reducer
It runs the `main()` function in `lizard-raster-reducer/scripts.py`,
adjust that if necessary. The script is configured in `setup.py` (see
`entry_points`).In order to get nicely formatted python files without having to spend manual
work on it, run the following command periodically::$ pipenv run black lizard_raster_reducer
Run the tests regularly. This also checks with pyflakes, black and it reports
coverage. Pure luxury::$ pipenv run pytest
The tests are also run automatically `on travis-ci
`_, you'll see it
in the pull requests. There's also `coverage reporting
`_ on
coveralls.io (once it has been set up).If you need a new dependency (like `requests`), add it in `setup.py` in
`install_requires`. Afterwards, run install again to actually install your
dependency::$ pipenv install --dev