21cmfast / 21cmFAST

Official repository for 21cmFAST: a code for generating fast simulations of the cosmological 21cm signal
MIT License
58 stars 37 forks source link

Global Interpolation Tables #362

Open daviesje opened 6 months ago

daviesje commented 6 months ago

Currently there are two interpolation tables in redshift which are built during the spin temperature computation, one for the global expected ionising emissivity, and one for the global expected star formation rate density. The emissivity is used for the calculation of the x-ray mean free path in nu_tau_one, and the SFR table is used to fix the mean SFR of the grids. Both of these tables require hundreds (or thousands with minihalos) of integrals to build.

The SFR table is only evaluated once per filter radius (less than 100 times usually), and could easily be replaced by the integral. The emissivity table is evaluated more times, since we integrate over it to get tau, however I think that this could be achieved more accurately and more efficiently by passing the actual global neutral fraction of the simulation, rather than calculating the expected value at each point.

The second option is to define these tables outside of the spin temperature, and explicitly store them somewhere so we don't have to recalculate them every snapshot, since they should be exactly the same. We could also apply this to other tables which only need one initialisation, such as the RMS fluctuation sigma(M) or the random number generator.