Satellite derived Seascapes generated as part of the ESA funded Biodiversity in the Open Ocean: Mapping, Monitoring and Modelling (BOOMS) project.
“Seascapes” in this dataset are defined as the boundaries between ocean water masses with common categorical classifications derived from earth observation satellite imagery physical properties, such as optical reflectance spectra, ocean fronts, and in combination with Bio-argo float data. Species data are not used to determine seascapes.
* EO4SOCIETY Website: https://eo4society.esa.int/projects/booms/
* Original Data Source: https://zenodo.org/records/15672978
* Reference: https://opensciencedata.esa.int/projects/booms/collection
* OSC entry: https://opensciencedata.esa.int/projects/booms/collection ,
* License: CC-BY-NC-4.0import xarray as xrfrom pystac_client import Client
catalog = Client.open("https://eoapi.workspace.earthcode.eox.at/stac/")
collection = catalog.search(collections=["booms-dataset"]).item_collection()
items = {item.id: item for item in collection}
collectionLoading...
[item.assets["data"].href for item in collection]ds = xr.open_zarr(items["booms-dataset-seascape-t1-owt"].assets["data"].href)
dsLoading...
Plotting¶
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
import cartopy.crs as ccrs
import cartopy.feature as cfeature
def plot_med_water_class(da, label="smoothed mode dominant water class"):
# 14 discrete OWT classes
classes = np.arange(1, 15)
# A categorical colour map
cmap = plt.get_cmap("tab20", 14)
# Boundaries put each integer in the centre of a colour bin
boundaries = np.arange(0.5, 15.5, 1)
norm = mcolors.BoundaryNorm(
boundaries,
ncolors=cmap.N
)
fig = plt.figure(figsize=(13, 7))
ax = plt.axes(
projection=ccrs.PlateCarree()
)
im = ax.pcolormesh(
da.lon,
da.lat,
da,
cmap=cmap,
norm=norm,
shading="nearest",
transform=ccrs.PlateCarree()
)
ax.set_extent(
[lon_min, lon_max, lat_min, lat_max],
crs=ccrs.PlateCarree()
)
ax.add_feature(
cfeature.LAND,
facecolor="lightgrey",
zorder=2
)
ax.add_feature(
cfeature.COASTLINE,
linewidth=0.6,
zorder=3
)
ax.add_feature(
cfeature.BORDERS,
linewidth=0.3,
zorder=3
)
cbar = plt.colorbar(
im,
ax=ax,
ticks=classes,
boundaries=boundaries,
pad=0.03,
shrink=0.85
)
cbar.set_label(label)
date = da.time.values if "time" in da.coords else ds.time.isel(time=time_index).values
ax.set_title(
f"Bio-optical Seascape - Mediterranean\n"
f"{np.datetime_as_string(date, unit='D')}"
)
plt.tight_layout()
return fig, axds = xr.open_zarr(items["booms-dataset-seascape-t1-owt"].assets["data"].href)
# subset data
da = ds['smoothed_mode_dominant_water_class'].isel(time=0)
# Mediterranean bounding box
lon_min, lon_max = -6, 37
lat_min, lat_max = 30, 46.5
# Crop before plotting
da = da.where(
(da.lon >= lon_min) &
(da.lon <= lon_max) &
(da.lat >= lat_min) &
(da.lat <= lat_max),
drop=True
)
plot_med_water_class(da)(<Figure size 1300x700 with 2 Axes>,
<GeoAxes: title={'center': 'Bio-optical Seascape - Mediterranean\n1998-01-01'}>)
ds = xr.open_zarr(items["booms-dataset-seascape-t2-biophysical"].assets["data"].href)
# subset data
da = ds['smoothed_dominant_water_class'].isel(time=0)
# Mediterranean bounding box
lon_min, lon_max = -6, 37
lat_min, lat_max = 30, 46.5
# Crop before plotting
da = da.where(
(da.lon >= lon_min) &
(da.lon <= lon_max) &
(da.lat >= lat_min) &
(da.lat <= lat_max),
drop=True
)
plot_med_water_class(da, label="smoothed dominant water class")(<Figure size 1300x700 with 2 Axes>,
<GeoAxes: title={'center': 'Bio-optical Seascape - Mediterranean\n1999-01-01'}>)
ds = xr.open_zarr(items["booms-dataset-seascape-t3-4d-atlantic"].assets["data"].href)
# subset data
da = ds['mode_seascape_4D'].isel(time=0, depth=0).squeeze()
da = da.rename({'longitude': 'lon', 'latitude': 'lat'})
da_plot = da.transpose("lat", "lon")
plot_med_water_class(da_plot, label="mode seascape 4D depth 0")(<Figure size 1300x700 with 2 Axes>,
<GeoAxes: title={'center': 'Bio-optical Seascape - Mediterranean\n1999-01-06'}>)
ds = xr.open_zarr(items["booms-dataset-seascape-t3-4d-southern"].assets["data"].href)
da = ds.mode_seascape_4D.isel(time=0, depth=0).transpose("latitude", "longitude")
ax = plt.axes(projection=ccrs.SouthPolarStereo())
ax.set_extent([-180, 180, -90, -40], ccrs.PlateCarree())
im = ax.pcolormesh(da.longitude, da.latitude, da, transform=ccrs.PlateCarree(), shading="auto")
ax.coastlines()
plt.colorbar(im, ax=ax)
plt.show()