API
Cosmos.Maybe — Type
Useful alias for type definition. To prevent conflicts, this is not exported.
Cosmos.defaultCosmologyRef — Constant
Define global variable to hold information about the default cosmological model.
Cosmos.AbstractDistanceMeasure — Type
Abstract supertype for distance measurements. Sub-types include:
DistanceComovingDistanceLightTravelDistanceAngularDiameterDistanceComovingTransverseDistanceLuminosity
Cosmos.AbstractTimeMeasure — Type
Abstract supertype for time measurements. Sub-types include:
TimeLookback,TimeConformal.
Cosmos.CosmologicalModel — Type
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)Nν[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 ΛCDMcosmology[C]: underlyingCosmology.jlobject (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 closuresdistance/time -> z(same keys)
Indirect members
h: the dimensionless Hubble parameter, delegated to the underlyingcosmologyfieldΩΛ: the dark energy density parameter, delegated to the underlyingcosmologyfieldΩm: the matter density parameter, delegated to the underlyingcosmologyfieldΩr: the radiation density parameter, delegated to the underlyingcosmologyfieldΩk: the curvature density parameter, delegated to the underlyingcosmologyfield (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.
Cosmos.DistanceAngularDiameter — Type
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 referenced[Length{T}]: the distance
Cosmos.DistanceAngularDiameter — Method
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 |>.
Cosmos.DistanceAngularDiameter — Method
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 |>.
Cosmos.DistanceAngularDiameter — Method
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 |>.
Cosmos.DistanceAngularDiameter — Method
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 |>.
Cosmos.DistanceComoving — Type
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 referenced[Length{T}]: the distance
Cosmos.DistanceComoving — Method
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 |>.
Cosmos.DistanceComoving — Method
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 |>.
Cosmos.DistanceComoving — Method
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 |>.
Cosmos.DistanceComoving — Method
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 |>.
Cosmos.DistanceComovingTransverse — Type
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 referenced[Length{T}]: the distance
Cosmos.DistanceComovingTransverse — Method
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 |>.
Cosmos.DistanceComovingTransverse — Method
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 |>.
Cosmos.DistanceComovingTransverse — Method
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 |>.
Cosmos.DistanceComovingTransverse — Method
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 |>.
Cosmos.DistanceLightTravel — Type
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 referenced[Length{T}]: the distance
Cosmos.DistanceLightTravel — Method
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 |>.
Cosmos.DistanceLightTravel — Method
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 |>.
Cosmos.DistanceLightTravel — Method
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 |>.
Cosmos.DistanceLightTravel — Method
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 |>.
Cosmos.DistanceLuminosity — Type
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 referenced[Length{T}]: the distance
Cosmos.DistanceLuminosity — Method
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 |>.
Cosmos.DistanceLuminosity — Method
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 |>.
Cosmos.DistanceLuminosity — Method
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 |>.
Cosmos.DistanceLuminosity — Method
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 |>.
Cosmos.Redshift — Type
Convenient object to handle redshifts.
Cosmos.RedshiftConversion — Type
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 underlyingAbstractCosmologyobjectf[F]: a top-level function(cosmo, z2, z1) -> observable
Cosmos.ScaleFactor — Type
Convenient object to handle scale factors.
Cosmos.TimeConformal — Type
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 referencet[Time{T}]: the time
Cosmos.TimeConformal — Method
convert(TimeType, time)Type conversion from TimeLookback to TimeConformal. It ultimately enables conversion implicit conversions and the usage of the operator |>.
Cosmos.TimeLookback — Type
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 referencet[Time{T}]: the time
Cosmos.TimeLookback — Method
convert(TimeType, time)Type conversion from TimeConformal to TimeLookback. It ultimately enables conversion implicit conversions and the usage of the operator |>.
Cosmos.UnitInterpolation — Type
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 objectunit[U]: Unitful unit used to normaliseQuantityinputs (e.g.u"m",u"s")
Base.:(==) — Method
Object equality comparison.
Base.:(==) — Method
Operations with Redshift.
Base.:(==) — Method
Operations with ScaleFactor.
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from Cosmos.DistanceComovingTransverse to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from DistanceAngularDiameter to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from DistanceComoving to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from DistanceLightTravel to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from DistanceLuminosity to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from TimeConformal to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(ScaleFactor, distance)Type conversion from TimeLookback to ScaleFactor. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
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).
Base.convert — Method
convert(DistanceType, distance)Type conversions for Cosmos.DistanceComovingTransverse. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
convert(DistanceType, distance)Type conversions for DistanceAngularDiameter. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
convert(DistanceType, distance)Type conversions for DistanceComoving. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
convert(DistanceType, distance)Type conversions for DistanceLightTravel. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
convert(DistanceType, distance)Type conversions for DistanceLuminosity. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
convert(DistanceType, distance)Type conversions for TimeConformal. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
convert(DistanceType, distance)Type conversions for TimeLookback. This enables conversions between different distance measures (DistanceLightTravel, DistanceComoving, etc.) and the usage of the operator |>.
Base.convert — Method
Type conversion.
Base.convert — Method
Useful extensions of Cosmology.jlto enable type conversion related toCosmology.ClosedLCDM`.
Base.convert — Method
Useful extensions of Cosmology.jlto enable type conversion related toCosmology.ClosedWCDM`.
Base.convert — Method
Useful extensions of Cosmology.jlto enable type conversion related toCosmology.FlatLCDM`.
Base.convert — Method
Useful extensions of Cosmology.jlto enable type conversion related toCosmology.FlatWCDM`.
Base.convert — Method
Useful extensions of Cosmology.jlto enable type conversion related toCosmology.OpenLCDM`.
Base.convert — Method
Useful extensions of Cosmology.jlto enable type conversion related toCosmology.OpenWCDM`.
Base.convert — Method
convert(Redshift, distance)Type conversion from Cosmos.DistanceComovingTransverse to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(Redshift, distance)Type conversion from DistanceAngularDiameter to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(Redshift, distance)Type conversion from DistanceComoving to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(Redshift, distance)Type conversion from DistanceLightTravel to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(Redshift, distance)Type conversion from DistanceLuminosity to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(Redshift, distance)Type conversion from TimeConformal to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.convert — Method
convert(Redshift, distance)Type conversion from TimeLookback to Redshift. These conversions assume distances/times with respect to present time (z=0).
Base.eltype — Method
Get the underlying data type of an AbstractCosmology object (from Cosmology.jl).
Base.eltype — Method
Get type of values contained in CosmologicalModel object.
Base.eltype — Method
eltype(redshift)
eltype(scaleFactor)Get data type.
Base.getproperty — Method
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.
Base.promote_rule — Method
Promotion rules.
Base.promote_rule — Method
Useful extensions of Cosmology.jl implementing promotion rules.
Base.promote_rule — Method
Useful extensions of Cosmology.jl implementing promotion rules.
Base.promote_rule — Method
Useful extensions of Cosmology.jl implementing promotion rules.
Base.promote_rule — Method
Useful extensions of Cosmology.jl implementing promotion rules.
Base.promote_rule — Method
Useful extensions of Cosmology.jl implementing promotion rules.
Base.promote_rule — Method
Useful extensions of Cosmology.jl implementing promotion rules.
Base.show — Method
@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 outputd[AbstractDistanceMeasure]: a distance object
Cosmos.CosmologyPlanck — Method
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
Cosmos.ageOfUniverse — Method
ageOfUniverse(cosmo)
ageOfUniverse(cosmo, z)Computes the Hubble distance for a given cosmology and possibly at a given redshift.
Input
cosmo[CosmologicalModel]: the cosmological modelz[Real]: the redshift
Cosmos.comovingElement — Method
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 modelz[Real]: the redshiftz[Redshift]: the redshift (of typeRedshift)a[ScaleFactor]: the scale factor type
Cosmos.comovingVolume — Method
comovingVolume(cosmology, z)Calculates the comoving volume at a given redshift.
Input
cosmo[CosmologicalModel]: the cosmological modelz[Real]: the redshift
Cosmos.comovingVolumeElement — Method
comovingVolumeElement(cosmology, z)Calculates the comoving volume element at a given redshift.
Input
cosmo[CosmologicalModel]: the cosmological modelz[Real]: the redshift
Cosmos.computeBaryonDensity — Method
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 interestz[Real]: the redshift at which to compute the density
Cosmos.computeCriticalDensity — Method
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 interestz[Real]: the redshift at which to compute the density
Cosmos.computeCurvatureDensity — Method
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 interestz[Real]: the redshift at which to compute the density
Cosmos.computeDarkEnergyDensity — Method
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 interestz[Real]: the redshift at which to compute the density
Cosmos.computeMatterDensity — Method
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 interestz[Real]: the redshift at which to compute the density
Cosmos.computeRadiationDensity — Method
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 interestz[Real]: the redshift at which to compute the density
Cosmos.hubbleConstant — Method
hubbleConstant(cosmology, z)Compute the present-day Hubble constant.
Input
cosmo[CosmologicalModel]: the cosmological model
Cosmos.hubbleDistance — Method
hubbleDistance(cosmo)
hubbleDistance(cosmo, z)Computes the Hubble distance for a given cosmology and possibly at a given redshift.
Input
cosmo[CosmologicalModel]: the cosmological modelz[Real]: the redshift
Cosmos.hubbleParameter — Method
hubbleParameter(cosmology, z)Compute the Hubble parameter H(z).
Input
cosmo[CosmologicalModel]: the cosmological modelz[Real]: the redshift
Cosmos.hubbleTime — Method
hubbleTime(cosmo)
hubbleTime(cosmo, z)Computes the Hubble distance for a given cosmology and possibly at a given redshift.
Input
cosmo[CosmologicalModel]: the cosmological modelz[Real]: the redshift
Cosmos.isClosed — Method
isClosed(cosmology)Determine whether a CosmologicalModel has a closed geometry.
Input
cosmology[CosmologicalModel]: the cosmological model
Cosmos.isCold — Method
isCold(cosmology)Determine whether a CosmologicalModel is described by cold dark matter.
Input
cosmology[CosmologicalModel]: the cosmological model
Cosmos.isFlat — Method
isFlat(cosmology)Determine whether a CosmologicalModel has a flat geometry.
Input
cosmology[CosmologicalModel]: the cosmological model
Cosmos.isOpen — Method
isOpen(cosmology)Determine whether a CosmologicalModel has an open geometry.
Input
cosmology[CosmologicalModel]: the cosmological model
Cosmos.isWarm — Method
isWarm(cosmology)Determine whether a CosmologicalModel is described by warm dark matter.
Input
cosmology[CosmologicalModel]: the cosmological model
Cosmos.scaleFactor — Method
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 modelz[Real]: the redshift
Cosmos.scalingFunctionHubbleParameter — Method
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 modelz[Real]: the redshift
Cosmos.setDefaultCosmology — Method
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.
Cosmos.@generateDistanceType — Macro
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.Comoving→DistanceComovinginfo[String]: description text inserted into the type docstring
Cosmos.@generateTimeType — Macro
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.Lookback→TimeLookbackinfo[String]: description text inserted into the type docstring