Package: nuflux
nufluxNuflux is a library for calculating atmospheric neutrino fluxes.InstallationPackagesnuflux is availableon pypi.
If you only need to use nuflux in python this is the easiest way to install it.
Runpip install nuflux.nuflux is packagedon conda-forge. Install withconda install -c conda-forge nuflux.On MacOS you can use homebrew. IceCube maintains atapwhich includes a formulat for nuflux. Run:brew tap "icecube/icecube"
brew install nufluxFrom sourcenuflux uses two different build systems: one based onsetuptoolsand one based onmeson. Which one you should use depends on whether you need to build C++ libraries against nuflux, or are content to use the Python bindings.Prerequisitescfitsiophotosplineboost_pythonsetuptoolsIf you only need to use python you can install it directly through pip:pip install --user git+https://github.com/icecube/nufluxNote 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 theCMAKE_PREFIX_PATHenvironment variable to the root of your photospline installation andBOOST_ROOTto 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/nufluxIf you are running it in IceCube's cvmfs environment you will want to setCMAKE_PREFIX_PATHandBOOST_ROOTto the base of the cvmfs environment which is stored in the environment variableSROOT: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/nufluxMesonIf you want to use nuflux from a c++ program you need to install it with mesongit clone https://github.com/icecube/nuflux
cd nuflux
meson build
ninja -C build
sudo ninja -C build installIf 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 setCMAKE_PREFIX_PATH=/path/to/photospline. Boost usesBOOST_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/tothe 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=FalseYou may also use the environment variableNUFLUX_DATAto specify the path of the raw flux tables if they are in a
place other than where they were installed to.DocumentationYou can build the documentation yourself using sphinx:pip3 install sphinx breathe sphinx_rtd_themeRun ninja with docs/html target:ninja docs/htmlThe latest version of the documentation is automatically uploaded toIceCube documentation serverUsageFrom 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-11from 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);
}