Remote-sensing opensource python library reading optical and SAR constellations, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
Project description
EOReader
EOReader is a remote-sensing opensource python library reading optical and SAR constellations, loading and stacking bands, clouds, DEM and spectral indices in a sensor-agnostic way.
Optical | SAR |
---|---|
Sentinel-2 and Sentinel-2 Theia Sentinel-3 OLCI and SLSTR Landsat 1 to 9PlanetScope and SkySat Pleiades and Pleiades-Neo SPOT 6-7 Vision-1 Maxar (WorldViews, GeoEye) |
Sentinel-1 COSMO-Skymed 1st and 2nd GenerationTerraSAR-X , TanDEM-X and PAZ SAR RADARSAT-2 and RADARSAT-Constellation ICEYE SAOCOM |
It also implements additional sensor-agnostic features:
load
: Load many band types:- satellite bands (optical or SAR)
- index
- cloud bands
- DEM bands
stack
: Stack all these type of bands
EOReader works with xarrays.DataArray
and geopandas.GeoDataFrames
Python Quickstart
Optical
>>> 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 constellation 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")
SAR
>>> 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 constellation 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 SNAP
free software to be orthorectified and calibrated. Ensure that you have the folder containing yourgpt
executable in yourPATH
.
Documentation
The API documentation can be found here.
Examples
Available notebooks provided as examples:
- Basic tutorial
- Optical data
- SAR data
- VHR data
- Sentinel-3 data
- Water detection on multiple products
- DEM
- Custom stacks
- Methods to clean optical bands
- S3 Compatible Storage
- Dask
- STAC
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 constellations (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 constellation:
- the algorithm (and its developer) can focus on its core tasks (such as extraction) without taking into account the constellation 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 constellation 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 constellations 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 !
Press Release
License
EOReader is licensed under Apache License v2.0. See LICENSE file for details.
Authors
EOReader has been created by ICube-SERTIT. Follow us on twitter
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
Built Distribution
Hashes for eoreader-0.15.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8984a796c623ffcc343cee9636f2c75de2ade3a29b6eedc95ac79d8e18479ff |
|
MD5 | 71a1b59d14e683de46f9ad0966d59b65 |
|
BLAKE2b-256 | 27f2eaba790152be48ecf084ca1cdfab6702b7f5b1c780c7ee74d49755b4f6ad |