GlobalSplineFit
Parametric model of cosmic ray flux and composition based on cubic B-spline fits to observational data. Covers all elements Z=1--28, with full covariance propagation and solar modulation.
Installation
pip install globalsplinefit
Quick Start
from globalsplinefit import GSFEnergy
import numpy as np
model = GSFEnergy() # default 2026 fit
model_uso = GSFEnergy(version="2026-USO") # Usoskin 2017 modulation
model_s23e = GSFEnergy(version="2026-SIB23e") # SIBYLL-2.3e-only interpretation
model_epos = GSFEnergy(version="2026-EPOSLHCR") # EPOS-LHC-R only (other half of the mixture)
model_2025 = GSFEnergy(version="2025") # historical release
energy = np.logspace(0, 3, 100) # 1 GeV to 1 TeV total energy
proton_flux = model.flux(energy, "p")
proton_error = model.error(energy, "p")
total_flux = model.total_flux(energy)
# Flux at Earth averaged over a time period (end month EXCLUSIVE):
# (200901, 201001) = calendar year 2009
flux_earth = model.flux(energy, "p", time_interval=(200901, 201001))
Examples
Try the model without installing anything: the GSF Explorer and the tutorial gallery run in the browser.
The tutorials in examples/ are marimo notebooks — plain
Python files you can open interactively or run as scripts:
uv run marimo edit examples/reduced_model.py # interactive
uv run python examples/reduced_model.py # run top to bottom
Need a Jupyter notebook? uvx marimo export ipynb examples/<name>.py -o <name>.ipynb.
How to cite
Please cite the GSF 2026 paper — A. Fedynitch, K. Fujisue, H. Dembinski, and R. Engel, Global Spline Fit: A unified data-driven view of the cosmic-ray spectrum and mass composition from GeV to the highest energies (2026) — and the software version you used. Machine-readable metadata is in CITATION.cff (GitHub's "Cite this repository" button); the documentation lists the reference for every parameter set and solar-modulation potential.
Development
Development uses uv:
git clone https://github.com/gsf-project/globalsplinefit.git
cd globalsplinefit
uv sync --all-extras # creates .venv with all optional dependencies
uv run pytest tests/
uv run pre-commit install
Contributions are welcome — see CONTRIBUTING.md (it also serves as the orientation guide for AI coding agents).
Links
License
BSD 3-Clause. See LICENSE.
Metadata
Release files for globalsplinefit 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| globalsplinefit-2.0.0.tar.gz | 815.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| globalsplinefit-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.4 MB
Release files / globalsplinefit-2.0.0.tar.gz
| Download URL | globalsplinefit-2.0.0.tar.gz |
|---|---|
| Size | 815.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f01b332bbaf51fb47689e148067f6028ba29d512e90596b3195ec65ed30d1b7
|
|
BLAKE2b-256 checksum How to use checksums |
c5e66df951538e1e7e17f57c98d5f0b0c3c2903722a582bff2640b760d640ba3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency logRelease files / globalsplinefit-2.0.0-py3-none-any.whl
| Download URL | globalsplinefit-2.0.0-py3-none-any.whl |
|---|---|
| Size | 626.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e24bd04fe6df265eb49945aee72b85c722bb4f6edd4df82cde3579e08cab061e
|
|
BLAKE2b-256 checksum How to use checksums |
99a45cb2cb779020cb09587a45c0f926fb477bedc705d29ef65291530ed9dbfa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.
Transparency log