Survey of three ocean-data-challenges repos (all MIT-style) to identify
features worth integrating into xrtoolz. Repo 1 & 3 are forks of a common
eval base; repo 2 is the leaner eNATL60/NATL60 OSSE subset.
Repo 1: https://
github .com /ocean -data -challenges /2024 _DC _SSH _mapping _SWOT _OSE Repo 2: https://
github .com /ocean -data -challenges /2023 _SSH _mapping _train _eNATL60 _test _NATL60- Repo 3: https://
github .com /ocean -data -challenges /2024c _DC _4DMedSea -ESA
This document is a working catalogue: we walk through it item-by-item to decide what to port, adapt, or skip. Status column is updated as decisions are made.
1. 2024_DC_SSH_mapping_SWOT_OSE¶
| # | File | What it provides | Status |
|---|---|---|---|
| 1.1 | mod_filter.py | lanczos_filter (FFT 1D low-pass), apply_bandpass_filter(ds, λmin, λmax) for along-track SLA, compute_median_dx (haversine spacing). Lanczos + bandpass not in xrtoolz. | Proposal: ODC-1.1 — FIR filters (Lanczos + Kaiser) and along-track wavelength bandpass |
| 1.2 | mod_interp.py | run_interpolation(ds_maps, ds_alongtrack) colocates a gridded map onto along-track obs via pyinterp 4D, plus drifter and u/v variants. Most-reused function across all three repos. | Proposal: ODC-1.2 — Grid-to-points colocation (along-track / drifters) |
| 1.3 | mod_spectral.py | Segment-based 1D PSD: compute_segment (gap-tolerant equal-length segmentation w/ overlap), spectral_computation (per-segment FFT + cross-spec + coherence), compute_resolution (canonical λx-at-PSD-score=0.5), compute_psd_scores driver. | Proposal: ODC-1.3 — Segmented along-track PSD score + effective resolution λx |
| 1.4 | mod_stat.py | bin_data (2D lat/lon binning of along-track residuals), compute_stat_scores_by_regimes (coastal/equatorial/high-vs-low-eddy), dm_test (Diebold–Mariano significance). | Proposal: ODC-1.4 — Binned residual maps, region/regime scoring, Diebold–Mariano test |
| 1.5 | mod_plot.py | Mostly redundant with our validation viz; net-new are regime-bar plots and plot_polarization. | Proposal: ODC-1.5 — Regime-stratified bar panel + rotary spectrum & polarization panel |
2. 2023_SSH_mapping_train_eNATL60_test_NATL60-¶
| # | File | What it provides | Status |
|---|---|---|---|
| 2.1 | src/mod_eval.py | rmse_based_scores returns (rmse_t, rmse_xy, leaderboard, error_stability=std(rmse_t)); psd_based_scores does 2D (kx, kt) PSD-score + 0.5-contour extraction of (λx, λt). xrtoolz only has the 1D isotropic version. | Proposal: ODC-2.1 — RMSE-skill bundle + space-time PSD-score with (λx, λt) summary |
| 2.2 | src/mod_regrid.py | pyinterp 3D regrid + Gauss–Seidel NaN extrapolation. Clean alternative to current sklearn-NN regridder. | Proposal: ODC-2.2 — Laplacian (Gauss–Seidel) gap-fill + verify 3D regrid path |
| 2.3 | src/mod_plot.py | Seasonal PSD-score mosaic panel — only viz not already covered. | Proposal: ODC-2.3 — Generic FacetPanel (subsumes the seasonal PSD-score mosaic) |
3. 2024c_DC_4DMedSea-ESA¶
(Inherits repo 1’s filter/interp/spectral/stat; only net-new modules listed.)
| # | File | What it provides | Status |
|---|---|---|---|
| 3.1 | src/mod_powerspec.py | wavenumber_spectra (radial 2D PSD with Tukey/Hanning windows), cross_spectra, spectra_flux (KE spectral flux from u, v in Fourier space), weighted_scale (integral scale), fill_nan. Spectral KE flux is genuinely missing from xrtoolz. | Proposal: ODC-3.1 — Spectral KE flux + dual-cascade companions (enstrophy flux, integral / Taylor scales, slope fitter, compensated spectra) |
| 3.2 | src/mod_switchvar.py | sla_to_ssh(ds, mdt) (adds CNES MDT), currents_to_potential_vorticity(u, v, h). The rest duplicates our ocn ops. | Mostly already covered (potential_vorticity_barotropic, geostrophic_velocities, relative_vorticity, grid_metrics_from_coords, calculate_ssh_alongtrack). One small gap (optional LWE in calculate_ssh_alongtrack) filed as #135. |
| 3.3 | src/mod_traj.py | Lagrangian drifter advection: adv_eul, adv_rk4, compute_traj (multi-horizon), compute_deviation (binned RMSE between modeled vs observed drifters), dist_drifters. Entire Lagrangian sub-domain missing from xrtoolz. | Reconciles with Epic V3 (#49) — see ODC-3.3 — Lagrangian advection: reconciliation with Epic V3. Upstream adv_eul/adv_rk4 → #51; compute_deviation → #53 (new EndpointErrorMap); prepare_drifter_data → #54. |
| 3.4 | src/mod_compare.py | Paired-diff stat/PSD plots (the wrappers, not the zoom/longitude utils). | Proposal: ODC-3.4 — Generic PairwiseComparePanel (study-vs-ref with diff) |
| 3.5 | src/mod_xscale.py / mod_utils.py / mod_read.py | Duplicate xrft, generic helpers, data-fetch. | Skip |
| 3.6 | mod_plot.py:movie | matplotlib.animation intercomparison panels. | Proposal: ODC-3.6 — Generic AnimatePanel (time-axis animation wrapper) |
Cross-cutting consensus workflow¶
The recurring pipeline across all three repos:
read
→ bandpass-filter reference along-track
→ colocate gridded map onto along-track via pyinterp
→ bin residuals
→ score (RMSE / segmented-PSD λx / 2D PSD λx,λt / drifter deviation)
→ plot maps + PSD curves + leaderboard
→ paired-diff + DM-testEvery notebook in all three repos re-implements this by hand. The single
biggest win is lifting this chain into a xrtoolz.geo.metrics.ssh_mapping
mini-pipeline + a Sequential recipe.
Top integration candidates (value × ease)¶
| Rank | Item | Value | Ease | Maps to |
|---|---|---|---|---|
| 1 | AlongTrackColocate / DrifterColocate operator built on xarray.Dataset.interp (no new deps) | HIGH | MEDIUM | geo/inference |
| 2 | SegmentedPSDScore + effective_resolution(k, psd_diff, psd_ref, t=0.5) | HIGH | MEDIUM | geo/metrics |
| 3 | 2D (kx, kt) PSD-score with (λx, λt) double-contour + PSDScore2DPanel | HIGH | EASY | geo/metrics + viz/validation |
| 4 | Spectral KE flux spectra_flux(u, v, lon, lat) | HIGH | MEDIUM | ocn |
| 5 | Lagrangian drifter advection + deviation skill (RK4 + binned-RMSE) | HIGH | HIGH (~600 LOC) | new xrtoolz.ocn.lagrangian |
| 6 | Lanczos / bandpass filter primitives for 1D along-track | MEDIUM | EASY | geo |
| 7 | Diebold–Mariano paired-forecast test | MEDIUM | EASY | geo/metrics |
| 8 | error_stability = std(rmse_t) | MEDIUM | TRIVIAL | geo/metrics |
| 9 | Regime-stratified scoring (coastal/equatorial/eddy) + bar plot | MEDIUM | MEDIUM | geo/metrics + viz |
| 10 | Laplacian (Gauss–Seidel) NaN-fill primitive — see ODC-2.2 — Laplacian (Gauss–Seidel) gap-fill + verify 3D regrid path | MEDIUM | EASY | geo/regrid |
| 11 | sla_to_ssh(ds, mdt) MDT-addition op + ssh→PV | MEDIUM | TRIVIAL | ocn |
| 12 | Seasonal PSD-score mosaic viz | LOW-MEDIUM | EASY | viz/validation |
| 13 | Movie / animation comparison panel | LOW | MEDIUM | viz/validation |
Skip list¶
mod_xscale.py— duplicatesxrft(already a dependency).mod_utils.py— generic helpers redundant with xarray.regional_zoom/convert_longitude— already ingeo/subset.ssh_to_currents/currents_to_relative_vorticity— already inocn.mod_read.pydata-fetch — belongs outside the library.Bulk of
mod_plot.py— already covered by_ValidationPanel/SpatialMapPanel/PSDIsotropicScorePanel.median_filter—scipy.signal.medfiltis preferable.
Decision log¶
Use this section as we walk through items 1.1 → 3.6 to record decisions (port / adapt / skip), proposed APIs, and follow-up issue links.
| Item | Decision | Notes / Issue |
|---|---|---|
| e.g. 1.2 | Adapt as geo.inference.AlongTrackColocate | TBD |