Loading...
Loading...
Contributors:
Dataset URI:
10.5281/zenodo.22869841ROMS 4D-Var Operational Observation Impact Analysis A modular, production-ready system for calculating, aggregating, and visualizing observation impacts from ROMS 4D-Var data assimilation cycles, tailored for the NorKystDA ocean application at MET Norway. 1. Overview & Theoretical Background Observation impact analysis quantifies how individual assimilated observations (or groups of observations) contribute to changes in an analysis circulation metric $J$ (Moore et al., 2011). In the ROMS 4D-Var framework (such as RBL4D-Var or Split RBL4D-Var), this formulation is directly aligned with the official ROMS 4D-Var benchmark tutorials (e.g., WC13 California Current System, Exercise 5). Mathematical Formulation The sensitivity of a chosen scalar metric functional $J$ with respect to the ocean state $\mathbf{x}$ is defined as an adjoint forcing functional $\partial J / \partial \mathbf{x}$ and written to an adjoint sensitivity NetCDF file (ocean_ads.nc or wc13_ads.nc). The adjoint model is integrated backward in time across the assimilation window, forced by $\partial J / \partial \mathbf{x}$. Using the Lanczos vectors from the primary 4D-Var minimization, ROMS projects this sensitivity into observation space: $$\mathbf{q} = \mathbf{K}^T \frac{\partial J}{\partial \mathbf{x}}$$ where $\mathbf{K}$ is the 4D-Var Kalman gain operator. ROMS stores the components of $\mathbf{q}$ in the observation processing file (ocean_mod.nc / norshelf_mod_*.nc) as the array ObsImpact_total. The first-order tangent linear impact $\Delta J_i$ of each individual assimilated datum $i$ on the metric $J$ is evaluated as:$$\Delta J_i = \text{ObsImpact_total}_i \times (y_i - \mathcal{H}_i(\mathbf{x}_b)) \times s_i$$where: $\text{ObsImpact_total}_i$: Adjoint sensitivity of metric $J$ with respect to observation $i$ ($q_i$). $(y_i - \mathcal{H}_i(\mathbf{x}_b))$: Innovation vector $\mathbf{d}_i$ (difference between observation value $y_i$ and the prior nonlinear background trajectory $\mathcal{H}_i(\mathbf{x}_b)$). $s_i \in [0, 1]$: Quality control and assimilation scale factor (obs_scale), filtering out rejected or unassimilated data ($s_i = 0$ or fill values). Summed over all observations, the total tangent linear impact is:$$\Delta J_{\text{TL}} = \sum_i \Delta J_i \approx \Delta J_{\text{NL}} = J(\mathbf{x}_a) - J(\mathbf{x}_b)$$ nterpretation of Analysis Impact Analysis Observation Impact evaluates the impact on a circulation metric evaluated during the analysis cycle (e.g., Norwegian Coastal Current SST sst_ncc in NorKystDA). When $J$ is sea surface temperature in the region of the NCC, $\Delta J_i$ has units of $^{\circ}\text{C}$ (positive = warming contribution, negative = cooling contribution). 2. Repository Structure sst-impact/├── config/│ └── analysis_config.yaml # YAML configuration for data paths, categories, and plot settings├── src/│ ├── analysis/ # Core modular analysis engine│ │ ├── __init__.py│ │ ├── reader.py # NetCDF modfile ingestion and provenance classification│ │ ├── impact_calculator.py # Observation impact math, aggregations, and statistics│ ├── plotting/ # Publication-grade plotting routines│ │ ├── __init__.py│ │ ├── bar_plots.py # Total impact and cycle time-series bar plots│ │ ├── butterfly.py # Innovation vs. impact 2D density butterfly plots│ │ ├── maps.py # Spatial impact maps (single-cycle and multi-cycle aggregated)├── operational_code/ # Production scripts executed by ecFlow│ ├── README.md # Detailed documentation of operational routines│ ├── adsen.cdl # CDL schema for ocean_ads adjoint forcing file│ ├── create_adsenfile.py # Adjoint forcing file creator from CDL and forward file│ ├── sst_ncc.py # Adjoint sensitivity functional for Norwegian Coastal Current SST│ ├── impact_calculations.py # Metric generator dispatcher│ ├── prep_norshelf_adsenfrc.ecf # ecFlow task script├── scripts/│ └── run_analysis.py # CLI entry point to run full analysis pipeline from config├── notebooks/│ └── impact_analysis.ipynb # Interactive step-by-step tutorial notebook├── tests/│ └── test_analysis.py # Unit and integration test suite├── output/ # Default directory for generated plots, JSON, and CSV summaries└── README.md # Project documentation (this file) 3. Observation Provenance & Classification The system decodes 7-digit integer observation provenances ($O \cdot 10^6 + P \cdot 10^4 + S \cdot 10^2 + \text{station}$) into physical observation groups: Category Key Category Label ROMS obs_type Provenance $O$ Typical Data Sources sst_inf SST Infrared 6 3 Sentinel-3 SLSTR, MetOp AVHRR, VIIRS sst_pmw SST Microwave (PMW) 21 3 AMSR2 passive microwave SST ins_T In-situ Temperature 6 6 CTD profiles, gliders, Argo, moorings ins_S In-situ Salinity 7 7 CTD profiles, gliders, Argo, moorings zeta SSH Altimetry 1 1 Along-track satellite altimetry (Sentinel, CryoSat) hf_radar Coastal HF Radar 20 2 Coastal radar surface radial currents 4. Quickstart & Installation Requirements Python 3.10+ numpy, pandas, xarray, netCDF4, pyyaml, matplotlib, cmocean, datashader Installation Activate your environment and install dependencies: pip install numpy pandas xarray netCDF4 pyyaml matplotlib cmocean datashader Running the Analysis CLI Run the full analysis suite using the default configuration: ./scripts/run_analysis.py --config config/analysis_config.yaml To run a specific subset of plots or specify custom paths: ./scripts/run_analysis.py --config config/analysis_config.yaml --output-dir my_results --plots total_bar,per_datum_bar,timeseries_bar,timeseries_per_datum_bar Or override the modfile search pattern directly from the command line: ./scripts/run_analysis.py --modfile-pattern "path/to/modfiles/norshelf_mod_*.nc" Running Unit Tests Execute the automated test suite: python3 -m unittest discover -s tests -v 5. Visualizations & Outputs The analysis suite produces publication-grade diagnostic figure types: 1. Total Impact Bar Plot (total_impact_bar.png) Shows cumulative impact on the target metric for each observation category across all analyzed assimilation cycles. Each bar is annotated with total observation count ($N$) and numerical impact. 2. Observation Impact per Datum Bar Plot (impact_per_datum_bar.png) Quantifies observation efficiency and information density per datum across categories: Mode both (Default): Side-by-side comparison featuring: * Net Impact per Datum ($\sum \Delta J_i / N$): Mean cooling or warming contribution per observation datum. * Mean Absolute Impact per Datum ($\sum |\Delta J_i| / N$): Mean information leverage / sensitivity per datum regardless of sign. Modes net & abs: Single-panel standalone bar plots. 3. Assimilation Cycle Time Series (cycle_impact_timeseries.png) Displays a grouped bar plot showing impact per cycle broken down by observation type, overlaid with the net total impact trajectory across assimilation cycles. 4. Mean Impact per Datum Cycle Time Series (cycle_impact_per_datum_timeseries.png) Grouped bar plot showing the mean impact per observation datum for each category across assimilation cycles, with an overlaid trajectory of overall mean impact per datum. 5. Butterfly Density Plots (butterfly_<category>.png) Plots innovation ($x$-axis) versus impact ($y$-axis) for a given observation category. Density shading: Uses Datashader rasterization (with Matplotlib fallback) for datasets with millions of observations. 4-Quadrant Statistics: Annotates percentages and counts in each quadrant: * $Q_1$ ($d < 0, I > 0$): Negative innovation, positive impact * $Q_2$ ($d > 0, I > 0$): Positive innovation, positive impact * $Q_3$ ($d > 0, I < 0$): Positive innovation, negative impact * $Q_4$ ($d < 0, I < 0$): Negative innovation, negative impact Summary Metrics: Correlation coefficient ($r$), mean impact, and observation count. 6. Spatial Impact Maps Single-Cycle Maps (map_<category>_<cycle>.png): Spatial scatter map showing observation locations colored by impact using a diverging colormap (cmocean.cm.balance). Aggregated Maps (map_<category>_aggregated.png): 2D spatial binning across multiple cycles showing: * Panel 1: Net impact sum per bin * Panel 2: Absolute impact sum per bin Data Summaries (Human & AI Readable) In addition to figures, the runner outputs: summary_categories.csv & summary_categories.json: Complete numerical metrics per category (including mean_impact and mean_abs_impact). summary_cycles.csv: Per-cycle observation counts, impacts, and mean impacts per datum. Formatted console tables printed during execution. 6. Configuration Guide (config/analysis_config.yaml) The analysis pipeline is driven entirely by YAML configuration: data: modfile_pattern: "/path/to/modfiles/norshelf_mod_*.nc" output_dir: "output" metric_name: "NCC SST" metric_unit: "°C" categories: sst_inf: label: "SST Infrared" color: "#118ab2" obstypes: [3, 6] provenance_types: [3] exclude_provenances: [3010103] ... plots: total_bar: filename: "total_impact_bar.png" figsize: [10, 6] dpi: 300 butterfly: use_datashader: true cmap: "viridis" maps: single_cycle_categories: ["sst_inf", "sst_pmw", "hf_radar"] aggregated_categories: ["sst_inf", "sst_pmw", "hf_radar", "ins_T", "total"] cmap: "balance" grid_bins: [150, 150] lon_bounds: [-5.0, 36.0] lat_bounds: [55.0, 75.0] single_cycle_categories controls which categories are mapped for the firstloaded assimilation cycle. aggregated_categories controls which categories aremapped across all loaded cycles. Entries must be category keys from categoriesor the synthetic total category. 7. Interactive Exploration An interactive Jupyter Notebook is provided in notebooks/impact_analysis.ipynb, allowing users to inspect datasets, customize plot appearances, and filter specific assimilation cycles or observation subsets interactively.
Keyword(s):
MeSH Term(s):
Grants and Funding:
Associated Publication(s):
No Associated Publication Data Available
Supplementary Data:
No Supplementary Data Available
Related Dataset(s):
No Related Dataset Data Available
The National Library of Medicine (NLM) provides information about biomedical datasets. Inclusion on an NLM Web page does not imply endorsement of, or agreement with, the contents by NLM or the National Institutes of Health. Learn more: NLM Web Policies (nih.gov)