Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def comovingDistance(self, z_min = 0.0, z_max = 0.0):
- """
- The comoving distance between redshift :math:`z_{min}` and :math:`z_{max}`.
- Either z_min or z_min can be a numpy array; in those cases, the same z_min / z_max is
- applied to all values of the other. If both are numpy arrays, they need to have
- the same dimensions, and the comoving distance returned corresponds to a series of
- different z_min and z_max values.
- Parameters
- -------------------------------------------------------------------------------------------
- zmin: array_like
- Redshift; can be a number or a numpy array.
- zmax: array_like
- Redshift; can be a number or a numpy array.
- Returns
- -------------------------------------------------------------------------------------------
- d: array_like
- The comoving distance in Mpc/h; has the same dimensions as zmin and/or zmax.
- See also
- -------------------------------------------------------------------------------------------
- luminosityDistance: The luminosity distance to redshift z.
- angularDiameterDistance: The angular diameter distance to redshift z.
- """
- d = self._integral_oneOverEz(z_min = z_min, z_max = z_max)
- if self.Ok0 > 0.:
- sqrtOk0 = np.sqrt(self.Ok0)
- d = np.sinh(sqrtOk0*d) / sqrtOk0
- elif self.Ok0 < 0:
- sqrtOk0 = np.sqrt(-self.Ok0)
- d = np.sin(sqrtOk0*d)/sqrtOk0
- d *= constants.C * 1E-7
- return d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement