SciPy

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, clean_up_tf=True, data_prefix=None)

Main function computing histories and spectra.

Parameters:
in_spec_elecSpectrum or function, optional

Spectrum per injection event into electrons. in_spec_elec.rs of the Spectrum must be the initial redshift. Alternatively, a function taking (rs, next_rs=…, dt=…) as input and output a Spectrum object with the corresponding redshift. If next_rs and dt are not specified, must return the instantaneous spectrum.

in_spec_photSpectrum or function, optional

Spectrum per injection event into photons. in_spec_phot.rs of the Spectrum must be the initial redshift. Alternatively, a function taking (rs, next_rs=…, dt=…) as input and output a Spectrum object with the corresponding redshift. If next_rs and dt are not specified, must return the instantaneous spectrum.

rate_func_Nfunction, optional

Function returning number of injection events per volume per time, with (rs, next_rs=…, dt=…) as an input. If next_rs and dt are not specified, must return the instantaneous rate.

rate_func_engfunction, optional

Function returning energy injected per volume per time, with (rs, next_rs=…, dt=…) as an input. If next_rs and dt are not specified, must return the instantaneous rate.

DM_process{‘swave’, ‘decay’}, optional

Dark matter process to use.

sigmavfloat, optional

Thermally averaged cross section for dark matter annihilation.

lifetimefloat, optional

Decay lifetime for dark matter decay.

primarystring, 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_boostfunction, optional

Energy injection boost factor due to structure formation.

start_rsfloat, 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_rsfloat, optional

Final redshift \((1+z)\) to evolve to. Default is 1+z = 4.

reion_switchbool

Reionization model included if True, default is False.

helium_TLAbool

If True, the TLA is solved with helium. Default is False.

reion_rsfloat, optional

Redshift \((1+z)\) at which reionization effects turn on.

photoion_rate_functuple 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_functuple 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_funcfunction, optional

Specifies a fixed ionization history after reion_rs.

init_condtuple of floats

Specifies the initial (xH, xHe, Tm). Defaults to Tm_std(), xHII_std() and xHeII_std() at the start_rs.

coarsen_factorint

Coarsening to apply to the transfer function matrix. Default is 1.

backreactionbool

If False, uses the baseline TLA solution to calculate \(f_c(z)\). Default is True.

compute_fs_method{‘no_He’, ‘He_recomb’, ‘He’}
mxstepint, optional

The maximum number of steps allowed for each integration point. See scipy.integrate.odeint() for more information. Default is 1000.

rtolfloat, optional

The relative error of the solution. See scipy.integrate.odeint() for more information. Default is 1e-4.

use_tqdmbool, optional

Uses tqdm if True. Default is True.

cross_checkbool, 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.

Examples

  1. 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()
    )
    
  2. 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
    ) 
    

This Page