Installing NuRadioMC / NuRadioReco

Requirements

In order to use NuRadioMC / NuRadioReco, please ensure you are using a version of Python >=3.6, and a UNIX operating system (linux or MacOS). If you are using Windows, consider installing the Windows Subsystem for Linux.

Installation using pip

As of version 2.0.0, NuRadioReco is now a subpackage of NuRadioMC. Both NuRadioMC and NuRadioReco can therefore be installed using pip:

pip install NuRadioMC

NuRadioMC/NuRadioReco will then be available from Python using import NuRadioMC and import NuRadioReco, respectively. The pip installation will also install all core dependencies.

Important

Some optional dependencies cannot be installed using pip and have to be installed manually.

Note

This is the release version of NuRadioMC. If you want the latest (development) version, use

pip install git+https://github.com/nu-radio/NuRadioMC.git

instead, or install it manually (see below).

Development version

The most recent version of NuRadioMC is available on github. It can be downloaded manually from the repository website, or cloned using git

git clone https://github.com/nu-radio/NuRadioMC.git

If you don’t already have it installed, you should install Git. To set up NuRadioMC and install the required dependencies, navigate to the NuRadioMC folder and run the python installer provided:

cd NuRadioMC/
python3 install_dev.py

This will launch an interactive installer that allows you to install all core and some optional dependencies, as well as setting up some git settings in case you want to contribute to NuRadioMC. We highly recommend installing NuRadioMC inside a virtual environment. You can either use python3 -m venv name_of_venv or use a virtual environment manager like conda. If you for some reason do not want to use a virtual environment, you can install the dependencies for the current user only by appending python3 install_dev.py --user.

If the installer above does not work, or you want/need to install additional dependencies, please follow the manual installation instructions below.

PYTHONPATH

To use the development version of NuRadioMC, its installation path needs to be included in the user PYTHONPATH. If the installer does not succesfully do this, please manually add

export PYTHONPATH=/path/to/NuRadioMC:$PYTHONPATH

to your ~/.profile. (Depending on which terminal you use, you may have to modify one of .zprofile, .bashrc or .zshrc instead).

Manual installation

Pip-installable dependencies

To install all (optional and non-optional) dependencies available in pip at once, use the command

pip install numpy scipy matplotlib astropy tinydb tinydb-serialization aenum h5py mysql-python pymongo dash plotly toml peakutils

Note that some optional dependencies are not pip-installable and need to be installed manually

Core Dependencies

  • toml:

    pip install toml
    
  • radiotools:

    pip install radiotools
    
  • numpy:

    pip install numpy
    
  • scipy:

    pip install scipy
    
  • matplotlib:

    pip install matplotlib
    
  • astropy:

    pip install astropy
    
  • tinydb: tinydb version 4.1.1 or newer is required.

    pip install tinydb tinydb-serialization
    
  • Advanced enum:

    pip install aenum
    

Optional Dependencies

These packages are recommended to be able to use all of NuRadioMC/NuRadioReco’s features:

  • h5py to open HDF5 files:

pip install h5py
  • uproot to open RNO-G root files:

pip install uproot awkward
  • To access some detector databases:

  • For SQL datbases install MySQL and mysql-python:

    pip install mysql-python
    
  • For MongoDB databases install:

    pip install pymongo
    
  • To use the Event Display you need plotly and dash:

    pip install dash
    pip install plotly
    

    If you want templates to show up in the Event Display, you need to set up an environment variable NURADIORECOTEMPLATES and have it point to the template directory.

  • The documentation is created using Sphinx. We use the readthedocs theme, and the numpydoc format is used in our docstrings. This dependency is needed only if you want to generate the documentation locally - the online documentation is generated by a Github action automatically. Note that we use the sphinx autodoc feature, which tries to import all modules it documents. So if you are missing some optional dependencies, it will not generate correct documentation for all the code.

    pip install sphinx sphinx_rtd_theme numpydoc
    
  • Some debug plots need peakutils:

    pip install peakutils
    
  • Proposal to use NuRadioMC.EvtGen.NuRadioProposal module:

    pip install proposal==7.6.2
    

    Note that the pip installation for this version of proposal may not work on all systems, in particular:

    • conda cannot be used on all systems (eg. on Mac), in that case use a python venv, see details here

    • if the linux kernel is too old (eg. on some computing clusters), refer to this step-by-step guide

  • To use the channelGalacticNoiseAdder, you need the PyGDSM package.

    pip install git+https://github.com/telegraphic/pygdsm
    

Not pip-installable packages

  • To speed up the analytic ray tracing module, GSL needs to be installed, and $GSL_DIR should point at the correct installation folder. On Linux, GSL can be installed using

    sudo apt-get install libgsl-dev
    

    (On MacOS, use brew install gsl instead - you may have to install homebrew first). With GSL installed, compile the CPP ray tracer by navigating to NuRadioMC/NuRadioMC/SignalProp and running the included install.sh script.

  • To use the RadioPropa numerical ray tracing module, radiopropa needs to be installed. The radiopropa github, with installation instructions, can be found here.

  • To read ARIANNA files, Snowshovel needs to be installed.

  • To read ARA files, ARA ROOT needs to be installed.