Skip to main content

A modular Python framework for reading and analyzing GALFORM HDF5 simulation outputs.

Project description

galform_analysis

CI License: MIT

A modular Python framework designed for the efficient reading and analysis of GALFORM HDF5 simulation outputs. This library provides standardized tools for processing large-scale galaxy formation data, from low-level HDF5 I/O to high-level astronomical probes.

Core Features

  • Standardized I/O: Robust loaders for GALFORM galaxies.hdf5 files with support for different output versions.
  • Data Aggregation: Tools to scan simulation directories and aggregate data across subvolumes using high-performance polars dataframes.
  • Mass Functions: Computation of Stellar Mass Functions (SMF), Halo Mass Functions (HMF), and Halo Occupation Distribution (HOD).
  • Correlation Functions: Estimators for 2-point, 3-point, and N-point correlation functions (2PCF/NPCF) including subvolume-weighted corrections for convergence analysis.
  • Redshift-Space Distortions: Estimators for anisotropic clustering ($\xi(s, \mu)$) and multipoles ($\xi_0, \xi_2, \xi_4$).
  • Simulation Management: Built-in configurations for major N-body simulations including L800, Millennium I/II, COLIBRE, and FLAMINGO.

Installation

Install the package in your Python environment:

uv pip install -e .

Dependencies

The library requires numpy, scipy, matplotlib, polars, h5py, seaborn, and Corrfunc. These are automatically managed during installation.

Quick Start

The following example demonstrates how to load a simulation configuration and read galaxy data:

from galform_analysis import SimulationConfig, config
from galform_analysis.readers.loaders import read_snapshot_data

# 1. Access simulation-specific constants (box size, cosmology, etc.)
sim = SimulationConfig('L800')
print(f"Simulation: {sim.name}, Box Size: {sim.box_size} Mpc/h")

# 2. Configure the data location
config.set_base_dir('/path/to/Galform_Out/L800/model_name')

# 3. Load snapshot data for a specific subvolume
data = read_snapshot_data('iz271', ivol=0)
mstar = data['mstar']  # Stellar masses in M_sun/h

Citation & Academic Credit

If you use galform_analysis in your research, please cite the software using the DOI provided above or the following BibTeX entry:

@software{galform_analysis,
  author = {Hickman, Oscar},
  title = {galform_analysis: A modular Python framework for analyzing GALFORM simulation outputs},
  version = {0.1.3},
  doi = {10.5281/zenodo.FIXME},
  url = {https://github.com/OscarHickman/galform_analysis}
}

Simulation Metadata

Configurations for supported simulations are stored centrally in galform_analysis/sim_configs/. This allows for dynamic access to cosmological parameters and volume metadata:

from galform_analysis import SimulationConfig

flamingo = SimulationConfig('FLAMINGO')
omega_m = flamingo.omega_m
h0 = flamingo.h0

Documentation & Examples

Refer to the examples/ directory for interactive Jupyter notebooks:

  • examples/readers/load_snapshot.ipynb: Introduction to data loading.
  • examples/analysis/mass_functions/smf_example.ipynb: Plotting Stellar Mass Functions.
  • examples/analysis/correlation/correlation_example.ipynb: Computing clustering statistics.

Testing & Quality Standards

The project maintains high code quality through automated linting and comprehensive testing:

# Run the test suite
pytest tests

# Check code style
ruff check galform_analysis

Author

Oscar Hickman

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

galform_analysis-0.1.6.tar.gz (61.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

galform_analysis-0.1.6-py3-none-any.whl (75.4 kB view details)

Uploaded Python 3

File details

Details for the file galform_analysis-0.1.6.tar.gz.

File metadata

  • Download URL: galform_analysis-0.1.6.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for galform_analysis-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b0eb8b1a7620d2271bb03aa6f0244441c813a25265ac77724e170c8a4dcbee30
MD5 0c8c1fa69d6c5ce79d0e8f91825cd22e
BLAKE2b-256 a040c393a60ca7684692dae6b3909c43aa66944333a1f03246dda2f19d538886

See more details on using hashes here.

Provenance

The following attestation bundles were made for galform_analysis-0.1.6.tar.gz:

Publisher: release.yml on OscarHickman/galform_analysis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file galform_analysis-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for galform_analysis-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 61f469b0def491e01d159ab33b64ee1c0a8743aa21ff13e30f6e64a06143cb83
MD5 44ebce64931c7172c9cefe5c02703885
BLAKE2b-256 fe2f5ca33ea901f8cc6307eb94cb885f66638ecea7b4d0f9f29bd0fa3ba0cfdb

See more details on using hashes here.

Provenance

The following attestation bundles were made for galform_analysis-0.1.6-py3-none-any.whl:

Publisher: release.yml on OscarHickman/galform_analysis

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page