Skip to content
/ smood Public

`smood` makes it simple to pull in observational data from GBIF and build species distribution maps. Go explore!

License

Notifications You must be signed in to change notification settings

pmckenz1/smood

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smood

simple mapping of occurrence data: a package for making species distribution maps with Maxent.

Feature requests?

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

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).

Installation

git clone https://github.com/pmckenz1/smood.git
pip install smood

Demonstration

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

we can define our species and boundary right away:

# define our object
mapobj = smood.Mapper(sp_name = "Monarda fistulosa",
                      lat_range=[19.0,52.0],
                      lon_range=[-125.0,-68.0])

now we can use a simple run() function to make things go:

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()

results

raw png output from maxent (including occurrence data and the prediction densities)

mapobj.maxent_image

png

we can look at the occurrence data by itself

# list of longitudes
mapobj.lons
# list of latitudes
mapobj.lats

we can also work directly with the density matrix

smood.plot_density(density_mat=mapobj.density_mat)

png

if we want, we can set a threshold on this matrix over which everything is considered "filled" and under which everything is considered "empty"

start with a high threshold:

smood.plot_threshold(density_mat=mapobj.density_mat, 
                     threshold=.8)

png

now try with a lower threshold:

smood.plot_threshold(density_mat=mapobj.density_mat,
                     threshold=.5)

png

About

`smood` makes it simple to pull in observational data from GBIF and build species distribution maps. Go explore!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published