Saved in:
Bibliographic Details
Main Authors: Verma, Kaushledra, Munier, Simon
Format: Recurso digital
Language:
Published: Zenodo 2026
Online Access:https://doi.org/10.5281/zenodo.18402332
Tags: Add Tag
No Tags, Be the first to tag this record!
Table of Contents:
  • <div dir="auto"> <h2>Overview</h2> This repository implements a confidence-aware global mapping pipeline that assigns river reaches from SWORD v17b to CTRIP 1/12° routing pixels. Assignments combine geometric and hydrological criteria:</div> <ul> <li>reach–pixel intersection</li> <li>distance to pixel centroid</li> <li>upstream area consistency (MERIT vs CTRIP)</li> <li>reach length</li> <li>flow-direction alignment (D8)</li> </ul> <p dir="auto">Each pixel assignment receives a confidence tier:</p> <ul> <li>Tier 1 — Single: exactly one intersecting reach (very high confidence)</li> <li>Tier 2 — Scored: multiple candidates, best score passes thresholds (High / Medium / Low)</li> <li>Tier 3 — Fallback: curated/relaxed rules (optional)</li> <li>Tier 4 — Unassigned: no assignment</li> </ul> <p dir="auto">Outputs include per-zone CSV/NetCDF and global aggregates suitable for data assimilation (e.g., CTRIP-HyDAS) and analysis.</p> <div dir="auto"> <h2> </h2> <h2>Pipeline (A → B → C/H → Z → V)</h2> </div> <div dir="auto"> <h3>Phase A — SWORD–MERIT filtering & zone setup</h3> </div> <ul> <li>A_01 PHASE_A_01__assign_merit_basins.py</li> </ul> <p dir="auto">Inputs: SWORD shapefile + NetCDF, MERIT Basin cat/riv, zone table</p> <p dir="auto">Outputs: SWORD-MERIT_pfaf{pfaf}.nc, removed_unmapped_reaches_pfaf{pfaf}.csv, centerlines_collection_pfaf{pfaf}.npy, plots</p> <p dir="auto">Purpose: Assign MERIT basin/river IDs; remove ghost/unmapped reaches.</p> <ul> <li>A_02a PHASE_A_02a__analyze_removed_reaches.py</li> </ul> <p dir="auto">Inputs: removed/unmapped CSV</p> <p dir="auto">Outputs: analytics CSVs + histogram plot</p> <p dir="auto">Purpose: Summarize and visualize unmapped/removed characteristics.</p> <ul> <li>(Optional A_02b/A_02c/A_03/A_04 visualization & reassignment helpers are included in the repo; see docs/README_SCRIPTS.md for the full A-phase map.)</li> </ul> <div dir="auto"> <h3>Phase B — CTRIP assignment, scoring, selection, finalization</h3> </div> <p dir="auto">End-to-end assignment and QA:</p> <ul> <li>single-pixel matches (Tier 1), multi-reach scoring (Tier 2), selection and merge,</li> <li>NetCDF write & diagnostics, consistency checks (B_02 … B_05e). Outputs: per-zone final CSV & NetCDF + logs/plots.</li> </ul> <div dir="auto"> <h3>Phase C — Fallback (optional)</h3> </div> <p dir="auto">For any remaining unassigned pixels:</p> <ul> <li>generate candidates (C_01), navigate/inspect (C_02), apply curated reassignments (C_03), verify (C_04), summarize (C_05). Auto-skips if Phase B achieved full coverage.</li> </ul> <div dir="auto"> <h3>Phase H — Under-utilized observable pixels (optional)</h3> </div> <ul> <li>analyze filtered-out single/multi pixels with SWOT observability,</li> <li>assign best observable candidate to increase usage (H_01–H_02).</li> </ul> <div dir="auto"> <h3>Phase Z — Global aggregation</h3> </div> <ul> <li>Z_01 merge per-zone final CSVs → global CSV</li> <li>Z_02 write global assignment grid (NetCDF)</li> </ul> <div dir="auto"> <h3>Phase V — Visualization (manuscript figures)</h3> </div> <ul> <li>V_01 global confidence map + score histogram + tier counts</li> <li>V_02 global pixel map colored by final basin hash, with Pfaf L2 overlay</li> </ul> <p dir="auto">See docs/README_SCRIPTS.md and docs/pipeline_overview.md for a complete step-by-step map and manuscript cross-walk.</p> <div dir="auto"> <h2>Data & Configuration</h2> </div> <ul> <li>Zone mapping – pfaf_lvl_2_mapping.csv</li> </ul> <p dir="auto">Contains Pfaf L2 zone extents & metadata (min/max lon/lat, continent, etc.). A ready-to-edit sample is provided:</p> <p dir="auto">pfaf_lvl_2_mapping.sample.csv → copy to pfaf_lvl_2_mapping.csv and edit.</p> <ul> <li>Central config – config/default_config.yaml</li> </ul> <p dir="auto">Controls output_dir, logging level, and optional scoring/fallback thresholds.</p> <ul> <li>Core inputs</li> </ul> <p dir="auto">SWORD v17b: zone subset shapefile (attributes: reach_id, type, lakeflag, strm_order/stream_order) and SWORD NetCDF (reaches + centerlines)</p> <p dir="auto">MERIT Basin cat/riv: polygon & river line shapefiles per Pfaf L2</p> <p dir="auto">CTRIP grid: lon/lat and routing fields (via myPyFunc or aligned NetCDFs you provide)</p> <blockquote> <p dir="auto">myPyFunc (optional): If present, scripts will use helpers like res2lonlat, trip_param, merit_param. Built-in fallbacks are used where feasible; otherwise provide aligned NetCDFs via CLI flags.</p> </blockquote> <div dir="auto"> <h2>Key Outputs</h2> </div> <p dir="auto">Per-zone</p> <ul> <li>final_sword_ctrip_assignment_pfaf{pfaf}.csv (and <em>full</em> variants)</li> <li>SWORD-CTRIP_pfaf{pfaf}_clean.nc (and _final.nc after fallback)</li> <li>reassignment_log_pfaf{pfaf}.csv, diagnostics CSVs, plots</li> </ul> <p dir="auto">Global</p> <ul> <li>final_sword_ctrip_assignment_global_full.csv (or .csv.gz)</li> <li>SWORD-CTRIP_assignment_global.nc</li> <li>Manuscript figures from Phase V (PNG)</li> </ul> <div dir="auto"> <h2>Reproducibility</h2> </div> <ul> <li>Zone-wise: independent inputs/outputs per zone; trivially parallelizable.</li> <li>Config-driven: no hard-coded directories; all paths via CLI or YAML.</li> <li>Environment: pinned requirements.txt / environment.yml.</li> <li>Determinism: scoring and thresholds are explicit; re-runs reproduce identical outputs given identical inputs.</li> </ul> <div dir="auto"> </div> <p> </p>