Recent Releases of 21cmFAST v3

21cmFAST v3 - v4 Beta

21cmFAST Version 4 Initial Release

This is the first release of 21cmFAST version 4. The key improvements in comparison to previous versions are: * A stochastic halo sampler, which allows the user to create lightcones and catalogues of galaxy properties consistent with the IGM calculations * A complete overhaul of the input parameter structures, with TOML run templates and strict consistency checks * More organised output structures and caches * Modularisation of the key IGM calculations in the C backend.

Each of these changes is described in more detail below, as well as in the docs docs/updates_from_v3. This release is marked as a beta since we expect to make minor API changes over the next few weeks, however the core functionality should remain unchanged.

Stochastic Halo Sampling

The main addition the 21cmFAST in version 4 is the stochastic halo sampler. This samples conditional halo mass functions instead of integrating over them, producing a discrete source field which is then used in the spin temperature and ionization field calculations. This not only includes the effects of stochasticity in the IGM observables, but also creates several new outputs which can be further used in forecasting galaxy survey, line intensity mapping, and cosmic background statistics. The sampler is activated with the flag HALO_STOCHASTICITY and serves as a faster replacement to the previous excursion-set halo finder, with greatly increased functionality. Halos are sampled in a backward time-loop in each run before the main IGM calculations start. Halo catlogues can be found in the HaloField (Initial Lagrangian) and PerturbHaloField (Final Eulerian) classes. Each catalogue contains the coordinates and masses of each halo, as well as the correlated RNG used to determine their galaxy properties. Converting from the RNG to the properties can be done with py21cmfast.wrapper.cfuncs.convert_halo_properties. Galaxy properties are not directly stored in these objects for efficiency and so we can correctly account for feedback in the forward time-loop.

The conditional mass functions used to perform integrals have been extended with the Sheth-Tormen CHMF (Sheth+2002) which has been applied to 21cmFAST in both halo and grid based source models, when the user sets HMF=='ST'. All other mass functions rescale the Extended Press-Schechter (EPS) conditional mass function.

Input Parameters

The most significant changes for a user will be how input parameters are passed into simulation in 21cmFASTv4. In version 4 the user will mostly deal with a single structure, InputParameters, while many of the underlying parameters are unchanged, there are now simpler ways to construct parameter sets, and consistency between your inputs is more explicily enforced. Key differences include: * We allow for the creation of TOML templates to easily save parameter sets, and provide several native templates for common modes. Call :func:py21cmfast.run_templates.list_templates for a full list * We no longer fix parameter sets behind the scenes to make them consistent, it is now up to the user to ensure their parameters pass our consistency checks. * While the parameters are still separated by type in the backend (mostly for caching purposes), all parameters are passed as one object to each of our functions.

Outputs and Caching

Significant improvements were made to the caching mechanism for 21cmFAST outputs. We provide the class OutputCache for searching, reading and writing low-level outputs to file, and RunCache for specifying all the outputs needed to complete a run with given inputs. We also provide CacheConfig for a user to specify exactly which output strucutres are cached. high-level functions such as run_coeval and run_lightcone accept the cache keyword argument to specify an OutputCache to write data to, and the write keyword argument to specify a CacheConfig, or simple boolean if one wants to turn on or off caching entirely. For examples on using the cache, see tutorials/caching.

Both the input and output structures have been transformed into attrs classes and can be used with all the methods available in that module.

Renaming of fields/functions

Many changes were made to the names of functions and output fields for clarity. For a full list see docs/updates_from_v3, or the API reference.

