/eHabpy

eHabitat+ enhanced segmentation and similarity maps for DOPA

Primary LanguagePython

eHabitat+

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

DOI

eHabitat+ GRASS GIS 7 scripts and Python 2.7 library for automatic delineation of habitats within protected areas (PA) and calculation of maps of probabilities to find areas presenting similar ecological characteristics to those found in PA within the corresponding ecoregion. A habitat similarity index (HSI) is computed based on the ratio between the extent of similar areas around the PA and the PA extent, as well as some landscape metrics and indices to characterize similar areas to PA. Processed results are being updated and can be accessed through the DOPA Explorer.

OS setup

sh conf_grass7eHabplus.sh # edit target folder
make -j2 # 2 is the number of available processors
sudo make install
  • Install python-pysal, scipy, scikit-learn, numpy, gdal, python-fiona, libudunits2-dev
  • Install R and required libraries:
    • vegan
    • ggplot2
    • rgdal
    • ade4
    • reshape2
    • RColorBrewer
    • sf

Running

Segmentation (segm_optim folder)

python segmentation_pca_par.py # it uses parallel processing

python # opens a python environment
from getmeanvar import * # alternative: from getmedianvar import *
run_batch_all()
exit()

python moranvar.py

Similarity

python subpas_loop_segm_optim.py # move to 'pas' folder

python # opens a python environment
from ehab_optim import * # alternative: from ehab_optim_median import *
run_batch() # it runs using all available processors in parallel
exit()

Rscript thdi.R