py21cmfast.drivers.global_evolution

Module containing a driver function for computing the global evolution of the fields in the simulation.

Classes

GlobalEvolution

Structure that contains the global evolution (as a function of redshift) of all the fields in the simulation.

Functions

compute_global_reionization_at_z(...)

Compute an ionized box at a given redshift, according to the global evolution.

run_global_evolution(→ GlobalEvolution)

Compute the global evolution of all the fields in the simulation.

Module Contents

py21cmfast.drivers.global_evolution.compute_global_reionization_at_z(redshift: float, inputs: py21cmfast.wrapper.inputs.InputParameters, previous_ionized_box: py21cmfast.wrapper.outputs.IonizedBox, spin_temp: py21cmfast.wrapper.outputs.TsBox | None) py21cmfast.wrapper.outputs.IonizedBox[source]

Compute an ionized box at a given redshift, according to the global evolution.

Parameters:
  • inputs (InputParameters) – The input parameters specifying the run. Since this may be the first box to use the astro params/flags, it is needed when we have not computed a TsBox or HaloBox.

  • previous_ionize_box (IonizedBox) – An ionized box at higher redshift.

  • spin_temp (TsBox or None, optional) – A spin-temperature box, only required if USE_TS_FLUCT is True. This is useful since the volume filling factor Q_HI is already contained in this object. If None, it will be evaluated by calling the C code.

Returns:

IonizedBox – An object containing the ionized box data.

Parameters:
Return type:

py21cmfast.wrapper.outputs.IonizedBox

py21cmfast.drivers.global_evolution.run_global_evolution(inputs: py21cmfast.wrapper.inputs.InputParameters, source_model: str | None = None, progressbar: bool = False, overdensity_z0: float | None = None) GlobalEvolution[source]

Compute the global evolution of all the fields in the simulation.

Parameters:
  • inputs (InputParameters) – This object specifies the input parameters for the run, including the random seed.

  • source_model (str, optional) – The source model to use in the simulation. If not provided, it is taken from inputs, unless inputs.matter_options.has_discrete_halos is True, in which case an error is thrown. Options are: E-INTEGRAL : The traditional excursion-set formalism, where source properties are

    defined on the Eulerian grid after 2LPT in regions of filter scale R (see the X_FILTER options for filter shapes). This integrates over the CHMF using the smoothed density grids, then multiplies the result. by (1 + delta) to get the source properties in each cell.

    CONST-ION-EFF: Similar to E-INTEGRAL, but ionizing efficiency is constant and does not depend on the halo mass

    (see Mesinger+ 2010).

    L-INTEGRALAnalagous to the ‘ESF-L’ model described in Trac+22, where source properties

    are defined on the Lagrangian (IC) grid by integrating the CHMF prior to the IGM physics and then mapping properties to the Eulerian grid using 2LPT.

  • progressbar (bool, optional) – If True, a progress bar will be displayed throughout the simulation. Defaults to False.

  • overdensity_z0 (float, optional) – The linear matter overdensity at z=0. Default is 0. This input argument could be useful for doing linear perturbation analysis with 21cmFAST.

Returns:

global_evolution (GlobalEvolution) – The object containing the global evolution of the fields in the simulation.

Raises:
  • ValueError – If source_model is None and inputs.matter_options.has_discrete_halos, or if source_model is provided,:

  • but is not one of the said options above.

Parameters:
Return type:

GlobalEvolution

Notes

For convenience, the provided InputParameters object by the user is overwritten to allow this function to work smoothly in all cases. The InputParameters object that was used in this function can be accessed via global_evolution.inputs. Note for example that the actual InputParameters object that is used by this function has only one cell (HII_DIM=DIM=1) and no 2LPT is performed (since we have only one cell). In addition, note that the classic reionization module of 21cmFAST (where the excursion-set algorithm is applied to find ionized bubbles) is not called by this function, since there are no bubbles in a one cell box! Instead, we compute the global reionization history based on the global volume filling factor Q. For that reason, note that the correction due to photon non-conservation in the excursion-set algorithm is never applied when this function is called.