Skip to main content

pylgframework

A software framework for the Local Group.

The barycentre of the Local Group is routinely adopted as a point estimate. pylgframework replaces the single-line centre-of-mass calculation with a Monte Carlo that propagates the observational uncertainty of the member galaxies, and returns the barycentre together with its uncertainty region.

Frutos Plaza, M. (2026). Membership Systematics of the Local Group Barycentre: Uncertainty Region, Dependence on Member Galaxies, and Consistency with the CMB Dipole. (manuscript; data and code at doi:10.5281/zenodo.23440771)

Status

tests

Installation

Requires Python ≥ 3.11

pip install pylgframework             # core: numpy, pandas, astropy
pip install "pylgframework[rebound]"  # adapter for REBOUND simulations

Installation (for developers)

git clone https://github.com/mfrutosp/pylgframework
cd pylgframework
pip install -e .                 # core: numpy, pandas, astropy
pip install -e ".[rebound]"      # adapter for REBOUND simulations
pip install -e ".[test]"         # development and tests

Quick start

from pylgframework import barycentre, compare, fiducials

res = barycentre(fiducials.WU, n=1000, seed=2000)
print(res)                       # position, velocity, principal axes, CMB-frame speed, assumptions

res.median_position              # kpc, Galactocentric
res.axes                         # 1-sigma principal axes of the barycentre cloud (kpc)
res.vcmb("4")                    # speed w.r.t. the CMB (16th, 50th, 84th percentile, km/s)
res.cloud                        # DataFrame with every realization

# Paired audit of two literature fiducials (identical random draws)
compare(fiducials.WU, fiducials.VDM2012, n=1000, seed=3000)

Available fiducials: WU (Wu et al. 2026), SAWALA (Sawala et al. 2025), VDM2019, VDM2012 and VDM2012_3B (van der Marel et al. 2012, four-body and faithful three-body variants). Each one carries its reference and notes (fiducials.WU.reference).

Memberships: "2" (MW+M31), "3M" (+M33), "3L" (+LMC), "4" (all four).

Assumptions

  • Observables (distance modulus, proper motions, radial velocity, mass) are drawn from Gaussians truncated at ±2σ (the effective standard deviation is about 0.88σ).
  • Sky positions are held fixed; the MW is at rest at the origin of the Galactocentric frame (R0 = 8.122 kpc, v⊙ = (12.9, 245.6, 7.78) km/s).
  • The output is the uncertainty induced by the declared errors, not a complete physical uncertainty region.
  • The uncertainty model is fixed across fiducials unless sigmas= is supplied.

Reproducibility

Realization i of an ensemble with seed s uses numpy.random.default_rng([s, i]). This scheme is part of the public interface. The test suite reproduces Table 1 and Sects. 3 and 4 of the manuscript:

pytest            # fast tests

An example using REBOUND adapter is here tests/test_rebound_simulation.py.

References

The bibliography of the manuscript, including the sources of every fiducial and of the CMB dipole, is in docs/references.bib.

License

MIT.

Metadata

Release files for pylgframework 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylgframework 0.1.1
File Size Uploaded Provenance Actions
pylgframework-0.1.1.tar.gz 16.3 kB Without provenance Details for pylgframework-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pylgframework 0.1.1
File Interpreter ABI Platform Actions
pylgframework-0.1.1-py3-none-any.whl Python 3 none any Details for pylgframework-0.1.1-py3-none-any.whl

Total release size: 30.3 kB

Release files / pylgframework-0.1.1.tar.gz

Download URL pylgframework-0.1.1.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0770a6ed430e483228e5af86a56e6b69fe0d96d81520fcf600b43adb5e49cb78
BLAKE2b-256 checksum
How to use checksums
11f3d7a2cc1fa5d0a44a6208dbb821dc6f111d03f2eda60f37688cbd7ce8d04e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.6

Release files / pylgframework-0.1.1-py3-none-any.whl

Download URL pylgframework-0.1.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
260c000fa43d9013acd815bcc71c6826db61d16d7304d33f2a0c323f13272f27
BLAKE2b-256 checksum
How to use checksums
886b5a9b5c8dc631abf256a6131808e0081a0a9eca59f90d9791a2ce5ba7569e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.6

Security for pylgframework 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page