Skip to main content

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

Project description

pypi Conda Tests Gitter Apache DOI starts

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 1st and 2nd Generation
TerraSAR-X, TanDEM-X and PAZ
RADARSAT-2
RADARSAT-Constellation
ICEYE

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:

>>> import os
>>> from eoreader.reader import Reader
>>> from eoreader.bands import *
>>> from eoreader.env_vars import DEM_PATH

>>> # Sentinel-2 path
>>> s2_path = "S2B_MSIL1C_20181126T022319_N0207_R103_T51PWM_20181126T050025.SAFE"

>>> # Create the reader object and open satellite data
>>> eoreader = Reader()

>>>  # The Reader will recognize the satellite type from its structure
>>> s2_prod = eoreader.open(s2_path)

>>> # Specify a DEM to load HILLSHADE AND SLOPE bands
>>> os.environ[DEM_PATH] = "my_dem.tif"

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

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

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

For SAR data:

>>> import os
>>> from eoreader.reader import Reader
>>> from eoreader.bands import *
>>> from eoreader.env_vars import DEM_PATH

>>> # Sentinel-1 GRD path
>>> s1_path = "S1B_EW_GRDM_1SDH_20200422T080459_20200422T080559_021254_028559_784D.zip"

>>> # Create the reader object and open satellite data
>>> eoreader = Reader()

>>> # The Reader will recognize the satellite type from its structure
>>> s1_prod = eoreader.open(s1_path)

>>>  # Specify a DEM to load DEM and SLOPE bands
>>> 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

Command line

You can install EOReader via conda:

conda config --env --set channel_priority strict

conda install -c conda-forge eoreader

But for the moment, the lib used for caching objects (methodtools) is not available on conda. So please install it via pip (pip install methodtools) before using EOReader !

Configuration file (preferred method)

You can use a configuration file like this (environment.yml) for conda to create your environment:

name: eoreader
channels:
  - conda-forge
dependencies:         # everything under this, installed by conda
  - python=3.7
  - eoreader
  - pip
  - pip:                # everything under this, installed by pip
      - methodtools

And create your environment like that: conda env create -f environment.yml.

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

However, keep in mind that the support of all the sensors used in CEMS is done in a best effort mode, especially for commercial data. Indeed, we may not have faced every product type, sensor mode or order configuration, so some details may be missing. If this happens to you, do not hesitate to make a PR or write an issue about that !

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:

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eoreader-0.11.2.tar.gz (133.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eoreader-0.11.2-py3-none-any.whl (202.3 kB view details)

Uploaded Python 3

File details

Details for the file eoreader-0.11.2.tar.gz.

File metadata

  • Download URL: eoreader-0.11.2.tar.gz
  • Upload date:
  • Size: 133.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for eoreader-0.11.2.tar.gz
Algorithm Hash digest
SHA256 4b16f61121bc895f2234e52fc7047efad9f7e78f804068af97a4f7c255fa1fc3
MD5 87b8955d85065d2385c639b7e48e33ed
BLAKE2b-256 cc0f65ebfa16c6cf44c4029e4da6bb3adec39a880deaa8aea9212737740768e7

See more details on using hashes here.

File details

Details for the file eoreader-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: eoreader-0.11.2-py3-none-any.whl
  • Upload date:
  • Size: 202.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.12

File hashes

Hashes for eoreader-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 adab993ecac56853c4a6df3af7135565ac2493c7eb2eb4e582082bcb7c4b0658
MD5 eee160738bd731a531fed0cfc1d8ff5e
BLAKE2b-256 1d086b6c3f488a078ddaee0124f59a17e030c267e961f7b39a9873bacf61fb5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page