The tutorial describes how to read Sentinel-2 data with sensorsio
Motivation
The notebook demonstrates how to leverage the sensorsio Python package to load and process Sentinel-2 Level-2A (MAJA format) imagery efficiently. It covers key capabilities like reprojection, subsetting, and reading both raw bands and masks into numpy and xarray.
Prerequisites
To follow the tutorial, you need:
- Python environment setup: Ability to run Jupyter notebooks. Installing the library can be done via:
pip install sensorsio - Sentinel-2 L2A data: MAJA-processed Sentinel-2 product, e.g. downloaded from THEIA or a similar provider.
Tutorial Content
The notebook proceeds through several structured steps:
-
Import & Instantiate
-
Import the Sentinel-2 driver from
sensorsio. -
Load a Sentinel-2 image by pointing at the directory path of the L2A product.
-
Reading Data
-
Use
read_as_numpyto retrieve selected resolution bands (e.g., 10m group). -
Use
read_as_xarrayto get anxarray.Datasetwith dimensions, coordinates, masks, and metadata. -
Visualization
-
Apply
utils.rgb_renderto generate RGB-composite arrays with scaling parameters. -
Plot side-by-side comparisons using Matplotlib for visual inspection.
-
Extras & Metadata Access
-
Highlight access to sensor-specific metadata such as tile identifier, CRS, and acquisition date.