API

Cosmos.MaybeType

Useful alias for type definition. To prevent conflicts, this is not exported.

source
Cosmos.AbstractDistanceMeasureType

Abstract supertype for distance measurements. Sub-types include:

  • DistanceComoving
  • DistanceLightTravel
  • DistanceAngularDiameter
  • DistanceComovingTransverse
  • DistanceLuminosity
source
Cosmos.CosmologicalModelType

General struct to hold a Cosmology.jl object of type AbstractCosmology. It exposes the relevant cosmological parameters and adds new ones. The equation of state follows the Chevallier-Polarski-Linder parametrisation: "Accelerating Universes with Scaling Dark Matter" M. Chevallier and D. Polarski International Journal of Modern Physics D 10 (2001) 213. https://arxiv.org/abs/gr-qc/0009008 https://doi.org/10.1142/S0218271801000822 "Exploring the Expansion History of the Universe" E. Linder Physical Review Letters 90 (2003) 091301. https://doi.org/10.1103/PhysRevLett.90.091301

The default constructors can be built using only the first 3 or 4 parameters.

Members

  • Ωb [T]: baryon density parameter (set to -1 if unavailable)
  • Tcmb [T]: CMB temperature at present time in Kelvin (defaults to 2.7255 K, following Planck)
  • [T]: number of effective neutrino species (defaults to 3)
  • wEOSΛ [SVector{2, T}]: equation-of-state parameters for dark energy: $w(a) = w_0 + w_a (1 - a)$; set to $(-1, 0)$ for ΛCDM
  • cosmology [C]: underlying Cosmology.jl object (concrete type, e.g. FlatLCDM{T})
  • fromRedshift [FF]: named tuple of concrete closures (z2, z1) -> distance/time (keys: :comoving, :lightTravel, :luminosity, :transverseComoving, :angularDiameter, :lookback, :conformal)
  • toRedshift [TF]: named tuple of concrete closures distance/time -> z (same keys)

Indirect members

  • h: the dimensionless Hubble parameter, delegated to the underlying cosmology field
  • ΩΛ: the dark energy density parameter, delegated to the underlying cosmology field
  • Ωm: the matter density parameter, delegated to the underlying cosmology field
  • Ωr: the radiation density parameter, delegated to the underlying cosmology field
  • Ωk: the curvature density parameter, delegated to the underlying cosmology field (returns 0 for flat cosmologies)

Examples

# define parameters
Tcmb = 2.7255
h = 0.69
ΩΛ = 0.7099
Ωk = 0.
Ωm = 0.29
Ωr = 1. - ΩΛ - Ωk - Ωm
Nν = 3.04

# some constructors
cosmo1 = CosmologicalModel(Cosmology.FlatLCDM{Float64}(h, ΩΛ, Ωm, Ωr); Nν = Nν, Tcmb = Tcmb)
cosmo2 = CosmologicalModel(h, Ωm; Tcmb = Tcmb,  Nν = Nν) # assumes Ωr = 0
cosmo3 = CosmologicalModel(h, Ωm, Ωk; Tcmb = Tcmb,  Nν = Nν) # if geometry is not flat and Ωr = 0
cosmo4 = CosmologicalModel(h, Ωm, Ωk, Ωr; Tcmb = Tcmb,  Nν = Nν) # includes radiation and non-flat geometry 

To do

. Consider taking Unitful quantities.

source
Cosmos.DistanceAngularDiameterType

Convenient object to help with distance measures conversions. The angular diameter distance is the ratio of an object's transverse length to its angular size. It relates to the transverse comoving distance in the following way: da = dm / (1 + z)

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • d [Length{T}]: the distance
source
Cosmos.DistanceAngularDiameterMethod

Constructor for DistanceAngularDiameter{D} from Cosmos.DistanceComovingTransverse. It essentially convert from Cosmos.DistanceComovingTransverse to DistanceAngularDiameter. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceAngularDiameterMethod

