zeus21.maps
Make maps! For fun and science.
- Authors: zeus21 v2 collaboration - June 2026
Emily Bregou ; Hector Afonso G. Cruz ; Sarah Libanore ; Julian B. Muñoz ; Yonny Sklansky ; Emilie Thélie ; Alessandra Venditti
arXiv:2302.08506, arXiv:2306.09403, arXiv:2407.18294, Sklansky et al. (in prep)
Classes
All arguments of reionization_maps that have default values |
|
Generates 3D maps of the reionization fields. |
|
Module Contents
- class zeus21.maps.ReioMapsConfig[source]
All arguments of reionization_maps that have default values
- class zeus21.maps.reionization_maps(CosmoParams, CoeffStructure, input_z, input_boxlength=300.0, ncells=300, seed=1234, r_precision=1.0, Rs=None, barrier=None, PRINT_TIMER=True, LOGNORMAL_DENSITY=False, COMPUTE_DENSITY_AT_ALLZ=False, COMPUTE_MASSWEIGHTED=False, lowres_massweighting=1, COMPUTE_PARTIAL_IONIZATIONS=False, COMPUTE_ZREION=False)[source]
Generates 3D maps of the reionization fields.
Uses a density threshold barrier determined from a converged bubble mass function. With default parameters, the code takes about 20 minutes on laptop to run.
- Parameters:
CosmoParams (zeus21.Cosmo_Parameters class) – Stores cosmology.
CoeffStructure (zeus21.get_T21_coefficients class) – Stores sfrd and 21cm coefficients.
input_z (1D np.array) – The redshifts at which to compute output maps. Narrowed down later to select available redshifts from CoeffStructure.zintegral.
input_boxlength (float) – Comoving physical side length of the box. Default is 300 cMpc.
ncells (int) – Number of cells on a side. Default is 300 cells.
seed (int) – Sets the predetermined generation of maps. Default is 1234.
r_precision (float) – Allows to change the steps of the radii for faster computation. Default (and max) is 1, lower values make the computation faster at the cost of accuracy.
barrier (function) – Input density barrier to be used as the threshold for map generation. Takes z value as input and returns np.array of shape. Default is None.
PRINT_TIMER (bool) – Whether to print the time elapsed along the process. Default is True.
LOGNORMAL_DENSITY (bool) – Whether to use lognormal (True) or Gaussian (False) density fields. Default is False.
COMPUTE_DENSITY_AT_ALLZ (bool) – Whether to output the density field at all redshifts. If False, only the density at the lower input redshift is computed. If True, the computation time and memory usage dramatically increases. Default is False.
COMPUTE_MASSWEIGHTED (bool) – Whether to compute the mass weighted ionized field and fraction. If True, COMPUTE_DENSITY_AT_ALLZ will be forced to True, thus increasing computation time dramatically. Default is False.
lowres_massweighting (int) – Compute the mass-weighted ionized field and fraction more efficiently by using lower resolution density and ionized fields. Has to be >=1 and an integer. Default is 1.
COMPUTE_PARTIAL_IONIZATIONS (bool) – Whether to compute the subpixel ionizations in the field and the ionized fractions.
- z[source]
Redshifts at which the output maps are computed. Selected to be the closest to the input redshifts from the available ones in zeus21.
- Type:
1D np.array
- r
Radii at which the density field is smoothed. Selected using r_precision from the available ones in zeus21.
- Type:
1D np.array
- density_allz[source]
Overdensity field at all the redshifts asked by the user. First dimension correponds to redshifts. Only computed if COMPUTE_DENSITY_AT_ALLZ is True.
- Type:
4D np.array
- ion_field_allz
Ionized fraction field at all the redshifts asked by the user. First dimension correponds to redshifts.
- Type:
4D np.array
- ion_frac
Volume weighted ionized fraction at all the redshifts asked by the user.
- Type:
1D np.array
- ion_frac_massweighted
Mass weighted ionized fraction at all the redshifts asked by the user. Only computed if COMPUTE_MASSWEIGHTED is True.
- Type:
1D np.array
- generate_density(CosmoParams)[source]
Generates the initial density field at the lowest redshift.
- Parameters:
CosmoParams (CosmoParams class)
- Returns:
density_field – Three-dimensional delta field evaluated at self.z_of_density.
- Return type:
array
- generate_density_allz(CosmoParams)[source]
Evolves the density field to all redshifts using the linear growth factor.
- Parameters:
CosmoParams (CosmoParams class)
- Returns:
density_allz – Four-dimensional delta field. The first dimension is z.
- Return type:
array
- compute_k()[source]
Computes the Fourier-space wavenumber grid for the box.
- Returns:
k – Three-dimensional array of wavenumber magnitudes.
- Return type:
array
- smooth_density()[source]
Smooths the density field over all smoothing radii.
- Returns:
density_smoothed_allr – Density field smoothed at each radius in self.r.
- Return type:
array
- sigma_correction(CosmoParams)[source]
Computes the non-ergodicity correction to the generated density variance.
- Parameters:
CosmoParams (CosmoParams class)
- Returns:
sigma_ratio – Ratio between the measured and theoretical sigma.
- Return type:
float
- generate_xHII(CosmoParams)[source]
Generates ionized fraction fields and volume-weighted ionized fractions.
- Parameters:
CosmoParams (CosmoParams class)
- Returns:
ion_field_allz (array) – Ionized fraction field at each redshift.
ion_frac (array) – Volume-weighted ionized fraction at each redshift.
- ionize(CosmoParams, curr_z_idx)[source]
Computes the binary ionized field at a single redshift.
- Parameters:
CosmoParams (CosmoParams class)
curr_z_idx (int) – Index of the redshift at which to compute the ionized field.
- Returns:
ion_field – Binary ionized field at curr_z.
- Return type:
array
- compute_massweighted(CosmoParams, lowres_massweighting=1)[source]
Computes the mass-weighted ionized field and ionized fraction.
- Parameters:
CosmoParams (CosmoParams class)
lowres_massweighting (int, optional) – Factor by which to downsample the density and ionized fields for mass weighting. Default is 1.
- Returns:
ion_frac_massweighted (array) – Mass-weighted ionized fraction at each redshift.
ion_field_massweighted_allz (array) – Mass-weighted ionized field at each redshift.
- compute_partial(CosmoParams, CoeffStructure, r=None)[source]
Computes the partially ionized field and volume-weighted partially ionized fraction.
- Parameters:
CosmoParams (CosmoParams class)
CoeffStructure (get_T21_coefficients class)
r (float, optional) – Smoothing radius in cMpc used to evaluate the prebarrier ionized fraction. Default is None, in which case self.r[0] is used.
- Returns:
ion_frac_partial (array) – Volume-weighted partially ionized fraction at each redshift.
ion_field_partial_allz (array) – Partially ionized field at each redshift.
- compute_partial_massweighted(CosmoParams, CoeffStructure, r=None)[source]
Computes the mass-weighted partially ionized field and fraction.
- Parameters:
CosmoParams (CosmoParams class)
CoeffStructure (get_T21_coefficients class)
r (float, optional) – Smoothing radius in cMpc used to evaluate the prebarrier ionized fraction. Default is None, in which case self.r[0] is used.
- Returns:
ion_frac_partial_massweighted (array) – Mass-weighted partially ionized fraction at each redshift.
ion_field_partial_massweighted_allz (array) – Mass-weighted partially ionized field at each redshift.
- class zeus21.maps.T21_maps[source]
- CosmoParams: dataclasses.InitVar[zeus21.inputs.Cosmo_Parameters][source]
- CoeffStructure: dataclasses.InitVar[zeus21.T21coefficients.get_T21_coefficients][source]
- PowerSpectra: dataclasses.InitVar[zeus21.correlations.Power_Spectra][source]
- ReioMaps_config: ReioMapsConfig[source]
- ReioMaps: reionization_maps[source]
- generate_density_pb()[source]
Generates density fields using PowerBox.
- Returns:
density (array) – Density field at each redshift.
pbs (list) – PowerBox objects that generate the density fields.