mirror of
https://github.com/heyarne/earth-observation-for-journalism.git
synced 2026-05-06 19:13:40 +02:00
Incorporate Josh's feedback
This commit is contained in:
parent
7dac1babd5
commit
f5e22013c4
4 changed files with 40 additions and 39 deletions
|
|
@ -6,13 +6,13 @@
|
|||
"source": [
|
||||
"# Visualization\n",
|
||||
"\n",
|
||||
"This notebook show 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",
|
||||
"\n",
|
||||
"1. It allows comparing the readings with a rendering provided by official sources, thereby allowing us to find 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 specific phenomena.\n",
|
||||
"\n",
|
||||
"We start by reading the shape of Berlin previously downloaded from OpenStreetMap:"
|
||||
"First the shape of Berlin is created from data previously downloaded from OpenStreetMap:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We know the product with the lowest cloud cover percentage from the previous notebook."
|
||||
"The information which product contains the least amount of clouds is given in the previous notebook."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -92,7 +92,7 @@
|
|||
"source": [
|
||||
"The product path contains a lot of information:\n",
|
||||
"\n",
|
||||
"- `S2B` shows that the downloaded products was captured by the Sentinel-2 satellite B. At the moment there are two satellites in the mission, A and B.\n",
|
||||
"- `S2B` shows that the downloaded product was captured by the Sentinel-2 satellite B. At the moment there are two satellites in the mission, A and B.\n",
|
||||
"- `MSI` stands for Multi Spectral Instrument.\n",
|
||||
"- `L2A` is the processing level. Level 2A is the highest processing level and lower processing levels may need further processing to be useful.\n",
|
||||
"- The first timestamp, `20200602T100559`, is the date at which the data was captured.\n",
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
"source": [
|
||||
"Using the compressed zip-file, while slightly inconvenient, makes sense because it allows saving disk space and allows us to avoid the extra step of decompressing every single downloaded product.\n",
|
||||
"\n",
|
||||
"There is a pre-rendered True-Color Image (\"TCI\") that we can use to get a quick plot of the contents:"
|
||||
"There is a pre-rendered True-Color Image (\"TCI\") that can be plotted for an impression of the product's contents:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -203,7 +203,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Using the `rasterio` library we can open this image and render its contents:"
|
||||
"The `rasterio` library is used to open this image and render its contents:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -238,7 +238,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"You will see this pattern repeatedly:\n",
|
||||
"This pattern shows repeatedly across many notebooks:\n",
|
||||
"\n",
|
||||
"``` python\n",
|
||||
"with r.open(...) as src:\n",
|
||||
|
|
@ -252,7 +252,7 @@
|
|||
"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",
|
||||
"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 helper that wraps `scihub_band_paths` to retrieve those bands in a resolution of our choice:"
|
||||
"`sentinel_helpers.py` contains a function wrapping `scihub_band_paths` to retrieve those bands in a resolution of choice:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -313,7 +313,7 @@
|
|||
"source": [
|
||||
"### Full Range Plot\n",
|
||||
"\n",
|
||||
"We continue with a plot of the combination of these bands:"
|
||||
"Next, a plot of the combination of these bands is plotted:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -510,7 +510,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We can compare the histograms of `included_tci` and the `normalized_rgb` array: "
|
||||
"A comparison of the histograms of `included_tci` and the `normalized_rgb` array offers more details:"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -555,7 +555,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"We can see each the red, green and blue band peaking higher in the prerendered TCI around a value of 50 - the curves match closely. Most of the pixels are using the designated nodata-value 0, which is the black stripe in the top left corner of the image.\n",
|
||||
"Each the red, green and blue band have higher peaks in the prerendered TCI at value of around 50 - the curves match closely. Most of the pixels are using the designated nodata-value 0, which is the black stripe in the top left corner of the image.\n",
|
||||
"\n",
|
||||
"Because the purpose of this visualization is not creating a one-to-one replica of the included TCI but rather demonstrate how to interpret and manipulate the raster file contents, the approximation is sufficient.\n",
|
||||
"\n",
|
||||
|
|
@ -563,7 +563,7 @@
|
|||
"\n",
|
||||
"It is rare to plot the entire product because the data in this product can be partially missing depending on the orbit position (see [](01c-coverage-analysis.ipynb) for more information).\n",
|
||||
"\n",
|
||||
"We can create a rectangular cutout of the created image using code provided in the `rasterio` library for its `rio` command line tool. The code uses a data structure called `Window`, which is a rectangle with an x- and y-offset that is provided by `rasterio` to partially read or write raster data.\n",
|
||||
"The created image can be cropped using code provided in the `rasterio` library for its `rio` command line tool. This requires constructing a `Window`, which is a rectangle with an x- and y-offset that is provided by `rasterio` to partially read or write raster data.\n",
|
||||
"\n",
|
||||
"The position of the `Window` is calculated by transforming the area of interest `berlin` into the Coordinate Reference System that is used by `src` and then calculating the intersection:"
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue