It also implements additional sensor-agnostic features:
load: Load many band types:
stack: Stack all these type of bands
>>> from eoreader.reader import Reader >>> from eoreader.bands import * >>> # Sentinel-2 path >>> s2_path = "S2B_MSIL1C_20181126T022319_N0207_R103_T51PWM_20181126T050025.SAFE" >>> # Create the reader object and open satellite data >>> reader = Reader() >>> # The reader will recognize the sensor from its product structure >>> s2_prod = reader.open(s2_path) >>> # Load some bands and index >>> bands = s2_prod.load([NDVI, GREEN, CLOUDS]) >>> # Create a stack with some bands >>> stack = s2_prod.stack([RED, GREEN, BLUE], stack_path="s2_rgb_stack.tif")
>>> from eoreader.reader import Reader >>> from eoreader.bands import * >>> # Sentinel-1 GRD path >>> s1_path = "S1B_EW_GRDM_1SDH_20200422T080459_20200422T080559_021254_028559_784D.zip" >>> # Create the reader object and open satellite data >>> reader = Reader() >>> # The reader will recognize the sensor from its product structure >>> s1_prod = reader.open(s1_path) >>> # Load some bands and index >>> bands = s1_prod.load([VV, VV_DSPK]) >>> # Create a stack with some bands >>> stack = s1_prod.stack([VV, VV_DSPK], stack_path="s1_vv_stack.tif")
⚠️SNAP and SAR
SAR products need
ESA SNAPfree software to be orthorectified and calibrated. Ensure that you have the folder containing your
gptexecutable in your
The API documentation can be found here.
Available notebooks provided as examples:
You can install EOReader via pip:
pip install eoreader
EOReader mainly relies on
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.
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.
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 !
EOReader is licensed under Apache License v2.0. See LICENSE file for details.
EOReader is built on top of amazing libs, without which it couldn’t have been coded:
Product Factory, class creating products according to their names
SAR and Optical products
Band module containing:
Environment variables that can change the processes
Additional keywords for EOReader used in
Utils: mostly getting directories relative to the project