rename helper function from angularDiameter to comovingDistance since that's what it actually is

This commit is contained in:
Paul M. Sutter 2024-06-05 23:16:21 +02:00
parent f59fee9bf8
commit 03c8f773b6
3 changed files with 34 additions and 28 deletions

View file

@ -25,7 +25,7 @@ import scipy.integrate as integrate
import os
from backend import *
__all__=['expansion', 'angularDiameter', 'aveExpansion']
__all__=['expansion', 'comovingDistance', 'aveExpansion']
# returns 1/E(z) for the given cosmology
def expansion(z, Om = 0.27, Ot = 1.0, w0 = -1.0, wa = 0.0):
@ -38,8 +38,8 @@ def expansion(z, Om = 0.27, Ot = 1.0, w0 = -1.0, wa = 0.0):
def eosDE(z, w0 = -1.0, wa = 0.0):
return w0 + wa*z/(1+z)
# returns D_A(z) for the given cosmology
def angularDiameter(z, Om = 0.27, Ot = 1.0, w0 = -1.0, wa = 0.0):
# returns the comoving distance for the given cosmology
def comovingDistance(z, Om = 0.27, Ot = 1.0, w0 = -1.0, wa = 0.0):
da = integrate.quad(expansion, 0.0, z, args=(Om, Ot, w0, wa))[0]
return da