skais_mapper.cosmology
Utilities for handling cosmology-dependent calculations.
Classes:
Name | Description |
---|---|
CosmoModel |
Set cosmological parameter for distance calculations, mass projections, etc. |
CosmoModel
dataclass
CosmoModel(
omega_m: float = 0.279952,
omega_l: float = 0.72,
omega_k: float = 0.0,
z: float = 0.0,
c: ac.Constant = (lambda: ac.c)(),
h: float = 0.718,
u_H0: au.CompositeUnit = au.km / au.s / au.Mpc,
)
Set cosmological parameter for distance calculations, mass projections, etc.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
omega_m
|
float
|
matter energy fraction |
0.279952
|
omega_l
|
float
|
dark energy fraction |
0.72
|
omega_k
|
float
|
curvature fraction |
0.0
|
omega_r
|
float
|
radiation energy fraction (will be calculated assuming flat universe if not given) |
required |
h
|
float
|
'little' H (H0 / 100 km/s/Mpc) |
0.718
|
c
|
ac.Constant
|
speed of light |
(lambda: ac.c)()
|
z
|
float
|
redshift |
0.0
|
Methods:
Name | Description |
---|---|
H |
The Hubble parameter at a given scale factor |
arcsec2kpc |
Angular distance d_z from a redshift z within given cosmology. |
d_comov |
Calculate the comoving distance from scale factor (for solve_ivp). |
d_z |
Angular distance d_z from a redshift z within given cosmology. |
d_z2kpc |
Given scale-less distance d, return scaled distance c/H0 * d [kpc]. |
Attributes:
Name | Type | Description |
---|---|---|
H0 |
au.Quantity
|
The Hubble constant getter. |
a |
float
|
The scale parameter getter. |
omega_r |
float
|
The radiation density parameter getter. |
rho_crit |
au.Quantity
|
The critical density getter. |
H0
property
writable
H0: au.Quantity
The Hubble constant getter.
a
property
writable
a: float
The scale parameter getter.
omega_r
property
writable
omega_r: float
The radiation density parameter getter.
rho_crit
property
rho_crit: au.Quantity
The critical density getter.
H
H(a: float | None = None) -> au.Quantity
The Hubble parameter at a given scale factor a
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
float | None
|
scale factor |
None
|
Returns:
Type | Description |
---|---|
float
|
value of the Hubble parameter |
Source code in skais_mapper/cosmology.py
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
|
arcsec2kpc
staticmethod
arcsec2kpc(
z: float,
dist_z: float | None = None,
cosmo_model: TCosmo | None = None,
) -> au.Quantity
Angular distance d_z from a redshift z within given cosmology.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z
|
float
|
redshift |
required |
dist_z
|
float | None
|
scaled comoving distance |
None
|
cosmo_model
|
TCosmo | None
|
cosmological parameter lookup class |
None
|
Return
(float): kpc/arcsec scaling within given redshift and cosmology
Source code in skais_mapper/cosmology.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
d_comov
staticmethod
d_comov(
a: float, r: float, cosmo_model: TCosmo | None = None
) -> au.Quantity
Calculate the comoving distance from scale factor (for solve_ivp).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a
|
float
|
scale factor |
required |
r
|
float
|
distance |
required |
cosmo_model
|
TCosmo | None
|
cosmological parameter lookup class |
None
|
Returns:
Type | Description |
---|---|
float
|
comoving radial distance (scale-free) |
Source code in skais_mapper/cosmology.py
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
|
d_z
staticmethod
d_z(
z: float | None = None,
cosmo_model: TCosmo | None = None,
scaled: bool = False,
) -> au.Quantity
Angular distance d_z from a redshift z within given cosmology.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
z
|
float | None
|
redshift |
None
|
cosmo_model
|
TCosmo | None
|
cosmological parameter lookup class |
None
|
scaled
|
bool
|
return result with c/H0 in units of kpc |
False
|
Return
(float): apparent distance d_z
Source code in skais_mapper/cosmology.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
d_z2kpc
staticmethod
d_z2kpc(
distance: float | np.ndarray,
cosmo_model: TCosmo | None = None,
) -> au.Quantity
Given scale-less distance d, return scaled distance c/H0 * d [kpc].
Parameters:
Name | Type | Description | Default |
---|---|---|---|
distance
|
float | np.ndarray
|
scale-less distance |
required |
cosmo_model
|
TCosmo | None
|
cosmological parameter lookup class |
None
|
Source code in skais_mapper/cosmology.py
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|