Baryonic correction for N-body simulations
Project description
Baryonic_Correction_Model
Description
A Python package for applying a baryonic correction model to cosmological simulations following Schneider & Teyssier 2015. This tool helps account for the effects of baryonic physics on dark matter distributions, improving the accuracy of cosmological models without the need for expensive hydrodynamic simulations.
With ever-increasing compute power, cosmological simulations have become more accurate and span larger ranges of redshift and space. But increasing accuracy still comes with a price because ydrodynamic simulations are computationally very expensive compared to only N-Body ones. The baryonic correction method proposed by Schneider & Teyssier in 2015
Table of Contents
Usage
import baryonic_correction as bc
# Load simulation data from Dm Snapshot
data = bc.load_simulation("path/to/simulation")
# Apply baryonic correction
corrected_data = bc.apply_correction(data)
# Save or analyze results
bc.save_results(corrected_data, "path/to/output")
Requirements
- Baryonic correction methods depend on a lot of formulas and profiles which can be quickly overwhelming. This package aims to make it easy to correct N-body simulations to come close to the computationally more expensive hydrodynamic ones.
- This package should be able to read in local CAMELS dark matter snapshots and go through halo by halo and calculate a displacement function. This displacement is then added for each halo respectively and returned as a snapshot. Comparison between two snapshots for accuracy testing.
- Correct reading of snapshot in two files (group, and snapshot) is necessary for further calculations. Accurate modelling from Schneider & Teyssier 2015 will provide accurate results without much computation. The comparison is necessary to verify the results with actual dark matter and hydrodynamic simulations.
- Dependencies:
- Python 3.8+
- NumPy
- SciPy
- Matplotlib
- Astropy
- h5py (for HDF5 file support)
User stories
-
Max is working with CAMELS Simulations and wants to add a mass threshold to halo masses because small halos have very little impact but take a reasonable amount of computational time.
-
Max is working with subparts of CAMELS and wants to simulate with custom parameters because different halos maybe need different model parameters.
-
Max is trying different Simulations and needs to be able to customize input necessary parameters if datastructure is different from camles. To allow tool to work with a wider variety of simulations.
-
Max was working with various CAMELS snapshots and wants to add input checks because the use of gas+dm simulations for the correction can be calculated but makes no sense.
Examples
Example: Basic Correction and Verification
import baryonic_correction as bc
# Apply default correction to a simulation
data = bc.load_simulation("examples/dm_only_sim.hdf5")
corrected = bc.apply_correction(data)
bc.verify_sim(corrected,"examples/gas_sim.hdf5")
License
This project is licensed under the MIT License - see the LICENSE file for details.
Authors
- Maximilian Rauter - GitHub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baryonic_correction-0.0.1.tar.gz.
File metadata
- Download URL: baryonic_correction-0.0.1.tar.gz
- Upload date:
- Size: 37.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c8a33dc29347e66d92838ab7066a176891f410d1bd1f6e57f9c903129928c0a
|
|
| MD5 |
adc1c4ef6493a2a6f80e9c3c7c10e119
|
|
| BLAKE2b-256 |
9a3ce3e13e245985e9e269ecd98e85b7714f54ad0eeb5e0381f9c19f61a1a143
|
File details
Details for the file baryonic_correction-0.0.1-py3-none-any.whl.
File metadata
- Download URL: baryonic_correction-0.0.1-py3-none-any.whl
- Upload date:
- Size: 41.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86f22d4c408d50d3987c59ff0edade4eae82d8cf9b827a2f3b5d295d15a7549c
|
|
| MD5 |
e56893cd8476502e0f786acd4d1a335d
|
|
| BLAKE2b-256 |
51b987c68bbf36f7fb1a0cda803cc73ffd162fee9f67f999e5272df3b1fce77b
|