Creating Satellite Image Timelapses

#Creating #Satellite #Image #Timelapses

You are downloading satellite images from the new ESA Sentinel Hub API and merging them into animated gifs using pure Python.

Milan Janosov

A while ago, I wrapped up the know-how of collecting and preparing satellite imagery data from the European Space Agency’s Sentinel satellites in my article titled Deep Dive into ESA’s Sentinel API. Since then, ESA rolled out a major update unseen in years on the Sentinel Hub with updates API access methods. Hence, I briefly review how to get data from the current API. As an additional use-case, I also show how to merge the downloaded satellite image snapshots into animated gifs using pure Python. This article aims to get you started and be onboard, with the possibility to further explore the API depending on specific use cases and data sets.

All images created by the author.

First, you will need to install the sentinelhub python library, which you can do in a Jupyter notebook by running the following cell:

import sys
!{sys.executable} -m pip install sentinelhub --upgrade

Then, you will also need to sign up and create your access tokens. You may read about the how-to here and get your account up and running on your Sentinel Hub Dashboard here. The Dashboard also informs you about your data usage, including the amount of free credits you have and the possibility to upgrade to a premium plan. To that end, you may also be interested in reading about the different types of data layers the Sentinel Hub provides here under the Data tab. Long story short — sign up for the API, log into the Dashboard, hit User Settings, and g for the OAuth client button.

Let’s config our notebook:

from sentinelhub import SHConfig

client_secret = 'GEZixbNoqGcFYiFMNSLz74HrzN03rfvi'
client_id = '10e7a03e-5783-413f-a5ba-3e1a452ce742'

config = SHConfig(sh_client_id = client_id, sh_client_secret = client_secret)

Here, I rely on sample codes built by the Sentinel team to show you how to get imagery data for various areas. I try to make it interesting by selecting a few more…