def redshift(self, age):
"""
Invert the above ``self.age(z)`` formula analytically, to calculate
the redshift corresponding to the given cosmic time (age).
Parameters
----------
age : `~numpy.ndarray`
Age of the universe (i.e., cosmic time)
Unit: [Gyr]
Returns
-------
z : `~numpy.ndarray`
Redshift corresponding to the specified age.
"""
age = np.asarray(age)
t_H = self.hubble_time
term1 = (1/self.Om0) - 1
term2 = np.sinh(3*age * np.sqrt(1-self.Om0) / (2*t_H)) ** 2
z = (term1 / term2) ** (1/3) - 1
return z
评论列表
文章目录