Constructor for DistanceAngularDiameter{D} from DistanceComoving. It essentially convert from DistanceComoving to DistanceAngularDiameter. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceAngularDiameterMethod

Constructor for DistanceAngularDiameter{D} from DistanceLightTravel. It essentially convert from DistanceLightTravel to DistanceAngularDiameter. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceAngularDiameterMethod

Constructor for DistanceAngularDiameter{D} from DistanceLuminosity. It essentially convert from DistanceLuminosity to DistanceAngularDiameter. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingType

Convenient object to help with distance measures conversions. The comoving distance is the distance between any two points in the reference frame of the Hubble flow. It is defined as: dc = RH ∫ dz / E(z) between any two points z1 and z2.

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • d [Length{T}]: the distance
source
Cosmos.DistanceComovingMethod

Constructor for DistanceComoving{D} from Cosmos.DistanceComovingTransverse. It essentially convert from Cosmos.DistanceComovingTransverse to DistanceComoving. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingMethod

Constructor for DistanceComoving{D} from DistanceAngularDiameter. It essentially convert from DistanceAngularDiameter to DistanceComoving. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingMethod

Constructor for DistanceComoving{D} from DistanceLightTravel. It essentially convert from DistanceLightTravel to DistanceComoving. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingMethod

Constructor for DistanceComoving{D} from DistanceLuminosity. It essentially convert from DistanceLuminosity to DistanceComoving. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingTransverseType

Convenient object to help with distance measures conversions. For two objects at the same redshift separated by a given angle, the transverse comoving distance depends on the curvature: dm = dc if Ωk=0 dm = RH sinh(sqrt(|Ωk|) dc / RH) / sqrt(|Ωk|) otherwise

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • d [Length{T}]: the distance
source
Cosmos.DistanceComovingTransverseMethod

Constructor for Cosmos.DistanceComovingTransverse{D} from DistanceAngularDiameter. It essentially convert from DistanceAngularDiameter to Cosmos.DistanceComovingTransverse. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingTransverseMethod

Constructor for Cosmos.DistanceComovingTransverse{D} from DistanceComoving. It essentially convert from DistanceComoving to Cosmos.DistanceComovingTransverse. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingTransverseMethod

Constructor for Cosmos.DistanceComovingTransverse{D} from DistanceLightTravel. It essentially convert from DistanceLightTravel to Cosmos.DistanceComovingTransverse. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceComovingTransverseMethod

Constructor for Cosmos.DistanceComovingTransverse{D} from DistanceLuminosity. It essentially convert from DistanceLuminosity to Cosmos.DistanceComovingTransverse. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLightTravelType

Convenient object to help with distance measures conversions. The light-travel distance corresponds to the time light from a given object would take to reach an observer.

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • d [Length{T}]: the distance
source
Cosmos.DistanceLightTravelMethod

Constructor for DistanceLightTravel{D} from Cosmos.DistanceComovingTransverse. It essentially convert from Cosmos.DistanceComovingTransverse to DistanceLightTravel. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLightTravelMethod

Constructor for DistanceLightTravel{D} from DistanceAngularDiameter. It essentially convert from DistanceAngularDiameter to DistanceLightTravel. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLightTravelMethod

Constructor for DistanceLightTravel{D} from DistanceComoving. It essentially convert from DistanceComoving to DistanceLightTravel. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLightTravelMethod

Constructor for DistanceLightTravel{D} from DistanceLuminosity. It essentially convert from DistanceLuminosity to DistanceLightTravel. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLuminosityType

Convenient object to help with distance measures conversions. The luminosity distance is related to the flux (Φ) and the bolometric luminosity (L) as: d_L = sqrt(L / 4πΦ).

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • d [Length{T}]: the distance
source
Cosmos.DistanceLuminosityMethod

