User Guide
Accessing EOPF Sentinel Zarr Data Cubes with xcube
The "eopf-zarr" xcube data store enables you to create analysis-ready data cubes
(ARDCs) from Sentinel Zarr sample products published by the
EOPF Sentinel Zarr Sample Service.
This plugin provides convenient access to analysis-ready data from the Sentinel-1, Sentinel-2, and Sentinel-3 missions. Sentinel-1 GRD and SLC support is currently experimental.
This guide walks you through:
- Set up an EOPF Data Store
- Selecting a Product
- Opening a Spatiotemporal Data Cube
- Inspecting, Visualizing, and Saving the Data Cube
1. Set up an EOPF Data Store
To instantiate the data store:
from xcube.core.store import new_data_store
store = new_data_store("eopf-zarr")
2. Select a Data Product
Data products from Sentinel-1, -2, and -3 are accessed via the data_id parameter,
which corresponds to collection names in the EOPF STAC API.
To list all available data IDs:
store.list_data_ids()
data_id is documented in the respective sections for the
supported missions below.
3. Open a Spatiotemporal Data Cube
To open a cube (e.g., for Sentinel-2 Level-2A):
ds = store.open_data(
data_id="sentinel-2-l2a",
bbox=[9.7, 53.4, 10.3, 53.7],
time_range=["2025‑05‑01", "2025‑05‑07"],
spatial_res=10 / 111320, # here approx. 10m in degrees
crs="EPSG:4326",
)
💡 Note
open_data()builds a Dask graph and returns a lazyxarray.Dataset. No actual data is loaded at this point.
Required parameters:
bbox: Bounding box ["west", "south", "east", "north"] in CRS coordinates.time_range: Temporal extent ["YYYY-MM-DD", "YYYY-MM-DD"].spatial_res: Spatial resolution in meters or degrees, depending on the selected CRS. Optional for some data IDs.
These parameters control the STAC API query and define the output cube's spatial grid.
Optional Parameters
crs: Coordinate reference system, defaults to"EPSG:4326".variables: Variables to include in the dataset. Accepts a single name, a regex pattern, or an iterable of either.tile_size: Spatial tile size of the returned dataset, given as(width, height).query: Additional filtering options for STAC Items by their properties. See the STAC Query Extension for details.agg_methods: Aggregation method(s) for downsampling spatial variables. Accepts:- A single method applied to all variables, or
- A dictionary mapping variable names or dtypes to methods.
Supported methods include:
"center", "count", "first", "last", "max", "mean", "median",
"mode", "min", "prod", "std", "sum", "var".
Default: "center" for integer arrays, "mean" otherwise.
For details, see the xcube-resampling documentation.
interp_methods: Interpolation method(s) for upsampling spatial variables. Accepts:- A single method applied to all variables, or
- A dictionary mapping variable names or dtypes to methods.
Supported methods include:
- 0 — nearest neighbor (default for categorical / integer datasets)
- 1 — linear / bilinear (default for float datasets)
- "nearest" - alias for 0
- "triangular" - linearly interpolate between 4 points using two triangles
- "bilinear" - alias for 1
For details, see the xcube-resampling documentation.
4. Inspect, Visualize, and Save the Data Cube
You can visualize a time slice:
ds.b04.isel(time=0).plot()
⚠️ Warning
This operation triggers data downloads and processing. For large regions, use with care.
Saving the Data Cube
Although the EOPF xcube plugin focuses on data access, it integrates seamlessly with the broader xcube ecosystem for post-processing and storage.
To persist the data cube, write it to a local file or S3-compatible object storage
using the file or s3 xcube data store backends:
Local Filesystem Data Store:
storage = new_data_store("file")
storage = new_data_store(
"s3",
root="bucket-name",
storage_options=dict(
anon=False,
key="your_s3_key",
secret="your_s3_secret",
),
)
Then, write the cube:
storage.write_data(ds, "path/to/file.zarr")
Visualize in xcube Viewer
Once saved as Zarr, you can use xcube Viewer, to visualize the cube:
from xcube.webapi.viewer import Viewer
viewer = Viewer()
ds = storage.open_data("path/to/file.zarr")
viewer.add_dataset(ds)
viewer.show()
To retrieve the temporary URL of the launched viewer as a web app:
viewer.info()
Specific Parameters for supported Sentinel Missions
🛰️ Sentinel-1
Sentinel-1 provides C-band Synthetic Aperture Radar (SAR) data. Unlike optical sensors, SAR actively transmits microwave pulses and measures the returned signal, enabling observations independent of daylight and largely unaffected by cloud cover.
Each pixel measures the radar backscatter, i.e., the fraction of the emitted microwave energy reflected back to the satellite. Bright pixels indicate strong reflections, while dark pixels indicate weak reflections. The measured backscatter depends on factors such as surface roughness, moisture content, geometry, and vegetation structure.
Sentinel-1 supports several radar polarization combinations:
- VV – Vertical transmit, Vertical receive
- VH – Vertical transmit, Horizontal receive
- HH – Horizontal transmit, Horizontal receive
- HV – Horizontal transmit, Vertical receive
The available polarization combinations depend on the acquisition mode.
The main Sentinel-1 product types are:
| Product | Description | Typical applications | STAC Collection |
|---|---|---|---|
| SLC (Single Look Complex) | Complex-valued radar data (amplitude and phase) in slant-range geometry. | Interferometry (InSAR), ground deformation, DEM generation | sentinel-1-l1-slc |
| GRD (Ground Range Detected) | Detected radar intensity projected to ground-range geometry. Easier to use than SLC for most applications. | Flood mapping, sea ice, agriculture, ship detection | sentinel-1-l1-grd |
| OCN (Ocean) | Ocean geophysical products including wind, wave, and surface current information. | Oceanography, marine weather, offshore monitoring | sentinel-1-l2-ocn |
Note: Support for Sentinel-1 GRD and SLC products is currently experimental and undergoing validation. Some conversion parameters required for the processing chain are not yet available in the new EOPF products and are therefore estimated. Future EOPF product versions will provide these parameters directly.
Data Cube Generation Workflow
- STAC query: Retrieve all matching STAC Items based on the requested spatial (
bbox) and temporal (time_range) extent. - Grouping: Group the retrieved items by acquisition day, relative orbit, orbit direction (ascending or descending), and satellite platform.
- Opening: Open each product in analysis mode using xarray-eopf.
- GRD: Performs radiometric calibration, geocoding based on zero-Doppler geometry using a DEM, and radiometric terrain correction. If no DEM is provided, the Copernicus DEM GLO-30 is automatically retrieved from CDSE. See the GRD documentation.
- SLC: Performs radiometric calibration, TOPSAR burst debursting and merging, geocoding based on zero-Doppler geometry using a DEM, and radiometric terrain correction. If no DEM is provided, the Copernicus DEM GLO-30 is automatically retrieved from CDSE. See the SLC documentation.
- OCN: Rectifies the irregular measurement grid to a regular spatial grid. See the OCN documentation.
- Mosaicking: Merge adjacent tiles acquired on the same day into seamless scenes.
- Stacking: Stack the daily mosaics along the temporal dimension to create multi-temporal data cubes for each variable.
📚 Further reading: xcube-eopf Sentinel-1 Documentation
🛰️ Sentinel-2
Sentinel-2 provides multi-spectral imagery at different native resolutions:
- 10m: b02, b03, b04, b08
- 20m: b05, b06, b07, b8a, b11, b12
- 60m: b01, b09, b10
Sentinel-2 products are organized as STAC Items, each representing a single tile. These tiles are stored in their native UTM CRS, which varies by geographic location.
Data Identifiers
The EOPF xcube data store supports two Sentinel-2 product types via the data_id argument:
| Data ID | Description |
|---|---|
sentinel-2-l1c |
Level‑1C top‑of‑atmosphere (TOA) reflectance |
sentinel-2-l2a |
Level‑2A atmospherically corrected surface reflectance |
Supported Variables
- Surface reflectance bands:
b01,b02,b03,b04,b05,b06,b07,b08,b8a,b09,b11,b12 - Classification/Quality layers (L2A only):
cld,scl,snw
Data Cube Generation Workflow
- STAC Query: A STAC API request returns relevant STAC Items (tiles) based on
spatial and temporal extent (
bboxandtime_rangeargument). - Sorting: Items are ordered by solar acquisition time and Tile ID.
- Native Alignment: Within each UTM zone, tiles from the same solar day are aligned in the native UTM without reprojection. Overlaps are resolved by selecting the first non-NaN pixel value in item order.
- Cube Assembly: The method of cube creation depends on the user's request, as summarized below:
| Scenario | Native Resolution Preservation | Reprojected or Resampled Cube |
|---|---|---|
| Condition | Requested bounding box lies within a single UTM zone, native CRS is requested, and the spatial resolution matches the native resolution. | Data spans multiple UTM zones, a different CRS is requested (e.g., EPSG:4326), or a custom spatial resolution is requested. |
| Processing steps | Only upsampling or downsampling is applied to align the differing resolutions of the spectral bands. Data cube is directly cropped using the requested bounding box, preserving original pixel values. Spatial extent may deviate slightly due to alignment with native pixel grid. | A target grid mapping is computed from bounding box, spatial resolution, and CRS. Data from each UTM zone is reprojected/resampled to this grid. Overlaps resolved by first non-NaN pixel. |
Users can specify any spatial resolution and coordinate reference system (CRS) when
opening data with open_data. As a result, spectral bands may be resampled — either
upsampled or downsampled — and reprojected to match the target grid. If reprojection
is needed at a lower resolution, the process first downsamples the data and
subsequently performs the reprojection. Upsampling and downsampling are controlled using the agg_methods and interp_methods
parameters (see Optional Parameters).
Furthermore, the parameter crs can be set to "native", which allows the user to
provide the bounding box in regular latitude/longitude coordinates while retrieving
the data in its native UTM grid—without triggering any reprojection.
The following snippet shows an example:
from xcube.core.store import new_data_store
store = new_data_store("eopf-stac")
ds = store.open_data(
data_id="sentinel-2-l2a",
bbox=[9.7, 53.4, 10.3, 53.7],
time_range=["2025-05-01", "2025-05-07"],
spatial_res=10,
crs="native",
variables=["b02", "b03", "b04", "scl"],
)
Note that if the requested area spans multiple UTM zones, a DataStoreError
will be raised.
🛰️ Sentinel-3
Sentinel-3 has two instruments on board:
🌊 OLCI — Ocean and Land Colour Instrument
- Purpose: Primarily designed for ocean and land surface monitoring.
- Spectral bands: 21 bands (400–1020 nm).
- Spatial resolution: 300 m.
- Swath width: ~1,270 km
🔥 SLSTR — Sea and Land Surface Temperature Radiometer
- Purpose: Measures global sea and land surface temperatures with high accuracy.
- Spectral bands: 9 bands (visible to thermal infrared, 0.55–12 μm).
- Spatial resolution: 500 m (visible & shortwave infrared bands) and 1 km (thermal infrared bands).
- Swath width: ~1,400 km
Sentinel-3 data products are distributed as STAC Items, where each item corresponds to a single tile. The datasets are provided in their native 2D irregular grid and typically require rectification for analysis-ready applications.
Data Identifiers
The EOPF xcube data store so far supports three Sentinel-3 product types via the
data_id argument:
| Data ID | Description |
|---|---|
sentinel-3-olci-l1-efr |
Level-1 full-resolution top-of-atmosphere radiances from the OLCI |
sentinel-3-olci-l2-lfr |
Level-2 land and atmospheric geophysical parameters derived from OLCI |
sentinel-3-slstr-l1-rbt |
Level-1 radiances and brightness temperatures derived from SLSTR |
sentinel-3-slstr-l2-lst |
Level-2 land surface temperature products derived from SLSTR |
Supported Variables
sentinel-3-olci-l1-efr:
oa01_radiance,oa02_radiance,oa03_radiance,oa04_radiance,oa05_radiance,oa06_radiance,oa07_radiance,oa08_radiance,oa09_radiance,oa10_radiance,oa11_radiance,oa12_radiance,oa13_radiance,oa14_radiance,oa15_radiance,oa16_radiance,oa17_radiance,oa18_radiance,oa19_radiance,oa20_radiance,oa21_radiancesentinel-3-olci-l2-lfr:
gifapar,iwv,otci,rc681,rc865sentinel-3-slstr-l1-rbt:
s1_radiance_an,s2_radiance_an,s3_radiance_an,s4_radiance_an,s5_radiance_an,s6_radiance_an,s1_radiance_ao,s2_radiance_ao,s3_radiance_ao,s4_radiance_ao,s5_radiance_ao,s6_radiance_ao,s4_radiance_bn,s5_radiance_bn,s6_radiance_bn,s4_radiance_bo,s5_radiance_bo,s6_radiance_bo,f1_bt_fn,f1_bt_fo,f2_bt_in,f2_bt_io,s7_bt_in,s8_bt_in,s9_bt_in,s7_bt_io,s8_bt_io,s9_bt_iosentinel-3-slstr-l2-lst:
lst
Data Cube Generation Workflow
The workflow for building 3D analysis-ready cubes from Sentinel-3 products involves the following steps:
- Query tiles using the EOPF Zarr Sample Service STAC API for a given time range and spatial extent.
- Group items by solar day and orbit direction (ascending and descending passes).
- Rectify data from the native 2D irregular grid to a regular grid using xcube-resampling.
- Mosaic adjacent tiles into seamless daily scenes.
- Stack the daily mosaics along the temporal axis to form 3D data cubes for each variable (e.g., spectral bands).
⚠️ Important considerations:
- Rectification (irregular → regular grid) is computationally expensive and may slow down cube generation.
- Users can specify any spatial resolution and coordinate reference system (CRS) when
opening data with
open_data. During rectification, spectral bands are internally reprojected to the target grid. If a lower-resolution grid is requested, downsampling is applied prior to rectification. - Resampling behavior is controlled via the
agg_methods(downsampling) andinterp_methods(upsampling/interpolation) parameters.