yaw.core.cosmology.Scale#

class yaw.core.cosmology.Scale(rmin: float, rmax: float)[source]#

Bases: object

Class that represents a range of physical scales in kpc.

The range is defined by a lower and an upper scale limit. An instance can be converted to a string representation that is used as dictionary key in some places of yaw.

Examples

Get the center points:

>>> scale = Scale(100, 1000)
>>> scale.mid, scale.mid_log
(550.0, 316.22776601683796)

String representation:

>>> str(scale)
'kpc100t1000'

Methods

__init__(rmin, rmax)

to_radian(z, cosmology)

Get the separation in radian at a given redshift.

Attributes

mid

The mid point of the scale range.

mid_log

The logarithmic (base 10) mid point of the scale range.

rmin

Lower scale limit in kpc.

rmax

Upper scale limit in kpc.

property mid: float#

The mid point of the scale range.

property mid_log: float#

The logarithmic (base 10) mid point of the scale range.

rmax: float#

Upper scale limit in kpc.

rmin: float#

Lower scale limit in kpc.

to_radian(z: float, cosmology: TypeCosmology) NDArray[np.float64][source]#

Get the separation in radian at a given redshift.

Parameters:
  • z (float) – Redshift at which conversion happens.

  • cosmology (astropy.cosmology.FLRW, CustomCosmology) – Cosmological model used for calculations.

Returns:

Angular separation at given redshift.

Return type:

NDArray