Sentinel-2 L2A Data Access
Demonstrate how to access Sentinel-2 L2A data in EOPF Zarr format

Table of ContentsΒΆ
Run this notebook interactively with all dependencies pre-installed
This notebook contain the most common data access procedures for the Sentinel-2 L2A EOPF Zarr data collection.
For more examples on how to use the data in different application scenarios, please refer to the EOPF Sample Notebooks available at: https://
Discover Products using STACΒΆ
Discover Sentinel-2 L2A products using the EOPF STAC catalog at https://stac.core.eopf.eodc.eu.
The STAC Collection is https://stac.core.eopf.eodc.eu/collections/sentinel-2-l2a .
import pystac_client
STAC_URL = "https://stac.core.eopf.eodc.eu"
catalog = pystac_client.Client.open(STAC_URL)
# Define area of interest
bbox = [11.2, 45.5, 11.3, 45.6]
# Look for all products starting from the first date until the present
temporal_extent = ["2025-10-01", None]
print("Discovering Sentinel-2 products from STAC catalog...")
s2_items = list(
catalog.search(
collections=["sentinel-2-l2a"],
bbox=bbox,
datetime=temporal_extent,
query={"eo:cloud_cover": {"lt": 20}},
).items()
)
print(f"Found {len(s2_items)} Sentinel-2 L2A products")Discovering Sentinel-2 products from STAC catalog...
Found 16 Sentinel-2 L2A products
Open a single product with xarrayΒΆ
This step will open a Sentinel-2 product as an Xarray.DataTree object.
import xarray as xr
xr.set_options(display_expand_attrs=False)
stac_item = s2_items[-1]
zarr_url = stac_item.assets["product"].href
ds = xr.open_datatree(zarr_url, engine="zarr")
dsOpen a single product with xarray-eopfΒΆ
This step will open a Sentinel-2 product as an Xarray.Dataset object.
For the package documentation please visit https://
ds = xr.open_dataset(zarr_url, engine="eopf-zarr")
dsOpen multiple products with xcube-eopfΒΆ
This step will combine all the products into a datacube.
For the package documentation please visit https://
from xcube.core.store import new_data_store
# Define area of interest
bbox = [11.2, 45.5, 11.3, 45.6]
# Look for all products starting from the first date until the present
temporal_extent = ["2025-10-01", None]
store = new_data_store("eopf-zarr")
ds = store.open_data(
data_id="sentinel-2-l2a",
bbox=bbox,
spatial_res=10,
time_range=temporal_extent,
crs="native",
variables=["b02", "b03", "b04", "scl"],
query={"eo:cloud_cover": {"lt": 20}},
)
ds