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 at galacticusorg/rockstar2galacticus for reference; new development happens here 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.0a1.tar.gz (57.8 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.0a1-py3-none-any.whl (37.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astrosylva-0.1.0a1.tar.gz
  • Upload date:
  • Size: 57.8 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.0a1.tar.gz
Algorithm Hash digest
SHA256 854f67d5be14722e06dde718e353f31a70354717d34454eed59e670d8ae52eaf
MD5 6352169f3caf4ccde43bccfbe6ed4592
BLAKE2b-256 218c48b7ac2300bc08a41d5f014e694bfbca0ee1124f95693c6e1772bf0b97cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for astrosylva-0.1.0a1.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.0a1-py3-none-any.whl.

File metadata

  • Download URL: astrosylva-0.1.0a1-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.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 8694aa70c6d8ced6c5be3e2fa6f0468fb3246dc8acf93a275ac6d9d1b995a35e
MD5 db4bf95aad348b4e8cd727b1556668d7
BLAKE2b-256 fae36521ccb41ab6deffd0327081f4d0bc88c0a883a0b2b415eeb1120d8c3683

See more details on using hashes here.

Provenance

The following attestation bundles were made for astrosylva-0.1.0a1-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