Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

density_field_properties

Tools for computing and analyzing properties derived from the dark matter density field in cosmological simulations.

This repository provides methods and scripts for:

  • Building the density field from dark matter particles using grid assignment schemes (CIC, TSC, etc.).
  • Computing the tidal tensor and its eigenvalues/eigenvectors.
  • Deriving related quantities such as tidal anisotropy and linear bias.
  • Performing auxiliary analyses on density fields, including smoothing, Fourier transforms, and memory-efficient batching.

Installation

Clone the repository and create the environment:

git clone https://github.com/<your-username>/density_field_properties.git
cd density_field_properties
conda env create -f environment.yml
conda activate density_field

Alternatively, install it as a local editable package:

pip install -e .

Pre-commit installation

To ensure consistent code style and quality, this repository uses pre-commit hooks configured with:

  • Black — automatic code formatter
  • isort — import sorting
  • flake8 — code linting

Install pre-commit

pip install pre-commit

Set up hooks in your local repository

pre-commit install

Run checks manually (optional)

pre-commit run --all-files

The hooks will automatically run on every git commit, ensuring that code is formatted, imports are sorted, and style issues are caught early.


Main dependencies

  • numpy
  • scipy
  • h5py
  • matplotlib
  • tqdm
  • numba (optional, for JIT acceleration)

Scientific context

This codebase is designed for studies involving:


FastPM halo catalogs (Rockstar .list)

Rockstar text catalogs produced after FastPM runs (for example out_0.list under rockstar_out_pm or rockstar_out_nbody) are read with the same RockstarCatalogReader as standalone Rockstar outputs. Do not use FastPMCatalogReader for those .list files; that reader is only for native halos stored in FastPM BigFile snapshots.

Design: reuse RockstarCatalogReader only—no duplicate parser in fastpm.py and no separate fastpm_rockstar catalog alias unless a future requirement justifies it.

CLI example:

python scripts/your_pipeline.py \
  --halo_catalog_name rockstar \
  --halo_file /path/to/fastpm_tfm/rockstar_out_pm/out_0.list

Typical folder layout on shared storage is documented in config/fastpm_folders.md (rockstar_out_pm vs rockstar_out_nbody).

About

Tools for computing and analyzing properties derived from the dark matter density field in cosmological simulations.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages