Skip to content

Codes to generate fast HI field-level mocks in real and redshift space

License

Notifications You must be signed in to change notification settings

andrejobuljen/Hi-Fi_mocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hi-Fi mocks

arXiv

Codes to generate fast HI field-level (Hi-Fi) mocks in real and redshift space.


About

Codes to produce 3D neutral hydrogen (HI) over-density fields in real and redshift space tuned to HI clustering properties of Illustris TNG300-1 (L=205 Mpc/h). These codes allow quick and accurate production of HI mocks for any box size and any redshift between z=0-5. This code is accompanying the paper: arXiv:2207.12398/PRD. It is based on the perturbative approach from Schmittfull+18 & +19.

Installation

Hi-Fi mocks are based on and require nbodykit package. To install nbodykit please follow these instructions (preferably using conda). Once installed, also install matplotlib package by running: conda install matplotlib within the nbodykit conda environment.

After succesfully installing nbodykit and matplotlib, download Hi-Fi mocks code. This can be done for example via terminal using:

git clone https://github.com/andrejobuljen/Hi-Fi_mocks.git

Then enter the folder Hi-fi_mocks and follow the next steps. In order to use this code from outside its folder, add Hi-Fi mocks folder to your PYTHONPATH by running in terminal: export PYTHONPATH=/path/to/HI-Fi_mocks:$PYTHONPATH.

Usage

To generate HI mock in real space run the following:

python Hi-Fi_mock_real_space.py

To generate HI mock in redshift space run the following:

python Hi-Fi_mock_redshift_space.py

The parameters for each run are the following:

  • BoxSize, size of the box in units of Mpc/h,
  • Nmesh, number of mesh grids per side,
  • seed, initial condition (IC) seed number,
  • zout output redshift between z=0-5,
  • output_folder, name of the output folder where the fields and power spectra are to be stored.

These parameters can be specified while running codes in the following way:

python Hi-Fi_mock_real_space.py --seed=seed --nmesh=Nmesh --boxsize=BoxSize --output_redshift=zout --output_folder='output_folder'

python Hi-Fi_mock_redshift_space.py --seed=seed --nmesh=Nmesh --boxsize=BoxSize --output_redshift=zout --output_folder='output_folder'

The default values of run parameters are set to those of TNG300-1 (BoxSize=205 Mpc/h, Nmesh=256^3, seed=2695896), and (zout=1).

Based on these given parameters these codes produce HI meshes in real & redshift space using best-fit polynomials for transfer functions tuned to scales in the k range of TNG300-1: 0.03-1 h/Mpc. The transfer function fits are calibrated to the following TNG300-1 output redshifts z=[0,0.5,1,1.5,2,3,5]. The code interpolates transfer functions for other zout values.

For default parameters it takes less than 2 minutes on a modern laptop for the codes to finish, and output final HI overdensity field, figure with smoothed overdensity slice and measured power spectra into the output_folder. Note that for larger box sizes a higher grid resolution is needed in order to probe small scales, which makes the code run slower and requires more memory.

Running the codes in parallel (not fully tested)

To run Hi-Fi mocks in parallel using N processors, run the codes in a following way:

srun -n N python Hi-Fi_mock_real_space.py

and

srun -n N python Hi-Fi_mock_redshift_space.py.

Citation

If you use this code in your research, please cite:

@ARTICLE{2023PhRvD.108h3528O,
       author = {{Obuljen}, Andrej and {Simonovi{\'c}}, Marko and {Schneider}, Aurel and {Feldmann}, Robert},
        title = "{Modeling HI at the field level}",
      journal = {\prd},
     keywords = {Astrophysics - Cosmology and Nongalactic Astrophysics},
         year = 2023,
        month = oct,
       volume = {108},
       number = {8},
          eid = {083528},
        pages = {083528},
          doi = {10.1103/PhysRevD.108.083528},
archivePrefix = {arXiv},
       eprint = {2207.12398},
 primaryClass = {astro-ph.CO},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2023PhRvD.108h3528O},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Author

Acknowledgement

Parts of our code uses scripts from lsstools and parts are based on perr.

About

Codes to generate fast HI field-level mocks in real and redshift space

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published