Python for Geosciences: Satellite Image Analysis (step by step)

Second post in a series that will teach non-programmers how to use Python to handle and analyze geospatial data.

Maurício Cordeiro
Analytics Vidhya

--

Due to changes in Medium.com policy concerning non-members reads, implemented in Sep 2023, this post is now freely available on geocorner.net: https://www.geocorner.net/post/python-for-geosciences-satellite-image-analysis-step-by-step

This is the second story of the series Python for Geosciences — working with satellite image data. In the first post of this series (here) we set up the environment to run Python code from a Jupyter Notebook and learned how to open a GeoTiff image by using the rasterio package. Today we will learn the basics of matrix manipulation. This will allow us to combine matrices to create data cubes, perform raster calculations and create spectral indices.

As our series is based in step by step examples, our goal is to calculate the Modifies Normalized Difference Water Index (MNDWI) and select just the pixels with a high probability of being water. At the end, we will display the water mask and the RGB image side by side for comparisons. I will write the code throughout the text as snippets, but at the end I will provide the full notebook.

--

--

Maurício Cordeiro
Analytics Vidhya

Ph.D. Geospatial Data Scientist and water specialist at Brazilian National Water and Sanitation Agency. To get in touch: https://www.linkedin.com/in/cordmaur/