Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Accessing Sentinel-2 Data

ESA

This notebook shows a simple end-to-end workflow for bringing Sentinel-2 L2A data into the ESA Antarctica Datacube workflow. We use the cube grid to define an area of interest, search a STAC API, load RGB and scene classification data lazily with odc.stac, build a least-bad-pixel mosaic, and plot polar cube data over the result.

Define the search area from the cube grid

STAC searches expect longitude/latitude bounds, but our analysis area is easier to describe in the cube CRS. Here we define the ROI in EPSG:3031 metres, then transform its four corners to EPSG:4326 for the STAC bbox.

[-70.86635679409451, -68.95219601061162, -61.85839876773828, -65.45764355045239]
<Figure size 700x700 with 1 Axes>
Loading...
<Figure size 640x480 with 2 Axes>

Sentinel-2 Data Archives Access Example

Sentinel-2 L2A is the surface reflectance product and includes the scl scene classification layer used for masking clouds, shadows, nodata, and defective pixels.

84

Quick thumbnail check

The cloud-cover property is attached to the Sentinel-2 tile, not just the small ROI. A quick thumbnail pass is useful for spotting obviously bad acquisitions before loading the full data.

Loading...
<function __main__.show(i)>

Load RGB and SCL onto the cube CRS

groupby="solar_day" combines same-day Sentinel-2 tiles into one time step. This matters because a large Antarctic bbox often intersects many MGRS tiles from the same pass. The data are loaded at 100 m to match the cube-scale workflow.

[########################################] | 100% Completed | 94.43 ss
Loading...

Rank scenes by usable pixels

  1. Masks bad Sentinel-2 pixels using scl.

  2. Sorts the images by how many good pixels they have.

  3. Builds an RGB mosaic by filling gaps with the next-best image, then reprojects it to match ds.

Plot Sentinel Data Mosaic

<Figure size 1000x1000 with 1 Axes>

Overlay Bedrock Topography on Sentinel-2

<Figure size 800x800 with 2 Axes>