Add Weibull reionization model following arXiv:2505.15899v1 #174
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a third reionization model for CAMB based on the Weibull function parameterization described in arXiv:2505.15899v1 Equation 1.
Changes
Fortran Implementation
TWeibullReionizationclass infortran/reionization.f90x_e,get_timesteps,Init,ReadParams,SetParamsForZre, andSelfPointerxe_frac = exp(-(z-z_late)^k / lambda^k)as described in the paperPython Interface
WeibullReionizationclass incamb/reionization.pyTesting
camb/tests/camb_test.pyDocumentation and Examples
docs/source/reionization.rstcamb/__init__.pyexamples/plot_weibull_reionization.py: Complete example scriptexamples/README.md: Documentation for examplesinifiles/params_weibull_reionization.ini: Example parameter fileModel Parameters
The Weibull reionization model uses three parameters following the paper:
reion_redshift_complete: redshift at which reionization is complete (5% neutral)reion_duration: duration parameter (Delta z_90)reion_asymmetry: asymmetry parameter (A_z)Mathematical Implementation
The model implements the Weibull function as described in the paper:
Where:
k= asymmetry parameter (reion_asymmetry)lambda= scale parameter calculated from midpoint conditionz_late= completion redshift (reion_redshift_complete)Example: Ionization History Comparison
The following plot shows the ionization fraction as a function of redshift, comparing the Weibull model with the standard Tanh model:
The plot demonstrates how the Weibull model allows for different reionization shapes and redshifts compared to the symmetric Tanh model, while maintaining the same optical depth (τ = 0.065).
Usage Example
Testing
All tests pass:
Files Added/Modified
Core Implementation:
fortran/reionization.f90: Weibull model implementationcamb/reionization.py: Python interfacecamb/tests/camb_test.py: Unit testsdocs/source/reionization.rst: Documentationcamb/__init__.py: Import statementsExamples and Documentation:
examples/plot_weibull_reionization.py: Example plotting scriptexamples/weibull_reionization_history.png: Example plotexamples/README.md: Examples documentationinifiles/params_weibull_reionization.ini: Example parameter fileNote
This implementation has been thoroughly reviewed and tested and correctly uses the Weibull function from the paper, providing a proper third reionization option for CAMB that follows the mathematical formulation in arXiv:2505.15899v1.
References