# Introduction¶

This is the introduction page for the MJOLNIR software package. The main purpose of this document is to give an overview of different features of the software and how you can contribute to it.

The software is currently developed by Jakob Lass, PhD student at both the Niels Bohr Institute, Copenhagen - Denmark, and the Paul Scherrer Institute, Villigen - Switzerland, and is not developed by a professional team. The software is intended to be used for data treatment and visualization for the CAMEA upgrade at the RITA II instrument at SINQ, PSI Villigen - Switzerland.

The software is found at GitHub and is intended to be used together with Python versions 2.7, (3.4,) 3.5, 3.6, and 3.7. This compatibility is ensured by the use of automated unit test through the Travis project (Travis). Python 3.4 is no longer tested due to updates in the Travis testing framework. Further than just testing, as to ensure a thorough testing the coverage of these are monitored using Coveralls (Coveralls). However, certain algorithms and methods are not suited to be tested through simple tests. This includes graphical methods where one for example uses a plotting routine to generate a specific output. Though the visual inspection is far outside of the testing scope for this software, some of the methods are still tested by simple run through test. That is, if they can be run and generate a plot without crashing and throwing an error, it is believed that they work as intended. This is where actual user testing is needed.

## IPython¶

The MJOLNIR software package makes use of many features of the interactive part of matplotlib. Thus, if the code/tutorials are run through an IPython kernel, these might be absent. However, including the following code snippet to the top of the scripts changes the IPython matplotlib back-end to be interactive:

try:
import IPython
shell = IPython.get_ipython()
shell.enable_matplotlib(gui='qt')
except:
pass


This block can in principal also be included for regular python kernels as it will then through an exception and pass. If the ‘qt’ back-end is not available, one could try a number of others; For a list run “matplotlib.rcsetup.interactive_bk” after import of matplotlib.

## Software Structure¶

The software is divided into individual modules being Instrument, DataSet, and Statistics. With this division it is intended that each part of the software suit is to be fully independent of the others but may be used together. The same goes for the tutorials that are intended to cover all of the methods and workflow a user would come into contact with while using the software.

## Installation¶

The MJOLNIR software package is available for download an installation through the python package installer PyPI. This then allows for an installation by simply writing in a terminal

pip install MJOLNIR


Depending on the set-up on the computer, one recomendation is to install MJOLNIR in a virtual environment through the use of e.g. conda or Anaconda with different packages. Currently, MJOLNIR is not installable through conda thus one needs to first set up the virtual environment and afterwards install the package through PyPI

conda create --name MJOLNIR python=3.6 spyder=3.1.4
pip install MJOLNIR


The specific version of python is not a requirement but merely a suggestion. The same is valid for Spyder which is a recommendable IDE for python and more. The specific version is the last that supports running scripts in interactive python environments.

For a nightly-build version of MJOLNIR, that are currently being developed on the Develop branch one needs only to change an argument to PyPI

pip install -i https://test.pypi.org/simple/ MJOLNIR