Skip to content

Python for Raw Sentinel-2 data (PyRawS) is an open-source software providing utilities to open and process Sentinel 2 RAW data, which corresponds to a decompressed version of Level-0 data with additional metadata. The software is demonstrated on the first Sentinel-2 dataset containing raw data for warm temperature hotspots detection/classification.

License

ESA-PhiLab/PyRawS

Repository files navigation

Docker Automated build GitHub last commit GitHub contributors GitHub issues GitHub pull requests Tests Python 3.8 Python 3.9 Python 3.10 PyPI Docs

(Disclaimer: This project is currently under development.)

PyRawS

Alt Text

News & Updates

  • #23
  • #28
  • New Readme 🎉 (23/03/2024)

About the project

Python for RAW Sentinel-2 data (PyRawS) is a powerful open-source Python package that provides a comprehensive set of tools for working with Sentinel-2 Raw data🔬. 1 It provides utilities for coarse spatial bands coregistration, geo-referencing, data visualization📊, and image processing🖼️. The software is demonstrated on the first Sentinel-2 🛰️ Raw database for warm temperature hotspots 🔥 detection/classification, making it an ideal tool for a wide range of applications in remote sensing and earth observation🌍. The package is written in Python and is open source💻, making it easy to use and modify for your specific needs. The systme is based on pytorch, which be installed with CUDA support, to enable GPU acceleation.

Important

NB: What we call raw data in this project are Sentinel-2 data generated by the decompression and metadata addition of Sentinel-2 L0 data. Because of that, with the exception of the effects due to onboard equalization and lossy compression, they are the most similar version of the rawest form of data acquired by the satellite's sensors. Both the compression and equalization are applied onboard the satellite to reduce the amount of data transmitted to the ground station. For easy naming convention, this repo refer to the term "Raw" as the products decompressed with ancillary information appended. For further information browse our paper at https://arxiv.org/abs/2305.11891

Note

YouTube Tutorial ⭐️

A demo showcasing PyRawS capabilities is available on the YouTube channel of Robin Cole Alt Text

Content of the repository

The PyRawS repository includes the following directories:

Directory Name Description
quickstart Contains Jupyter notebooks for quick start:
1. API demonstration: Notebook demonstrating PyRawS API.
2. DB_creation: Notebook for automatic creation of a database for a target dataset.
3. geographical_distribution: Notebook to display the geographical distribution of dataset events on a map.
pyraws Contains PyRawS package with the following subdirectories:
1. database: Various PyRawS and other databases.
2. raw: Includes Raw_event and Raw_granule classes for modeling Sentinel-2 Raw events and granules.
3. l1: Contains L1_event and L1_tiles classes for modeling Sentinel-2 L1C events and tiles.
4. utils: Utilities for the PYRAW package.
resources Contains various resources, such as images for the README.
scripts_and_studies Contains scripts and code for different studies related to the THRAWS dataset:
1. coregistration_study: Utils for coregistration study and coarse coregistration technique.
2. dataset_preparation: Scripts and files for designing THRAWS files, including data download and event selection.
3. hta_detection_algorithms: Custom and simplified implementation of various high-thermal-anomalies-detection algorithms, including those used for designing the THRAWS dataset.
4. runscripts: Runscripts and utils for cropping Sentinel-2 L1C tiles, generating images, and exporting tif.
5. granules_filtering: Script for running and mapping cropped Sentinel-2 L1C tiles to corresponding Raw granules.
6. download_thraws: Utility for downloading the THRAWS dataset from Zenodo.

Installation

Install pyraws referring to the guide in here.

Sidenote: Sentinel-2 Raw granules and events

Alt Text

Downloading Sentinel-2 Raw data requires to specify a polygon surrounding the area of interest and a date. Given the pushbroom nature of the Sentinel-2 sensor, bands of data at Raw level do not look at the same area (i.e., they are not registered). Therefore,to be sure to collect all the band around an event (i.e., volcanic eruptions, wildfires) rectangular polygons centered on the events of area 28x10 $km^2$ are used (white rectangular in the image above). This leads to download all the Raw granules whose reference band (B02) interesects the polygon area.
The image above shows the footprint of the all the Sentinel-2 Raw granules that are downloaded for the eruption named "Etna_00" in our database by using the white rectangular polygon. We define the collection of Raw granules that are downloaded for each of the rows of our database "Sentinel-2 Raw event".
However, as you can see in the image above, most of the Sentinel-2 Raw granules in Etna_00 Sentinel-2 Raw event do not contain the volcanic eruption (big red spot) of interest (red rectangulars). Indeed, only the yellow and the pink rectangulars intersects or include part of the volcanic eruption.
In addition, the fact that one Raw granule intersects or include one event, this does not mean that the latter interesects or is included in all the bands of that Raw granule. In particular, since we use the bands [B8A, B11, B12] to detect wildfires and volcanic eruptions, we consider Raw useful granules those granules whose band B8A interesects the event. This is true for the yellow rectangular but not for the pink one (you need to trust us here, since the bands are not displaced in the image above). We take the band B8A only because after the coregistration, the other bands will be moved to match the area of B8A.
Finally, for some Raw useful granules part of the eruptions or the wildfire could extend until the top or the bottom edge of the polygon. In this case, some of the bands could be missing for a portion of the area of interest. To be sure that this is not happening, in addition to the Raw useful granules, it is important to consider Raw complementary granules, which fills the missing part of the interest bands of the Raw useful granules.
For each Sentinel-2 Raw event, the THRAWS dataset clearly states those Raw granules that are Raw useful granules or Raw complementary granules. However, the entire Raw granules collection is provided for each Raw event to permit users that wants to use other bands to detect warm temeprature anomalies to do it.

Contributing

The PyRawS project is open to contributions. To discuss new ideas and applications, please, reach us via email (please, refer to Contacts). To report a bug or request a new feature, please, open an issue to report a bug or to request a new feature.

If you want to contribute, please proceed as follow:

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Create NewFeature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

License

Distributed under the Apache License.

Contacts

Created by the European Space Agency $\Phi$-lab.

  • Gabriele Meoni - G.Meoni@tudelft.nl (previously, wit ESA $\Phi$-lab)
  • Roberto Del Prete - roberto.delprete at ext.esa.int and unina.it
  • Nicolas Longepe - nicolas.longepe at esa.int
  • Federico Serva - federico.serva at ext.esa.int

References

Ref1

Massimetti, Francesco, et al. ""Volcanic hot-spot detection using SENTINEL-2: a comparison with MODIS–MIROVA thermal data series."" Remote Sensing 12.5 (2020): 820."

About

Python for Raw Sentinel-2 data (PyRawS) is an open-source software providing utilities to open and process Sentinel 2 RAW data, which corresponds to a decompressed version of Level-0 data with additional metadata. The software is demonstrated on the first Sentinel-2 dataset containing raw data for warm temperature hotspots detection/classification.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published