true-color → true color

This commit is contained in:
heyarne 2021-03-16 21:15:07 +01:00
commit 999082184e
7 changed files with 16 additions and 16 deletions

View file

@ -4,4 +4,4 @@ The first chapter contains notebooks that document the data retrieval process fr
It explains how to use the [`sentinelsat`](https://github.com/sentinelsat/sentinelsat) library to interact with the HTTP API: How to specify what kind of data we are interested in with the aide of open map data from [OpenStreetMap](https://www.openstreetmap.org/) and [`geopandas`](https://geopandas.org/) and how to download it. It then goes on to show how to use [`rasterio`](https://rasterio.readthedocs.io/) and [`numpy`](https://numpy.org/) to read and process the downloaded data and [`matplotlib`](https://matplotlib.org/stable/index.html) to visualize it. It explains how to use the [`sentinelsat`](https://github.com/sentinelsat/sentinelsat) library to interact with the HTTP API: How to specify what kind of data we are interested in with the aide of open map data from [OpenStreetMap](https://www.openstreetmap.org/) and [`geopandas`](https://geopandas.org/) and how to download it. It then goes on to show how to use [`rasterio`](https://rasterio.readthedocs.io/) and [`numpy`](https://numpy.org/) to read and process the downloaded data and [`matplotlib`](https://matplotlib.org/stable/index.html) to visualize it.
The Sentinel-2 satellite captures light in visible and invisible parts of the spectrum. This can be used to derive different kinds of useful information about ground-level phenomena. The end of this chapter will detail how to use it to create true-color images for different moments in time. The Sentinel-2 satellite captures light in visible and invisible parts of the spectrum. This can be used to derive different kinds of useful information about ground-level phenomena. The end of this chapter will detail how to use it to create true color images for different moments in time.

View file

@ -6,11 +6,11 @@
"source": [ "source": [
"# Interpretation and Visualization\n", "# Interpretation and Visualization\n",
"\n", "\n",
"This notebook shows how to access the content of the products downloaded in [](01a-download-process.ipynb) and plot a true-color rendering. \n", "This notebook shows how to access the content of the products downloaded in [](01a-download-process.ipynb) and plot a true color rendering. \n",
"While the products already contain a True-Color Image (TCI), this approach is useful for two reasons:\n", "While the products already contain a True Color Image (TCI), this approach is useful for two reasons:\n",
"\n", "\n",
"1. It allows comparing the custom rendering with a rendering provided by official sources, thereby providing a template that can be used to spot any errors.\n", "1. It allows comparing the custom rendering with a rendering provided by official sources, thereby providing a template that can be used to spot any errors.\n",
"2. Generating a custom True-Color Image can be useful for further image manipulations, changing contrast or changing out single bands for others to highlight phenomena which are more visible at certain wavelengths.\n", "2. Generating a custom True Color Image can be useful for further image manipulations, changing contrast or changing out single bands for others to highlight phenomena which are more visible at certain wavelengths.\n",
"\n", "\n",
"First the shape of Berlin is created from data previously downloaded from OpenStreetMap:" "First the shape of Berlin is created from data previously downloaded from OpenStreetMap:"
] ]
@ -110,7 +110,7 @@
"\n", "\n",
"The largest share of the product size is made up by `*.jp2` files, which are raster images which contain geocoded spectral band information at a fixed resolution.\n", "The largest share of the product size is made up by `*.jp2` files, which are raster images which contain geocoded spectral band information at a fixed resolution.\n",
"Data on each spectral band captured by the Sentinel-2 mission is distributed on a per-file basis, which is why most of these files contain data on a single channel only.\n", "Data on each spectral band captured by the Sentinel-2 mission is distributed on a per-file basis, which is why most of these files contain data on a single channel only.\n",
"An exception is the included True-Color Image, which contains data in red, green and blue channels.\n", "An exception is the included True Color Image, which contains data in red, green and blue channels.\n",
"There is a function that, given a resolution and one or more spectral band name, returns the correct file paths.\n", "There is a function that, given a resolution and one or more spectral band name, returns the correct file paths.\n",
"It contains code to deal with compressed or uncompressed products." "It contains code to deal with compressed or uncompressed products."
] ]
@ -178,7 +178,7 @@
"source": [ "source": [
"Using the compressed zip-file, while slightly inconvenient, makes sense because it allows saving disk space and avoiding the extra step of decompressing every single downloaded product.\n", "Using the compressed zip-file, while slightly inconvenient, makes sense because it allows saving disk space and avoiding the extra step of decompressing every single downloaded product.\n",
"\n", "\n",
"The pre-rendered True-Color Image can be plotted for an impression of the product's contents:" "The pre-rendered True Color Image can be plotted for an impression of the product's contents:"
] ]
}, },
{ {
@ -250,9 +250,9 @@
"\n", "\n",
"It is used to open one or more data sets at a time and close them as soon as the execution pointer of the block has ended. This means data is only read inside the block, which is also where the processing usually takes place.\n", "It is used to open one or more data sets at a time and close them as soon as the execution pointer of the block has ended. This means data is only read inside the block, which is also where the processing usually takes place.\n",
"\n", "\n",
"## Creating a Custom True-Color Composition\n", "## Creating a Custom True Color Composition\n",
"\n", "\n",
"While for many use cases using the TCI can be enough, knowing how to compose True-Color Images provides additional merit as explained above.\n", "While for many use cases using the TCI can be enough, knowing how to compose True Color Images provides additional merit as explained above.\n",
"\n", "\n",
"The blue, green, and red parts of the spectrum are represented in the raster files for the bands 2, 3 and 4 respectively\n", "The blue, green, and red parts of the spectrum are represented in the raster files for the bands 2, 3 and 4 respectively\n",
"`sentinel_helpers.py` contains a function wrapping `scihub_band_paths` to retrieve those bands in a resolution of choice:" "`sentinel_helpers.py` contains a function wrapping `scihub_band_paths` to retrieve those bands in a resolution of choice:"
@ -488,7 +488,7 @@
"\n", "\n",
"with r.open(b02) as blue, r.open(b03) as green, r.open(b04) as red, r.open(low_res_tci) as tci:\n", "with r.open(b02) as blue, r.open(b03) as green, r.open(b04) as red, r.open(low_res_tci) as tci:\n",
" fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(18,6))\n", " fig, (ax1, ax2, ax3) = plt.subplots(1, 3, figsize=(18,6))\n",
" fig.suptitle('True-Color Image', fontsize=20)\n", " fig.suptitle('True Color Image', fontsize=20)\n",
" \n", " \n",
" ax1.grid(False)\n", " ax1.grid(False)\n",
" ax2.grid(False)\n", " ax2.grid(False)\n",

View file

@ -4,7 +4,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"# True-Color Mosaic\n", "# True Color Mosaic\n",
"\n", "\n",
"Based on the [](01c-coverage-analysis), this chapter implements a self-contained processing pipeline that downloads and assembles available data with up to a certain configurable threshold of cloud coverage.\n", "Based on the [](01c-coverage-analysis), this chapter implements a self-contained processing pipeline that downloads and assembles available data with up to a certain configurable threshold of cloud coverage.\n",
"The result is a single raster combined image (i.e. a mosaic) in a user-defined Coordinate Reference System.\n", "The result is a single raster combined image (i.e. a mosaic) in a user-defined Coordinate Reference System.\n",

View file

@ -152,7 +152,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"To avoid the the merging process demonstrated in [](01d-true-color-mosaic), only products that fully contain the Tempelhofer Feld are considered.\n", "To avoid the the merging process demonstrated in [](01d-true color-mosaic), only products that fully contain the Tempelhofer Feld are considered.\n",
"The footprints (i.e. the geometries) of the returned products are therefore intersected with the Tempelhofer Feld geometry using the `geopandas` library:" "The footprints (i.e. the geometries) of the returned products are therefore intersected with the Tempelhofer Feld geometry using the `geopandas` library:"
] ]
}, },

