Repository navigation
0.5.0 — CMEMS grid mask pre-filter for build_sites
[0.5.0] - 2026-07-22
Changed
-
build_sitesnow pre-filters candidates against the CMEMS grid
mask by default. Previously,data.sites.build_sitesreturned
every GEBCO ocean cell in the region's bbox that met the depth
window. On regions with complex bank/channel bathymetry (Bahamas,
Maldives, Marshall Islands…) up to ~93 % of those candidates landed
in CMEMS cells that GLORYS12v1 marks as land or above the model
seafloor, anddata_processingsilently dropped them as NaN. The
reported site count for Bahamas at defaults was290— pyOTEC
reports ~1342 for the same domain because its bundled
CMEMS_points_with_properties.csvis CMEMS-grid-aligned by
construction. This asymmetry was reported by a user comparing the
two frameworks.build_sitesnow downloads a single-time, single-depth CMEMS
thetaosnapshot atcmems_verify_depth(default1062.44 m,
matchingSeawaterPipes.cw_inlet_lengthand pyOTEC's
length_CW_inlet), extracts its boolean valid-cell mask, and
discards GEBCO candidates that fall on CMEMS-invalid cells. The
mask is cached under$OTEX_CACHE_DIR/cmems_mask/so subsequent
(and offline) calls are free.For Bahamas at defaults the pool now returns
2618sites —
the remaining gap vs pyOTEC (~1342) is explained by OTEX's wider
admin-0 bbox with a 2° offshore buffer.Opt out with
build_sites(..., cmems_verify=False)(matches the
0.4.x behaviour). The graceful fallback still handles missing
copernicusmarine/ CMEMS credentials with aRuntimeWarning
and returns the un-filtered pool.
Added
otex.data.cmems_mask— new module exposing
cmems_valid_mask(west, east, south, north, depth_m, refresh=False)
andfilter_sites_by_cmems_mask(sites, ...). Both cache the
downloaded snapshot per(bbox, depth)tuple under
$OTEX_CACHE_DIR/cmems_mask/for offline reuse on HPC compute
nodes.build_sitesgainedcmems_verify: bool = Trueand
cmems_verify_depth: float = 1062.44keyword arguments. Both are
part of the on-disk cache key so verified and unverified pools are
cached independently.