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

. h [Real]: dimensionless Hubble constant
. Ωm [Real]: matter density
. Ωr [Real]: radiation density
. Ωk [Real]: curvature density
. ΩΛ [Real]: dark energy density
. Ωb [Real]: baryon density (set to -1 if unavailable)
. [Real]: number of effective neutrino species (defaults to 3)
. Tcmb [Real]: CMB temperature at present time (defaults to 2.7255 K, following Planck)
. wEOSΛ [NTuple{2, Real}]: tuple with parameters of the equation of state for dark energy: w = w_0 + w_a (1 - a)
. cosmology [AbstractCosmology]: object fromCosmology.jl`
. toRedshift [Dict{Symbol, Function}]: functions to convert distance/time to redshift (:comoving, :lightTravel, :angularDiameter,:transverseComoving, :luminosity, :lookback, :conformal)
. fromRedshift::Dict{Symbol, Function}: functions to convert distance/time from redshift (:comoving, :lightTravel, :angularDiameter, :transverseComoving, :luminosity, :lookback, :conformal)
. zArray [Vector{T}]: array of values of redshift to build distance/time conversion functions; if nothing defaults to built-in values

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.
. Should this struct be immutable?

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. This 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.TimeConformalType

Convenient object to help with time measures conversions. This 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 distance corresponds to the time difference between the universe's age at t2 and t1. tl = tH ∫ dz / E(z) / (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
. 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
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 type of values contained in CosmologicalModel object.

source
Base.eltypeMethod

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

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

Latest Planck's cosmology. This is based on: "Planck 2018 results. VI. Cosmological parameters" Planck Collaboration Astronomy and Astrophysics 641 (2020) A6. https://arxiv.org/abs/1807.06209 https://doi.org/10.1051/0004-6361/201833910

Input

. T::Type: type of the data (defaults to Float64)

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.

\[ rac{d ll}{dz} = rac{c}{H(z)} rac{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.conversionsFromRedshiftMethod

Helper function (unexported) to iniatilise conversions of distance or time to/from redshift.

To do

. Consider speeding up building this function using @threads

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

. cosmol::CosmologicalModel: the cosmological model

source
Cosmos.isColdMethod
isCold(cosmology)

Determine whether a CosmologicalModel is described by cold dark matter.

Input

. cosmol::CosmologicalModel: the cosmological model

source
Cosmos.isFlatMethod
isFlat(cosmology)

Determine whether a CosmologicalModel has a flat geometry.

Input

. cosmol::CosmologicalModel: the cosmological model

source
Cosmos.isOpenMethod
isOpen(cosmology)

Determine whether a CosmologicalModel has an open geometry.

Input

. cosmol::CosmologicalModel: the cosmological model

source
Cosmos.isWarmMethod
isWarm(cosmology)

Determine whether a CosmologicalModel is described by warm dark matter.

Input

. cosmol::CosmologicalModel: the cosmological model

source
Cosmos.prepareRedshiftSamplesMethod
prepareRedshiftSamples(T::Type{<: Real})

Prepare a set of redshift samples for cosmological calculations. This function generates a range of redshift values, including negative, small, and large redshifts, to cover a wide range of cosmological scenarios. The redshift values are returned as a unique array of type T.

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