Skip to main content

A vectorized implementation of the Coleman et al. (2020) Milky Way bulge density model.

Project description

Coleman Bulge Density Model

A vectorized implementation of the Coleman et al. (2020) Milky Way bulge density model.

Features

  • Hybrid Evaluation Engine: Rapidly evaluates density using SciPy's RegularGridInterpolator for coordinates within a pre-computed grid. It gracefully falls back to an analytical "SX" model for extrapolation outside the grid bounds.
  • Vectorized Processing: Fully vectorized to efficiently process large NumPy arrays of coordinates at once.
  • Flexible Coordinate Systems: Accepts inputs in either Sun-centered spherical coordinates (r, lat, lon) or Galactic Cartesian coordinates (x, y, z).
  • Pre-instantiated: The package automatically instantiates the model and loads the pre-computed grid data (model_data.npz) upon import, making it ready to use immediately.

Requirements

  • Python >= 3.8
  • NumPy >= 1.20.0
  • SciPy >= 1.7.0

Installation

You can install this package locally using pip:

pip install coleman_bulge_density_model

Examples

import numpy as np
from coleman_bulge_density import bulge_density_model

# 1. Using Sun-centered spherical coordinates (r, lat, lon)
density, in_bounds = bulge_density_model(r=8.0, lat=0.0, lon=0.0)

# 2. Using Galactic Cartesian coordinates (x, y, z)
# Note: Do not mix coordinate systems.
density, in_bounds = bulge_density_model(x=8.0, y=0.0, z=0.0)

# 3. Processing large arrays
r_arr = np.linspace(0, 15, 100)
lat_arr = np.zeros(100)
lon_arr = np.zeros(100)
densities, bounds = bulge_density_model(r=r_arr, lat=lat_arr, lon=lon_arr)

Hexagonal bin plot showing the spatial distribution of Milky Way bulge density samples across the celestial sphere. The plot uses a color gradient to represent density values, with brighter hexagons indicating higher density regions concentrated toward the galactic center and plane. The visualization demonstrates the model's effectiveness in capturing the bulge structure in Sun-centered coordinates.

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

coleman_bulge_density_model-0.3.2.tar.gz (77.4 MB view details)

Uploaded Source

Built Distribution

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

coleman_bulge_density_model-0.3.2-py3-none-any.whl (74.1 MB view details)

Uploaded Python 3

File details

Details for the file coleman_bulge_density_model-0.3.2.tar.gz.

File metadata

File hashes

Hashes for coleman_bulge_density_model-0.3.2.tar.gz
Algorithm Hash digest
SHA256 5274900cc0ccae42683f932214740f2d0326b2005fa3c061fff17da344da887d
MD5 7845bacf546e0a470f1901ef0fbafb76
BLAKE2b-256 0c3958cda35ca661383d0bd096fd5f50c4fcaa84ac3787fcfb248be0b0e86b95

See more details on using hashes here.

Provenance

The following attestation bundles were made for coleman_bulge_density_model-0.3.2.tar.gz:

Publisher: publish.yml on dylannpaterson/coleman_bulge_density_model

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

File details

Details for the file coleman_bulge_density_model-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for coleman_bulge_density_model-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3b2d67d0f1673ad01e40d4eccd3e6ca90452e516617ab5b14c1a7f5e2121ca65
MD5 14b55a0ae66c39a215ae2f904462babd
BLAKE2b-256 d9bd190dc5521756f16b050be30ea95b80c18e713f3ae9f48829ac585e699dc1

See more details on using hashes here.

Provenance

The following attestation bundles were made for coleman_bulge_density_model-0.3.2-py3-none-any.whl:

Publisher: publish.yml on dylannpaterson/coleman_bulge_density_model

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