Constructor for DistanceLuminosity{D} from Cosmos.DistanceComovingTransverse. It essentially convert from Cosmos.DistanceComovingTransverse to DistanceLuminosity. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLuminosityMethod

Constructor for DistanceLuminosity{D} from DistanceAngularDiameter. It essentially convert from DistanceAngularDiameter to DistanceLuminosity. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLuminosityMethod

Constructor for DistanceLuminosity{D} from DistanceComoving. It essentially convert from DistanceComoving to DistanceLuminosity. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.DistanceLuminosityMethod

Constructor for DistanceLuminosity{D} from DistanceLightTravel. It essentially convert from DistanceLightTravel to DistanceLuminosity. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.RedshiftConversionType
RedshiftConversion{C, T, F}

Callable struct encoding one redshift-to-observable conversion. Storing the specific Cosmology.jl function as the concrete type parameter F avoids heap-allocated closures and enables full inlining.

Members

  • cosmo [C]: the underlying AbstractCosmology object
  • f [F]: a top-level function (cosmo, z2, z1) -> observable
source
Cosmos.TimeConformalType

Convenient object to help with time measures conversions. The conformal time is the time in the frame of the Hubble flow. It is defined as: t_c = ∫ dt / a(t) between any two points z1 and z2.

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • t [Time{T}]: the time
source
Cosmos.TimeConformalMethod
convert(TimeType, time)

Type conversion from TimeLookback to TimeConformal. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.TimeLookbackType

Convenient object to help with time measures conversions. The lookback time corresponds to the time difference between the universe's age at two redshifts. tl = tH ∫ dz / E(z) / (1 + z) between any two points z1 and z2.

For more information see: "Distance measures in cosmology" D. Hogg arXiv:astro-ph/9905116

Input

  • cosmology [CosmologicalModel]: the cosmological model to be used as reference
  • t [Time{T}]: the time
source
Cosmos.TimeLookbackMethod
convert(TimeType, time)

Type conversion from TimeConformal to TimeLookback. It ultimately enables conversion implicit conversions and the usage of the operator |>.

source
Cosmos.UnitInterpolationType
UnitInterpolation{I, U}

Callable struct pairing a monotonic interpolation object with a Unitful unit for input normalisation. Calling with a bare Real forwards the value directly to the interpolation (must already be expressed in the correct SI unit). Calling with a Unitful.Quantity first converts to unit, strips, then forwards.

Members

  • interp [I]: the underlying monotonic interpolation object
  • unit [U]: Unitful unit used to normalise Quantity inputs (e.g. u"m", u"s")
source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from Cosmos.DistanceComovingTransverse to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from DistanceAngularDiameter to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from DistanceComoving to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from DistanceLightTravel to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from DistanceLuminosity to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from TimeConformal to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(ScaleFactor, distance)

Type conversion from TimeLookback to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceAngularDiameter to Cosmos.DistanceComovingTransverse. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceComoving to Cosmos.DistanceComovingTransverse. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLightTravel to Cosmos.DistanceComovingTransverse. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLuminosity to Cosmos.DistanceComovingTransverse. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from Cosmos.DistanceComovingTransverse to DistanceAngularDiameter. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceComoving to DistanceAngularDiameter. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLightTravel to DistanceAngularDiameter. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLuminosity to DistanceAngularDiameter. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from Cosmos.DistanceComovingTransverse to DistanceComoving. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceAngularDiameter to DistanceComoving. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLightTravel to DistanceComoving. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLuminosity to DistanceComoving. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from Cosmos.DistanceComovingTransverse to DistanceLightTravel. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceAngularDiameter to DistanceLightTravel. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceComoving to DistanceLightTravel. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLuminosity to DistanceLightTravel. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from Cosmos.DistanceComovingTransverse to DistanceLuminosity. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceAngularDiameter to DistanceLuminosity. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceComoving to DistanceLuminosity. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversion from DistanceLightTravel to DistanceLuminosity. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume distances with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to Cosmos.DistanceComovingTransverse. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to Cosmos.DistanceComovingTransverse. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to DistanceAngularDiameter. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to DistanceAngularDiameter. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to DistanceComoving. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to DistanceComoving. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to DistanceLightTravel. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to DistanceLightTravel. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to DistanceLuminosity. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to DistanceLuminosity. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to TimeConformal. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to TimeConformal. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, redshift, cosmology)
convert(DistanceAngularDiameter, redshift, cosmology)
convert(DistanceLightTravel, redshift, cosmology)
convert(DistanceComovingTransverse, redshift, cosmology)
convert(DistanceLuminosity, redshift, cosmology)

