mirror of
https://github.com/Richard-Sti/csiborgtools_public.git
synced 2025-07-06 22:41:11 +00:00
Pass marg arg
This commit is contained in:
parent
c81d39ee81
commit
05123ec868
1 changed files with 17 additions and 7 deletions
|
@ -354,8 +354,8 @@ def mask_fields(density, velocity, mask, return_none):
|
||||||
|
|
||||||
|
|
||||||
def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
absolute_calibration=None, calibration_fpath=None,
|
wo_num_dist_marginalisation=False, absolute_calibration=None,
|
||||||
void_kwargs=None):
|
calibration_fpath=None, void_kwargs=None):
|
||||||
"""
|
"""
|
||||||
Get a model and extract the relevant data from the loader.
|
Get a model and extract the relevant data from the loader.
|
||||||
|
|
||||||
|
@ -369,9 +369,14 @@ def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
Maximum observed redshift in the CMB frame to include.
|
Maximum observed redshift in the CMB frame to include.
|
||||||
mag_selection : dict, optional
|
mag_selection : dict, optional
|
||||||
Magnitude selection parameters.
|
Magnitude selection parameters.
|
||||||
|
wo_num_dist_marginalisation : bool, optional
|
||||||
|
Whether to directly sample the distance without numerical
|
||||||
|
marginalisation. in which case the tracers can be coupled by a
|
||||||
|
covariance matrix. By default `False`.
|
||||||
add_absolute_calibration : bool, optional
|
add_absolute_calibration : bool, optional
|
||||||
Whether to add an absolute calibration for CF4 TFRs.
|
Whether to add an absolute calibration for CF4 TFRs.
|
||||||
calibration_fpath : str, optional
|
calibration_fpath : str, optional
|
||||||
|
Path to the file containing the absolute calibration of CF4 TFR.
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
|
@ -418,7 +423,8 @@ def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
los_overdensity, los_velocity,
|
los_overdensity, los_velocity,
|
||||||
RA[mask], dec[mask], zCMB[mask], e_zCMB, calibration_params,
|
RA[mask], dec[mask], zCMB[mask], e_zCMB, calibration_params,
|
||||||
None, mag_selection, loader.rdist, loader._Omega_m, "SN",
|
None, mag_selection, loader.rdist, loader._Omega_m, "SN",
|
||||||
name=kind, void_kwargs=void_kwargs)
|
name=kind, void_kwargs=void_kwargs,
|
||||||
|
wo_num_dist_marginalisation=wo_num_dist_marginalisation)
|
||||||
elif "Pantheon+" in kind:
|
elif "Pantheon+" in kind:
|
||||||
keys = ["RA", "DEC", "zCMB", "mB", "x1", "c", "biasCor_m_b", "mBERR",
|
keys = ["RA", "DEC", "zCMB", "mB", "x1", "c", "biasCor_m_b", "mBERR",
|
||||||
"x1ERR", "cERR", "biasCorErr_m_b", "zCMB_SN", "zCMB_Group",
|
"x1ERR", "cERR", "biasCorErr_m_b", "zCMB_SN", "zCMB_Group",
|
||||||
|
@ -451,7 +457,8 @@ def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
los_overdensity, los_velocity,
|
los_overdensity, los_velocity,
|
||||||
RA[mask], dec[mask], zCMB[mask], e_zCMB[mask], calibration_params,
|
RA[mask], dec[mask], zCMB[mask], e_zCMB[mask], calibration_params,
|
||||||
None, mag_selection, loader.rdist, loader._Omega_m, "SN",
|
None, mag_selection, loader.rdist, loader._Omega_m, "SN",
|
||||||
name=kind, void_kwargs=void_kwargs)
|
name=kind, void_kwargs=void_kwargs,
|
||||||
|
wo_num_dist_marginalisation=wo_num_dist_marginalisation)
|
||||||
elif kind in ["SFI_gals", "2MTF", "SFI_gals_masked"]:
|
elif kind in ["SFI_gals", "2MTF", "SFI_gals_masked"]:
|
||||||
keys = ["RA", "DEC", "z_CMB", "mag", "eta", "e_mag", "e_eta"]
|
keys = ["RA", "DEC", "z_CMB", "mag", "eta", "e_mag", "e_eta"]
|
||||||
RA, dec, zCMB, mag, eta, e_mag, e_eta = (loader.cat[k] for k in keys)
|
RA, dec, zCMB, mag, eta, e_mag, e_eta = (loader.cat[k] for k in keys)
|
||||||
|
@ -467,7 +474,8 @@ def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
los_overdensity, los_velocity,
|
los_overdensity, los_velocity,
|
||||||
RA[mask], dec[mask], zCMB[mask], None, calibration_params, None,
|
RA[mask], dec[mask], zCMB[mask], None, calibration_params, None,
|
||||||
mag_selection, loader.rdist, loader._Omega_m, "TFR", name=kind,
|
mag_selection, loader.rdist, loader._Omega_m, "TFR", name=kind,
|
||||||
void_kwargs=void_kwargs)
|
void_kwargs=void_kwargs,
|
||||||
|
wo_num_dist_marginalisation=wo_num_dist_marginalisation)
|
||||||
elif "CF4_TFR_" in kind:
|
elif "CF4_TFR_" in kind:
|
||||||
# The full name can be e.g. "CF4_TFR_not2MTForSFI_i" or "CF4_TFR_i".
|
# The full name can be e.g. "CF4_TFR_not2MTForSFI_i" or "CF4_TFR_i".
|
||||||
band = kind.split("_")[-1]
|
band = kind.split("_")[-1]
|
||||||
|
@ -535,7 +543,8 @@ def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
los_overdensity, los_velocity,
|
los_overdensity, los_velocity,
|
||||||
RA[mask], dec[mask], z_obs[mask], None, calibration_params,
|
RA[mask], dec[mask], z_obs[mask], None, calibration_params,
|
||||||
abs_calibration_params, mag_selection, loader.rdist,
|
abs_calibration_params, mag_selection, loader.rdist,
|
||||||
loader._Omega_m, "TFR", name=kind, void_kwargs=void_kwargs)
|
loader._Omega_m, "TFR", name=kind, void_kwargs=void_kwargs,
|
||||||
|
wo_num_dist_marginalisation=wo_num_dist_marginalisation)
|
||||||
elif kind in ["CF4_GroupAll"]:
|
elif kind in ["CF4_GroupAll"]:
|
||||||
# Note, this for some reason works terribly.
|
# Note, this for some reason works terribly.
|
||||||
keys = ["RA", "DE", "Vcmb", "DMzp", "eDM"]
|
keys = ["RA", "DE", "Vcmb", "DMzp", "eDM"]
|
||||||
|
@ -556,7 +565,8 @@ def get_model(loader, zcmb_min=None, zcmb_max=None, mag_selection=None,
|
||||||
los_overdensity, los_velocity,
|
los_overdensity, los_velocity,
|
||||||
RA[mask], dec[mask], zCMB[mask], None, calibration_params, None,
|
RA[mask], dec[mask], zCMB[mask], None, calibration_params, None,
|
||||||
mag_selection, loader.rdist, loader._Omega_m, "simple",
|
mag_selection, loader.rdist, loader._Omega_m, "simple",
|
||||||
name=kind, void_kwargs=void_kwargs)
|
name=kind, void_kwargs=void_kwargs,
|
||||||
|
wo_num_dist_marginalisation=wo_num_dist_marginalisation)
|
||||||
else:
|
else:
|
||||||
raise ValueError(f"Catalogue `{kind}` not recognized.")
|
raise ValueError(f"Catalogue `{kind}` not recognized.")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue