Void boost along axis. (#151)

* Add Vmag along model ax

* Fix typo

* Updat evoid plots

* Add label

* Update script

* Update defaults
This commit is contained in:
Richard Stiskalek 2024-09-23 12:33:48 +02:00 committed by GitHub
parent 6974deca91
commit c881f8eb39
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 55 additions and 15 deletions

View File

@ -378,7 +378,7 @@ def sample_simple(e_mu_min, e_mu_max, dmu_min, dmu_max, alpha_min, alpha_max,
def sample_calibration(Vext_min, Vext_max, Vmono_min, Vmono_max, beta_min, def sample_calibration(Vext_min, Vext_max, Vmono_min, Vmono_max, beta_min,
beta_max, sigma_v_min, sigma_v_max, h_min, h_max, beta_max, sigma_v_min, sigma_v_max, h_min, h_max,
rLG_min, rLG_max, no_Vext, sample_Vmono, sample_beta, rLG_min, rLG_max, no_Vext, sample_Vmono, sample_beta,
sample_h, sample_rLG): sample_h, sample_rLG, sample_Vmag_vax):
"""Sample the flow calibration.""" """Sample the flow calibration."""
sigma_v = sample("sigma_v", Uniform(sigma_v_min, sigma_v_max)) sigma_v = sample("sigma_v", Uniform(sigma_v_min, sigma_v_max))
@ -387,10 +387,18 @@ def sample_calibration(Vext_min, Vext_max, Vmono_min, Vmono_max, beta_min,
else: else:
beta = 1.0 beta = 1.0
if not no_Vext and sample_Vmag_vax:
raise RuntimeError("Cannot sample Vext and Vext magnitude along the "
"void axis simultaneously.")
if no_Vext: if no_Vext:
Vext = jnp.zeros(3) Vext = jnp.zeros(3)
# 840 in the direction of (l, b) = (117, 4)
# Vext = jnp.asarray([338.9478154 , -11.45056064, 768.49415294]) if sample_Vmag_vax:
Vext_mag = sample("Vext_axis_mag", Uniform(0.0, Vext_max))
# In the direction if (l, b) = (117, 4)
Vext = Vext_mag * jnp.asarray([0.4035093, -0.01363162, 0.91487396])
else: else:
Vext = sample("Vext", Uniform(Vext_min, Vext_max).expand([3])) Vext = sample("Vext", Uniform(Vext_min, Vext_max).expand([3]))

View File

@ -694,7 +694,7 @@ class Paths:
sample_beta=False, no_Vext=None, sample_beta=False, no_Vext=None,
sample_Vmono=False, sample_mag_dipole=False, sample_Vmono=False, sample_mag_dipole=False,
sample_curvature=False, absolute_calibration=None, sample_curvature=False, absolute_calibration=None,
verbose_print=True): sample_Vmag_vax=False, verbose_print=True):
"""Flow validation file path.""" """Flow validation file path."""
if isinstance(catalogue, list) and len(catalogue) == 1: if isinstance(catalogue, list) and len(catalogue) == 1:
catalogue = catalogue[0] catalogue = catalogue[0]
@ -710,10 +710,11 @@ class Paths:
keys = ["smooth", "nsim", "zcmb_min", "zcmb_max", "mag_selection", keys = ["smooth", "nsim", "zcmb_min", "zcmb_max", "mag_selection",
"sample_alpha", "sample_beta", "no_Vext", "sample_Vmono", "sample_alpha", "sample_beta", "no_Vext", "sample_Vmono",
"sample_mag_dipole", "sample_curvature", "sample_mag_dipole", "sample_curvature",
"absolute_calibration"] "sample_Vmag_vax", "absolute_calibration"]
values = [smooth, nsim, zcmb_min, zcmb_max, mag_selection, values = [smooth, nsim, zcmb_min, zcmb_max, mag_selection,
sample_alpha, sample_beta, no_Vext, sample_Vmono, sample_alpha, sample_beta, no_Vext, sample_Vmono,
sample_mag_dipole, sample_curvature, absolute_calibration] sample_mag_dipole, sample_curvature,
sample_Vmag_vax, absolute_calibration]
for key, value in zip(keys, values): for key, value in zip(keys, values):

View File

@ -60,6 +60,7 @@ def names_to_latex(names, for_corner=False):
"l": "\\ell ~ [\\mathrm{deg}]", "l": "\\ell ~ [\\mathrm{deg}]",
"b": "b ~ [\\mathrm{deg}]", "b": "b ~ [\\mathrm{deg}]",
"rLG": "R_{\\rm offset} ~ [\\mathrm{Mpc} / h]", "rLG": "R_{\\rm offset} ~ [\\mathrm{Mpc} / h]",
"Vext_axis_mag": "V_{\\rm axis} ~ [\\mathrm{km} / \\mathrm{s}]",
} }
ltx_corner = {"alpha": r"$\alpha$", ltx_corner = {"alpha": r"$\alpha$",

View File

@ -2,7 +2,7 @@
"cells": [ "cells": [
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
@ -286,18 +286,42 @@
] ]
}, },
{ {
"cell_type": "code", "cell_type": "markdown",
"execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "source": [
"source": [] "### 5. $V_{\\rm ext}$ along the model axis and $\\beta = 1$"
]
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [] "source": [
"for simname in [\"IndranilVoid_exp\", \"IndranilVoid_gauss\", \"IndranilVoid_mb\"]:\n",
" X = []\n",
" for catalogue in [\"2MTF\", \"SFI_gals\", \"CF4_TFR_i\", \"CF4_TFR_w1\"]:\n",
"\n",
" fname = paths.flow_validation(\n",
" fdir, simname, catalogue, inference_method=\"bayes\",\n",
" sample_alpha=False, sample_beta=None,\n",
" no_Vext=True, zcmb_max=0.05, sample_Vmag_vax=True)\n",
" \n",
" X_i = samples_to_getdist(get_samples(fname, False), catalogue_to_pretty(catalogue))\n",
" X.append(X_i)\n",
"\n",
" params = [\"rLG\", \"sigma_v\", \"Vext_axis_mag\"]\n",
" with plt.style.context(\"science\"):\n",
" g = plots.get_subplot_plotter()\n",
" g.settings.figure_legend_frame = False\n",
" g.settings.alpha_filled_add = 0.75\n",
"\n",
" g.triangle_plot(X, params=params, filled=True, legend_loc='upper right')\n",
" plt.gcf().suptitle(simname_to_pretty(simname), y=1.025)\n",
" plt.gcf().tight_layout()\n",
" plt.gcf().show()\n",
" plt.gcf().savefig(f\"../../plots/void_{simname}_Vext_along_axis_no_beta.png\", dpi=500, bbox_inches='tight')"
]
}, },
{ {
"cell_type": "code", "cell_type": "code",

View File

@ -310,6 +310,7 @@ if __name__ == "__main__":
sample_alpha = False if "IndranilVoid_" in ARGS.simname or ARGS.simname == "no_field" else True # noqa sample_alpha = False if "IndranilVoid_" in ARGS.simname or ARGS.simname == "no_field" else True # noqa
sample_beta = None sample_beta = None
no_Vext = None no_Vext = None
sample_Vmag_vax = False
sample_Vmono = False sample_Vmono = False
sample_mag_dipole = False sample_mag_dipole = False
absolute_calibration = None absolute_calibration = None
@ -325,6 +326,7 @@ if __name__ == "__main__":
"sample_alpha": sample_alpha, "sample_alpha": sample_alpha,
"sample_beta": sample_beta, "sample_beta": sample_beta,
"no_Vext": no_Vext, "no_Vext": no_Vext,
"sample_Vmag_vax": sample_Vmag_vax,
"sample_Vmono": sample_Vmono, "sample_Vmono": sample_Vmono,
"sample_mag_dipole": sample_mag_dipole, "sample_mag_dipole": sample_mag_dipole,
"absolute_calibration": absolute_calibration, "absolute_calibration": absolute_calibration,
@ -378,6 +380,7 @@ if __name__ == "__main__":
"sigma_v_min": 1.0, "sigma_v_max": 5000 if "IndranilVoid_" in ARGS.simname else 750., # noqa "sigma_v_min": 1.0, "sigma_v_max": 5000 if "IndranilVoid_" in ARGS.simname else 750., # noqa
"h_min": 0.01, "h_max": 5.0, "h_min": 0.01, "h_max": 5.0,
"no_Vext": False if no_Vext is None else no_Vext, # noqa "no_Vext": False if no_Vext is None else no_Vext, # noqa
"sample_Vmag_vax": sample_Vmag_vax,
"sample_Vmono": sample_Vmono, "sample_Vmono": sample_Vmono,
"sample_beta": sample_beta, "sample_beta": sample_beta,
"sample_h": sample_h, "sample_h": sample_h,

View File

@ -37,9 +37,12 @@ else
fi fi
for simname in "IndranilVoid_exp" "IndranilVoid_gauss" "IndranilVoid_mb"; do # for simname in "IndranilVoid_exp" "IndranilVoid_gauss" "IndranilVoid_mb"; do
for simname in "Carrick2015" "Lilow2024" "csiborg2_main" "csiborg2X" "manticore_2MPP_N128_DES_V1" "CF4" "CLONES"; do
# for simname in "no_field"; do # for simname in "no_field"; do
for catalogue in "LOSS" "Foundation" "2MTF" "SFI_gals" "CF4_TFR_i" "CF4_TFR_w1"; do for catalogue in "LOSS" "Foundation" "2MTF" "SFI_gals" "CF4_TFR_i" "CF4_TFR_w1"; do
# for catalogue in "2MTF"; do
# for catalogue in "CF4_TFR_i" "CF4_TFR_w1"; do # for catalogue in "CF4_TFR_i" "CF4_TFR_w1"; do
# for catalogue in "2MTF" "SFI_gals" "CF4_TFR_i" "CF4_TFR_w1"; do # for catalogue in "2MTF" "SFI_gals" "CF4_TFR_i" "CF4_TFR_w1"; do
for ksim in "none"; do for ksim in "none"; do
@ -47,7 +50,7 @@ for simname in "IndranilVoid_exp" "IndranilVoid_gauss" "IndranilVoid_mb"; do
# for ksim in $(seq 0 5 500); do # for ksim in $(seq 0 5 500); do
# for ksim in "0_100_5" "100_200_5" "200_300_5" "300_400_5" "400_500_5"; do # for ksim in "0_100_5" "100_200_5" "200_300_5" "300_400_5" "400_500_5"; do
# for ksim in {0..500}; do # for ksim in {0..500}; do
for ksmooth in 0; do for ksmooth in 0 1; do
pythoncm="$env $file --catalogue $catalogue --simname $simname --ksim $ksim --ksmooth $ksmooth --ndevice $ndevice --device $device" pythoncm="$env $file --catalogue $catalogue --simname $simname --ksim $ksim --ksmooth $ksmooth --ndevice $ndevice --device $device"
if [ "$on_login" == "1" ]; then if [ "$on_login" == "1" ]; then