Metadata-Version: 2.4
Name: crflux
Version: 2.0.0
Summary: Parameterizations of the cosmic ray flux at Earth
Author-email: Anatoli Fedynitch <afedynitch@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/mceq-project/crflux
Project-URL: Documentation, https://mceq-project.github.io/crflux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Physics
Classifier: Intended Audience :: Science/Research
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: matplotlib; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs<2,>=1.6; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Dynamic: license-file

![PyPI](https://img.shields.io/pypi/v/crflux)
![Tests](https://github.com/mceq-project/crflux/actions/workflows/tests.yml/badge.svg)

# `crflux.models`:  parameterizations of the Cosmic Ray flux

Historically, this module was part of the research code for a paper
[A. Fedynitch, J. Becker Tjus, and P. Desiati, Phys. Rev. D 86, 114024
(2012)](http://journals.aps.org/prd/abstract/10.1103/PhysRevD.86.114024),
where we compared the effects of different Cosmic Ray Flux models on the atmospheric lepton flux.

This code is now an integral dependency of the atmospheric neutrino and
air-shower cascade research code [MCEq: Matrix Cascade Equations (MCEq)](https://github.com/afedynitch/MCEq) providing:

- numerical models/parameterizations of high energy cosmic ray fluxes,
- conversions from all-particle into all-nucleon flux,
- geomagnetic cutoff support (rigidity cutoff in GV),
- and other convenience functions for semi-analytical atmospheric lepton flux calculations.

## Documentation

[Documentation](https://mceq-project.github.io/crflux). Please acknowledge the code by citing the paper above.

## Requirements

Python >= 3.9, numpy, scipy.

## Installation

    pip install crflux

## Example

```python
import numpy as np
import crflux.models as mods

model = mods.HillasGaisser2012("H3a")
E = np.logspace(1, 11, 100)
pfrac, p_flux, n_flux = model.p_and_n_flux(E)

# With geomagnetic cutoff of 7 GV
model_cut = mods.HillasGaisser2012("H3a", geomagnetic_cutoff=7.0)
pfrac_cut, p_cut, n_cut = model_cut.p_and_n_flux(E)
```

## Contributors

Hans Dembinski [@HDembinski](https://github.com/HDembinski)

## [MIT LICENSE](LICENSE)

Code and documentation copyright 2015 Anatoli Fedynitch
