Skip to main content

Convert halo merger trees (Consistent-Trees, LHaloTree, SubLink, AHF) into the Galacticus HDF5 input format.

Project description

astrosylva

Carry merger trees from the forest to Galacticus.

A Python library and CLI that converts halo merger-tree catalogues into the Galacticus HDF5 input format.

Supports:

  • Consistent-Trees (Rockstar pipeline; forests.list + locations.dat + tree_*.dat)
  • LHaloTree (Millennium-style binary)
  • SubLink (IllustrisTNG-style HDF5)
  • AHF (Amiga Halo Finder MergerTree output)

This package is a Python port of the original C utility rockstar2galacticus. The legacy C sources are preserved on the rockstar2galacticus branch of this repository for reference; new development happens on main in src/astrosylva/.

Install

pip install astrosylva

Or, from a checkout:

pip install -e ".[dev]"

Quickstart

astrosylva convert config.yaml

A minimal config:

reader:
  name: consistent_trees
  source:
    input_path: ./Illustris-3/tree/trees/
    forests_path: ./Illustris-3/tree/forests.list
    locations_path: ./Illustris-3/tree/locations.dat
  options:
    host_source: pid           # or "upid"
    scale_radius_source: rs    # or "rs_klypin"

writer:
  output_path: galacticus_illustris3.hdf5

metadata:
  cosmology:
    HubbleParam: 0.704
    Omega0: 0.2726
    OmegaLambda: 0.7274
    OmegaBaryon: 0.0456
    sigma_8: 0.809
  simulation:
    boxSize: 75000.0
    simulationCode: AREPO
    startRedshift: 127.0
  groupFinder:
    groupFinderCode: rockstar
    minimumParticleNumber: 10
  haloTrees:
    haloMassesIncludeSubhalos: 1
    forestsAreSelfContained: 1
    treesHaveSubhalos: 1
    velocitiesIncludeHubbleFlow: 0

Values that the reader can introspect from the input data (e.g. cosmological parameters from a Consistent-Trees header) override the metadata block; conflicts emit a MetadataConflictWarning showing both values.

CLI

Command What it does
astrosylva convert <config.yaml> Run the full conversion.
astrosylva readers List discovered readers (entry-point plugins).
astrosylva validate <config.yaml> Parse and validate the config without writing.

Implementation status

Reader Status Notes
Consistent-Trees Implemented Full port; column lookup is name-based.
AHF Experimental .AHF_halos + .AHF_mtree; union-find forests.
SubLink Experimental HDF5; multi-chunk, FOF host resolution.
LHaloTree Experimental Millennium binary; multi-chunk; some proxies.

The Galacticus writer emits formatVersion = 2, matching the legacy C tool's output layout byte-for-byte (group structure, dataset names, attribute names).

License

MIT — see LICENSE.

Contributing

Bug reports, feature requests, and pull requests welcome. See CONTRIBUTING.md for the dev-loop guide and CONTRIBUTORS.md for credits.

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

astrosylva-0.1.0a0.tar.gz (57.3 kB view details)

Uploaded Source

Built Distribution

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

astrosylva-0.1.0a0-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

Details for the file astrosylva-0.1.0a0.tar.gz.

File metadata

  • Download URL: astrosylva-0.1.0a0.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for astrosylva-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 53ebfcf8c7923edb11418841d775f2a0e4fecb6ff18592ec12061a247bbf8ecc
MD5 2651a4cce9605028c7064bfe55718919
BLAKE2b-256 41dbdb12f04a0bfe5cc9a5a9d31aa4508ffe96d198516afde5ac7cf432fea145

See more details on using hashes here.

Provenance

The following attestation bundles were made for astrosylva-0.1.0a0.tar.gz:

Publisher: release.yml on galacticusorg/astrosylva

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

File details

Details for the file astrosylva-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: astrosylva-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 37.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for astrosylva-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 8866906a2adf702f07ad384f38befda69d6bb2cb97da13e67ef5716b548e4112
MD5 d532cec7ccfa48e9c991e1eaaafc4df9
BLAKE2b-256 29739f0ab7f14b4f77937f544f750405cdfd4f9345b7625f5fab2acd23ca26f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for astrosylva-0.1.0a0-py3-none-any.whl:

Publisher: release.yml on galacticusorg/astrosylva

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