Skip to content

Exploritory work with grace and knockout tests - moving to main - #23

Merged
0thomasholland merged 18 commits into
mainfrom
exploritory_work
Mar 18, 2026
Merged

0thomasholland merged 18 commits into
mainfrom
exploritory_work

Conversation

@0thomasholland

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 18, 2026 10:49
@0thomasholland
0thomasholland merged commit cf32e2a into main Mar 18, 2026
2 of 4 checks passed
@0thomasholland
0thomasholland deleted the exploritory_work branch March 18, 2026 10:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds exploratory GRACE joint-inversion work and knockout-style experiments, along with new plotting utilities to visualize posterior covariance structure (notably ice vs firn GMSL) and CG convergence.

Changes:

  • Introduces a GRACE-augmented factored forward operator + preconditioned inversion workflow (new work script + figures).
  • Adds a knockout test script that runs multiple inversion variants and produces comparative diagnostic plots.
  • Extends plotting utilities in pygeoinf_extras with corner/bivariate-corner plotting helpers.

Reviewed changes

Copilot reviewed 8 out of 46 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
work/14_grace_joint_inversion/joint_precon_grace.py New exploratory script adding GRACE as an additional observation row in a factored forward operator + preconditioned inversion.
work/14_grace_joint_inversion/figs1/joint_precon_grace_cg_convergence.pdf Generated convergence plot output from the GRACE joint-preconditioned solve.
work/14_grace_joint_inversion/figs/knockout_grace_gmsl.pdf Generated figure for GRACE-related knockout/GMSL visualization.
work/13_knockout_test/knockout_test.py New knockout experiment script running multiple inversions and producing GMSL/component comparison plots.
work/13_knockout_test/figs/knockout_gmsl.pdf Generated GMSL posterior comparison plot output.
work/08_joint_inversion/joint_precon_factored.py Adds ice-vs-firn GMSL covariance corner plot and increases CG max iterations.
work/08_joint_inversion/joint_inversion.py Removes interactive plt.show() calls (non-interactive/script-friendly).
work/08_joint_inversion/figs1/joint_precon_cg_convergence.pdf Generated convergence plot output (updated).
test_var.py Adds an ad-hoc debug script for computing GMSL posterior stats.
src/pygeoinf_extras/plots.py Adds general corner plot + bivariate-corner plotting helpers for Gaussian posteriors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +639 to +642
sigma = abs(exp_mm - total_gmsl_true_mm) / std_mm
print(
f" {label:<25}: mean={exp_mm:.4f} mm, std={std_mm:.2e} mm, "
f"{sigma:.2f} sigma from truth"
Comment on lines +20 to +24
read_gloss_tide_gauge_data,
sea_level_change_to_load_operator,
sea_surface_height_operator,
tide_gauge_operator,
)
Comment on lines +28 to +31
from project import colors
from project.operators import (
ice_thickness_to_estimated_gmsl_operator,
)
Comment thread test_var.py
Comment on lines +6 to +8
print("Computing GMSL posterior full:")
exp_mm, std_mm = compute_gmsl_posterior(posterior_full)
print(f"Exp: {exp_mm}, Std: {std_mm}")
Comment on lines +35 to +45
Args:
posterior_measure: Multi-dimensional posterior measure (pygeoinf object)
true_values: True values for each dimension (optional)
labels: Labels for each dimension (optional)
title: Title for the plot
figsize: Figure size tuple (if None, calculated based on dimensions)
show_plot: Whether to display the plot
include_sigma_contours: Whether to include 1-sigma contour lines
colormap: Colormap for 2D plots
parallel: Compute dense covariance matrix in parallel, default False.
n_jobs: Number of cores to use in parallel calculations, default -1.
Comment on lines +279 to +294
def plot_bivariate_corner(
posterior_measure: object,
/,
*,
true_values: Optional[
Union[List[float], np.ndarray]
] = None,
labels: Optional[List[str]] = None,
title: str = "Joint Posterior Distribution",
figsize: Optional[tuple] = (8, 8),
include_sigma_contours: bool = True,
colormap: str = "Blues",
parallel: bool = False,
n_jobs: int = -1,
pdf_colors: Optional[List[str]] = None,
):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants