Python module to run Simbelmynë code
Find a file
2026-01-29 10:49:35 +01:00
examples MPI-Rockstar 2025-12-01 10:22:54 +01:00
sbmy_control bugfix crop in power spectrum 2026-01-29 10:49:35 +01:00
.gitignore gitignore 2025-05-27 14:52:48 +02:00
README.md Update README.md 2025-11-04 13:21:44 +00:00
setup.py analysis halos 2025-11-19 16:16:58 +01:00

SBMY CONTROL

SBMY control is a pipeline package for running N-body cosmological simulation based on the Simbelmynë code. It features:

  1. Generation of parameter files, time stepping
  2. Execution of Initial Conditions generation with monofonIC or Simbelmynë
  3. Execution of N-body simulation with Simbelmynë using the tCOLA or sCOLA frameworks or with Gadget-4
  4. Friends-of-friends halo finding with Rockstar
  5. Analysis of results (slices, power spectra, ...)

All of the codes can be run locally or submitted to slurm job scheduler.

Please check the git wiki for more details on the package.

Installation

git clone https://git.aquila-consortium.org/Aquila-Consortium/sbmy_control.git
pip install -e .

Requirements

Simbelmynë needs to be installed and reachable through the pysbmy package.

If wanted, Gadget-4 can be installed, and its source code should be specified with the argument --gadget_source_dir.

If wanted, monofonIC can be installed, and its binary executable can be specified with the argument --monofonic_binary. We recommend using this monofonIC which supports output of \delta,\phi_1,\phi_2 and of the particles snapshot.

If wanted, Rockstar can be installed, and its binary executable can be specified with the argument --rockstar_binary.

Standard python libraries: numpy, matplotlib, h5py, tqdm. Pylians package needs to be installed if you want to compute bispectra.

Commands

SBMY Control

sbmy_control -c config.yaml

or

sbmy_control -d /your/path -M alltCOLA -E slurm -Np 256 -ic monofonic

Exemples of configuration files can be found in the directory examples/

Slices

slices -ref final_density_tCOLA.h5 -f final_density_sCOLA.h5 final_density_other.h5 -l "sCOLA" "Other" -log

The details of all options can be displayed with -h argument.

Power Spectra

power_spectrum -ref final_density_tCOLA.h5 -f final_density_sCOLA.h5 final_density_other.h5 -l "sCOLA" "Other" --kmax 2. --Gfile fourier_grid.h5 --pcbfile "power_spectrum" -ps -cc

API

Modules contains functions that can be imported, and that can happen to be useful. Notably the analysis functions can be used to make plots inside your jupyter notebooks or python scripts. Notably:

from sbmy_control.analysis import slices
from sbmy_control.analysis import power_spectrum

fig, ax = slices.plot_imshow_with_reference([your2D_data1,your2D_data2],titles=["Data 1", "Data 2", ],reference=your2D_ref,ref_label="True Data")
fig1, ax1 = power_spectrum.plot_power_spectra([your3D_data1,your3D_data2],Pk_ref=Pk_ref,labels=["Data 1", "Data 2",],L=L,ylims=None,yticks=None,)

These functions can be run with or without reference to compare to, and other functions are also available.