simple mapping of occurrence data: a package for making species distribution maps with Maxent.
smood
is in its earliest stages right now and therefore is very simple. While simplicity is one of my goals, I also want the package to be flexible enough to be useful for a bunch of types of projects. Please don't hesitate to raise an issue on Github if there's something else you want smood
to do!
Maxent is a java application that models the suitability of grid cells in a landscape using observational data (in our case, from GBIF) and environmental background layers (in our case, from WorldClim).
- Steven J. Phillips, Miroslav Dudík, Robert E. Schapire. [Internet] Maxent software for modeling species niches and distributions (Version 3.4.1). Available from url: http://biodiversityinformatics.amnh.org/open_source/maxent/. Accessed on 2019-11-25.
git clone https://github.com/pmckenz1/smood.git
pip install smood
We just have to provide 1) a species name and 2) lat/lon coordinates for a bounding box. smood
then automatically collects gbif observations and pushes them through maxent to make fun maps.
import smood
# define our object
mapobj = smood.Mapper(sp_name = "Monarda fistulosa",
lat_range=[19.0,52.0],
lon_range=[-125.0,-68.0])
The run()
function calls gbif to find all observations of the species within the bounding box, and then it runs maxent using these observations and the designated worldclim layers.
Although this writes to disk, everything that is written is then cleaned up unless you ask for it to stay with write_outputs=True
.
mapobj.run()
mapobj.maxent_image
# list of longitudes
mapobj.lons
# list of latitudes
mapobj.lats
smood.plot_density(density_mat=mapobj.density_mat)
if we want, we can set a threshold on this matrix over which everything is considered "filled" and under which everything is considered "empty"
smood.plot_threshold(density_mat=mapobj.density_mat,
threshold=.8)
smood.plot_threshold(density_mat=mapobj.density_mat,
threshold=.5)