main.evolve¶
-
main.evolve(in_spec_elec=None, in_spec_phot=None, rate_func_N=None, rate_func_eng=None, DM_process=None, mDM=None, sigmav=None, lifetime=None, primary=None, struct_boost=None, start_rs=None, end_rs=4, helium_TLA=False, reion_switch=False, reion_rs=None, photoion_rate_func=None, photoheat_rate_func=None, xe_reion_func=None, init_cond=None, coarsen_factor=1, backreaction=True, compute_fs_method='no_He', mxstep=1000, rtol=0.0001, use_tqdm=True, cross_check=False, tf_mode='table', verbose=0)¶ Main function computing histories and spectra.
Parameters: - in_spec_elec :
Spectrum, optional Spectrum per injection event into electrons. in_spec_elec.rs of the
Spectrummust be the initial redshift.- in_spec_phot :
Spectrum, optional Spectrum per injection event into photons. in_spec_phot.rs of the
Spectrummust be the initial redshift.- rate_func_N : function, optional
Function returning number of injection events per volume per time, with redshift \((1+z)\) as an input.
- rate_func_eng : function, optional
Function returning energy injected per volume per time, with redshift \((1+z)\) as an input.
- DM_process : {‘swave’, ‘decay’}, optional
Dark matter process to use.
- sigmav : float, optional
Thermally averaged cross section for dark matter annihilation.
- lifetime : float, optional
Decay lifetime for dark matter decay.
- primary : string, optional
Primary channel of annihilation/decay. See
get_pppc_spec()for complete list. Use ‘elec_delta’ or ‘phot_delta’ for delta function injections of a pair of photons/an electron-positron pair.- struct_boost : function, optional
Energy injection boost factor due to structure formation.
- start_rs : float, optional
Starting redshift \((1+z)\) to evolve from. Default is \((1+z)\) = 3000. Specify only for use with DM_process. Otherwise, initialize in_spec_elec.rs and/or in_spec_phot.rs directly.
- end_rs : float, optional
Final redshift \((1+z)\) to evolve to. Default is 1+z = 4.
- reion_switch : bool
Reionization model included if True, default is False.
- helium_TLA : bool
If True, the TLA is solved with helium. Default is False.
- reion_rs : float, optional
Redshift \((1+z)\) at which reionization effects turn on.
- photoion_rate_func : tuple of functions, optional
Functions take redshift \(1+z\) as input, return the photoionization rate in s-1 of HI, HeI and HeII respectively. If not specified, defaults to
photoion_rate().- photoheat_rate_func : tuple of functions, optional
Functions take redshift \(1+z\) as input, return the photoheating rate in s-1 of HI, HeI and HeII respectively. If not specified, defaults to
photoheat_rate().- xe_reion_func : function, optional
Specifies a fixed ionization history after reion_rs.
- init_cond : tuple of floats
Specifies the initial (xH, xHe, Tm). Defaults to
Tm_std(),xHII_std()andxHeII_std()at the start_rs.- coarsen_factor : int
Coarsening to apply to the transfer function matrix. Default is 1.
- backreaction : bool
If False, uses the baseline TLA solution to calculate \(f_c(z)\). Default is True.
- compute_fs_method : {‘no_He’, ‘He_recomb’, ‘He’}
- mxstep : int, optional
The maximum number of steps allowed for each integration point. See scipy.integrate.odeint() for more information. Default is 1000.
- rtol : float, optional
The relative error of the solution. See scipy.integrate.odeint() for more information. Default is 1e-4.
- use_tqdm : bool, optional
Uses tqdm if True. Default is True.
- cross_check : bool, optional
If True, compare against 1604.02457 by using original MEDEA files, turning off partial binning, etc. Default is False.
- tf_mode : {‘table’, ‘nn’}
Specifies transfer function mode being used. Options: ‘table’: generate transfer functions from interpolating data tables; ‘nn’: use neural network to generate transfer functions with preset coarsen factor 12.
- verbose : {0, 1}
Set verbosity. Tqdm not affected.
See also
get_pppc_spec(),struct_boost_func(),photoion_rate(),photoheat_rate(),Tm_std(),xHII_std()Examples
Dark matter annihilation – dark matter mass of 50 GeV, annihilation cross section \(2 \times 10^{-26}\) cm3 s-1, annihilating to \(b \bar{b}\), solved without backreaction, a coarsening factor of 32 and the default structure formation boost:
import darkhistory.physics as phys out = evolve( DM_process='swave', mDM=50e9, sigmav=2e-26, primary='b', start_rs=3000., backreaction=False, struct_boost=phys.struct_boost_func() )
Dark matter decay – dark matter mass of 100 GeV, decay lifetime \(3 \times 10^{25}\) s, decaying to a pair of \(e^+e^-\), solved with backreaction, a coarsening factor of 16:
out = evolve( DM_process='decay', mDM=1e8, lifetime=3e25, primary='elec_delta', start_rs=3000., backreaction=True )
- in_spec_elec :
