Downloading Sentinel-2 Imagery in Python with Google Colab (Updated Nov 2023)

Mahyar Aboutalebi, Ph.D. πŸŽ“
12 min readNov 13, 2023

As you may be aware, the primary platform for accessing Sentinel images, https://scihub.copernicus.eu/, stopped operation in October 2023. A new portal with an updated API structure has been launched recently at https://dataspace.copernicus.eu/. Therefore, existing R and Python libraries will only work after receiving the necessary updates.

To facilitate the process, after registering on the new website, I will guide you through scripting in Python with the Google Colab platform to download Sentinel-2 images, perform the conversion from β€œjp2” files to GeoTIFF format, clip the images to your Area of Interest (AOI), and visualize the true color representation for both the top of the atmosphere and the surface reflectance product.

Table of Contents

  1. 🌟 Introduction
  2. πŸš€ Sign up for β€œCopernicus Data Space Ecosystem”
  3. πŸ” Install and Import the Libraries
  4. ⏳ Filter and Submit the Query
  5. πŸ“₯ Download the β€œjp2” files for the Surface Reflectance Product
  6. πŸ“₯ Download the β€œjp2” files for the Top of the Atmosphere (TOA)
  7. πŸ› οΈ Stack, Convert to Geotiff, and Clip it to AOI (Surface Reflectance)
  8. πŸ› οΈ Stack, Convert to Geotiff, and Clip it to AOI (TOA)
  9. πŸ“ˆ Plot the True Color of the TOA and Surface Reflectance Images

--

--

Mahyar Aboutalebi, Ph.D. πŸŽ“

🌐 Geospatial Data Scientist πŸ’‘ Enthusiastic Explorer πŸ“Š Passionate about Large Datasets πŸ€– Bringing AI to Life πŸš€ From Raw Data To Actionable Insights