Type conversion from Redshift to TimeLookback. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceComoving, scaleFactor, cosmology)
convert(DistanceAngularDiameter, scaleFactor, cosmology)
convert(DistanceLightTravel, scaleFactor, cosmology)
convert(DistanceComovingTransverse, scaleFactor, cosmology)
convert(DistanceLuminosity, scaleFactor, cosmology)

Type conversion from ScaleFactor to TimeLookback. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(TimeType, time)

Type conversion from TimeLookback to TimeConformal. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume times with respect to present time (z=0).

source
Base.convertMethod
convert(TimeType, time)

Type conversion from TimeConformal to TimeLookback. This function performs no type checks. It assumes that the underlying CosmologicalModel is the same for both. These conversions assume times with respect to present time (z=0).

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for Cosmos.DistanceComovingTransverse. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for DistanceAngularDiameter. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for DistanceComoving. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for DistanceLightTravel. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for DistanceLuminosity. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for TimeConformal. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod
convert(DistanceType, distance)

Type conversions for TimeLookback. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.

source
Base.convertMethod

Useful extensions of Cosmology.jlto enable type conversion related toCosmology.ClosedLCDM`.

source
Base.convertMethod

Useful extensions of Cosmology.jlto enable type conversion related toCosmology.ClosedWCDM`.

source
Base.convertMethod

Useful extensions of Cosmology.jlto enable type conversion related toCosmology.FlatLCDM`.

source
Base.convertMethod

Useful extensions of Cosmology.jlto enable type conversion related toCosmology.FlatWCDM`.

source
Base.convertMethod

Useful extensions of Cosmology.jlto enable type conversion related toCosmology.OpenLCDM`.

source
Base.convertMethod

Useful extensions of Cosmology.jlto enable type conversion related toCosmology.OpenWCDM`.

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from Cosmos.DistanceComovingTransverse to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from DistanceAngularDiameter to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from DistanceComoving to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from DistanceLightTravel to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from DistanceLuminosity to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from TimeConformal to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.convertMethod
convert(Redshift, distance)

Type conversion from TimeLookback to Redshift. These conversions assume distances/times with respect to present time (z=0).

source
Base.eltypeMethod

Get the underlying data type of an AbstractCosmology object (from Cosmology.jl).

source
Base.eltypeMethod

Get type of values contained in CosmologicalModel object.

source
Base.getpropertyMethod
getproperty(cosmology, name)

Property access for CosmologicalModel. The fields h, ΩΛ, Ωm, Ωr, Ωk are not stored directly; they are delegated to the underlying cosmology field to avoid data duplication. Accessing them in a tight loop is fine; for absolute maximum performance use cosmology.cosmology.h etc. to bypass dispatch.

source
Base.showMethod
@show(io, cosmology)
print(io, cosmology)
println(io, cosmology)

Display information of CosmologicalModel types.

Input

  • io [IO]: IO-type objects with standard output
  • cosmology [CosmologicalModel]: the cosmological model object
source
Base.showMethod
@show(io, d)
print(io, d)
println(io, d)

Display information about AbstractDistanceMeasure types. Note that distances are cosmology-dependent, but this information is not displayed.

Input

  • io [IO]: IO-type objects with standard output
  • d [AbstractDistanceMeasure]: a distance object
