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.

#000000

1

Saturated or defective

The sensor was overexposed or the pixel is defective, so the values cannot be trusted. Always exclude.

#ff0000

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.

#2f2f2f

3

Cloud shadows

The dark ground under a cloud. The reflectance is too low, which distorts averages and indices. Exclude.

#643200

4

Vegetation

Green plants: forests, fields, grass, parks. Keep for vegetation indices and most maps.

#00a000

5

Not vegetated

Bare soil, sand, roads, roofs and other built-up surfaces, and sometimes dry or sparse vegetation. Keep it for city maps.

#ffe65a

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).

#0000ff

7

Unclassified

Pixels the classifier could not assign, often haze, cloud edges or mixed pixels. Exclude unless you have too few observations.

#808080

8

Cloud, medium probability

Probably a cloud. Exclude.

#c0c0c0

9

Cloud, high probability

Almost certainly a cloud. Exclude.

#ffffff

10

Thin cirrus

High, thin cloud. The ground is partly visible but looks washed out. Exclude.

#64c8ff

11

Snow or ice

Snow or ice. Keep only for snow studies; the classifier sometimes confuses snow with cloud.

#ff96ff

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 selected to see them marked with X (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_classes of NDVI, EVI and NDMI.

cdec.SCL_LAND_AND_WATER: tuple[int, ...] = (4, 5, 6)

Land and water: the default scl_classes of 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_classes of 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 of plot_scene_classification_map().