Skip to content

Commit 7912fdc

Browse files
committed
fixed also snippet in the docs showing EBL abosrption
1 parent bfe283b commit 7912fdc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/snippets/ebl_models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77

88

99
# redshift and array of frequencies over which to evaluate the absorption
10-
z = 1
11-
nu = np.logspace(15, 25) * u.Hz
12-
10+
z = 0.5
11+
nu = np.logspace(15, 28, 200) * u.Hz
12+
E = nu.to("eV", equivalencies=u.spectral())
1313

1414
load_mpl_rc()
1515

1616
for model in ["franceschini", "dominguez", "finke", "saldana-lopez"]:
1717
ebl = EBL(model)
1818
absorption = ebl.absorption(z, nu)
19-
plt.loglog(nu, absorption, label=model)
19+
plt.loglog(E, absorption, label=model)
2020

21-
plt.xlabel(r"$\nu\,/\,{Hz}$")
21+
plt.xlabel(r"$E\,/\,{\rm eV}$")
2222
plt.title("EBL absorption at z=1")
2323
plt.ylabel("absorption")
24+
plt.ylim([1e-4, 2])
2425
plt.legend()
25-
plt.ylim([1e-5, 2])
2626
plt.show()

0 commit comments

Comments
 (0)