CurvatureComponent#

class astropy.cosmology.traits.CurvatureComponent[source]#

Bases: object

The object has attributes and methods related to the global curvature.

This is a trait class; it is not meant to be instantiated directly, but instead to be used as a mixin to other classes.

Attributes Summary

Ok0

Omega curvature; the effective curvature density/critical density at z=0.

is_flat

Return bool; True if the cosmology is globally flat.

Methods Summary

Ok(z)

Return the equivalent density parameter for curvature at redshift z.

Attributes Documentation

Ok0#

Omega curvature; the effective curvature density/critical density at z=0.

is_flat#

Return bool; True if the cosmology is globally flat.

Methods Documentation

Ok(z)[source]#

Return the equivalent density parameter for curvature at redshift z.

Parameters:
zQuantity-like [‘redshift’], numpy:array_like

Input redshift.

Changed in version 7.0: Passing z as a keyword argument is deprecated.

Returns:
Okndarray

The equivalent density parameter for curvature at each redshift.

Changed in version 7.2: Always returns a numpy object, never a float.

Examples

>>> import numpy as np
>>> from astropy.cosmology import Planck18, units as cu
>>> Planck18.Ok(2)
array(0.)
>>> Planck18.Ok([1, 2])
array([0., 0.])
>>> Planck18.Ok(np.array([2]))
array([0.])
>>> Planck18.Ok(2 * cu.redshift)
array(0.)
>>> cosmo = Planck18.clone(Ode0=0.71, to_nonflat=True)
>>> cosmo.Ok0
np.float64(-0.021153694455455927)
>>> cosmo.Ok(100)
np.float64(-0.0006557825253017665)