Skip to content

Commit

Permalink
Merge pull request #43 from digitalearthafrica/week-4-in-progress
Browse files Browse the repository at this point in the history
Week 4 in progress
  • Loading branch information
Andrew Hicks committed Sep 17, 2020
2 parents 2e19962 + ba997b9 commit 5c69185
Show file tree
Hide file tree
Showing 18 changed files with 1,792 additions and 1 deletion.
Binary file added docs/_static/session_4/01_band_indices_ndvi.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/session_4/01_band_indices_table.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/session_4/Week4_Band-indices.pdf
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ Should you require help, see the :doc:`Frequently_asked_questions` and :doc:`Con
session_1/index
session_2/index
session_3/index
session_4/index

Sessions 4 -- 6 will be added shortly.
Sessions 5 -- 6 will be added shortly.

.. toctree::
:maxdepth: 1
Expand Down
336 changes: 336 additions & 0 deletions docs/session_4/01_band_indices.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,336 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Band indices"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"True-colour images, like the RGB ones we created in Session 2 and Session 3, are an intuitive way of displaying spatial data as it appears to our eyes. However, satellites capture many more layers of data: their range extends outside the visible spectrum. We can also make use of these measurements to perform various kinds of data analysis. \n",
"\n",
"One established analysis technique for identifying specific terrain features, such as water or bare soil, is to calculate a **band index**."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Video: Band indices"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Watch the short video below to learn about band indices. Then, read the text below for more detail."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"[Download the video slides as a PDF](../_static/session_4/Week4_Band-indices.pdf)"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
".. only:: html\n",
"\n",
" .. youtube:: xLHWXoP8rvQ\n",
" :width: 100%"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## What is a band?"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img align=\"middle\" src=\"./../_static/session_4/01_band_indices_spectrum.jpg\" alt=\"Some of the Landsat 8 bands on the EM spectrum.\" width=\"700\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*A section of the electromagnetic spectrum showing some of the Landsat 8 bands.* [[Source](http://www.geocarto.com.hk/edu/PJ-BCMBLSAT/main_BCLS.html)]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You may recall from the [introduction to satellite products](../session_2/01_products_intro.ipynb) that the range of data acquired by a satellite is defined by its **bands**. Bands are subdivisions of the electromagnetic spectrum dependent on the sensors on the satellite.\n",
"\n",
"A selection of commonly-used Landsat 8 and Sentinel-2 bands are shown in the table below. We can see the spectral ranges between Landsat 8 and Sentinel-2 are similar, but not the same. Also note the band numbers do not always correspond to the same spectral range."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img align=\"middle\" src=\"./../_static/session_4/01_band_indices_table.PNG\" alt=\"Table of commonly-used Landsat 8 and Sentinel-2 bands.\" width=\"700\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<!--|Band| Landsat 8 wavelength range (nm) | Sentinel-2 wavelength range (nm)|\n",
"|------------|--------|---------------|\n",
"| Blue | Band 2 <br> 450 &ndash; 510 | Band 2 <br> 458 &ndash; 523 |\n",
"| Green| Band 3 <br> 530 &ndash; 590| Band 3 <br> 543 &ndash; 578\n",
"| Red | Band 4 <br> 640 &ndash; 670 | Band 4 <br> 650 &ndash; 680 |\n",
"| Near-infrared (NIR) | Band 5 <br> 850 &ndash; 880| Band 8 <br> 785 &ndash; 899|\n",
"| Short-wave infrared 1 (SWIR 1) | Band 6 <br> 1570 &ndash; 1650 | Band 11 <br> 1565 &ndash; 1655||-->"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Sources:* [Landsat 8 bands](https://www.usgs.gov/media/images/landsat-8-band-designations), [Sentinel-2 bands](https://earth.esa.int/web/sentinel/technical-guides/sentinel-2-msi/msi-instrument)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Bands and terrain features"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Different types of ground cover absorb and reflect different amounts of radiation along the electromagnetic spectrum. This is dependent on the physical and chemical properties of the surface."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example:\n",
"\n",
"* **Water:** Open water bodies generally reflect light in the visible spectrum, and absorb more short-wave infrared than near-infrared radiation. This can change if the water is turbid.\n",
"\n",
"* **Snow:** Ice and snow reflect most visible radiation, but do not reflect much short-wave infrared. Reflectance measurements depend on snow granule size and liquid water content.\n",
"\n",
"* **Green vegetation:** Chlorophyll, a pigment in plants, absorbs a lot of visible light, including red light. When plants are healthy, they strongly reflect near-infrared light.\n",
"\n",
"* **Bare soil:** The mineral composition of soil can be characterised using the visible and near-infrared spectrum. Soil moisture content can greatly influence the results.\n",
"\n",
"Using these spectral differences, we can calculate ratios between bands to isolate and accentuate the specific terrain feature we are interested in. These metrics are known as band ratios or **band indices**."
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
".. note::\n",
" In practice, variation within terrain feature classes, as well as the presence of multiple features in one area, can make different types of ground cover difficult to distinguish. This is one of the challenges of spectral data analysis."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Example: Normalised Difference Vegetation Index (NDVI)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"One of the most widely-used band indices is the Normalised Difference Vegetation Index (NDVI). It is used to show the presence of live green vegetation. Generally, green vegetation has a low red band measurement, as red light is absorbed by chlorophyll. In addition to this, healthy leaf cell structures reflect near-infrared light, giving a high near-infrared (NIR) band measurement. \n",
"\n",
"NDVI is therefore typically calculated using a satellite's NIR band and red band. One value is calculated per pixel."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\\begin{equation} \\text{NDVI} \\ = \\ \\frac{\\text{NIR} - \\text{Red}}{\\text{NIR} + \\text{Red}} \\end{equation}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We see the index is calculated by the difference $(\\text{NIR} - \\text{Red})$ divided by the sum $(\\text{NIR} + \\text{Red})$. This normalises the index: all values will fall between $-1$ and $1$.\n",
"\n",
"Large values of NDVI will occur for pixels where NIR is high and red is low. Conversely, NDVI can be close to 0 or even negative where NIR is low and red is high. This means we interpret NDVI as follows:"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\\begin{align}\n",
"\\text{NDVI} &> 0, \\text{ or close to }1 = \\text{green vegetation}\\\\\n",
"\\text{NDVI} &\\leq 0 = \\text{not green vegetation; water, soil, etc.}\n",
"\\end{align}"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"But what is green vegetation? The US Geological Survey provides a more specific [guide to interpreting NDVI](https://www.usgs.gov/land-resources/eros/phenology/science/ndvi-foundation-remote-sensing-phenology?qt-science_center_objects=0#qt-science_center_objects).\n",
"\n",
"> Areas of barren rock, sand, or snow usually show very low NDVI values (for example, 0.1 or less). Sparse vegetation such as shrubs and grasslands or senescing crops may result in moderate NDVI values (approximately 0.2 to 0.5). High NDVI values (approximately 0.6 to 0.9) correspond to dense vegetation such as that found in temperate and tropical forests or crops at their peak growth stage. \n",
"\n",
"You can see even this definition does not exhaustively cover every kind of vegetation. It is important to remember that Earth observation data analysis is sensitive to the dataset location and time. The nature of climate and environment variations across the globe, and even just within the African continent, mean that band indices like NDVI need to be interpreted with knowledge and context of the area."
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
".. note::\n",
" Normalising band indices so their values fall between -1 and 1 gives a relative scale that allows for easier data analysis. Values of the index can be better compared between different points in the area of analysis, and across time periods."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Below we have two plots of an area with river distributaries in Guinea-Bissau, a country that experiences monsoonal-like seasons. We see the amount of vegetation as detected by NDVI fluctuates over time. The top image shows NDVI in April, at the end of the dry season. NDVI readings are much lower than when compared to the same area in November (bottom image), after several months of rain during the wet season.\n",
"\n",
"Notice the RGB images may show parts of the area to be visibly 'dry' or 'lush', but in places where this is less obvious, it is easier to analyse NDVI than the multispectral RGB dataset."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img align=\"middle\" src=\"./../_static/session_4/01_band_indices_ndvi.PNG\" alt=\"NDVI in Guinea-Bissau.\" width=\"600\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*NDVI calculated from Sentinel-2 data in Guinea-Bissau in April 2018 (top left) and November 2018 (bottom left). The NDVI values reflect typical seasonal patterns in a quantitative manner.*"
]
},
{
"cell_type": "raw",
"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": [
".. note::\n",
" We see in the table above that satellites have slightly different band ranges for the same band name (e.g. 'Red' for Landsat 8 is slightly different than 'Red' for Sentinel-2). This means they will produce different band index values even at approximately the same time and place. It is best practice to compare like datasets only."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Band indices in research"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"NDVI is just one example of a useful band index. There are many other band indices used in Earth observation research to draw out terrain features. Selecting a band index is often dependent on environmental conditions and research purpose."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Vegetation:** As described above, NDVI is a good baseline vegetation index. It is simple to calculate, and only requires two bands &mdash; red and NIR. However, the Enhanced Vegetation Index (EVI) is often more accurate. EVI is calculated with three bands &mdash; red, blue and NIR &mdash; and requires some coefficients for scaling. \n",
" \n",
" In arid regions, where vegetative cover is low, consider using the Soil Adjusted Vegetation Index (SAVI), which incorporates a soil brightness correction factor.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Urbanisation:** Human settlements can be identified through urbanisation indices, one of which is the Normalised Difference Built-up Index (NDBI). NDBI uses SWIR 1 and NIR bands:\n",
"\n",
" $$ \\text{NDBI} \\ = \\ \\frac{\\text{SWIR 1} - \\text{NIR}}{\\text{SWIR 1} + \\text{NIR}} $$\n",
" \n",
" However, NDBI can be confused between built-up areas and bare soil, so in arid and semi-arid regions where this is problematic, it may be better to use the Dry Bare Soil Index (DBSI).\n",
" \n",
" $$ \\text{DBSI} \\ = \\ \\frac{\\text{SWIR 1} - \\text{Green}}{\\text{SWIR 1} + \\text{Green}} \\ - \\ \\text{NDVI}$$\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"* **Water bodies:** Delineation between water and land can be defined using the Modified Normalised Difference Water Index (MNDWI). It is calculated using green and SWIR 1 bands:\n",
"\n",
" $$ \\text{MNDWI} \\ = \\ \\frac{\\text{Green} - \\text{SWIR 1}}{\\text{Green} + \\text{SWIR 1}} $$\n",
" \n",
" This should not be confused with indices for monitoring water content in vegetation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"It is important to remember band indices are not infallible; their usefulness relies on appropriate index selection and sensible interpretation. However, as the field of remote sensing grows, ongoing research into differentiating terrain types with different band combinations give rise to more nuanced and accurate data analysis. For instance, it is common to use more than one index to help distinguish feature classes with similar spectral characteristics. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Conclusion"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Band indices are an integral part of spatial data analysis, and are an efficient method of distinguishing different types of land cover. In the following sections, we will calculate NDVI for a cloud-free composite using the Sandbox."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

0 comments on commit 5c69185

Please sign in to comment.