Skip to main content

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

Project description

astrosylva

astrosylva

PyPI version Python versions Documentation Status CI License: MIT

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.0a2.tar.gz (58.2 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.0a2-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: astrosylva-0.1.0a2.tar.gz
  • Upload date:
  • Size: 58.2 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.0a2.tar.gz
Algorithm Hash digest
SHA256 c5a399d12cbdfc262b220e06f14798252c4bc1f9f295de97f927d922f7f073be
MD5 1a907f06ef211ec79336e6a7a6e7ff58
BLAKE2b-256 9407f7ab3fb89229b9472094072e8e9e645f69295ae467be9c4530f05b9f0e22

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: astrosylva-0.1.0a2-py3-none-any.whl
  • Upload date:
  • Size: 37.8 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.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 b87d4a514f3bb987bdc07646bcac44f5fa7ded60a6d9c03693f04af524e29209
MD5 84295f0bd7546b4145a734b3de14ed87
BLAKE2b-256 926424d105c030f7538c2cad4720dad3bdbab5864ff06b454231b5dc39b5855e

See more details on using hashes here.

Provenance

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