py21cmfast.wrapper.photoncons¶
Module for the photon conservation models.
The excursion set reionisation model applied in ionize_box does not conserve photons. As a result there is an offset between the expected global ionized fraction and the value calculated from the ionized bubble maps. These models apply approximate corrections in order to bring the bubble maps more in line with the expected global values.
The application of the model is controlled by the flag option PHOTON_CONS_TYPE, which can take 4 values:
No correction is applied
We use the ionizing emissivity grids from a different redshift when calculating ionized bubble maps, this mapping from one redshift to another is obtained by performing a calibration simulation and measuring its redshift difference with the expected global evolution.
The power-law slope of the ionizing escape fraction is adjusted, using a fit ALPHA_ESC -> X + Y*Q(z), where Q is the expected global ionized fraction. This relation is fit by performing a calibration simulation as in (1), and comparing it to a range of expected global histories with different power-law slopes.
The normalisation of the ionizing escape fraction is adjusted, using a fit F_ESC10 -> X + Y*Q(z), where Q is the expected global ionized fraction. This relation is fit by performing a calibration simulation as in (1), and taking its ratio with the expected global evolution.
Notes
The function map for the photon conservation model looks like:
wrapper.run_lightcone/coeval()
setup_photon_cons_correction()
calibrate_photon_cons_correction()
_init_photon_conservation_correction() --> computes and stores global evolution
-->perfoms calibration simulation
_calibrate_photon_conservation_correction() --> stores calibration evolution
IF PHOTON_CONS_TYPE=='z-photoncons':
lib.ComputeIonizedBox()
lib.adjust_redshifts_for_photoncons()
lib.determine_deltaz_for_photoncons() (first time only) --> calculates the deltaz array with some smoothing
--> does more smoothing and returns the adjusted redshift
ELIF PHOTON_CONS_TYPE=='alpha-photoncons':
photoncons_alpha() --> computes and stores ALPHA_ESC shift vs global neutral fraction
lib.ComputeIonizedBox()
get_fesc_fit() --> applies the fit to the current redshift
ELIF PHOTON_CONS_TYPE=='f-photoncons':
photoncons_fesc() --> computes and stores F_ESC10 shift vs global neutral fraction
lib.ComputeIonizedBox()
get_fesc_fit() --> applies the fit to the current redshift
Attributes¶
Functions¶
|
Linear Function to fit in the simpler photon conservation model. |
|
Perform a photon conservation calibration simulation. |
|
Access the delta z arrays from the photon conservation model in C. |
|
Run the Simpler photons conservation model using ALPHA_ESC. |
|
Run the Even Simpler photon conservation model using F_ESC10. |
|
Set up the photon non-conservation correction. |
Module Contents¶
- py21cmfast.wrapper.photoncons.alpha_func(Q, a_const, a_slope)[source]¶
Linear Function to fit in the simpler photon conservation model.
- py21cmfast.wrapper.photoncons.calibrate_photon_cons(inputs, initial_conditions, **kwargs)[source]¶
Perform a photon conservation calibration simulation.
- Parameters:
initial_conditions (
InitialConditions,) – The InitialConditions instance to use for the photonconservation calculationinputs (
InputParameters,) – An InputParameters instance.
- Other Parameters:
See docs of :func:`compute_initial_conditions` for more information.
- Parameters:
initial_conditions (py21cmfast.wrapper.outputs.InitialConditions)
- py21cmfast.wrapper.photoncons.get_photoncons_dz(inputs, redshift, **kwargs)[source]¶
Access the delta z arrays from the photon conservation model in C.
- py21cmfast.wrapper.photoncons.photoncons_alpha(inputs, **kwargs)[source]¶
Run the Simpler photons conservation model using ALPHA_ESC.
This adjusts the slope of the escape fraction instead of redshifts to match a global evolution.
- py21cmfast.wrapper.photoncons.photoncons_fesc(inputs)[source]¶
Run the Even Simpler photon conservation model using F_ESC10.
Adjusts the normalisation of the escape fraction to match a global evolution.
- py21cmfast.wrapper.photoncons.setup_photon_cons(initial_conditions, inputs=None, **kwargs)[source]¶
Set up the photon non-conservation correction.
First performs a simplified calibration simulation and saves its neutral fraction history, to be matched to the analytic expression from solving the filling factor ODE.
This matching can happen via a redshift adjustment, or an adjustment to the escape fraction power-law parameters
- Parameters:
initial_conditions (
InitialConditions,) – The InitialConditions instance to use for the photonconservation calculationinputs (
InputParameters, optional) – An InputParameters instance. If not given will taken from initial_conditions.
- Other Parameters:
Any other parameters able to be passed to :func:`compute_initial_conditions`.
- Parameters:
initial_conditions (py21cmfast.wrapper.outputs.InitialConditions)
inputs (py21cmfast.wrapper.inputs.InputParameters | None)