The Cameron Peak Fire, Colorado, USA¶
This analysis looks at Cameron Peak and other fires
It’s another ESIIL Earth Data Science Workflow¶
This notebook contains your next environmental data science (EDS) coding challenge! Before we get started, make sure to read or review the guidelines below. These will help make sure that your code is readable and reproducible.
Don’t get caught by these interactive coding notebook gotchas¶
Image source: https://alaskausfws.medium.com/whats-big-and-brown-and-loves-salmon-e1803579ee36
These are the most common issues that will keep you from getting started and delay your code review:
Run your code in the right environment to avoid import errors¶
We’ve created a coding environment for you to use that already has all the software and libraries you will need! When you try to run some code, you may be prompted to select a kernel. The kernel refers to the version of Python you are using. You should use the base kernel, which should be the default option.
Always run your code start to finish before submitting¶
Before you commit your work, make sure it runs reproducibly by clicking:
Restart
(this button won’t appear until you’ve run some code), thenRun All
Check your code to make sure it’s clean and easy to read¶
Format all cells prior to submitting (right click on your code).
Use expressive names for variables so you or the reader knows what they are.
Use comments to explain your code – e.g.
# This is a comment, it starts with a hash sign
Label and describe your plots¶
Make sure each plot has:
- A title that explains where and when the data are from
- x- and y- axis labels with units where appropriate
- A legend where appropriate
The Cameron Peak Fire was the largest fire in Colorado history, with 326 square miles burned.
Observing vegetation health from space¶
We will look at the destruction and recovery of vegetation using NDVI (Normalized Difference Vegetation Index). How does it work? First, we need to learn about spectral reflectance signatures.
Every object reflects some wavelengths of light more or less than others. We can see this with our eyes, since, for example, plants reflect a lot of green in the summer, and then as that green diminishes in the fall they look more yellow or orange. The image below shows spectral signatures for water, soil, and vegetation:
> Image source: SEOS Project
Healthy vegetation reflects a lot of Near-InfraRed (NIR) radiation. Dead ve Less healthy vegetation reflects a similar amounts of the visible light spectra, but less NIR radiation. We don’t see a huge drop in Green radiation until the plant is very stressed or dead. That means that NIR allows us to get ahead of what we can see with our eyes.
> Image source: Spectral signature literature review by px39n
Different species of plants reflect different spectral signatures, but the pattern of the signatures are similar. NDVI compares the amount of NIR reflectance to the amount of Red reflectance, thus accounting for many of the species differences and isolating the health of the plant. The formula for calculating NDVI is:
$$NDVI = \frac{(NIR - Red)}{(NIR + Red)}$$
Read more about NDVI and other vegetation indices: * earthdatascience.org * USGS
Import necessary libraries
In the cell below, making sure to keep the packages in order, add packages for:
- Working with DataFrames
- Working with GeoDataFrames
What are we using the rest of these packages for? See if you can figure it out as you complete the notebook.
# Install the development version of the earthpy package
!pip install git+https://github.com/earthlab/earthpy@apppears
# Import python libraries
import getpass
import json
import os
import pathlib
from glob import glob
# Library to work with tabular data
import pandas as pd
# Library to work with vector data
import geopandas as gpd
import earthpy.appeears as eaapp
import hvplot.pandas
import hvplot.xarray
import rioxarray as rxr
import xarray as xr # uses numpy
import matplotlib.pyplot as plt
fire_path = "/workspaces/shortcourse-02-vegetation-nquarder/data/fire_archive_M-C61_464561.shp"
fire_gdf = gpd.read_file(fire_path)
fire_gdf
LATITUDE | LONGITUDE | BRIGHTNESS | SCAN | TRACK | ACQ_DATE | ACQ_TIME | SATELLITE | INSTRUMENT | CONFIDENCE | VERSION | BRIGHT_T31 | FRP | DAYNIGHT | TYPE | geometry | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 46.7993 | -113.3773 | 315.1 | 1.4 | 1.2 | 2005-07-21 | 2052 | Aqua | MODIS | 30 | 6.03 | 304.7 | 8.2 | D | 0 | POINT (-113.37730 46.79930) |
1 | 46.7975 | -113.3961 | 320.3 | 1.4 | 1.2 | 2005-07-21 | 2052 | Aqua | MODIS | 65 | 6.03 | 308.4 | 16.3 | D | 0 | POINT (-113.39610 46.79750) |
2 | 46.8114 | -111.8638 | 323.4 | 1.7 | 1.3 | 2005-07-23 | 1859 | Terra | MODIS | 76 | 6.03 | 304.9 | 26.8 | D | 0 | POINT (-111.86380 46.81140) |
3 | 46.8159 | -111.8784 | 325.4 | 1.2 | 1.1 | 2005-07-23 | 2040 | Aqua | MODIS | 62 | 6.03 | 312.9 | 13.0 | D | 0 | POINT (-111.87840 46.81590) |
4 | 49.1815 | -113.2053 | 313.2 | 1.1 | 1.0 | 2005-07-27 | 2016 | Aqua | MODIS | 38 | 6.03 | 299.4 | 5.4 | D | 0 | POINT (-113.20530 49.18150) |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
23296 | 47.3181 | -114.4514 | 324.0 | 1.0 | 1.0 | 2020-07-30 | 0538 | Terra | MODIS | 100 | 6.03 | 289.8 | 21.5 | N | 0 | POINT (-114.45140 47.31810) |
23297 | 47.3163 | -114.4651 | 337.7 | 1.0 | 1.0 | 2020-07-30 | 0538 | Terra | MODIS | 100 | 6.03 | 293.6 | 40.3 | N | 0 | POINT (-114.46510 47.31630) |
23298 | 47.3146 | -114.4786 | 313.3 | 1.0 | 1.0 | 2020-07-30 | 0538 | Terra | MODIS | 87 | 6.03 | 290.4 | 12.0 | N | 0 | POINT (-114.47860 47.31460) |
23299 | 47.3171 | -114.4624 | 310.9 | 1.0 | 1.0 | 2020-07-30 | 0947 | Aqua | MODIS | 44 | 6.03 | 293.5 | 9.7 | N | 0 | POINT (-114.46240 47.31710) |
23300 | 47.3152 | -114.4494 | 316.6 | 1.0 | 1.0 | 2020-07-30 | 0947 | Aqua | MODIS | 94 | 6.03 | 295.0 | 14.2 | N | 0 | POINT (-114.44940 47.31520) |
23301 rows × 16 columns
fire_gdf.explore()