Free near real-time 10-meter resolution satellite imagery with 5 lines of code

Satellite image

Satellite imagery has been a game-changer in many fields, from meteorology and environmental sciences to city planning and real estate. The ability to look at our planet from above offers insights that ground-based observation cannot provide. However, accessibility to such high-resolution imagery has often been perceived as costly and complicated. It doesn’t have to be! The European Space Agency (ESA) has a wealth of satellite imagery that is not just high resolution (up to 10 meters) but also free to access, download, and use. This resource is provided through their Earth Observation Program, with the Copernicus mission at its heart. Imagine the potential of this! Whether you’re an environmental researcher looking to analyze deforestation, an urban planner in need of accurate city topography, or a tech enthusiast eager to experiment with satellite imagery data, you now have a powerful tool at your fingertips.

Getting Started: Sign Up at Copernicus Scihub

To get started, you first need to sign up on Copernicus Scihub. This is ESA’s gateway for satellite data distribution, offering petabytes of information just a few clicks away. The sign-up process is straightforward: go to the Copernicus Open Access Hub, click on the sign-up button, and fill in the required details. Make sure to remember your username and password because you will need them in the next steps.

Access Satellite Imagery With Code

Now, let’s get to the exciting part. First install sentinelsat with the following command: pip install sentinelsat

Now with just 4 lines of Python code, you can access this treasure trove of satellite data. Here’s the basic script:

import fnmatch
from sentinelsat import SentinelAPI, make_path_filter

sapi = SentinelAPI('user', 'password', 'https://scihub.copernicus.eu/dhus/')
products = sapi.query(date=('NOW-1DAYS', 'NOW'), platformname='Sentinel-2', processinglevel='Level-2A')
sapi.download_all(products, './tempdataset', nodefilter=lambda a: fnmatch.fnmatch(a['node_path'], '*_TCI_10m.jp2'))

In these four lines of code:

  • We import the SentinelAPI module from the sentinelsat library. If you don’t have the sentinelsat library installed yet, you can easily add it to your Python environment using pip: pip install sentinelsat.
  • We create an instance of the SentinelAPI class, providing our Copernicus Scihub credentials and the URL of the Scihub server.
  • We use the query method to search for available satellite imagery based on specific criteria. Finally, we use the download_all method to download all the images that matched our query.

The beauty of this approach is its flexibility. You can adjust the query parameters based on your specific needs, like the date range, the satellite platform, or the acceptable cloud cover percentage. It’s that simple! Now, you can start exploring, analyzing, and using high-resolution satellite imagery, free of charge, and with just a few lines of code. The sky is not the limit; it’s the starting point!

Article on medium.

2024

The Time I Built a Probabilistic Computer

6 minute read

In early 2023, I embarked on a journey to explore the field of probabilistic computing. This endeavor culminated in the construction of a hardware prototype,...

Back to Top ↑

2023

Expanding the Commodore 64 Quantum Emulator

1 minute read

In a recent article I wrote, “Quantum Computing on a Commodore 64 in 200 Lines of BASIC”, published both on Medium and Hackaday.com, shows a two-qubit quantu...

Back to Top ↑

2020

OCaml and Quantum Computing

1 minute read

Qiskit is a python SDK developed by IBM and allows everyone to create quantum circuits, simulate them locally and also run the quantum circuit on a real quan...

Yallo, a new Tezos language

2 minute read

As someone noticed from the previous post, last weeks I started to write a new programming language for Tezos smart contracts. This project was initially int...

King of Tezos: a smart-ponzi on Tezos

2 minute read

While writing a new programming language, it is often useful to write some real use-cases to test the syntax, the language expressiveness and the code cleann...

Favorite dev quote

less than 1 minute read

Documentation is like sex: when it is good, it is very, very good; and when it is bad, it is better than nothing

New blog

less than 1 minute read

This is my new blog, based on jekyll. I’ll soon import old posts from my old blog.

Back to Top ↑

2016

Contractvm: decentralized applications on Bitcoin

less than 1 minute read

Contractvm is a general-purpose decentralized framework based on blockchain. The framework allows to implement arbitrary decentralized applications in an eas...

Back to Top ↑

2015

Dices provably fair - Nonce overflow vulnerability

less than 1 minute read

Most of bitcoin dice software use a system to prove the fair play of the server for each bet. Most of them implement this mechanism using two seed (server se...

Back to Top ↑

2014

Apache2: redirect different domains to subfolder

less than 1 minute read

In the aim to merge two of my server on digitalocean, today I tried to write a mod_rewrite rule to redirect a secondary domain to a subfolder. After one hour...

Back to Top ↑

2013

MineML: F# miner

less than 1 minute read

MineML is a multithread CPU based bitcoin miner written in F#. At the moment it’s a slow implementation, but the class structure offers the possibility to im...

Back to Top ↑