From 47261ebdad7d2f23e2b2d9fa94d4109bc9e45a8d Mon Sep 17 00:00:00 2001 From: Zachary Atkins Date: Sun, 20 Oct 2024 22:55:07 -0400 Subject: [PATCH] off_diag plots --- .../montecarlo/get_mc_corrected_xarrays_covmat_gp.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/project/data_analysis/python/montecarlo/get_mc_corrected_xarrays_covmat_gp.py b/project/data_analysis/python/montecarlo/get_mc_corrected_xarrays_covmat_gp.py index 999bbbd1..eb094f29 100644 --- a/project/data_analysis/python/montecarlo/get_mc_corrected_xarrays_covmat_gp.py +++ b/project/data_analysis/python/montecarlo/get_mc_corrected_xarrays_covmat_gp.py @@ -34,6 +34,7 @@ plot_dir = "plots/x_ar_cov" pspy_utils.create_directory(plot_dir) +pspy_utils.create_directory(plot_dir + '/off_diags') binning_file = d["binning_file"] lmax = d["lmax"] @@ -167,7 +168,13 @@ plt.legend() plt.title(f"Cov({name_i}_{spec_i}, {name_j}_{spec_j})\n{kern}") if args.iStart is not None: - plt.savefig(os.path.join(plot_dir, f"GP_MC_covmat_smooth_{name_i}_{spec_i}_{name_j}_{spec_j}_{iStart}_{iStop}.png")) + if i == j: + plt.savefig(os.path.join(plot_dir, f"GP_MC_covmat_smooth_{name_i}_{spec_i}_{name_j}_{spec_j}_{iStart}_{iStop}.png")) + else: + plt.savefig(os.path.join(plot_dir, 'off_diags', f"GP_MC_covmat_smooth_{name_i}_{spec_i}_{name_j}_{spec_j}_{iStart}_{iStop}.png")) else: - plt.savefig(os.path.join(plot_dir, f"GP_MC_covmat_smooth_{name_i}_{spec_i}_{name_j}_{spec_j}.png")) + if i == j: + plt.savefig(os.path.join(plot_dir, f"GP_MC_covmat_smooth_{name_i}_{spec_i}_{name_j}_{spec_j}.png")) + else: + plt.savefig(os.path.join(plot_dir, 'off_diags', f"GP_MC_covmat_smooth_{name_i}_{spec_i}_{name_j}_{spec_j}.png")) plt.close()