Skip to content

hfoote/snapAnalysis

Repository files navigation

snapAnalysis

An N-body simulation snapshot analysis package. snapAnalysis is designed specifically for working with idealized simulations of at most a few galaxies, rather than cosmological simulations. Currently, it supports any GADGET-format snapshots stored in the hdf5 format, though compatibility with older GADGET binary files is planned for the future. snapAnalysis can also handle fuzzy dark matter snapshots generated by Arepo's BECDM module.

snapAnalysis supports many common workflows for handling snapshots, including particle loading, particle filtering, centering, rotations, coordinate transformations, galaxy shape analysis, particle orbit extraction, galaxy center-of-mass orbit extraction, and more. Also included are a few basic visualization functions for plotting density and potential fields, density and anisotropy profiles, and more. Units are detected automatically from snapshot headers and handled using astropy's units module.

snapAnalysis is still under active development, and may still be missing planned functionality.

Installation

  1. I recommend installing snapAnalysis inside a virtual environment. If you already have one set up, activate it before cloning this repo. Otherwise, create a virtual environment with
python -m venv --system-site-packages </path/to/virtual/env>

then activate it

source </path/to/virtual/env>/bin/activate

and upgrade pip if needed

pip install --upgrade pip

With pip via PyPI

pip install snapanalysis

From Source

NOTE: If you intend to develop/contribute to snapAnalysis, please use the development install instructions.

  1. Clone this repository:
git clone https://github.com/hfoote/snapAnalysis.git
  1. Install with pip:
cd snapAnalysis
python -m pip install .

Tutorials

Tutorial notebooks are available in the tutorials folder. I also encourage you to look through the test suite for further examples of how to use snapAnalysis.

Documentation

Our documentation is hosted on ReadTheDocs here: https://snapanalysis.readthedocs.io/en/latest/

Issues and Contributing

Please see the contribution guidelines.

Acknowledgement

DOI If you use snapAnalysis as part of a published work, we request that you cite the Zenodo record for the version of the source code that you used:

@software{foote_snapanalysis_2026,
  author       = {Hayden R. Foote},
  title        = {hfoote/snapAnalysis: Version 0.1.1},
  month        = may,
  year         = 2026,
  publisher    = {Zenodo},
  version      = {v0.1.1},
  doi          = {10.5281/zenodo.20386578},
  url          = {https://doi.org/10.5281/zenodo.20386578},
}

About

My N-body simulation snapshot analysis package

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors