Matching of observations (#127)

* Rename file

* Add indents

* Update imports

* Add counting

* Docs

* Add nb

* Rename nb

* Update nb

* Add PV processing

* Update nb

* Add Pantheon+groups

* Update submission scripts

* Add Pantheon+zSN

* Update nb

* Edit param

* Matchin SFI

* Update nb

* Fix path bug

* Add list of clusters

* Update imports

* Update imports

* Add cartesian & mass of clusters

* Add observation to halo matching

* Add nb

* Add inverse CDF

* Add import

* Update nb

* Add comments
This commit is contained in:
Richard Stiskalek 2024-04-23 12:02:09 +01:00 committed by GitHub
parent 3876985f26
commit c4557cf35b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 1727 additions and 714 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -38,7 +38,7 @@ def read_samples(catalogue, simname, ksmooth, include_calibration=False,
Vx, Vy, Vz, beta, sigma_v, alpha = [], [], [], [], [], []
BIC, AIC, logZ, chi2 = [], [], [], []
if catalogue in ["LOSS", "Foundation", "Pantheon+"]:
if catalogue in ["LOSS", "Foundation"] or "Pantheon+" in catalogue:
alpha_cal, beta_cal, mag_cal, e_mu_intrinsic = [], [], [], []
elif catalogue in ["2MTF", "SFI_gals", "SFI_gals_masked"]:
a, b, e_mu_intrinsic = [], [], []
@ -86,7 +86,7 @@ def read_samples(catalogue, simname, ksmooth, include_calibration=False,
except KeyError:
chi2.append([0.])
if catalogue in ["LOSS", "Foundation", "Pantheon+"]:
if catalogue in ["LOSS", "Foundation"] or "Pantheon+" in catalogue: # noqa
alpha_cal.append(f[f"sim_{nsim}/alpha_cal"][:])
beta_cal.append(f[f"sim_{nsim}/beta_cal"][:])
mag_cal.append(f[f"sim_{nsim}/mag_cal"][:])
@ -106,7 +106,7 @@ def read_samples(catalogue, simname, ksmooth, include_calibration=False,
gof = np.hstack(BIC), np.hstack(AIC), np.hstack(logZ), np.hstack(chi2)
if catalogue in ["LOSS", "Foundation", "Pantheon+"]:
if catalogue in ["LOSS", "Foundation"] or "Pantheon+" in catalogue:
alpha_cal, beta_cal, mag_cal, e_mu_intrinsic = np.hstack(alpha_cal), np.hstack(beta_cal), np.hstack(mag_cal), np.hstack(e_mu_intrinsic) # noqa
elif catalogue in ["2MTF", "SFI_gals", "SFI_gals_masked"]:
a, b, e_mu_intrinsic = np.hstack(a), np.hstack(b), np.hstack(e_mu_intrinsic) # noqa
@ -118,6 +118,7 @@ def read_samples(catalogue, simname, ksmooth, include_calibration=False,
raise ValueError(f"Catalogue {catalogue} not recognized.")
# Calculate magnitude of V_ext
Vmag = np.sqrt(Vx**2 + Vy**2 + Vz**2)
# Calculate direction in galactic coordinates of V_ext
V = np.vstack([Vx, Vy, Vz]).T
@ -128,7 +129,7 @@ def read_samples(catalogue, simname, ksmooth, include_calibration=False,
names = ["alpha", "beta", "Vmag", "l", "b", "sigma_v"]
if include_calibration:
if catalogue in ["LOSS", "Foundation", "Pantheon+"]:
if catalogue in ["LOSS", "Foundation"] or "Pantheon+" in catalogue:
data += [alpha_cal, beta_cal, mag_cal, e_mu_intrinsic]
names += ["alpha_cal", "beta_cal", "mag_cal", "e_mu_intrinsic"]
elif catalogue in ["2MTF", "SFI_gals", "SFI_gals_masked"]:

File diff suppressed because one or more lines are too long