pypi Conda Tests Gitter pre-commit Apache DOI

eoreader_logo EOReader

EOReader is a remote-sensing opensource python library reading optical and SAR sensors, loading and stacking bands, clouds, DEM and index in a sensor-agnostic way.

Optical sensors

SAR sensors

Sentinel-2 and Sentinel-2 Theia
Sentinel-3 OLCI and Sentinel-3 SLSTR
Landsat 1 to 8 (MSS, TM, ETM and OLCI)
PlanetScope
Pleiades
SPOT 6-7
WorldView-2 to 4, GeoEye-1 (and other Maxar sensors)

Sentinel-1
COSMO-Skymed
TerraSAR-X, TanDEM-X & PAZ
RADARSAT-2
RADARSAT-Constellation

It also implements additional sensor-agnostic features:

EOReader works with xarrays.DataArray and geopandas.GeoDataFrames

Python Quickstart

The main features of EOReader are gathered hereunder. For optical data:

>>> from eoreader.reader import Reader
>>> from eoreader.bands.alias import *

>>> # Landsat-5 MSS path, can be found in CI/DATA
>>> l5_path = "LM05_L1TP_200029_19841014_20200902_02_T2.tar"

>>> # Create the reader object and open satellite data
>>> eoreader = Reader()
>>> l5_prod = eoreader.open(l5_path)  # The Reader will recognize the satellite type from its structure

>>> # Specify a DEM to load DEM bands
>>> import os
>>> from eoreader.env_vars import DEM_PATH
>>> os.environ[DEM_PATH] = "my_dem.tif"

>>> # Load some bands and index: they will all share the same metadata
>>> bands = l5_prod.load([NDVI, GREEN, HILLSHADE, CLOUDS])

>>> # Create a stack with some other bands
>>> stack = l5_prod.stack([NDWI, RED, SLOPE])

>>> # Read Metadata
>>> mtd, namespace = l5_prod.read_mtd()

For SAR data:

>>> from eoreader.reader import Reader
>>> from eoreader.bands.alias import *

>>> # Sentinel-1 GRD path, not provided in package
>>> s1_path = "S1B_EW_GRDM_1SDH_20200422T080459_20200422T080559_021254_028559_784D.zip"

>>> # Create the reader object and open satellite data
>>> eoreader = Reader()
>>> s1_prod = eoreader.open(s1_path)  # The Reader will recognize the satellite type from its name

>>>  # Specify a DEM to load DEM bands
>>> import os
>>> from eoreader.env_vars import DEM_PATH
>>> os.environ[DEM_PATH] = "my_dem.tif"

>>> # Load some bands and index: they will all share the same metadata
>>> bands = s1_prod.load([VV, VV_DSPK, DEM])

>>> # Create a stack with some other bands
>>> stack = s1_prod.stack([VV, VV_DSPK, SLOPE])

>>> # Read Metadata
>>> mtd, namespace = s1_prod.read_mtd()

SAR products need SNAP gpt to be orthorectified and calibrated. Ensure that you have the folder containing your gpt executable in your PATH.

Documentation

The API documentation can be found here.

Examples

Available notebooks provided as examples:

Installation

Pip

You can install EOReader via pip:

pip install eoreader

EOReader mainly relies on geopandas and rasterio (through rioxarray).

On Windows and with pip, you may face installation issues due to GDAL. The well known workaround of installing from Gohlke’s wheels also applies here. Please look at the rasterio page to learn more about that.

Conda

You can install EOReader via conda:

conda config --env --set channel_priority strict

conda install -c conda-forge eoreader

Context

SERTIT is part of the Copernicus Emergency Management Service rapid mapping and risk and recovery teams.

In these activations, we need to deliver information (such as flood or fire delineations, landslides mapping, etc.) based on various sensors (more than 10 optical and 5 SAR). As every minute counts in production, it seemed crucial to harmonize the ground on which are built our production tools, in order to make them as sensor-agnostic as possible.

Thus, thanks to EOReader, these tools are made independent to the sensor:

  • the algorithm (and its developer) can focus on its core tasks (such as extraction) without taking into account the sensor characteristics (how to load a band, which band correspond to which band number, which band to use for this index…)

  • the addition of a new sensor is done effortlessly (if existing in EOReader) and without any modification of the algorithm

  • the maintenance is simplified and the code is way more readable (no more ifs regarding the sensor type!)

  • the testing is also simplified as the sensor-related parts are tested in this library

License

EOReader is licensed under Apache License v2.0. See LICENSE file for details.

Authors

EOReader has been created by ICube-SERTIT.

Credits

EOReader is built on top of amazing libs, without which it couldn’t have been coded: