Code
%pip install -q -e ..Left to do:
reproject code in place.Python code setup:
%pip install -q -e ..pip install -q plotnine scikit-miscimport pandas as pd
import geopandas as gpd # read geojson file into gdf
import matplotlib.pyplot as plt # Overlay raster and vector data
import xarray as xr
from landmapyr.initial import create_data_dir # create (or retrieve) data directory
from landmapyr.plots import plot_gdf_state # plot gdf with state overlay
from landmapyr.plots import plot_gdf_da # plot GDF over DA
from landmapyr.plots import plot_das # plot DAs in rows
from landmapyr.process import da_combine, merge_da_df
from landmapyr.polaris import merge_soil # merge soil data from GDF
from landmapyr.srtm import srtm_download, srtm_slope # process SRTM data
from landmapyr.thredds import process_maca, maca_year, melt_maca # process MACA THREDDS
from landmapyr.explore import ramp_logic # ramp for fuzzy logic
from landmapyr.ggplot import ggplot_xy # plot with ggplot (plotnine)Our changing climate is changing where key grassland species can live, and grassland management and restoration practices will need to take this into account (Kane et al. 2017).
In this coding challenge, create a habitat suitability model for a species of your choice that lives in the continental United States (CONUS). We have this limitation because the downscaled climate data we suggest, the MACAv2 dataset, is only available in CONUS. If you find other downscaled climate data at an appropriate resolution you are welcome to choose a different study area. If you don’t have anything in mind, you can take a look at Sorghastrum nutans, a grass native to North America. In the past 50 years, its range has moved northward (GBIF S. nutans).
Your suitability assessment will be based on combining multiple data layers related to soil, topography, and climate. You will also need to create a modular, reproducible, workflow using functions and loops. To do this effectively, we recommend planning your code out in advance using a technique such as pseudocode outline or a flow diagram. We recommend planning each of the blocks below out into multiple steps. It is unnecessary to write a step for every line of code unles you find that useful. As a rule of thumb, aim for 2-5 line code chuck for major structure steps.
Before you begin coding, you will need to design your study.
Reflect and Respond: What question do you hope to answer about potential future changes in habitat suitability?
YOUR QUESTION HERE
Select the species you want to study, and research it’s habitat parameters in scientific studies or other reliable sources. You will want to look for reviews or overviews of the data, since an individual study may not have the breadth needed for this purpose. In the US, the National Resource Conservation Service can have helpful fact sheets about different species. University Extension programs are also good resources for summaries.
Based on your research, select soil, topographic, and climate variables that you can use to determine if a particular location and time period is a suitable habitat for your species.
Reflect and Respond: Write a description of your species. What habitat is it found in? What is its geographic range? What, if any, are conservation threats to the species? What data will shed the most light on habitat suitability for this species?
YOUR SPECIES DESCRIPTION HERE
Big bluestem is a warm-season grass native to the eastern two thirds of the United States from the mid-western short grass prairies to the coastal plain. It grows to 6 to 8 feet with short and scaly rhizomes and leaves that vary from light yellow-green to burgundy. The seed head is coarse and not fluffy, typically with three spikelets looking like a turkey foot.
Below are two pictures of me and my (leashed) dog, Kylie, on a walk in Prairie Moraine County Park (Dane Co, WI) surrounded by bluestem. We were walking on the Ice Age National Scenic Trail Corridor just north of the dog part. The Ice Age Trail is a 1000-mile system that comprises a unique boundary separating the glaciated and “driftless” regions across the state of Wisconsin. Bluestem is found along much of this trail system.