# ESA Mediterranean Data Cubes

**URL:** <https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159>\
**Category:** Science Clusters & Working Groups\
**Created:** [15 September 2026 14:13 UTC](https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159 "2026-09-15T14:13:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunnydean](https://discourse-earthcode.eox.at/user_avatar/discourse-earthcode.eox.at/sunnydean/32/71_2.png) [@sunnydean](https://discourse-earthcode.eox.at/u/sunnydean)\
**Post date:** [15 September 2026 14:13 UTC](https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159/1 "2026-09-15T14:13:52Z")

</div>

The **ESA Mediterranean Datacube** brings together Earth observation and ocean science datasets for the Mediterranean Sea as part of EarthCODE’s work to make data easier to access and analyse. Drawing on ESA Ocean Science Cluster activities and complementary research products, it covers ocean circulation, physical and biogeochemical conditions, marine productivity, carbon exchange and marine heatwaves.

The datasets share a common **1/24° latitude-longitude grid in EPSG:4326** and are organised in analysis-ready GeoZarr format, with separate stores for monthly variables, daily surface and depth-resolved fields, and hourly currents.

Visit the [ocean hackathon website](https://esa-earthcode.github.io/ocean_hackathon/intro/) to explore the data and accompanying examples, or [browse the notebooks on GitHub](https://github.com/ESA-EarthCODE/ocean_hackathon).

 ![ESA Mediterranean Datacube overview](https://discourse-earthcode.eox.at/uploads/default/original/1X/875e632d28dbf3d62359a716f2ab2b4fa9a388a1.png)

_Example variables from the ESA Mediterranean Datacube._

## The Data

The collection covers the Mediterranean Sea, approximately 6°W-36°E and 30°N-46°N. The daily and monthly grids cover 2016-2022, with depth-resolved data through July 2022; hourly currents cover late 2014-2019. Availability varies by source dataset and variable.

### Daily Surface Variables

The daily surface datasets we have processed are:

- **4DMED-SEA Surface Salinity and Density** : sea-surface salinity, density and associated uncertainties.
  - Original Data Source: [Zenodo dataset](https://zenodo.org/records/13753090)
  - Open Science Catalog: [4DMED-2D SSS](https://opensciencedata.esa.int/products/4dmed-2d-sss/collection)

- **4DMED-SEA Ocean Stirring** : finite-size Lyapunov exponents describing the separation of nearby water parcels.
  - Original Data Source: [Zenodo dataset](https://zenodo.org/records/11384073)
  - Open Science Catalog: [4DMED-2D ALT MIOST LE](https://opensciencedata.esa.int/products/4dmed-2d-alt-miost-le-24/collection)

- **4DMED-SEA Sea Level and Geostrophic Currents** : sea-level anomaly, absolute dynamic topography, geostrophic velocities and relative vorticity from the 4DvarNET products.
  - Original Data Sources: [1/8° product](https://zenodo.org/records/10908416), [1/20° product](https://zenodo.org/records/10912777)
  - Reference: [4DVarNet study](https://doi.org/10.3390/rs14102502)
  - Open Science Catalog: [1/8° product](https://opensciencedata.esa.int/products/4dmed-2d-alt-varnet-8/collection), [1/20° product](https://opensciencedata.esa.int/products/4dmed-2d-alt-varnet-20/collection)

- **CAREHeat Marine Heatwaves** : marine heatwave categories from the original and detrended sea-surface temperature records.
  - Original Data Source: [CAREHeat data at Ifremer](https://data-cersat.ifremer.fr/data/marine-heat-wave/esa-careheat/cnr/v2/)
  - Reference: [Ifremer dataset record](https://sextant.ifremer.fr/record/87a33c31-5930-4379-8cfa-0b29ceee9756/)
  - Open Science Catalog: [CAREHeat database](https://opensciencedata.esa.int/products/careheat-database/collection)

### Monthly Ocean Variables

The monthly store includes:

- **4DMED-SEA Phytoplankton and Underwater Light** : phytoplankton functional types and diffuse attenuation coefficients.
  - Original Data Source: [Zenodo dataset](https://zenodo.org/records/17077475)
  - Open Science Catalog: [4DMED-2D PFT and Kd](https://opensciencedata.esa.int/products/4dmed-2d-pft-kd/collection)

- **Ocean Heat Content** : ocean heat-content change from satellite-based estimates.
  - Original Data Source: [AVISO ocean heat-content product](https://www.aviso.altimetry.fr/en/data/products/ocean-indicators-products/ocean-heat-content-and-earth-energy-imbalance/atlantic-ocean-heat-content-change.html)
  - Reference: [Product documentation](https://www.aviso.altimetry.fr/fileadmin/documents/data/tools/OHC-EEI/OHCATL-DT-035-MAG_EDD_V3.0.pdf)
  - Open Science Catalog: [4D Atlantic ocean heat content](https://opensciencedata.esa.int/products/4d-atlantic-ohc-global/collection)

- **OceanSODA** : surface carbonate chemistry, including pH, dissolved inorganic carbon, alkalinity and carbonate saturation, together with air-sea CO₂ fluxes and related variables.
  - Original Data Source: [OceanSODA dataset record](https://doi.org/10.25921/m5wx-ja34)
  - Open Science Catalog: [OceanSODA-ETHZ](https://opensciencedata.esa.int/products/ocean-soda-ethz/collection)

- **BICEP** : marine primary productivity, export production, particulate organic carbon, phytoplankton carbon and chlorophyll-a.
  - Original Data Source: [BICEP data at CEDA](https://data.ceda.ac.uk/neodc/bicep/data)
  - Reference: [BICEP project deliverables](https://bicep-project.org/Deliverables)
  - Open Science Catalog: [BICEP database](https://opensciencedata.esa.int/products/bicep-database/collection)

- **MITHO Cumulative Hazard Indices** : cumulative hazard indices and their contributing stressors, supporting analysis of multiple threats to ocean health.
  - Original Data Source: [Zenodo dataset](https://zenodo.org/records/17191460)
  - Open Science Catalog: [Global cumulative hazard indices](https://opensciencedata.esa.int/products/global-cumulative-hazard-indexes-chis/collection)

### Daily Depth-Resolved Variables

The depth-resolved store includes fields at **18 levels from 3 to 135 m** :

- **4DMED-SEA Subsurface Physical Fields** : temperature, salinity, geostrophic currents and mixed-layer depth.
  - Original Data Source: [Zenodo dataset](https://zenodo.org/records/13969340)
  - Open Science Catalog: [4DMED temperature, salinity and geostrophic currents](https://opensciencedata.esa.int/products/4dmed-t-s-geo-150/collection)

- **4DMED-SEA Primary Production** : depth-resolved primary production and euphotic-zone depth.
  - Original Data Source: [4DMED primary-production data](https://4dmed.artov.ismar.cnr.it/thredds/catalog/4dmed/catalog_PP.html)
  - Open Science Catalog: [4DMED-3D primary production](https://opensciencedata.esa.int/products/4dmed-3d-prim-prod-150/collection)

### Hourly Currents

- **World Ocean Circulation (WOC) Total Currents at 15 m**: hourly total currents, with geostrophic and wind-driven components.
  - Original Data Source: [WOC product record](https://www.worldoceancirculation.org/Products#/metadata/b72f4ac1-ffc6-4ba9-a729-670b6e879d52)
  - Open Science Catalog: [Total surface current at 15 m](https://opensciencedata.esa.int/products/total-surface-current-15/collection)

Each source dataset retains its own attribution, licence and scientific reference. See the [dataset overview and access examples](https://esa-earthcode.github.io/ocean_hackathon/datasets-sumary/) for more information.

## Access

- **Monthly variables:** [ocean-med-monthly-cube.zarr](https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-monthly-cube.zarr)
- **Daily surface variables:** [ocean-med-daily-surface-cube.zarr](https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-daily-surface-cube.zarr)
- **Daily depth-resolved variables:** [ocean-med-biophysics.zarr](https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-biophysics.zarr)
- **Hourly currents:** [hourly\_cube.zarr](https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/hourly_cube.zarr)

## Reading the Data

You can read the monthly GeoZarr store using Xarray, opening group `0` for the full-resolution grid:

```python
import xarray as xr

ds = xr.open_zarr("https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-monthly-cube.zarr", group="0", chunks={})
ds

```

The store also provides groups `1` and `2` for coarser spatial levels. For example, you can open group `1` and select chlorophyll-a for July 2019:

```python
coarse_ds = xr.open_zarr("https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-monthly-cube.zarr", group="1", chunks={})

chlorophyll = coarse_ds["chl_a"].sel(time="2019-07-01")
chlorophyll

```

The stores share a spatial grid, but their time coordinates and depth dimensions differ. Select the variables and align the time periods needed for your analysis when working across stores.

For tutorials and worked examples, visit the [Mediterranean Datacube getting-started notebook](https://esa-earthcode.github.io/ocean_hackathon/intro/) or [GitHub repository](https://github.com/ESA-EarthCODE/ocean_hackathon).

To suggest a dataset, share a use case or help extend the collection, reply here or email [earth-code@esa.int](mailto:earth-code@esa.int).

---

<div class="post-metadata">

**Author:** ![jorandeg](https://discourse-earthcode.eox.at/user_avatar/discourse-earthcode.eox.at/jorandeg/32/91_2.png) [@jorandeg](https://discourse-earthcode.eox.at/u/jorandeg)\
**Post date:** [27 October 2026 14:24 UTC](https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159/2 "2026-10-27T14:24:16Z")

</div>

Hi,

I’ve been trying to integrate the datacubes into my R workflow instead of Python.  
But I haven’t been succesfull so far, the ‘recommended’ package i found online to read zarr files (Rarr) is not (anymore) on CRAN.

Honestly out of my depth a bit… any help would be appreciated! 😀

---

<div class="post-metadata">

**Author:** ![krasen\_samardzhiev](https://discourse-earthcode.eox.at/user_avatar/discourse-earthcode.eox.at/krasen_samardzhiev/32/92_2.png) [@krasen\_samardzhiev](https://discourse-earthcode.eox.at/u/krasen_samardzhiev)\
**Post date:** [27 October 2026 16:01 UTC](https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159/3 "2026-10-27T16:01:55Z")

</div>

Hi Joran,

Can you try using stars and updating gdal to 3.13 or above ? I’ve not used stars directly, but as far as I understand its using gdal underneath to read the data.

stars : [Reading Zarr files with R package stars](https://r-spatial.org/r/2022/09/13/zarr.html)

I can read some data with gdal 3.13 directly from the command line:

> pixi run gdalinfo -stats ‘ZARR:“/vsicurl/[https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med\_cubes/ocean-med-daily-surface-cube.zarr](https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-daily-surface-cube.zarr)”:/0/sos:0’  
> ERROR 1: Codec sharding\_indexed: sharding not supported for scalar array  
> ERROR 1: Codec sharding\_indexed: sharding not supported for scalar array  
> ERROR 1: Codec sharding\_indexed: sharding not supported for scalar array  
> Driver: Zarr/Zarr  
> Files: /vsicurl/[https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med\_cubes/ocean-med-daily-surface-cube.zarr/0/sos/zarr.json](https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes/ocean-med-daily-surface-cube.zarr/0/sos/zarr.json)  
> Size is 1012, 378  
> Coordinate System is:  
> GEOGCRS[“WGS 84”,  
> ENSEMBLE[“World Geodetic System 1984 ensemble”,  
> MEMBER[“World Geodetic System 1984 (Transit)”],  
> MEMBER[“World Geodetic System 1984 (G730)”],  
> MEMBER[“World Geodetic System 1984 (G873)”],  
> MEMBER[“World Geodetic System 1984 (G1150)”],  
> MEMBER[“World Geodetic System 1984 (G1674)”],  
> MEMBER[“World Geodetic System 1984 (G1762)”],  
> MEMBER[“World Geodetic System 1984 (G2139)”],  
> MEMBER[“World Geodetic System 1984 (G2296)”],  
> ELLIPSOID[“WGS 84”,6378137,298.257223563,  
> LENGTHUNIT[“metre”,1]],  
> ENSEMBLEACCURACY[2.0]],  
> PRIMEM[“Greenwich”,0,  
> ANGLEUNIT[“degree”,0.0174532925199433]],  
> CS[ellipsoidal,2],  
> AXIS[“geodetic latitude (Lat)”,north,  
> ORDER[1],  
> ANGLEUNIT[“degree”,0.0174532925199433]],  
> AXIS[“geodetic longitude (Lon)”,east,  
> ORDER[2],  
> ANGLEUNIT[“degree”,0.0174532925199433]],  
> USAGE[  
> SCOPE[“Horizontal component of 3D system.”],  
> AREA[“World.”],  
> BBOX[-90,-180,90,180]],  
> ID[“EPSG”,4326]]  
> Data axis to CRS axis mapping: 2,1  
> Origin = (-6.083331427243676,30.250000634091965)  
> Pixel Size = (0.041666669184619,0.041666670048490)  
> Metadata:  
> aggregation\_method=mean  
> data\_meaning=continuous  
> description=N/A  
> file\_type=area  
> grid\_mapping=spatial\_ref  
> is\_mask=false  
> long\_name=sea surface salinity  
> original\_spatial\_resolution={0.041666984558105469,0.041667938232421875}  
> original\_temporal\_resolution=1 day; nominally 12:00 UTC, 00:00 UTC in December 2020  
> processing\_steps={ “regrid\_func”: “regrid\_kdtree\_pyresample”, “roi\_m”: 4000, “epsilon”: 0 }  
> reference=[ESA 4DMED-SEA - Mediterranean Multivariate Optimal Interpolated Salinity and Density fields | Zenodo](https://zenodo.org/records/13753090)  
> source=[https://esa-earthcode.github.io/open-science-catalog-metadata/products/4dmed-2d-sss/collection](https://esa-earthcode.github.io/open-science-catalog-metadata/products/4dmed-2d-sss/collection)  
> standard\_name=sea\_surface\_salinity  
> valid\_range={0,40}  
> visualization\_range={36.440073242187502,39.414380035400391}  
> Corner Coordinates:  
> Upper Left ( -6.0833314, 30.2500006) ( 6d 4’59.99"W, 30d15’ 0.00"N)  
> Lower Left ( -6.0833314, 46.0000019) ( 6d 4’59.99"W, 46d 0’ 0.01"N)  
> Upper Right ( 36.0833378, 30.2500006) ( 36d 5’ 0.02"E, 30d15’ 0.00"N)  
> Lower Right ( 36.0833378, 46.0000019) ( 36d 5’ 0.02"E, 46d 0’ 0.01"N)  
> Center ( 15.0000032, 38.1250013) ( 15d 0’ 0.01"E, 38d 7’30.00"N)  
> Band 1 Block=506x189 Type=Float64, ColorInterp=Undefined  
> Minimum=9.414, Maximum=39.322, Mean=38.306, StdDev=0.678  
> NoData Value=nan  
> Unit Type: .0001  
> Metadata:  
> STATISTICS\_MINIMUM=9.4141149520874  
> STATISTICS\_MAXIMUM=39.321662902832  
> STATISTICS\_MEAN=38.306405851651  
> STATISTICS\_STDDEV=0.67784879118194  
> STATISTICS\_VALID\_PERCENT=36.97

---

<div class="post-metadata">

**Author:** ![sunnydean](https://discourse-earthcode.eox.at/user_avatar/discourse-earthcode.eox.at/sunnydean/32/71_2.png) [@sunnydean](https://discourse-earthcode.eox.at/u/sunnydean)\
**Post date:** [27 October 2026 16:15 UTC](https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159/4 "2026-10-27T16:15:04Z")

</div>

Hi Joran! Can you try using r-stars? You also will need a later version of gdal that supports zarr-v3. The below seems to work. I’m definitely not a R user though! 😃 So I’m not entirely sure how to install/update gdal in RStudio.

The below is ran from my local JupyterLab.

```auto
# install conda and run this either in the terminal or notebook
!micromamba create -y -n rzarr -c conda-forge "gdal>=3.13,<3.14" r-base r-stars r-irkernel jupyterlab

library(stars)

url <- paste0(
  "https://s3.waw4-1.cloudferro.com/EarthCODE/",
  "OSCAssets/med_cubes/ocean-med-daily-surface-cube.zarr"
)

dsn <- sprintf('ZARR:"/vsicurl/%s":/0/sos:0', url)

salinity <- read_stars(dsn, proxy = FALSE)

print(salinity)

plot(salinity, main = "Sea-surface salinity - first day")

```

* * *

Would be great to have an R example of accessing the data if you can get it working in RStudio!

---

<div class="post-metadata">

**Author:** ![jorandeg](https://discourse-earthcode.eox.at/user_avatar/discourse-earthcode.eox.at/jorandeg/32/91_2.png) [@jorandeg](https://discourse-earthcode.eox.at/u/jorandeg)\
**Post date:** [28 October 2026 09:43 UTC](https://discourse-earthcode.eox.at/t/esa-mediterranean-data-cubes/159/5 "2026-10-28T09:43:07Z")

</div>

Hi!

Thanks for the advice the both of you! After some tweaking I managed to get it to work using the stars package. Slight problem is that the GDAL in the sf package is an older version so it does not ‘directly’ work.

Instead I had to embed a python session in my r session using the reticulate package. Like this I managed to get it to work.

```auto

system("where python")
Sys.glob("C:/Users/Blueseeds/AppData/Local/Programs/Python/*/python.exe")
Sys.glob("C:/Program Files/Python*/python.exe")
# ---- 0. Setup ---------------------------------------------------------------
py_path <- Sys.glob("C:/Users/Blueseeds/AppData/Local/Python/pythoncore-*/python.exe")[1]
if (is.na(py_path)) py_path <- "C:/Users/Blueseeds/AppData/Local/Python/bin/python.exe"
Sys.setenv(RETICULATE_PYTHON = py_path) # must run before library(reticulate)

library(reticulate)
library(stars)

xr <- import("xarray")
bi <- import_builtins()
base <- "https://s3.waw4-1.cloudferro.com/EarthCODE/OSCAssets/med_cubes"

# ---- 1. Helpers -------------------------------------------------------------
open_cube <- function(name, level = "2") {
  xr$open_zarr(paste0(base, "/", name), group = level,
               chunks = py_eval("{}"), consolidated = TRUE, decode_coords = "all")
}

getvar <- function(ds, v) py_get_item(ds, v)

np1 <- function(x) {
  if (inherits(x, "python.builtin.object")) x <- x$tolist()
  as.numeric(unlist(x))
}

np2 <- function(x) {
  if (inherits(x, "python.builtin.object")) {
    x <- do.call(rbind, lapply(x$tolist(), as.numeric))
  }
  unname(as.matrix(x))
}

# 2D xarray DataArray (lat, lon) -> stars object, north up
da_to_stars <- function(da, name) {
  m <- np2(da$values)
  lon <- np1(da$lon$values)
  lat <- np1(da$lat$values)
  if (lat[1] < lat[2]) { m <- m[nrow(m):1, , drop = FALSE]; lat <- rev(lat) }

  dx <- (lon[length(lon)] - lon[1]) / (length(lon) - 1)
  dy <- (lat[length(lat)] - lat[1]) / (length(lat) - 1) # negative

  s <- st_as_stars(t(m))
  s <- st_set_dimensions(s, 1, offset = lon[1] - dx/2, delta = dx, names = "x")
  s <- st_set_dimensions(s, 2, offset = lat[1] - dy/2, delta = dy, names = "y")
  st_crs(s) <- 4326
  setNames(s, name)
}

# ---- 2. Open cube and select region ----------------------------------------
level <- "2" # "0" full res, "1" 1/6 deg, "2" 1/3 deg
daily <- open_cube("ocean-med-daily-surface-cube.zarr", level)

region <- daily$sel(lon = bi$slice(-6, 0), # Alboran Sea
                    lat = bi$slice(34, 38.5))
day <- region$sel(time = "2019-06-01")$compute()

# ---- 3. Plot 1: salinity and density ---------------------------------------
sos <- da_to_stars(getvar(day, "sos"), "sos")
dos <- da_to_stars(getvar(day, "dos"), "dos")

plot(sos, axes = TRUE, main = "Sea-surface salinity 2019-06-01")
plot(dos, axes = TRUE, main = "Sea-surface density 2019-06-01")

# ---- 4. Plot 2: sea level and geostrophic currents -------------------------
adt <- da_to_stars(getvar(day, "adt_4dvarnet"), "adt")

lon <- np1(day$lon$values)
lat <- np1(day$lat$values) # ascending, matches rows of u and v
u <- np2(getvar(day, "ugos_4dvarnet")$values) # [lat, lon]
v <- np2(getvar(day, "vgos_4dvarnet")$values)

plot(adt, axes = TRUE, reset = FALSE, main = "4DVarNet ADT

```
