Processing Sentinel-3 Data With Python

Typhoon-Trami-Diego.png

Super Typhoon Trami shown by Sentinel-3 OLCI (300 m resolution), processed with Python (SatPy). Level 1B Data Downloaded from CODA (Copernicus Online Data Access). Click to enlarge!

Hi all! As seen on this blog post, we may use Python / Satpy to generate a very nice color composite using GOES-16 data. One of the nicest thing about Satpy is that it may be used to process data from GOES-16, METEOSAT, Himawari, Sentinel-2, Sentinel-3, AQUA/TERRA, NPP and others. Actually we found it to be very easy to plot data from other satellites. We used Satpy to plot the image above (Typhoon Trami) using data downloaded from CODA (Copernicus Online Data Access). Below, another example plot:

true_color_florida_caribbean.pngtrue_color_florida_caribbean_2.png

And below, a plot for the Brazilian northeast coast:

true_color_brazilian_northeast_a.pngtrue_color_brazilian_northeast.png

Let’s see how to do it!

ACCESSING SENTINEL-3 DATA USING CODA

Create an account on the EUMETSAT Earth Observation portal for free. Click on “New User – Create New Account”. Fill out the requested data. You will receive a confirmation e-mail to complete your registration.

EUMETSAT_account.png

After accessing your EUMETSAT EO portal account, access CODA, the Copernicus Online Data Access webpage at the following link:

coda.eumetsat.int

CODA_1.png

Click on the following icon to navigate on the map (or press your mouse scroll button):
CODA_2.png

Let’s suppose we want an image form the Pacific coast of South America. Navigate to that region:

CODA_3.png

Now click on the following icon to select your region of interest:

CODA_4.png

And select the area:

CODA_5.png

Expand the “Insert Search Criteria” menu. In “Product Type”, select “OL_1_EFR___”, in instrument, choose “OLCI”, and in “Product Level”, choose “L1”. Click at the magnifier icon to search for data over the select region.

CODA_6.png

You should see the available passes for that region:

CODA_7.png

Let’s select this one:

CODA_8.png

Click at the following icon to download the L1B data:

CODA_9.png

After the download, extract the data in the directory of you preference. In this example, we extracted it at C:\OLCI

CODA_11

Three things you must consider from the folder name: date (on red below), start time (on blue below), and end time (on green below):

CODA_11b

You will use these on the Python code.

PROCESSING THE SENTINEL-3 DATA WITH SATPY

You should be familiar with Anaconda if you followed the GOES-16 and Python tutorials from this blog. Let’s make a quick overview.

Download the Anaconda Distribution from the following link:

http://www.anaconda.com/download/

After installing it, execute the Anaconda Prompt as an Admin:

CODA_10

Install SatPy in a new env using Anaconda and execute the Spyder IDE. Here are the commands we used:

conda create --name satellite
activate satellite

conda install -c conda-forge satpy
conda install -c conda-forge matplotlib
conda install -c conda-forge Pillow
conda install -c conda-forge pyorbital
conda install -c sunpy glymur

Use the following script to generate the True Color composite from that pass:

from satpy.scene import Scene
from satpy import find_files_and_readers
from datetime import datetime

files = find_files_and_readers(sensor='olci',
                               start_time=datetime(2018, 9, 24, 14, 19),
                               end_time=datetime(2018, 9, 24, 14, 22),
                               base_dir="C:\\OLCI",
                               reader='nc_olci_l1b')

scn = Scene(filenames=files)
scn.load(['true_color'])
scn.save_dataset('true_color', filename='true_color_gnc_tutorial'+'.png')

And that’s it! This is what we got plotting this dataset!

CODA_12.png

Ocean, desert and rainforest! 🙂

CODA_13.png

Salar de Uyuni

CODA_14.pngCODA_15.png

You can do many things using the features provided by Python / Satpy, like reprojection, exporting to other formats, overlaying maps and many other things!

You. Can. Do. Anything. With. Python.

1 thought on “Processing Sentinel-3 Data With Python

  1. Pingback: Viendo la calima de Canarias con satpy en Python – Pybonacci

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s