Skip to main content

Tests codecov Conda-Forge AUR DOI

nuflux

Nuflux is a library for calculating atmospheric neutrino fluxes.

Installation

Packages

nuflux is available on pypi. If you only need to use nuflux in python this is the easiest way to install it. Run pip install nuflux.

nuflux is packaged on conda-forge. Install with conda install -c conda-forge nuflux.

On MacOS you can use homebrew. IceCube maintains a tap which includes a formulat for nuflux. Run:

brew tap "icecube/icecube"
brew install nuflux

From source

nuflux uses two different build systems: one based on setuptools and one based on meson. Which one you should use depends on whether you need to build C++ libraries against nuflux, or are content to use the Python bindings.

Prerequisites

  • cfitsio
  • photospline
  • boost_python

setuptools

If you only need to use python you can install it directly through pip:

pip install --user git+https://github.com/icecube/nuflux

Note that this may fail if photospline and boost_python are installed in nonstandard locations, e.g. headers in /opt/toolsets/photospline/include, libraries in /opt/toolsets/photospline/lib. In this case, set the CMAKE_PREFIX_PATH environment variable to the root of your photospline installation and BOOST_ROOT to the root of your boost installation:

CMAKE_PREFIX_PATH=/opt/toolsets/photospline BOOST_ROOT=/opt/toolsets/boost pip install --user git+https://github.com/icecube/nuflux

If you are running it in IceCube's cvmfs environment you will want to set CMAKE_PREFIX_PATH and BOOST_ROOT to the base of the cvmfs environment which is stored in the environment variable SROOT:

eval `/cvmfs/icecube.opensciencegrid.org/py3-v4.3.0/setup.sh`
CMAKE_PREFIX_PATH=${SROOT} BOOST_ROOT=${SROOT} pip install --user git+https://github.com/icecube/nuflux

Meson

If you want to use nuflux from a c++ program you need to install it with meson

git clone https://github.com/icecube/nuflux
cd nuflux
meson build
ninja -C build
sudo ninja -C build install

If boost and photospline are installed in nonstandard locations, you might need to let meson know with environment variables. Since photospline is detected with cmake you need to set CMAKE_PREFIX_PATH=/path/to/photospline. Boost uses BOOST_ROOT.

For example, in IceCube's cvmfs environment you should do:

CMAKE_PREFIX_PATH=${SROOT} BOOST_ROOT=${SROOT} meson setup build . --prefix=/path/to/install/to

the option -Ddata_path can be used to install the raw flux tables to a directory outside of the PREFIX directory.

If you want to install to a read-only file system you can pass -Dinstall_data=False

You may also use the environment variable NUFLUX_DATA to specify the path of the raw flux tables if they are in a place other than where they were installed to.

Documentation

You can build the documentation yourself using sphinx:

pip3 install sphinx breathe sphinx_rtd_theme

Run ninja with docs/html target:

ninja docs/html

The latest version of the documentation is automatically uploaded to IceCube documentation server

Usage

From python:

>>> import nuflux
>>> flux = nuflux.makeFlux('honda2006')
>>> nu_type=nuflux.NuMu
>>> nu_energy=1e3 # in GeV
>>> nu_cos_zenith = 0.5
>>> flux.getFlux(nu_type,nu_energy,nu_cos_zenith)
2.2395566552347364e-11

from c++:

#include <nuflux/nuflux.h>

int main(){
  boost::shared_ptr<nuflux::FluxFunction> flux;
  flux=nuflux::makeFlux("honda2006");
  nuflux::ParticleType pdgid = nuflux::NuMu;
  double energy = 1e3; // in GeV
  double cos_zenith = 0;
  double f = flux->getFlux(pdgid, energy, cos_zenith);
  assert(f == 4.6476245267530432e-11);
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nuflux-2.0.5.tar.gz (4.3 MB view details)

Uploaded Source

Built Distributions

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

nuflux-2.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

nuflux-2.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

nuflux-2.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

nuflux-2.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

nuflux-2.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

nuflux-2.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.7 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file nuflux-2.0.5.tar.gz.

File metadata

  • Download URL: nuflux-2.0.5.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for nuflux-2.0.5.tar.gz
Algorithm Hash digest
SHA256 c844af23cd176fc70b73438e98c2fa0c5d5519b036b187456b61e38904d22864
MD5 6364f88f99bdac5fe24977a5d02dc4b6
BLAKE2b-256 d6fb967508ef919f5ae471c15bf81e02435fc7f6f84506081e52b78798d1b567

See more details on using hashes here.

File details

Details for the file nuflux-2.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nuflux-2.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c8a1be2b0318a28826e5335c064196e338be9e2535b725f1f279dc10c0142639
MD5 d273dfe343cdf4334bacfed776021c25
BLAKE2b-256 0a56eb2099ef9f4f4804995e2d4b5fa771c7607427f6d05d4e07c6146ea02a15

See more details on using hashes here.

File details

Details for the file nuflux-2.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nuflux-2.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 34ff5cbef75bad0acc9d0d30d3457808eab2f69efc6cba34dd05eba905e78756
MD5 af7a602bb5294d59728021a6c21f2466
BLAKE2b-256 de03f3547737192e4cb434e0cc7b7e630e0c356af2a586026d87cfdaa5a79272

See more details on using hashes here.

File details

Details for the file nuflux-2.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nuflux-2.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a46f690a111062b87bd66748d90c7a9197890e52594b1fc4cc6637ccfdd3c7f9
MD5 a3044f44cda01f2a1fb1625adc314863
BLAKE2b-256 2daf15bcb160e3449d9ade16ebba0a4cd568e16bcc0178d8e4df5987386cd419

See more details on using hashes here.

File details

Details for the file nuflux-2.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nuflux-2.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff047e0c2b946758e401d49d927af33e0902b0a89e5550c51f65301dcf0a4afb
MD5 251b0596e0a9f741ac5c6efa9ff4df14
BLAKE2b-256 5a883859e001e5c2cebbad891a0d4358ee6c337001533936ca86359cfb7835ef

See more details on using hashes here.

File details

Details for the file nuflux-2.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nuflux-2.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2dfc114832dd9a55efe90512da4e25fc136a6cdfbfea884ea4b10e0ac9689f43
MD5 25b2a4314331f0e90d0257b0af8c72cb
BLAKE2b-256 dade9c5aa108d771e0f0f48b44b5c9b4ef4efbe32e0163d203bef1ad6b490d25

See more details on using hashes here.

File details

Details for the file nuflux-2.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nuflux-2.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4fcfea4ded94b0c53553d3b14d3a514879cec4ad9a7300c518b379cab90965fe
MD5 49a46c6889b051632d0c58dc4a186ed3
BLAKE2b-256 5b12c7c8021c2c8a361c0a23c721b3179b18a46a27f6003609290b5005b4be1b

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.7

7 files

This release

2.0.5 This release

7 files

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