Let’s combine GRASS, Python and R

Satellite time series data for species distribution modeling

Author

Verónica Andreo

Published

July 1, 2024

Traditionally, species distribution models (SDM) use climatic data as predictors of habitat suitability for the target species. In this studio, we will explore the use of satellite data to derive relevant predictors. The satellite data processing, from download to analysis, will be performed using GRASS GIS software functionality. Then, we’ll read our predictors within R and perform SDM, visualize and analyze results there, to then exemplify how to write the output distribution maps back into GRASS.

Run this session online

We’ll run this session online within the Whole Tale platform. Whole Tale is an NSF-funded Data Infrastructure Building Block (DIBBS) initiative to build a scalable, open source, web-based, multi-user platform for reproducible research. It enables the creation, publication, and execution of tales - executable research objects that capture data, code, and the complete software environment used to produce research findings. It’s also great for teaching, as participants do not need to install all software packages required. They only need to register with institutional or personal email and they are ready to go!

Run the session online: Let’s combine GRASS, Python and R

If The Whole Tale does not work, we’ll use Google Colab. In that case, we’ll need to open the notebooks stored here within Colab as shown below:

Furthermore, we’ll need to set up our environment within Google Drive. See Section 2.3.

Run this session locally

Software

If you still want to run the workshop locally, you’ll find instructions and requirements below.

GRASS GIS

We will use GRASS GIS 8.3+. It can be installed either through standalone installers/binaries or through OSGeo-Live (a linux based virtual machine which includes all OSGeo software and packages).

MS Windows

For Windows users, we strongly recommend installing GRASS GIS through the OSGeo4W package, since it allows to install all OSGeo software and resolves dependencies.

Ubuntu Linux

Install GRASS GIS 8.3+ from the “unstable” package repository:

  sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
  sudo apt-get update
  sudo apt-get install grass grass-gui grass-dev
Fedora, openSuSe Linux

For other Linux distributions including Fedora and openSuSe, simply install GRASS GIS with the respective package manager. See also here

Mac OS

Find GRASS GIS binaries on http://grassmac.wikidot.com/ or install the latest available version from MacPorts.

GRASS GIS Add-ons

Install with g.extension extension=name_of_addon

R packages

The following R packages should be installed beforehand:

  install.packages(c("rgrass","terra","sf","mapview","biomod2","dismo","usdm","SDMtune","zeallot","rJava","ggpubr"))

Python libraries

The following Python libraries should be installed beforehand:

  pip install folium 

Other software

We will use the software MaxEnt to model habitat suitability. It can be downloaded from: https://biodiversityinformatics.amnh.org/open_source/maxent/

Data

  • Records of Aedes albopictus (Asian tiger mosquito) in Northern Italy downloaded from GBIF
  • Average daily MODIS LST reconstructed by mundialis GmbH & Co. KG based on Metz et al. (2017):
    • 1 km spatial resolution
    • Converted to Celsius degrees

Get the sample project

  • Create a folder named grass_foss4geu_2024
  • Within grass_foss4geu_2024 create a folder named grassdata
  • Download the eu_laea project with LST mapset and unzip it within your grassdata folder
  • Download mosquito data and drop it within grass_foss4geu_2024

The grass_foss4geu_2024 folder’s tree should look like this:

  grass_foss4geu_2024/
  ├── aedes_albopictus.gpkg
  └── grassdata
      └── eu_laea
          ├── italy_LST_daily
          └── PERMANENT

Clone the repo and execute notebooks

Once you are set with software installation and data, you should download or clone the following repo: https://github.com/veroandreo/grass_foss4geu_2024 and execute notebooks in Jupyter and Rstudio, respectively.

References

Metz, M., Andreo, V., and Neteler, M. (2017), “A New Fully Gap-Free Time Series of Land Surface Temperature from MODIS LST Data,” Remote Sensing, 9, 1333. https://doi.org/10.3390/rs9121333.

:::