Skip to content

Commit

Permalink
remove non cmb only
Browse files Browse the repository at this point in the history
  • Loading branch information
Louis Thibaut committed Dec 11, 2024
1 parent 9556281 commit 8df26aa
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@

cov_ml = np.load(f"{combined_spec_dir}/cov_{name}_{spectrum}.npy")

Dl_list = []
# Dl_list = []
Dl_list_fg_sub = []

inv_cov_ml = np.linalg.inv(cov_ml)

chi2_list = []
for iii in range(iStart, iStop + 1):
l, Dl, sigma = np.loadtxt(f"{combined_spec_dir}/Dl_{name}_{spectrum}_{iii:05d}.dat", unpack=True)
# l, Dl, sigma = np.loadtxt(f"{combined_spec_dir}/Dl_{name}_{spectrum}_{iii:05d}.dat", unpack=True)
l, Dl_fg_sub, sigma = np.loadtxt(f"{combined_spec_dir}/Dl_{name}_{spectrum}_{iii:05d}_cmb_only.dat", unpack=True)
Dl_list += [Dl]
# Dl_list += [Dl]
Dl_list_fg_sub += [Dl_fg_sub]

id = np.where(lb >= l[0])
Expand All @@ -82,7 +82,7 @@
plt.clf()
plt.close()

Dl_mean = np.mean(Dl_list, axis=0)
# Dl_mean = np.mean(Dl_list, axis=0)
Dl_fg_sub_mean = np.mean(Dl_list_fg_sub, axis=0)

print("ok")
Expand All @@ -95,7 +95,7 @@
plt.xlabel(r"$\ell$", fontsize=19)
plt.ylabel(r"$D^{%s}_{\ell}$" % spectrum, fontsize=19)
plt.plot(lb, Dbth)
plt.errorbar(l, Dl_mean, sigma_mc, fmt=".", label="mean spectrum")
# plt.errorbar(l, Dl_mean, sigma_mc, fmt=".", label="mean spectrum")
plt.errorbar(l, Dl_fg_sub_mean, sigma_mc, fmt=".", label="mean spectrum fg subtracted")
plt.legend()
plt.savefig(f"{plot_dir}/{spectrum}.png", bbox_inches="tight")
Expand All @@ -105,7 +105,7 @@
plt.figure(figsize=(12,8))
plt.xlabel(r"$\ell$", fontsize=19)
plt.ylabel(r"$D^{%s}_{\ell} - D^{%s, th}_{\ell}$" % (spectrum,spectrum), fontsize=19)
plt.errorbar(l, Dl_mean - Dbth[id], sigma_mc / np.sqrt(iStop + 1 - iStart), label="mean - theory")
# plt.errorbar(l, Dl_mean - Dbth[id], sigma_mc / np.sqrt(iStop + 1 - iStart), label="mean - theory")
plt.errorbar(l, Dl_fg_sub_mean - Dbth[id], sigma_mc / np.sqrt(iStop + 1 - iStart), label="mean fg subtracted - theory")
plt.legend()
plt.savefig(f"{plot_dir}/{spectrum}_residual.png", bbox_inches="tight")
Expand Down

0 comments on commit 8df26aa

Please sign in to comment.