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
RegularGridInterpolatorfor 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)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coleman_bulge_density_model-0.3.2.tar.gz.
File metadata
- Download URL: coleman_bulge_density_model-0.3.2.tar.gz
- Upload date:
- Size: 77.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5274900cc0ccae42683f932214740f2d0326b2005fa3c061fff17da344da887d
|
|
| MD5 |
7845bacf546e0a470f1901ef0fbafb76
|
|
| BLAKE2b-256 |
0c3958cda35ca661383d0bd096fd5f50c4fcaa84ac3787fcfb248be0b0e86b95
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coleman_bulge_density_model-0.3.2.tar.gz -
Subject digest:
5274900cc0ccae42683f932214740f2d0326b2005fa3c061fff17da344da887d - Sigstore transparency entry: 987378197
- Sigstore integration time:
-
Permalink:
dylannpaterson/coleman_bulge_density_model@344744953e811beb89d2e2e5956c1198f7e603c8 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/dylannpaterson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@344744953e811beb89d2e2e5956c1198f7e603c8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file coleman_bulge_density_model-0.3.2-py3-none-any.whl.
File metadata
- Download URL: coleman_bulge_density_model-0.3.2-py3-none-any.whl
- Upload date:
- Size: 74.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b2d67d0f1673ad01e40d4eccd3e6ca90452e516617ab5b14c1a7f5e2121ca65
|
|
| MD5 |
14b55a0ae66c39a215ae2f904462babd
|
|
| BLAKE2b-256 |
d9bd190dc5521756f16b050be30ea95b80c18e713f3ae9f48829ac585e699dc1
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
coleman_bulge_density_model-0.3.2-py3-none-any.whl -
Subject digest:
3b2d67d0f1673ad01e40d4eccd3e6ca90452e516617ab5b14c1a7f5e2121ca65 - Sigstore transparency entry: 987378287
- Sigstore integration time:
-
Permalink:
dylannpaterson/coleman_bulge_density_model@344744953e811beb89d2e2e5956c1198f7e603c8 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/dylannpaterson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@344744953e811beb89d2e2e5956c1198f7e603c8 -
Trigger Event:
release
-
Statement type: