https://github.com/landscapegeoinformatics/lc_metrics_resources
Collection of scripts to compute large scale landscape metrics
https://github.com/landscapegeoinformatics/lc_metrics_resources
Last synced: 12 months ago
JSON representation
Collection of scripts to compute large scale landscape metrics
- Host: GitHub
- URL: https://github.com/landscapegeoinformatics/lc_metrics_resources
- Owner: LandscapeGeoinformatics
- License: gpl-3.0
- Created: 2019-10-10T06:38:59.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-12T13:36:43.000Z (over 6 years ago)
- Last Synced: 2025-02-28T12:47:07.612Z (over 1 year ago)
- Language: Python
- Size: 1.59 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# lc_metrics_resources
Collection of scripts to compute large scale landscape metrics.
For several examples working on the whole Amazon region we had several very similar scirpt and running configurations.
[](https://mybinder.org/v2/gh/LandscapeGeoinformatics/lc_metrics_resources/master?filepath=interactive-example.ipynb)
[](https://zenodo.org/badge/latestdoi/214106161)
Most importanly Python packages: `numpy`, `scipy`, `pandas`, `gdal`,`rasterio` and for emailing `sendgrid` (see examplary `conda`-based `environment.yml` file)
In each example folder there are several scripts that make up the experiment: a shell script (`calc_lcmodel_stats_test.sh` and `run.sh`) for sending calculation to background process via e.g. the Unix/Linux `nohup` command. Then the main python script (`second_stats_amz_prode_yearly.py` and `stats_runner.py` scripts respectively) that imports `lcmodel` and prepares and loads the raster into the required labelled numpy array structure. Also the metrics are selected in the main scripts. Finally, calculated metrics are collated into a `pandas` dataframe and saved into a .csv file.
For emailsending after a long-running calculation on Google Cloud platform we used `sendgrid`, as shown in the `demo_send_email.py` script, which would be invoked after the main Python script via the shell script. For that you need an own API key in the line `sg = sendgrid.SendGridAPIClient("xxx")`
## Attribution for LecoS
The core module `lcmodel.py` is based on Martin Jung's [LecoS](https://github.com/Martin-Jung/LecoS) - a Land cover statistics plugin for QGIS - which uses a Connected Component to calculates landscape metrics. The use can choose to calculate single or several metrics for the raster classes.
LecoS Reference:
Martin Jung, LecoS — A python plugin for automated landscape ecology analysis, Ecological Informatics, Volume 31, January 2016, Pages 18-21, ISSN 1574-9541, http://dx.doi.org/10.1016/j.ecoinf.2015.11.006.
Licence:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.