What's Changed

  • Stochasticity by @daviesje in https://github.com/21cmfast/21cmFAST/pull/349
  • fix bug in run_coeval using the wrong halobox by @daviesje in https://github.com/21cmfast/21cmFAST/pull/377
  • Fixing some issues in the HaloBox struct and Mass Function Integrals. by @daviesje in https://github.com/21cmfast/21cmFAST/pull/379
  • Halobox memory improvements by @daviesje in https://github.com/21cmfast/21cmFAST/pull/380
  • Large halo number fix by @daviesje in https://github.com/21cmfast/21cmFAST/pull/387
  • Allow halo catalogue cuts to output averages correctly by @daviesje in https://github.com/21cmfast/21cmFAST/pull/389
  • Inverse table improvements by @daviesje in https://github.com/21cmfast/21cmFAST/pull/388
  • fix urgent parameter error by @daviesje in https://github.com/21cmfast/21cmFAST/pull/391
  • Lightcone distance unit fix by @daviesje in https://github.com/21cmfast/21cmFAST/pull/392
  • fix return value order in makelightconeslices by @daviesje in https://github.com/21cmfast/21cmFAST/pull/394
  • change defaults in the branch to the halo sampler model by @daviesje in https://github.com/21cmfast/21cmFAST/pull/397
  • Fix parameter defaults by @daviesje in https://github.com/21cmfast/21cmFAST/pull/402
  • Lx scatter and Nikolic+2024 scaling relations by @daviesje in https://github.com/21cmfast/21cmFAST/pull/406
  • Test improvements by @daviesje in https://github.com/21cmfast/21cmFAST/pull/413
  • fix delta k in RSD velocity gradients for non-cubic boxes by @daviesje in https://github.com/21cmfast/21cmFAST/pull/410
  • remove unneeded param structures before validation by @daviesje in https://github.com/21cmfast/21cmFAST/pull/409
  • fix out-of-bounds access in TF_CLASS by @daviesje in https://github.com/21cmfast/21cmFAST/pull/421
  • C restructure by @daviesje in https://github.com/21cmfast/21cmFAST/pull/417
  • Fixing bugs in HaloBox.c by @daviesje in https://github.com/21cmfast/21cmFAST/pull/422
  • A few small bug fixes by @daviesje in https://github.com/21cmfast/21cmFAST/pull/423
  • Reading compatibility by @daviesje in https://github.com/21cmfast/21cmFAST/pull/425
  • fix UVLF from input parameters bugs by @daviesje in https://github.com/21cmfast/21cmFAST/pull/429
  • add a minimum z to lightcone_sliceplot by @daviesje in https://github.com/21cmfast/21cmFAST/pull/430
  • change default behaviour of from_file and read methods by @daviesje in https://github.com/21cmfast/21cmFAST/pull/431
  • small changes for the upcoming database by @daviesje in https://github.com/21cmfast/21cmFAST/pull/433
  • Filter func tests by @daviesje in https://github.com/21cmfast/21cmFAST/pull/424
  • Remove Recursion by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/415
  • Fixing Tests by @daviesje in https://github.com/21cmfast/21cmFAST/pull/438
  • run lc tests with correct params, stop purging ics for halos by @daviesje in https://github.com/21cmfast/21cmFAST/pull/439
  • Fix some bugs from most recent PR by @daviesje in https://github.com/21cmfast/21cmFAST/pull/440
  • Ionbox refactor by @daviesje in https://github.com/21cmfast/21cmFAST/pull/427
  • Fixing mac build and clang compilation on v4-prep by @daviesje in https://github.com/21cmfast/21cmFAST/pull/441
  • Run templates by @daviesje in https://github.com/21cmfast/21cmFAST/pull/444
  • fix trapezoidal bug, make error messages more clear by @daviesje in https://github.com/21cmfast/21cmFAST/pull/442
  • Fixed Template Filepath Reading by @samgagnon in https://github.com/21cmfast/21cmFAST/pull/447
  • Scaling relation uniformity by @daviesje in https://github.com/21cmfast/21cmFAST/pull/446
  • Fix recombinations error flag by @daviesje in https://github.com/21cmfast/21cmFAST/pull/451
  • remove global_params by @daviesje in https://github.com/21cmfast/21cmFAST/pull/452
  • Fix gamma12 in sub-sampler HaloBox by @daviesje in https://github.com/21cmfast/21cmFAST/pull/455
  • Debug dimensions by @daviesje in https://github.com/21cmfast/21cmFAST/pull/456
  • Output Struct Overhaul by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/445
  • Switch to using ruff by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/459
  • ci: nicer ci by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/460https://github.com/21cmfast/21cmFAST/pull/461
  • Minor fixes to plotting scripts, adding turnover masses to global variables by @daviesje in https://github.com/21cmfast/21cmFAST/pull/464
  • Fixing Some Issues with New Mturn Paramterisation by @daviesje in https://github.com/21cmfast/21cmFAST/pull/466
  • Add pc and caching checks by @daviesje in https://github.com/21cmfast/21cmFAST/pull/465
  • test: add tests for the RunCache by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/469
  • Backend interface overhaul by @daviesje in https://github.com/21cmfast/21cmFAST/pull/468
  • reorganise cosmology functions, setup future speed tests by @daviesje in https://github.com/21cmfast/21cmFAST/pull/471
  • Rare halo Truncation and some extra parameter checks by @daviesje in https://github.com/21cmfast/21cmFAST/pull/474
  • fixed segfault bug without halos but with minihalos and no lya heating by @jordanflitter in
  • https://github.com/21cmfast/21cmFAST/pull/475
  • J21LW exists only if USEMINIHALOS=True by @jordanflitter in https://github.com/21cmfast/21cmFAST/pull/481
  • Fcoll is 4D and FcollMINI exists only if USEHALO_FIELD=False by @jordanflitter in https://github.com/21cmfast/21cmFAST/pull/478
  • Add benchmarking, fix bug that copied all arrays on compute() by @daviesje in https://github.com/21cmfast/21cmFAST/pull/483
  • Add base benchmark by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/488
  • ci: different install strategy by @steven-murray in https://github.com/21cmfast/21cmFAST/pull/487
  • changed upper mass integral limit when HALO_STOCHASTICITY=False by @jordanflitter in https://github.com/21cmfast/21cmFAST/pull/491
  • copy the test workflow installation to the benchmarks by @daviesje in https://github.com/21cmfast/21cmFAST/pull/493
  • Fix caching issues by @daviesje in https://github.com/21cmfast/21cmFAST/pull/490
  • Detect c compiler more interactively by @moll-re in https://github.com/21cmfast/21cmFAST/pull/480
  • Addition of clang-format to pre-commit hooks, preparation for clang-tidy by @daviesje in https://github.com/21cmfast/21cmFAST/pull/496
  • Log the compiler choice during installation by @moll-re in https://github.com/21cmfast/21cmFAST/pull/499
  • Parameter reorganisation by @daviesje in https://github.com/21cmfast/21cmFAST/pull/497
  • Field renaming by @daviesje in https://github.com/21cmfast/21cmFAST/pull/500
  • V4 by @daviesje in https://github.com/21cmfast/21cmFAST/pull/502
  • rename master to main by @daviesje in https://github.com/21cmfast/21cmFAST/pull/503
  • ci: fix deploy to install fftw and co by @steven-murray https://github.com/21cmfast/21cmFAST/pull/506

New Contributors

  • @samgagnon made their first contribution in https://github.com/21cmfast/21cmFAST/pull/447
  • @jordanflitter made their first contribution in https://github.com/21cmfast/21cmFAST/pull/475
  • @moll-re made their first contribution in https://github.com/21cmfast/21cmFAST/pull/480

Full Changelog: https://github.com/21cmfast/21cmFAST/commits/v4.0.0-beta

Scientific Software - Peer-reviewed - C
Published by daviesje about 1 year ago