Skip to content

Commit

Permalink
Correcting cosmology calculator docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
brittonsmith committed Feb 4, 2019
1 parent 0a34a91 commit 2f5921e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions doc/source/analyzing/analysis_modules/cosmology_calculator.rst
Expand Up @@ -15,7 +15,8 @@ in the following way:
from yt.utilities.cosmology import Cosmology
co = Cosmology(hubble_constant=0.7, omega_matter=0.3,
omega_lambda=0.7, omega_curvature=0.0)
omega_lambda=0.7, omega_curvature=0.0,
omega_radiation=0.0)
Once created, various distance calculations as well as conversions between
redshift and time are available:
Expand All @@ -24,8 +25,7 @@ redshift and time are available:

from yt.utilities.cosmology import Cosmology

co = Cosmology(hubble_constant=0.7, omega_matter=0.3,
omega_lambda=0.7, omega_curvature=0.0)
co = Cosmology()

# Hubble distance (c / h)
print("hubble distance", co.hubble_distance())
Expand All @@ -51,7 +51,7 @@ redshift and time are available:
# time between two redshifts
print("lookback time", co.lookback_time(0, 0.5).in_units("Gyr"))

# age of the Universe at a given redshift
# inverse of the Hubble parameter at a given redshift
print("hubble time", co.hubble_time(0).in_units("Gyr"))

# critical density
Expand All @@ -64,7 +64,7 @@ redshift and time are available:
my_t = co.quan(8, "Gyr")
print("z from t", co.z_from_t(my_t))

# convert redshift to time after Big Bang (same as Hubble time)
# convert redshift to time after Big Bang
print("t from z", co.t_from_z(0.5).in_units("Gyr"))

.. warning::
Expand All @@ -76,8 +76,7 @@ redshift and time are available:
x, x.to("Mpc") and x.to("Mpccm") will be the same. The user should take
care to understand which reference frame is correct for the given calculation.

All of the above
functions accept scalar values and arrays. The helper functions, `co.quan`
The helper functions, `co.quan`
and `co.arr` exist to create unitful `YTQuantities` and `YTArray` with the
unit registry of the cosmology calculator. For more information on the usage
and meaning of each calculation, consult the reference documentation at
Expand Down

0 comments on commit 2f5921e

Please sign in to comment.