This repository simulates the distribution of cosmic ray electrons within the intergalactic medium (IGM) and calculates the Landau damping rate caused by them to TeV electron-positron pair beams. For a detailed explanation, refer to our associated paper: Astrophysical Journal, AD3237.
Ensure you have Python 3 installed on your system. You may also need to install the required Python packages. It's recommended to use a virtual environment.
# Clone the repository
git clone https://github.com/SourceYang/CReDamp.git
cd CReDamp
To execute all related scripts with default redshift and energy resolution, along with source model settings, use the following command:
python exe.py --deltalin0 <value> --z <value>
python exe.py --deltalin0 0 --z 2This command will:
- Check for the existence of
source_term_Khaire.txt. If it doesn't exist, it will runget_source.pyto generate it. - Execute
IGM.pywith the specifieddeltalin0andz, saving results to the designated path. - Execute
damp_rate.pywith the same parameters, generating CSV files and figures related to the damping rates.
The main executable script that orchestrates the workflow by running other scripts based on the provided arguments.
Usage:
python exe.py --deltalin0 <value> --z <value>Generates the source file source_term_Khaire.txt if it doesn't already exist.
- Note: This process takes approximately 3 hours and is primarily affected by resolution settings.
- Pre-generated File: A pre-generated
source_term_Khaire.txtis included to save time. Use it unless you need a different resolution.
Generates five .npy files containing various physical quantities (row index for energy and column index for redshift):
energy_density_utot.npy: Total energy density.energy_per_baryon_E_eV.npy: Energy per baryon in electron volts (eV).number_of_electron_per_volume_N.npy: Number of electrons per volume per erg.pressure_P_e.npy: Pressure in erg/cm³.pressure_P_eV.npy: Pressure in eV/cm³.
Generates damping rate data and visualizations:
-
CSV Files:
damp_rate_largek_{z}_{deltalin0}.csv: Damping rates for k = 0.8 to 5 times omega_p/c.damp_rate_zoomk_{z}_{deltalin0}.csv: Damping rates for k = 0.995 to 1.1 times omega_p/c.
-
Figures:
damp_rate_largek_{z}_{deltalin0}.pdf: Plot for large k range.damp_rate_zoomk_{z}_{deltalin0}.pdf: Plot for zoomed k range.
-
Overdensity Evolution (
--deltalin0):0(mean density)- Values:
> 0: Overdensity< 0: Underdensity
- Values:
-
Redshift (
--z):2
These defaults can be modified by providing different values through command-line arguments.
- temp_history.py Generating temperature and thermal pressure evolution
- pre_IGMF.py Generating damp rate under pre-exist intergalactic magnectic field
-
Source File: The
source_term_Khaire.txtfile is generated byget_source.pyand is essential for running the simulation. If you encounter issues with this file, ensure thatget_source.pyhas executed successfully. -
Output Directory: Results are saved in a directory structured as
./results/redshift{z}_density{deltalin0}_{timestr}. Ensure you have write permissions for the desired location. -
Individual Script Descriptions: For more detailed information about each script, refer to the comments and documentation within the respective
.pyfiles. -
Performance Considerations: Generating the source file can be time-consuming (around 3 hours). It's recommended to use the pre-generated file unless necessary to regenerate it.
For questions or support, please contact Yuanyuan Yang.