21cmfast / 21cmFAST

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

Create a wrapper-level function to convert RNG to halo properties #375

Open daviesje opened 3 months ago

daviesje commented 3 months ago

The halo sampler correlates the halo properties (stellar mass and SFR) based on the sampling of its descendant, which is calculated backwards in time. Due to the presence of feedback, we cannot finalise the halo properties until we have the previous snapshot's (higher z) Lyman Werner and Ionising background.

As such, the current behaviour passes the correlated gaussian variables (which become the lognormal scatter in each property) backward in time, and then scales them to the mean (which includes the feedback) in the forward time-loop. This is efficient when running the lightcone, however it means that getting the star-formation rate or stellar mass in the halo catalogues is tedious.

To help with analysis, there should be an exposed function which loops through a catalogue and applies set_halo_properties() from HaloBox.c to a halo catalogue, given radiative backgrounds if required.