View file

@ -45,7 +45,7 @@
"source": [ "source": [
"## Product Preview\n", "## Product Preview\n",
"\n", "\n",
"The following lines can be uncommented to plot a true-color image of the downloaded data:" "The following lines can be uncommented to plot a true color image of the downloaded data:"
] ]
}, },
{ {

View file

@ -717,7 +717,7 @@
"source": [ "source": [
"## Lübtheen 2019\n", "## Lübtheen 2019\n",
"\n", "\n",
"The wildfire in Lübtheen 2019 is interesting because it was burning during a Sentinel-2 flyover, which ESA took as an opportunity to [publish an animation](https://web.archive.org/web/20210223154159/https://earth.esa.int/eogateway/news/german-wildfire) that shows the actively burning fire both as a true-color image and as a faux-color composite that highlights the burn scar using short-wave infrared measurements. The article the animation was published in mentions that the fire started on June 30 2019. The flyover happened on July 1.\n", "The wildfire in Lübtheen 2019 is interesting because it was burning during a Sentinel-2 flyover, which ESA took as an opportunity to [publish an animation](https://web.archive.org/web/20210223154159/https://earth.esa.int/eogateway/news/german-wildfire) that shows the actively burning fire both as a true color image and as a faux-color composite that highlights the burn scar using short-wave infrared measurements. The article the animation was published in mentions that the fire started on June 30 2019. The flyover happened on July 1.\n",
"\n", "\n",
"The animation provides an unusually clear depiction of the active fire area: There is no such information in the other two articles. This information can therefore be related to own NBR calculations and information published by official sources in follow-up reports.\n", "The animation provides an unusually clear depiction of the active fire area: There is no such information in the other two articles. This information can therefore be related to own NBR calculations and information published by official sources in follow-up reports.\n",
"\n", "\n",

View file

@ -969,7 +969,7 @@
"source": [ "source": [
"### Lübtheen 2019\n", "### Lübtheen 2019\n",
"\n", "\n",
"#### True-Color Plots\n", "#### True Color Plots\n",
"\n", "\n",
"The fire in Lübtheen in July 2019 is interesting because there was a flyover of Sentinel-2 while the fire was active and burning, which\n", "The fire in Lübtheen in July 2019 is interesting because there was a flyover of Sentinel-2 while the fire was active and burning, which\n",
"ESA used to publish an animation of the burning fire:\n", "ESA used to publish an animation of the burning fire:\n",
@ -978,7 +978,7 @@
"\n", "\n",
"Image Source: [ESA, 2019](http://www.esa.int/ESA_Multimedia/Images/2019/07/German_wildfire)\n", "Image Source: [ESA, 2019](http://www.esa.int/ESA_Multimedia/Images/2019/07/German_wildfire)\n",
"\n", "\n",
"The animation above contains a true-color rendering and a frame that highlights wavelengths in the infrared spectrum to create a faux-color image highlighting the burn-scar and decreasing the visibility of smoke.\n", "The animation above contains a true color rendering and a frame that highlights wavelengths in the infrared spectrum to create a faux-color image highlighting the burn-scar and decreasing the visibility of smoke.\n",
"\n", "\n",
"The same data gives an impression of the site before, during and after the fire:" "The same data gives an impression of the site before, during and after the fire:"
] ]
@ -1051,7 +1051,7 @@
"source": [ "source": [
"The area highlighted in the ESA animation is positioned in the lower-right corner of the superimposed boundary of Lübtheen.\n", "The area highlighted in the ESA animation is positioned in the lower-right corner of the superimposed boundary of Lübtheen.\n",
"\n", "\n",
"The true-color image on June 29 and July 26 show a very clear view of the area.\n", "The true color image on June 29 and July 26 show a very clear view of the area.\n",
"There is a lot of vegetation change that is likely not related to the fire, visible when comparing the top and bottom-left parts of the images.\n", "There is a lot of vegetation change that is likely not related to the fire, visible when comparing the top and bottom-left parts of the images.\n",
"\n", "\n",
"This vegetation change is likely also reflected in the NBR and $\\Delta$NBR values.\n", "This vegetation change is likely also reflected in the NBR and $\\Delta$NBR values.\n",