English | Deutsch
Sentinel-2 scene classification¶
Every Sentinel-2 Level-2A scene comes with an extra band, the Scene Classification Layer (SCL). For each 20 m pixel
it contains one number from 0 to 11 that says what the pixel probably shows. The Sentinel-2 download functions
use it to throw away unusable pixels before they average the scenes of your period. scl_classes is the list of
classes you want to keep; everything else is treated as no data (Filter clouds,
Clouds and masking).
ID |
Class |
Hint |
Color |
|---|---|---|---|
0 |
No data |
No measurement for this pixel (for example outside the satellite’s track). Always exclude. |
|
1 |
Saturated or defective |
The sensor was overexposed or the pixel is defective, so the values cannot be trusted. Always exclude. |
|
2 |
Topographic casted shadows |
Dark pixels in the shadow of terrain such as hills. Scenes before 2022-01-25 call this class ‘dark features/shadows’. Usually exclude. |
|
3 |
Cloud shadows |
The dark ground under a cloud. The reflectance is too low, which distorts averages and indices. Exclude. |
|
4 |
Vegetation |
Green plants: forests, fields, grass, parks. Keep for vegetation indices and most maps. |
|
5 |
Not vegetated |
Bare soil, sand, roads, roofs and other built-up surfaces, and sometimes dry or sparse vegetation. Keep it for city maps. |
|
6 |
Water |
Lakes, rivers and sea. Keep for the water index, true-colour and false-colour images, exclude for NDVI/EVI (water has no vegetation signal). |
|
7 |
Unclassified |
Pixels the classifier could not assign, often haze, cloud edges or mixed pixels. Exclude unless you have too few observations. |
|
8 |
Cloud, medium probability |
Probably a cloud. Exclude. |
|
9 |
Cloud, high probability |
Almost certainly a cloud. Exclude. |
|
10 |
Thin cirrus |
High, thin cloud. The ground is partly visible but looks washed out. Exclude. |
|
11 |
Snow or ice |
Snow or ice. Keep only for snow studies; the classifier sometimes confuses snow with cloud. |
|
The classification is calculated automatically (by ESA’s Sen2Cor processor) and is not perfect: thin clouds, haze and cloud edges are sometimes labelled as land, and snow is sometimes labelled as cloud. The class names follow the Sentinel Hub and ESA documentation; the hints are written for this package. To see the classes of your own area as a map, download the scene classification.
- cdec.show_scl_classes(selected=None)[source]¶
Print the SCL classes with a short hint, one line per class.
Pass the classes you intend to use as
selectedto see them marked withX(the classes that would be kept):show_scl_classes((4, 5, 6))
- cdec.SCL_CLASSES: dict[int, str]¶
The 12 classes of the Sentinel-2 Scene Classification Layer: class number to name.
- cdec.SCL_HINTS: dict[int, str]¶
A short explanation for every class, and whether you usually want to keep it.
- cdec.SCL_LAND: tuple[int, ...] = (4, 5)¶
Vegetation and not vegetated: the default
scl_classesof NDVI, EVI and NDMI.
- cdec.SCL_LAND_AND_WATER: tuple[int, ...] = (4, 5, 6)¶
Land and water: the default
scl_classesof NDWI, the true-colour image and the false-colour images (urban, infrared and SWIR).
- cdec.SCL_LAND_WATER_AND_SNOW: tuple[int, ...] = (4, 5, 6, 11)¶
Land, water and snow or ice: the default
scl_classesof NDSI.
- cdec.SCL_COLORS: dict[int, str]¶
The colour of every class as hex code (the colours of the Copernicus Browser layer). This is the colour table that
download_scene_classification_map()stores in the GeoTIFF, and the colours ofplot_scene_classification_map().