source
Base.showMethod
@show(io, t)
print(io, t)
println(io, t)

Display information about AbstractTimeMeasure types. Note that times are cosmology-dependent, but this information is not displayed.

Input

  • io [IO]: IO-type objects with standard output
  • t [AbstractTimeMeasure]: the time measure
source
Base.showMethod
@show(io, z)
print(io, z)
println(io, z)

Display information of Redshift types.

Input

  • io [IO]: IO-type objects with standard output
  • z [Redshift]: the redshift
source
Base.showMethod
@show(io, a)
print(io, a)
println(io, a)

Display information about ScaleFactor types.

Input

  • io [IO]: IO-type objects with standard output
  • a [ScaleFactor]: the scale factor
source
Cosmos.CosmologyPlanckMethod
CosmologyPlanck()

Convenience constructor for the Planck 2018 cosmological parameters (TT,TE,EE+lowE+lensing).

Reference

"Planck 2018 results. VI. Cosmological parameters" Planck Collaboration Astronomy and Astrophysics 641 (2020) A6 arXiv:1807.06209 doi:10.1051/0004-6361/201833910 bibkey: planck2020a

source
Cosmos.ageOfUniverseMethod
ageOfUniverse(cosmo)
ageOfUniverse(cosmo, z)

Computes the Hubble distance for a given cosmology and possibly at a given redshift.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.comovingElementMethod
comovingElement(cosmology, z)
comovingElement(cosmology, a)

Calculates the comoving line element at a given redshift. This is Hogg's eq. 28 adjusted.

\[\frac{\mathrm{d} \ell}{\mathrm{d}z} = \frac{c}{H(z)} \frac{1}{E(z)}\]

NOTE: check nomenclature.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
  • z [Redshift]: the redshift (of type Redshift)
  • a [ScaleFactor]: the scale factor type
source
Cosmos.comovingVolumeMethod
comovingVolume(cosmology, z)

Calculates the comoving volume at a given redshift.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.comovingVolumeElementMethod
comovingVolumeElement(cosmology, z)

Calculates the comoving volume element at a given redshift.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.computeBaryonDensityMethod
computeBaryonDensity(cosmology; z = 0.)

Computes the density of matter in the universe at a given redshift:

\[ \rho_\text{b} = \Omega_\text{b} \rho_\text{c}\]

Input

  • cosmology [CosmologicalModel]: the cosmological model of interest
  • z [Real]: the redshift at which to compute the density
source
Cosmos.computeCriticalDensityMethod
computeCriticalDensity(cosmology; z = 0.)

Computes the critical density of the universe at a given redshift:

\[ \rho_\text{c} = 3 \dfrac{3 H^2(z)}{8 \pi G}\]

Input

  • cosmology [CosmologicalModel]: the cosmological model of interest
  • z [Real]: the redshift at which to compute the density
source
Cosmos.computeCurvatureDensityMethod
computeCurvatureDensity(cosmology; z = 0.)

Computes the density of matter in the universe at a given redshift:

\[ \rho_\text{k} = \Omega_\text{k} \rho_\text{c}\]

Input

  • cosmology [CosmologicalModel]: the cosmological model of interest
  • z [Real]: the redshift at which to compute the density
source
Cosmos.computeDarkEnergyDensityMethod
computeDarkEnergyDensity(cosmology; z = 0.)

Computes the density of matter in the universe at a given redshift:

\[ \rho_\text{\Lambda} = \Omega_\Lambda \rho_\text{c}\]

Input

  • cosmology [CosmologicalModel]: the cosmological model of interest
  • z [Real]: the redshift at which to compute the density
source
Cosmos.computeMatterDensityMethod
computeMatterDensity(cosmology; z = 0.)

Computes the density of matter in the universe at a given redshift:

\[ \rho_\text{m} = \Omega_\text{m} \rho_\text{c}\]

