mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 17:48:01 +00:00
84a1609d77
* Add Lilow data * Fix Lilow NaNs * Update nb * Update nb
6.1 MiB
6.1 MiB
Calibrating the velocity field against observations¶
In [1]:
# Copyright (C) 2024 Richard Stiskalek
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import numpy as np
import matplotlib.pyplot as plt
import jax
from jax import numpy as jnp
from numpyro.infer import MCMC, NUTS, init_to_median
import corner
from getdist import plots
from scipy.stats import multivariate_normal
import csiborgtools
from flow_calibration import *
%load_ext autoreload
%autoreload 2
%matplotlib inline
paths = csiborgtools.read.Paths(**csiborgtools.paths_glamdring)
LOS density & radial velocity plots¶
In [2]:
fpath = "/mnt/extraspace/rstiskalek/catalogs/PV_compilation.hdf5"
loader_carrick = csiborgtools.flow.DataLoader("Carrick2015", [0], "LOSS", fpath, paths, ksmooth=0, )
# loaders_csiborg2X = [csiborgtools.flow.DataLoader("csiborg2X", i, "LOSS", fpath, paths, ksmooth=1, verbose=False) for i in range(20)]
# loaders_csiborg2 = [csiborgtools.flow.DataLoader("csiborg2_main", i, "LOSS", fpath, paths, ksmooth=1, verbose=False) for i in range(20)]
loader_CF4 = csiborgtools.flow.DataLoader("CF4gp", [0], "LOSS", fpath, paths, ksmooth=0, )
loader_lilow = csiborgtools.flow.DataLoader("Lilow2024", [0], "LOSS", fpath, paths, ksmooth=0, )
In [16]:
loader_lilow.los_density[0, 0]
Out[16]:
In [11]:
loader_lilow.rdist
Out[11]:
In [10]:
loader_lilow.los_radial_velocity
Out[10]:
In [7]:
ks = [i for i in range(50)]
# ks = [0, 1, 2, 3, 4, 5, 6, ]
for k in ks:
fig, axs = plt.subplots(2, 1, figsize=(7, 7), sharex=True)
fig.subplots_adjust(wspace=0)
cols = plt.rcParams['axes.prop_cycle'].by_key()['color']
# # CSiBORG2
# x = loaders_csiborg2X[0].rdist
# y = np.asarray([loaders_csiborg2[i].los_density[k, :] for i in range(len(loaders_csiborg2X))])
# ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)
# axs[0].fill_between(x, ylow, yhigh, color=cols[0], alpha=0.25)
# axs[0].plot(x, ymed, color=cols[0], label="CSiBORG2")
# y = np.asarray([loaders_csiborg2[i].los_radial_velocity[k, :] for i in range(len(loaders_csiborg2X))])
# ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)
# axs[1].fill_between(x, ylow, yhigh, color=cols[0], alpha=0.25)
# axs[1].plot(x, ymed, color=cols[0], label="CSiBORG2")
# # CSiBORG2X
# x = loaders_csiborg2X[0].rdist
# y = np.asarray([loaders_csiborg2X[i].los_density[k, :] for i in range(len(loaders_csiborg2X))])
# ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)
# axs[0].fill_between(x, ylow, yhigh, color=cols[1], alpha=0.25)
# axs[0].plot(x, ymed, color=cols[1], label="CSiBORG2X")
# y = np.asarray([loaders_csiborg2X[i].los_radial_velocity[k, :] for i in range(len(loaders_csiborg2X))])
# ylow, ymed, yhigh = np.percentile(y, [16, 50, 84], axis=0)
# axs[1].fill_between(x, ylow, yhigh, color=cols[1], alpha=0.25)
# axs[1].plot(x, ymed, color=cols[1], label="CSiBORG2X")
# Plot Carrick+2015
axs[0].plot(loader_carrick.rdist, loader_carrick.los_density[0, k, :], color="red", label="Carrick+2015")
axs[1].plot(loader_carrick.rdist, loader_carrick.los_radial_velocity[0, k, :] * 0.43, color="red")
# Plot CF4
c = cols[4]
axs[0].plot(loader_CF4.rdist, loader_CF4.los_density[0, k, :], color=c, label="CF4")
axs[1].plot(loader_CF4.rdist, loader_CF4.los_radial_velocity[0, k, :], color=c)
# Plot Lilow2024
c = cols[5]
axs[0].plot(loader_lilow.rdist, loader_lilow.los_density[0, k, :], color=c, label="Lilow+2024")
axs[1].plot(loader_lilow.rdist, loader_lilow.los_radial_velocity[0, k, :], color=c)
axs[1].set_xlabel(r"$r ~ [\mathrm{Mpc} / h]$")
axs[0].set_ylabel(r"$\rho_{\rm LOS} / \langle \rho_{\rm matter} \rangle$")
axs[1].set_ylabel(r"$v_{\rm LOS} ~ [\mathrm{km/s}]$")
axs[0].set_yscale("log")
axs[0].legend(loc="upper right")
axs[0].set_xlim(0, 200)
fig.tight_layout(w_pad=0, h_pad=0)
fig.savefig(f"../../plots/LOSS_los_{k}.png", dpi=500, bbox_inches="tight")
fig.show()
Test running a model¶
In [19]:
fpath_data = "/mnt/extraspace/rstiskalek/catalogs/PV_compilation.hdf5"
# fpath_data = "/mnt/extraspace/rstiskalek/catalogs/A2.h5"
# fpath_data = "/mnt/extraspace/rstiskalek/catalogs/PV_mock_CB2_17417_large.hdf5"
simname = "CF4"
catalogue = "LOSS"
loader = csiborgtools.flow.DataLoader(simname, [0], catalogue, fpath_data, paths, ksmooth=0, )
SN_hyperparams = {"e_mu_mean": 0.1, "e_mu_std": 0.05,
"mag_cal_mean": -18.25, "mag_cal_std": 0.5,
"alpha_cal_mean": 0.148, "alpha_cal_std": 0.05,
"beta_cal_mean": 3.112, "beta_cal_std": 1.0,
}
calibration_hyperparams = {"Vext_std": 250,
"alpha_mean": 1.0, "alpha_std": 0.5,
"beta_mean": 1.0, "beta_std": 0.5,
"sigma_v_mean": 150., "sigma_v_std": 100.,
"sample_alpha": True, "sample_beta": True,
}
get_model_kwargs = {"zcmb_max": 0.05}
Running HMC¶
In [20]:
model = csiborgtools.flow.get_model(loader, **get_model_kwargs)
model_kwargs = {"distmod_hyperparams": SN_hyperparams, "calibration_hyperparams": calibration_hyperparams,}
In [21]:
kernel = NUTS(model, init_strategy=init_to_median(num_samples=100))
mcmc = MCMC(kernel, num_warmup=500, num_samples=500)
rng_key = jax.random.PRNGKey(5)
mcmc.run(rng_key, extra_fields=("potential_energy",), **model_kwargs)
mcmc.print_summary()
samples = mcmc.get_samples()
In [25]:
from numpyro.infer import log_likelihood
In [26]:
ll_single = log_likelihood(model, samples, **model_kwargs)["ll"]
ll_mult = log_likelihood(model_mult, samples, **model_kwargs, )["ll"]
In [27]:
ll_single - ll_mult
Out[27]:
In [20]:
Out[20]:
In [ ]:
In [ ]:
In [10]:
mcmc.get_extra_fields()["potential_energy"]
Out[10]:
In [ ]:
In [11]:
samples = mcmc.get_samples()
csiborgtools.numpyro_gof(model, mcmc)
Out[11]:
In [117]:
data, names, __ = read_samples("LOSS", "Carrick2015", 0, return_MCsamples=False)
In [118]:
key = "beta"
plt.figure()
plt.hist(data[:, names.index(key)], bins="auto", density=1, histtype="step")
plt.hist(samples[key], bins="auto", density=1, histtype="step")
plt.show()
In [ ]:
In [119]:
samples = mcmc.get_samples()
In [120]:
samples["ll_values"]
Out[120]:
In [ ]:
In [121]:
nparam = 0
for val in samples.values():
if val.ndim == 1:
nparam += 1
elif val.ndim == 2:
nparam += val.shape[-1]
else:
raise ValueError("Invalid dimensionality of samples to count the number of parameters.")
nparam
Out[121]:
In [ ]:
In [122]:
Vmag = np.sqrt(samples["Vext"][:, 0]**2 + samples["Vext"][:, 1]**2 + samples["Vext"][:, 2]**2)
V = np.vstack([samples["Vext"][:, 0], samples["Vext"][:, 1], samples["Vext"][:, 2]]).T
V = csiborgtools.cartesian_to_radec(V)
l, b = csiborgtools.radec_to_galactic(V[:, 1], V[:, 2])
print(f"|V| = {np.mean(Vmag)} +- {np.std(Vmag)}")
print(f"l = {np.mean(l)} +- {np.std(l)}")
print(f"b = {np.mean(b)} +- {np.std(b)}")
if "beta" in samples:
print(f"beta = {np.mean(samples['beta'])} +- {np.std(samples['beta'])}")
In [123]:
data = [l, b, Vmag]
labels = [r"$l$", r"$b$", r"$|\bf{V}_{\rm ext}|$"]
if "alpha" in samples:
data.append(samples["alpha"])
labels.append(r"$\alpha$")
if "beta" in samples:
data.append(samples["beta"])
labels.append(r"$\beta$")
if "h" in samples:
data.append(samples["h"])
labels.append(r"$h$")
if "sigma_v" in samples:
data.append(samples["sigma_v"])
labels.append(r"$\sigma_v$")
data = np.vstack(data).T
fig = corner.corner(data, labels=labels, show_titles=True, title_fmt=".3f", title_kwargs={"fontsize": 12}, smooth=1)
fig.savefig(f"../../plots/mock_{simname}_{catalogue}.png", dpi=500, bbox_inches="tight")
In [125]:
read_samples("Pantheon+", "csiborg2_main", 0, return_MCsamples=True)
Out[125]:
Vizualize the results¶
In [ ]:
data, names, gof = read_samples("Pantheon+_groups", "Carrick2015", 0)
fig = corner.corner(data, labels=names_to_latex(names, True), show_titles=True,
title_fmt=".3f", title_kwargs={"fontsize": 12}, smooth=1)
$\texttt{LOSS}$ comparison¶
In [126]:
LOSS_Carrick_0 = read_samples("LOSS", "Carrick2015", 0, return_MCsamples=True)
# LOSS_Carrick_1 = read_samples("LOSS", "Carrick2015", 1, return_MCsamples=True)
# LOSS_CB1_0 = read_samples("LOSS", "csiborg1", 0, return_MCsamples=True)
# LOSS_CB1_1 = read_samples("LOSS", "csiborg1", 1, return_MCsamples=True)
# LOSS_CB2_0 = read_samples("LOSS", "csiborg2_main", 0, return_MCsamples=True)
# LOSS_CB2_1 = read_samples("LOSS", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
LOSS_Carrick_0,
# LOSS_Carrick_1,
# LOSS_CB1_0,
LOSS_CB1_1,
LOSS_CB2_0,
LOSS_CB2_1,
]
# params = ["l", "b", "Vmag", "beta"]
params = None
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, params=params, filled=True, legend_loc='upper right', )
g.export(f"../plots/LOSS_comparison.png", dpi=500,)
$\texttt{Foundation}$ comparison¶
In [ ]:
FOUNDATION_Carrick_0 = read_samples("Foundation", "Carrick2015", 0, return_MCsamples=True)
FOUNDATION_Carrick_1 = read_samples("Foundation", "Carrick2015", 1, return_MCsamples=True)
FOUNDATION_CB1_0 = read_samples("Foundation", "csiborg1", 0, return_MCsamples=True)
FOUNDATION_CB1_1 = read_samples("Foundation", "csiborg1", 1, return_MCsamples=True)
FOUNDATION_CB2_0 = read_samples("Foundation", "csiborg2_main", 0, return_MCsamples=True)
FOUNDATION_CB2_1 = read_samples("Foundation", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
FOUNDATION_Carrick_0,
# FOUNDATION_Carrick_1,
# FOUNDATION_CB1_0,
FOUNDATION_CB1_1,
FOUNDATION_CB2_0,
FOUNDATION_CB2_1,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
g.export(f"../plots/FOUNDATION_comparison.png", dpi=500,)
$\texttt{Pantheon+}$ comparison¶
In [ ]:
PANTHEONP_Carrick_0 = read_samples("Pantheon+", "Carrick2015", 0, return_MCsamples=True)
PANTHEONP_Carrick_1 = read_samples("Pantheon+", "Carrick2015", 1, return_MCsamples=True)
# PANTHEONP_CB1_0 = read_samples("Pantheon+", "csiborg1", 0, return_MCsamples=True)
# PANTHEONP_CB1_1 = read_samples("Pantheon+", "csiborg1", 1, return_MCsamples=True)
PANTHEONP_CB2_0 = read_samples("Pantheon+", "csiborg2_main", 0, return_MCsamples=True)
PANTHEONP_CB2_1 = read_samples("Pantheon+", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
PANTHEONP_Carrick_0,
# PANTHEONP_Carrick_1,
# PANTHEONP_CB1_0,
# PANTHEONP_CB1_1,
PANTHEONP_CB2_0,
PANTHEONP_CB2_1,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
# g.export(f"../plots/PANTHEONP_comparison.png", dpi=500,)
$\texttt{Pantheon+}$ groups¶
In [ ]:
LG = -1
PANTHEONP_Carrick = read_samples("Pantheon+", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG, )
PANTHEONP_Carrick_Groups = read_samples("Pantheon+_groups", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG)
PANTHEONP_Carrick_Groups_zSN = read_samples("Pantheon+_groups_zSN", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG)
PANTHEONP_Carrick_zSN = read_samples("Pantheon+_zSN", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG)
# ksmooth = 1
# PANTHEONP_CB2 = read_samples("Pantheon+", "csiborg2_main", ksmooth, return_MCsamples=True, subtract_LG_velocity=LG)
# PANTHEONP_CB2_Groups = read_samples("Pantheon+_groups", "csiborg2_main", ksmooth, return_MCsamples=True, subtract_LG_velocity=LG)
# PANTHEONP_CB2_Groups_zSN = read_samples("Pantheon+_groups_zSN", "csiborg2_main", ksmooth, return_MCsamples=True, subtract_LG_velocity=LG)
In [ ]:
params = ["Vmag", "l", "b"]
CMB = MCSamples(samples=multivariate_normal([627, 276, 30], [22, 3, 3]).rvs(size=20000),
names=params, labels=names_to_latex(params, True), label="CMB")
X = [
PANTHEONP_Carrick,
# PANTHEONP_Carrick_Groups,
# PANTHEONP_Carrick_Groups_zSN,
PANTHEONP_Carrick_zSN,
# PANTHEONP_CB2,
# PANTHEONP_CB2_Groups,
# PANTHEONP_CB2_Groups_zSN,
# CMB,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
g.export(f"../../plots/PANTHEON_GROUPS_Carrick_comparison_LG.png", dpi=500,)
$\texttt{2MTF}$ comparison¶
In [24]:
TWOMTF_Carrick_0 = read_samples("2MTF", "Carrick2015", 0, return_MCsamples=True)
TWOMTF_Carrick_1 = read_samples("2MTF", "Carrick2015", 1, return_MCsamples=True)
TWOMTF_CB1_0 = read_samples("2MTF", "csiborg1", 0, return_MCsamples=True)
TWOMTF_CB1_1 = read_samples("2MTF", "csiborg1", 1, return_MCsamples=True)
TWOMTF_CB2_0 = read_samples("2MTF", "csiborg2_main", 0, return_MCsamples=True)
TWOMTF_CB2_1 = read_samples("2MTF", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
TWOMTF_Carrick_0,
# TWOMTF_Carrick_1,
# TWOMTF_CB1_0,
TWOMTF_CB1_1,
TWOMTF_CB2_0,
TWOMTF_CB2_1,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
g.export(f"../plots/2MTF_comparison.png", dpi=500,)
$\texttt{SFI++ galaxies}$ comparison¶
In [ ]:
SFIGAL_Carrick_0 = read_samples("SFI_gals", "Carrick2015", 0, return_MCsamples=True)
SFIGAL_Carrick_1 = read_samples("SFI_gals", "Carrick2015", 1, return_MCsamples=True)
# SFIGAL_CB1_0 = read_samples("SFI_gals", "csiborg1", 0, return_MCsamples=True)
# SFIGAL_CB1_1 = read_samples("SFI_gals", "csiborg1", 1, return_MCsamples=True)
SFIGAL_CB2_0 = read_samples("SFI_gals", "csiborg2_main", 0, return_MCsamples=True)
SFIGAL_CB2_1 = read_samples("SFI_gals", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
SFIGAL_Carrick_0,
# SFIGAL_Carrick_1,
# SFIGAL_CB1_0,
# SFIGAL_CB1_1,
# SFIGAL_CB2_0,
SFIGAL_CB2_1,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
g.export(f"../plots/SFI_gals_comparison.png", dpi=500,)
$\texttt{SFI++ groups}$ comparison¶
In [ ]:
SFIGROUP_Carrick_0 = read_samples("SFI_groups", "Carrick2015", 0, return_MCsamples=True)
SFIGROUP_Carrick_1 = read_samples("SFI_groups", "Carrick2015", 1, return_MCsamples=True)
SFIGROUP_CB2_0 = read_samples("SFI_groups", "csiborg2_main", 0, return_MCsamples=True)
SFIGROUP_CB2_1 = read_samples("SFI_groups", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
SFIGROUP_Carrick_0,
SFIGAL_Carrick_0,
# SFIGROUP_Carrick_1,
# SFIGROUP_CB2_0,
# SFIGROUP_CB2_1,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
g.export(f"../plots/SFI_gals_vs_groups_comparison.png", dpi=500,)
SN to TF comparison¶
In [ ]:
LG = 0
# PANTHEONP_Carrick = read_samples("Pantheon+", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG, )
# PANTHEONP_Groups_Carrick = read_samples("Pantheon+_groups", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG, )
# TWOMTF_Carrick = read_samples("2MTF", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG)
# SFIGAL_Carrick = read_samples("SFI_gals", "Carrick2015", 0, return_MCsamples=True, subtract_LG_velocity=LG)
k = 1
PANTHEONP_CB2 = read_samples("Pantheon+", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG, )
PANTHEONP_Groups_CB2 = read_samples("Pantheon+_groups", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG, )
TWOMTF_CB2 = read_samples("2MTF", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
SFIGAL_CB2 = read_samples("SFI_gals", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
In [ ]:
params = ["Vmag", "l", "b"]
CMB = MCSamples(samples=multivariate_normal([627, 276, 30], [22, 3, 3]).rvs(size=20000),
names=params, labels=names_to_latex(params, True), label="CMB")
X = [
# PANTHEONP_Carrick,
# PANTHEONP_Groups_Carrick,
# TWOMTF_Carrick,
# SFIGAL_Carrick,
PANTHEONP_CB2,
PANTHEONP_Groups_CB2,
TWOMTF_CB2,
SFIGAL_CB2,
CMB,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
# g.export(f"../../plots/SN_TF_CB2_consistency.png", dpi=500,)
Mock $\texttt{CB2}$ comparison¶
In [ ]:
SMALLMOCK_CB2_0 = read_samples("CB2_small", "csiborg2_main", 0, return_MCsamples=True)
SMALLMOCK_CB2_1 = read_samples("CB2_small", "csiborg2_main", 1, return_MCsamples=True)
LARGEMOCK_CB2_0 = read_samples("CB2_large", "csiborg2_main", 0, return_MCsamples=True)
LARGEMOCK_CB2_1 = read_samples("CB2_large", "csiborg2_main", 1, return_MCsamples=True)
In [ ]:
X = [
# SMALLMOCK_CB2_0,
# SMALLMOCK_CB2_1,
LARGEMOCK_CB2_0,
LARGEMOCK_CB2_1,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, filled=True, legend_loc='upper right')
g.export(f"../plots/CB2_mocks_large.png", dpi=500,)
External flow consistency¶
Carrick2015¶
In [ ]:
X = [
# LOSS_Carrick_0,
# FOUNDATION_Carrick_0,
PANTHEONP_Carrick_0,
TWOMTF_Carrick_0,
SFIGAL_Carrick_0,
]
params = ["Vmag", "l", "b", "beta"]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, params=params, filled=True, legend_loc='upper right',)
g.export(f"../plots/Carrick2015_external_flow.png", dpi=500,)
CSiBORG1¶
In [ ]:
X = [
# LOSS_CB1_1,
# FOUNDATION_CB1_1,
PANTHEONP_CB1_1,
TWOMTF_CB1_1,
# SFIGAL_CB1_1,
]
params = ["Vmag", "l", "b", "beta"]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, params=params, filled=True, legend_loc='upper right',)
g.export(f"../plots/CB1_external_flow.png", dpi=500,)
CSiBORG2¶
In [ ]:
X = [
# LOSS_CB2_1,
# FOUNDATION_CB2_1,
PANTHEONP_CB2_1,
TWOMTF_CB2_1,
SFIGAL_CB2_1,
]
params = ["Vmag", "l", "b", "beta"]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, params=params, filled=True, legend_loc='upper right',)
g.export(f"../plots/CB2_external_flow.png", dpi=500,)
In [ ]:
k = 1
LG = 0
# Carrick
# LOSS_Carrick_LG = read_samples("LOSS", "Carrick2015", k, return_MCsamples=True, subtract_LG_velocity=LG)
# FOUNDATION_Carrick_LG = read_samples("Foundation", "Carrick2015", k, return_MCsamples=True, subtract_LG_velocity=LG)
# PANTHEON_Carrick_LG = read_samples("Pantheon+", "Carrick2015", k, return_MCsamples=True, subtract_LG_velocity=LG)
# TWOMTF_Carrick_LG = read_samples("2MTF", "Carrick2015", k, return_MCsamples=True, subtract_LG_velocity=LG)
SFIGAL_Carrick_LG = read_samples("SFI_gals", "Carrick2015", k, return_MCsamples=True, subtract_LG_velocity=LG)
SFIGROUPS_Carrick_LG = read_samples("SFI_groups", "Carrick2015", k, return_MCsamples=True, subtract_LG_velocity=LG)
# # CSiBORG2
# LOSS_CB2_LG = read_samples("LOSS", "csiborg2_main", k, return_MCsamples=True,subtract_LG_velocity=LG)
# FOUNDATION_CB2_LG = read_samples("Foundation", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
# PANTHEON_CB2_LG = read_samples("Pantheon+", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
# TWOMTF_CB2_LG = read_samples("2MTF", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
SFIGAL_CB2_LG = read_samples("SFI_gals", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
SFIGROUP_CB2_LG = read_samples("SFI_groups", "csiborg2_main", k, return_MCsamples=True, subtract_LG_velocity=LG)
# # CSiBORG1
# LOSS_CB1_LG = read_samples("LOSS", "csiborg1", k, return_MCsamples=True, subtract_LG_velocity=LG)
# FOUNDATION_CB1_LG = read_samples("Foundation", "csiborg1", k, return_MCsamples=True, subtract_LG_velocity=LG)
# PANTHEON_CB1_LG = read_samples("Pantheon+", "csiborg1", k, return_MCsamples=True, subtract_LG_velocity=LG)
# TWOMTF_CB1_LG = read_samples("2MTF", "csiborg1", k, return_MCsamples=True, subtract_LG_velocity=LG)
# SFIGAL_CB1_LG = read_samples("SFI_gals", "csiborg1", k, return_MCsamples=True, subtract_LG_velocity=LG)
In [ ]:
params = ["Vmag", "l", "b"]
CMB = MCSamples(samples=multivariate_normal([627, 276, 30], [22, 3, 3]).rvs(size=20000),
names=params, labels=names_to_latex(params, True), label="CMB")
X = [
# LOSS_Carrick_LG,
# FOUNDATION_Carrick_LG,
# PANTHEON_Carrick_LG,
# TWOMTF_Carrick_LG,
# SFIGAL_Carrick_LG,
# SFIGROUPS_Carrick_LG,
# LOSS_CB1_LG,
# FOUNDATION_CB1_LG,
# PANTHEON_CB1_LG,
# TWOMTF_CB1_LG,
# SFIGAL_CB1_LG,
# LOSS_CB2_LG,
# FOUNDATION_CB2_LG,
# PANTHEON_CB2_LG,
# TWOMTF_CB2_LG,
SFIGAL_CB2_LG,
SFIGROUP_CB2_LG,
CMB,
]
g = plots.get_subplot_plotter()
g.settings.figure_legend_frame = False
g.settings.alpha_filled_add = 0.75
# g.settings.title_limit_fontsize = 14
g.triangle_plot(X, params=params, filled=True, legend_loc='upper right', )
# g.export(f"../plots/ALL_dipole.png", dpi=500,)
In [ ]: