Skip to main content

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

Metadata

Release files for baryonic-correction 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for baryonic-correction 0.0.1
File Size Uploaded Provenance
baryonic_correction-0.0.1.tar.gz 37.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for baryonic-correction 0.0.1
File Interpreter ABI Platform
baryonic_correction-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 78.9 kB

Release files / baryonic_correction-0.0.1.tar.gz

Download URL baryonic_correction-0.0.1.tar.gz
Size 37.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5c8a33dc29347e66d92838ab7066a176891f410d1bd1f6e57f9c903129928c0a
BLAKE2b-256 checksum
How to use checksums
9a3ce3e13e245985e9e269ecd98e85b7714f54ad0eeb5e0381f9c19f61a1a143
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release files / baryonic_correction-0.0.1-py3-none-any.whl

Download URL baryonic_correction-0.0.1-py3-none-any.whl
Size 41.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86f22d4c408d50d3987c59ff0edade4eae82d8cf9b827a2f3b5d295d15a7549c
BLAKE2b-256 checksum
How to use checksums
51b987c68bbf36f7fb1a0cda803cc73ffd162fee9f67f999e5272df3b1fce77b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Security for baryonic-correction 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page