Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Ocean Data Challenges → xrtoolz Integration Survey

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.

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

#FileWhat it providesStatus
1.1mod_filter.pylanczos_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.2mod_interp.pyrun_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.3mod_spectral.pySegment-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.4mod_stat.pybin_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.5mod_plot.pyMostly 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-

#FileWhat it providesStatus
2.1src/mod_eval.pyrmse_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.2src/mod_regrid.pypyinterp 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.3src/mod_plot.pySeasonal 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.)

#FileWhat it providesStatus
3.1src/mod_powerspec.pywavenumber_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.2src/mod_switchvar.pysla_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.3src/mod_traj.pyLagrangian 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.4src/mod_compare.pyPaired-diff stat/PSD plots (the wrappers, not the zoom/longitude utils).Proposal: ODC-3.4 — Generic PairwiseComparePanel (study-vs-ref with diff)
3.5src/mod_xscale.py / mod_utils.py / mod_read.pyDuplicate xrft, generic helpers, data-fetch.Skip
3.6mod_plot.py:moviematplotlib.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-test

Every 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)

RankItemValueEaseMaps to
1AlongTrackColocate / DrifterColocate operator built on xarray.Dataset.interp (no new deps)HIGHMEDIUMgeo/inference
2SegmentedPSDScore + effective_resolution(k, psd_diff, psd_ref, t=0.5)HIGHMEDIUMgeo/metrics
32D (kx, kt) PSD-score with (λx, λt) double-contour + PSDScore2DPanelHIGHEASYgeo/metrics + viz/validation
4Spectral KE flux spectra_flux(u, v, lon, lat)HIGHMEDIUMocn
5Lagrangian drifter advection + deviation skill (RK4 + binned-RMSE)HIGHHIGH (~600 LOC)new xrtoolz.ocn.lagrangian
6Lanczos / bandpass filter primitives for 1D along-trackMEDIUMEASYgeo
7Diebold–Mariano paired-forecast testMEDIUMEASYgeo/metrics
8error_stability = std(rmse_t)MEDIUMTRIVIALgeo/metrics
9Regime-stratified scoring (coastal/equatorial/eddy) + bar plotMEDIUMMEDIUMgeo/metrics + viz
10Laplacian (Gauss–Seidel) NaN-fill primitive — see ODC-2.2 — Laplacian (Gauss–Seidel) gap-fill + verify 3D regrid pathMEDIUMEASYgeo/regrid
11sla_to_ssh(ds, mdt) MDT-addition op + ssh→PVMEDIUMTRIVIALocn
12Seasonal PSD-score mosaic vizLOW-MEDIUMEASYviz/validation
13Movie / animation comparison panelLOWMEDIUMviz/validation

Skip list


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.

ItemDecisionNotes / Issue
e.g. 1.2Adapt as geo.inference.AlongTrackColocateTBD