From 0e03f8d6d42751ceac9aa9a8154ee3e1d986ff2d Mon Sep 17 00:00:00 2001 From: andreab1997 Date: Mon, 13 Nov 2023 12:46:09 +0100 Subject: [PATCH] Add covariance matrix sum plot --- .../validphys/theorycovariance/construction.py | 7 +++++++ .../src/validphys/theorycovariance/output.py | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/validphys2/src/validphys/theorycovariance/construction.py b/validphys2/src/validphys/theorycovariance/construction.py index 5feb6835df..4c1eb9d8cb 100644 --- a/validphys2/src/validphys/theorycovariance/construction.py +++ b/validphys2/src/validphys/theorycovariance/construction.py @@ -697,6 +697,13 @@ def experimentplustheory_normcovmat_custom( return mat +@table +def experimentplustheory_covmat_singleprocess(procs_covmat, theory_covmat_singleprocess): + """Calculates the covariance matrix for the experimental + plus theory covariance matrices.""" + total_df = procs_covmat + theory_covmat_singleprocess + total_cov = (procs_covmat + theory_covmat_singleprocess).values + return total_cov @table def experimentplustheory_corrmat_singleprocess(procs_covmat, theory_covmat_singleprocess): diff --git a/validphys2/src/validphys/theorycovariance/output.py b/validphys2/src/validphys/theorycovariance/output.py index 7299579863..e98ad65369 100644 --- a/validphys2/src/validphys/theorycovariance/output.py +++ b/validphys2/src/validphys/theorycovariance/output.py @@ -323,6 +323,22 @@ def plot_expplusblockthcorrmat_heatmap(experimentplusblocktheory_corrmat): ) return fig +@figure +def plot_expplusthcovmat_heatmap_custom( + experimentplustheory_covmat_custom, + theoryids, + fivetheories, +): + """Matrix plot of the exp + theory covariance matrix""" + l = len(theoryids) + if l == 5: + if fivetheories == "bar": + l = r"$\bar{5}$" + fig = plot_covmat_heatmap( + experimentplustheory_covmat_custom, + f"Experimental + Theory Covariance Matrix ({l} pt)", + ) + return fig @figure def plot_expplusthcorrmat_heatmap_custom(