Skip to main content
`Ctrl`+`K`

# ScaleFactor

class astropy.cosmology.traits.ScaleFactor

  Bases: `object`

  The trait for computing the cosmological scale factor.

  The scale factor is defined as \(a = a_0 / (1 + z)\).

  Attributes Summary

  `scale_factor0` | Scale factor at redshift 0.

  Methods Summary

  `scale_factor`(z, /) | Compute the scale factor at redshift `z`.

  Attributes Documentation

  scale_factor0

    Scale factor at redshift 0.

    The scale factor is defined as \(a = a_0 / (1 + z)\). The common convention is to set \(a_0 = 1\). However, in some cases, like in some old CMB papers, \(a_0\) is used to normalize `a` to be a convenient number at the redshift of interest for that paper. Explicitly using \(a_0\) in both calculation and code avoids ambiguity.

  Methods Documentation

  scale_factor(z, /)

    Compute the scale factor at redshift `z`.

    The scale factor is defined as \(a = a_0 / (1 + z)\).

    Parameters:
      z Quantity-like [‘redshift’] | numpy:array_like

        Input redshift.

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

        Changed in version 8.0: z must be a positional argument.

    Returns:
      |Quantity|

        Scale factor at each input redshift.