mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2025-04-17 21:00:54 +00:00
Add Vmag along model ax
This commit is contained in:
parent
6974deca91
commit
1a1abfd8fb
3 changed files with 20 additions and 8 deletions
|
@ -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,
|
||||
beta_max, sigma_v_min, sigma_v_max, h_min, h_max,
|
||||
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."""
|
||||
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:
|
||||
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:
|
||||
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 lf (l, b) = (117, 4)
|
||||
Vext = Vext_mag * jnp.asarray([0.4035093, -0.01363162, 0.91487396])
|
||||
|
||||
else:
|
||||
Vext = sample("Vext", Uniform(Vext_min, Vext_max).expand([3]))
|
||||
|
||||
|
|
|
@ -694,7 +694,7 @@ class Paths:
|
|||
sample_beta=False, no_Vext=None,
|
||||
sample_Vmono=False, sample_mag_dipole=False,
|
||||
sample_curvature=False, absolute_calibration=None,
|
||||
verbose_print=True):
|
||||
sample_Vmag_vax=False, verbose_print=True):
|
||||
"""Flow validation file path."""
|
||||
if isinstance(catalogue, list) and len(catalogue) == 1:
|
||||
catalogue = catalogue[0]
|
||||
|
@ -710,10 +710,11 @@ class Paths:
|
|||
keys = ["smooth", "nsim", "zcmb_min", "zcmb_max", "mag_selection",
|
||||
"sample_alpha", "sample_beta", "no_Vext", "sample_Vmono",
|
||||
"sample_mag_dipole", "sample_curvature",
|
||||
"absolute_calibration"]
|
||||
"sample_Vmag_vax", "absolute_calibration"]
|
||||
values = [smooth, nsim, zcmb_min, zcmb_max, mag_selection,
|
||||
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):
|
||||
|
||||
|
|
|
@ -309,7 +309,8 @@ if __name__ == "__main__":
|
|||
mag_selection = None
|
||||
sample_alpha = False if "IndranilVoid_" in ARGS.simname or ARGS.simname == "no_field" else True # noqa
|
||||
sample_beta = None
|
||||
no_Vext = None
|
||||
no_Vext = True
|
||||
sample_Vmag_vax = True
|
||||
sample_Vmono = False
|
||||
sample_mag_dipole = False
|
||||
absolute_calibration = None
|
||||
|
@ -325,6 +326,7 @@ if __name__ == "__main__":
|
|||
"sample_alpha": sample_alpha,
|
||||
"sample_beta": sample_beta,
|
||||
"no_Vext": no_Vext,
|
||||
"sample_Vmag_vax": sample_Vmag_vax,
|
||||
"sample_Vmono": sample_Vmono,
|
||||
"sample_mag_dipole": sample_mag_dipole,
|
||||
"absolute_calibration": absolute_calibration,
|
||||
|
@ -377,7 +379,8 @@ if __name__ == "__main__":
|
|||
"beta_min": -10.0, "beta_max": 10.0,
|
||||
"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,
|
||||
"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_beta": sample_beta,
|
||||
"sample_h": sample_h,
|
||||
|
|
Loading…
Add table
Reference in a new issue