Input

  • cosmology [CosmologicalModel]: the cosmological model of interest
  • z [Real]: the redshift at which to compute the density
source
Cosmos.computeRadiationDensityMethod
computeRadiationDensity(cosmology; z = 0.)

Computes the density of matter in the universe at a given redshift:

\[ \rho_\text{r} = \Omega_\text{r} \rho_\text{c}\]

Input

  • cosmology [CosmologicalModel]: the cosmological model of interest
  • z [Real]: the redshift at which to compute the density
source
Cosmos.hubbleConstantMethod
hubbleConstant(cosmology, z)

Compute the present-day Hubble constant.

Input

  • cosmo [CosmologicalModel]: the cosmological model
source
Cosmos.hubbleDistanceMethod
hubbleDistance(cosmo)
hubbleDistance(cosmo, z)

Computes the Hubble distance for a given cosmology and possibly at a given redshift.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.hubbleParameterMethod
hubbleParameter(cosmology, z)

Compute the Hubble parameter H(z).

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.hubbleTimeMethod
hubbleTime(cosmo)
hubbleTime(cosmo, z)

Computes the Hubble distance for a given cosmology and possibly at a given redshift.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.isClosedMethod
isClosed(cosmology)

Determine whether a CosmologicalModel has a closed geometry.

Input

  • cosmology [CosmologicalModel]: the cosmological model
source
Cosmos.isColdMethod
isCold(cosmology)

Determine whether a CosmologicalModel is described by cold dark matter.

Input

  • cosmology [CosmologicalModel]: the cosmological model
source
Cosmos.isFlatMethod
isFlat(cosmology)

Determine whether a CosmologicalModel has a flat geometry.

Input

  • cosmology [CosmologicalModel]: the cosmological model
source
Cosmos.isOpenMethod
isOpen(cosmology)

Determine whether a CosmologicalModel has an open geometry.

Input

  • cosmology [CosmologicalModel]: the cosmological model
source
Cosmos.isWarmMethod
isWarm(cosmology)

Determine whether a CosmologicalModel is described by warm dark matter.

Input

  • cosmology [CosmologicalModel]: the cosmological model
source
Cosmos.scaleFactorMethod
scaleFactor(z)

Compute the scale factor for a given cosmology. This should be the same for all cosmologies, by definition, but passing this argument fixes the correct type.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.scalingFunctionHubbleParameterMethod
scalingFunctionHubbleParameter(cosmology, z)

Compute the scaling function for the Hubble parameter (often dubbed E):

\[E(z) = \frac{H(z)}{H(0)} \sqrt{\Omega_r (1 + z)^4 + \Omega_m (1 + z)^3 + \Omega_k (1 + z)^2 + \Omega_\Lambda}\]

This follows the definition from Peebles 1993 (p. ~310-322), adopted by Hogg, arXiv:astro-ph/9905116.

Input

  • cosmo [CosmologicalModel]: the cosmological model
  • z [Real]: the redshift
source
Cosmos.setDefaultCosmologyMethod

Set the value of the global default cosmological model. This will enable faster function calls. For instances, instead of d = DistanceComovingTransverse(1., cosmology), the second argument will become the default value.

source
Cosmos.@generateDistanceTypeMacro
generateDistanceType(distanceTypeSym, info)

Generate a distance measure type named Distance$(distanceTypeSym) together with all standard constructors and conversions to/from Redshift and ScaleFactor.

Input

  • distanceTypeSym [Symbol]: suffix of the type name, e.g. ComovingDistanceComoving
  • info [String]: description text inserted into the type docstring
source
Cosmos.@generateTimeTypeMacro
generateTimeType(timeTypeSym, info)

Generate a time measure type named Time$(timeTypeSym) together with all standard constructors and conversions to/from Redshift and ScaleFactor.

Input

  • timeTypeSym [Symbol]: suffix of the type name, e.g. LookbackTimeLookback
  • info [String]: description text inserted into the type docstring
source