Skip to content

Commit

Permalink
Merge pull request #135 from joezuntz/class-mu
Browse files Browse the repository at this point in the history
Add distance modulus to class
  • Loading branch information
joezuntz authored Aug 14, 2024
2 parents 0095bd3 + 9daac0f commit 7e25149
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion boltzmann/class/class_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def get_class_outputs(block, c, config):
block[distances, 'nz'] = nz

# Save distance samples
block[distances, 'd_l'] = np.array([c.luminosity_distance(zi) for zi in z])
d_l = np.array([c.luminosity_distance(zi) for zi in z])
block[distances, 'd_l'] = d_l
d_a = np.array([c.angular_distance(zi) for zi in z])
block[distances, 'd_a'] = d_a
block[distances, 'd_m'] = d_a * (1 + z)
Expand All @@ -215,6 +216,12 @@ def get_class_outputs(block, c, config):
h_z = np.array([c.Hubble(zi) for zi in z])
block[distances, 'H'] = h_z

mu = np.zeros(z.size)
mu[0] = -np.inf
mu[1:] = 5.0 * np.log10(d_l[1:]) + 25.0
block[distances, 'mu'] = mu


##
# Now the CMB C_ell
##
Expand Down

0 comments on commit 7e25149

Please sign in to comment.