Skip to content

Commit

Permalink
Updated CAMB tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JCGoran committed Jun 26, 2023
1 parent ff14cd1 commit 4eff086
Showing 1 changed file with 0 additions and 53 deletions.
53 changes: 0 additions & 53 deletions tests/test_camb_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,6 @@


class TestCMB:
def test_signal(self):
lmax = 100
cosmo = CambCMBDerivative(
config={
"omch2": 0.121203,
"ombh2": 0.02244,
"H0": 67,
"ns": 0.96,
"omk": 0,
"As": 2e-9,
"nnu": 3.046,
"max_l": lmax,
}
)
signal = cosmo.signal()

c = ClassyCMBDerivative(
config={
"omega_cdm": 0.121203,
"omega_b": 0.02244,
"H0": 67,
"n_s": 0.96,
"Omega_k": 0,
"A_s": 2e-9,
"N_ur": 3.046,
"output": "tCl,pCl",
"l_max_scalars": lmax,
}
)
s = c.signal()

# r = slice(2500, 4000)
r = slice(0, lmax)

s = s[r]
signal = signal[r]

print(signal / s)

fig, ax = plt.subplots(nrows=2, sharex=True)

ax[0].plot(signal, label="CAMB")
ax[0].plot(s, label="CLASS")
ax[0].set_xscale("log")
ax[0].legend()
ax[1].plot(100 * (1 - signal / s))
fig.savefig("camb_vs_class.pdf", dpi=300, bbox_inches="tight")

@pytest.mark.parametrize("lmax", [100, 999])
def test_lmax(self, lmax: int):
cosmo = CambCMBDerivative(
Expand Down Expand Up @@ -95,8 +47,3 @@ def test_fisher_matrix(self):
fm = cosmo.fisher_matrix(*parameters)

assert fm.is_valid()

ff = FisherFigure2D(show_joint_dist=True, show_1d_curves=True)

ff.plot(fm)
ff.savefig("camb_forecast.pdf")

0 comments on commit 4eff086

Please sign in to comment.