Probes
CIBTracer
Bases: container
Class representing the tracer associated with the Cosmic Infrared Background (CIB).
The kernel function associated with the CIB is represented as:
Attributes:
| Name | Type | Description |
|---|---|---|
z_min |
float
|
The minimum redshift. Defaults to 0.0. |
z_max |
float
|
The maximum redshift. Defaults to 6.0. |
n_z |
int
|
The number of redshifts. Defaults to 1024. |
Source code in jax_cosmo/probes.py
n_z: int
property
Returns the number of redshifts.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of redshifts. |
zmax: float
property
Returns the maximum redshift probed by this tracer.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The maximum redshift. |
zmin: float
property
Returns the minimum redshift probed by this tracer.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The minimum redshift. |
kernel(cosmo)
Calculates the Cosmic Infrared Background (CIB) kernel.
The kernel is computed using the power spectrum method with a given cosmology.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object, typically in the JAX COSMO framework. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The CIB kernel values. |
ndarray
|
The comoving radial distances corresponding to the kernel. |
Source code in jax_cosmo/probes.py
CMBLensingTracer
Bases: container
A tracer for the CMB lensing convergence, following Equation 31 in the CCL paper.
where
-
\(\chi_{*}\equiv\chi(z_{*})\)
-
\(\kappa\) is the convergence of a given source plane at redshift \(z_{*}\)
This tracer computes the lensing convergence kernel for the Cosmic Microwave Background (CMB).
Attributes:
| Name | Type | Description |
|---|---|---|
z_source |
float
|
The redshift of the source plane (CMB). |
n_samples |
int
|
The number of samples used for the comoving radial distance grid. Defaults to 100. |
Source code in jax_cosmo/probes.py
n_samples: int
property
Returns the number of samples for the comoving radial distance grid.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of samples used for integration. |
z_source: float
property
Returns the source redshift for the CMB lensing tracer.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The redshift of the source plane (CMB). |
kernel(cosmo)
Calculates the lensing convergence kernel for the CMB.
The kernel is computed using the cosmological parameters and the redshift of the source plane.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
A cosmology object providing the necessary cosmological parameters. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The kernel values for the CMB lensing convergence. |
ndarray
|
The corresponding comoving radial distances. |
Source code in jax_cosmo/probes.py
ISWTracer
Bases: container
Class representing the tracer associated with the Integrated Sachs-Wolfe (ISW) effect.
The ISW effect describes the temperature fluctuations in the Cosmic Microwave Background (CMB) due to the time evolution of gravitational potentials, which primarily occurs at late times in a universe with dark energy or curvature.
Attributes:
| Name | Type | Description |
|---|---|---|
z_max |
float
|
The maximum redshift up to which the kernel is computed. Defaults to 6.0. |
n_z |
int
|
The number of redshift points for the computation. Defaults to 1024. |
Source code in jax_cosmo/probes.py
n_z: int
property
Returns the number of redshift points used in this tracer.
Returns:
| Type | Description |
|---|---|
int
|
Number of redshift points. |
zmax: float
property
Returns the maximum redshift probed by this tracer.
Returns:
| Type | Description |
|---|---|
float
|
Maximum redshift. |
kernel(cosmo)
Calculates the ISW kernel and comoving radial distances.
The kernel represents the contribution of the ISW effect across different redshifts and distances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object providing the cosmological parameters. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The ISW kernel values as an array. |
ndarray
|
The comoving radial distances corresponding to the redshift points. |
Source code in jax_cosmo/probes.py
NumberCounts
Bases: container
Represents a galaxy clustering probe with a set of redshift bins.
This class handles the modeling of galaxy clustering, optionally including the effect of redshift space distortions (RSD).
Attributes:
| Name | Type | Description |
|---|---|---|
redshift_bins |
List
|
A list of redshift distributions for each redshift bin. |
bias |
List[float]
|
The bias parameter for each redshift bin. |
has_rsd |
bool
|
Indicates whether the redshift space distortion (RSD) effect is included. |
Source code in jax_cosmo/probes.py
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 | |
n_tracers: int
property
Returns the number of tracers (redshift bins) for this probe.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of redshift bins. |
zmax: float
property
Returns the maximum redshift probed by this probe.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The maximum redshift across all redshift bins. |
kernel(cosmo, z, ell)
Computes the radial kernel for all redshift bins in this probe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object providing necessary cosmological parameters. |
required |
z
|
Union[float, ndarray]
|
The redshift(s) at which to compute the kernel. |
required |
ell
|
Union[float, ndarray]
|
The angular scale(s) at which to compute the kernel. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The radial kernel with shape |
Source code in jax_cosmo/probes.py
noise()
Computes the noise power for all redshift bins.
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The noise power for each bin with shape |
Source code in jax_cosmo/probes.py
WeakLensing
Bases: container
Represents a weak lensing probe with a set of redshift bins.
This class models weak lensing observations, including optional intrinsic alignments (IA) and multiplicative biases.
Attributes:
| Name | Type | Description |
|---|---|---|
redshift_bins |
List
|
A list of redshift distributions for each redshift bin. |
ia_bias |
Optional[Union[float, List[float]]]
|
If provided, intrinsic alignments (IA) are added using the NLA model. Can be a single value or a list matching the number of redshift bins. |
multiplicative_bias |
Union[float, List[float]]
|
Adds a (1+m) multiplicative bias. Can be a single value or a list matching the number of redshift bins. |
sigma_e |
float
|
The intrinsic ellipticity of galaxies. Defaults to 0.26. |
config |
dict
|
Configuration settings, including flags such as |
Source code in jax_cosmo/probes.py
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | |
n_tracers: int
property
Returns the number of tracers (redshift bins) for this probe.
Returns:
| Type | Description |
|---|---|
int
|
The number of redshift bins. |
zmax: float
property
Returns the maximum redshift probed by this probe.
Returns:
| Type | Description |
|---|---|
float
|
The maximum redshift across all redshift bins. |
kernel(cosmo, z, ell)
Computes the radial kernel for all redshift bins in this probe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object providing necessary cosmological parameters. |
required |
z
|
Union[float, ndarray]
|
The redshift(s) at which to compute the kernel. |
required |
ell
|
Union[float, ndarray]
|
The angular scale(s) at which to compute the kernel. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The radial kernel with shape |
Source code in jax_cosmo/probes.py
noise()
Computes the noise power for all redshift bins.
Returns:
| Type | Description |
|---|---|
ndarray
|
The noise power for each bin with shape |
Source code in jax_cosmo/probes.py
tSZTracer
Bases: container
Represents the tracer associated with the thermal Sunyaev-Zel'dovich (tSZ) Compton-y parameter.
This tracer computes the radial kernel for the tSZ effect, modeled using the formula:
Attributes:
| Name | Type | Description |
|---|---|---|
z_max |
float
|
The maximum redshift to be considered. Defaults to 6.0. |
n_z |
int
|
The number of redshift samples. Defaults to 1024. |
Source code in jax_cosmo/probes.py
n_z: int
property
Returns the number of redshift samples used in the kernel.
Returns:
| Type | Description |
|---|---|
int
|
The number of redshift samples. |
zmax: float
property
Returns the maximum redshift probed by this tracer.
Returns:
| Type | Description |
|---|---|
float
|
The maximum redshift. |
kernel(cosmo)
Calculates the thermal Sunyaev-Zel'dovich (tSZ) kernel.
The kernel is computed using a power-law model with a predefined amplitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object providing necessary cosmological parameters. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The tSZ kernel (np.ndarray) over redshift. |
ndarray
|
The corresponding comoving radial distances (np.ndarray). |
Source code in jax_cosmo/probes.py
zPowerTracer
Bases: container
Represents the tracer associated with the power kernel.
The kernel is computed using the formula:
Attributes:
| Name | Type | Description |
|---|---|---|
z_min |
float
|
The minimum redshift to compute the kernel. Defaults to 0.0. |
z_max |
float
|
The maximum redshift to compute the kernel. Defaults to 6.0. |
n_z |
int
|
The number of redshift points in the kernel. Defaults to 1024. |
Source code in jax_cosmo/probes.py
n_z: int
property
Returns the number of redshift samples used in the kernel.
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The number of redshift samples. |
zmax: float
property
Returns the maximum redshift probed by this tracer.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The maximum redshift. |
zmin: float
property
Returns the minimum redshift probed by this tracer.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
The minimum redshift. |
kernel(cosmo, amplitude, alpha)
Calculates the power kernel.
The kernel is defined as a function of redshift using a power-law model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object providing necessary cosmological parameters. |
required |
amplitude
|
float
|
The amplitude (A) of the power kernel. |
required |
alpha
|
float
|
The power-law exponent of the kernel. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The power kernel (np.ndarray) over redshift. |
ndarray
|
The corresponding comoving radial distances (np.ndarray). |
Source code in jax_cosmo/probes.py
density_kernel(cosmo, pzs, bias, z, ell)
Computes the number counts density kernel for a given cosmology, redshift bins, bias, redshift values, and multipole moment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmology object containing cosmological parameters. |
required |
pzs
|
List[redshift_distribution]
|
A list of redshift distribution functions (or objects) for each redshift bin. Each element in the list should be callable and take a redshift |
required |
bias
|
List[float]
|
A list of bias functions (or constants) for each redshift bin. If a list of functions is provided, each function should accept |
required |
z
|
ndarray
|
A 1D array of redshift values for which the density kernel will be computed. |
required |
ell
|
ndarray
|
A 1D array of multipole moments for the kernel computation. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The computed density kernel, with shape |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If any of the redshift distributions are of type |
Notes
The density kernel is computed as the product of the redshift distribution dndz,
the bias function, and the background Hubble parameter at each redshift value.
The resulting kernel is then multiplied by normalization and ell-dependent factors,
though both factors are currently set to 1.0.
Source code in jax_cosmo/probes.py
isw_kernel(cosmo, z_max, n_z)
Compute the kernel for the Integrated Sachs-Wolfe (ISW) effect.
The ISW effect contributes to temperature fluctuations in the Cosmic Microwave Background (CMB) anisotropies due to the time evolution of the gravitational potential in a matter-dominated universe. The contribution to the CMB temperature is given by:
This function calculates the kernel required to compute angular power spectra involving the ISW effect. Note that any angular power spectra computed with this tracer should involve a three-dimensional power spectrum using the matter power spectrum.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
A cosmology object containing relevant parameters for calculations. |
required |
z_max
|
float
|
The maximum redshift to compute the kernel up to. |
required |
n_z
|
int
|
The number of redshift points for the kernel computation. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The ISW kernel values as an array. |
ndarray
|
The comoving radial distance corresponding to the redshift points. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in jax_cosmo/probes.py
kappa_kernel(cosmo, z_source, n_samples=100, ell=2000)
This convenience function returns the radial kernel for CMB-lensing-like tracers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
the cosmology object with all cosmological parameters. |
required |
z_source
|
float
|
the redshift of the source |
required |
n_samples
|
int
|
the number of samples of comoving radial distance. Defaults to 100. |
100
|
ell
|
int
|
the ell mode. Defaults to 2000. |
2000
|
Returns:
| Type | Description |
|---|---|
Tuple[ndarray, ndarray]
|
the kernel and the comoving radial distance |
Source code in jax_cosmo/probes.py
nla_kernel(cosmo, pzs, bias, z, ell)
Computes the Non-Linear Alignment (NLA) Intrinsic Alignment (IA) kernel.
The NLA kernel is used in cosmic shear and intrinsic alignment studies to model the non-linear alignment of galaxy intrinsic alignments. This implementation follows the formulation in Joachimi et al. (2011). See Equation 6.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
Cosmological parameters object. |
required |
pzs
|
List
|
List of photometric redshift distribution functions. |
required |
bias
|
List
|
Bias function or list of bias functions. |
required |
z
|
ndarray
|
Redshift values to evaluate the kernel. |
required |
ell
|
int
|
Multipole moment for angular power spectrum calculation. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
Computed NLA kernel values. |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If delta redshift distributions are used. |
Source code in jax_cosmo/probes.py
power_kernel(cosmo, amplitude, alpha, **kwargs)
Tracer obeying a power law alpha with an amplitude.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
the cosmology object in JAXCOSMO |
required |
amplitude
|
float
|
the amplitude of the kernel |
required |
alpha
|
float
|
the power of the kernel |
required |
Returns:
| Type | Description |
|---|---|
Tuple[ndarray, ndarray]
|
The kernel and the comoving radial distance |
Source code in jax_cosmo/probes.py
weak_lensing_kernel(cosmo, pzs, z, ell)
Computes the weak lensing kernel.
This function calculates the weak lensing kernel for a given cosmology,
redshift distributions (either extended or delta functions), redshift values,
and multipole moment ell. It separates the input redshift distributions
into extended distributions and delta functions to process them accordingly.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cosmo
|
Cosmology
|
The cosmological parameters and background model. |
required |
pzs
|
List[RedshiftDistribution]
|
List of redshift distributions (can include delta distributions). |
required |
z
|
ArrayLike
|
The redshift values for which the kernel is calculated. |
required |
ell
|
float
|
The multipole moment for weak lensing. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The computed weak lensing kernel for the provided redshifts and |
Notes
- The function treats extended redshift distributions and delta functions differently.
- Assumes redshift distributions implement
__call__for dndz evaluation.