TemperatureCMB#

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

Bases: object

The trait for computing the cosmological background temperature.

Methods Summary

Tcmb(z)

Compute the CMB temperature at redshift z.

Methods Documentation

Tcmb(z: Quantity | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) Quantity[source]#

Compute the CMB temperature 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:
TcmbQuantity [:ref: ‘temperature’]

The temperature of the CMB.

Examples

>>> import astropy.units as u
>>> from astropy.cosmology import Planck18, units as cu
>>> Planck18.Tcmb(u.Quantity([0.5, 1.0], cu.redshift))
<Quantity [4.08825, 5.451  ] K>
>>> Planck18.Tcmb(u.Quantity(0.5, ''))
<Quantity 4.08825 K>
>>> Planck18.Tcmb(0.5)
<Quantity 4.08825 K>
>>> Planck18.Tcmb([0.5, 1.0])
<Quantity [4.08825, 5.451  ] K>