|
|
pyOPALTools
|
|
|
====
|
|
|
|
|
|
*pyOPALTools* is a post-processing library written in Python.
|
|
|
The main idea behind the library is to provide a common interface to all output formats generated by [OPAL](https://gitlab.psi.ch/OPAL/src/wikis/home) in order to analyse the
|
|
|
data.
|
|
|
data. It is recommended to create a Python virtual environment where you install all necessary Python packages:
|
|
|
|
|
|
* [numpy](http://www.numpy.org/)
|
|
|
* [scipy](https://www.scipy.org/)
|
|
|
* [jupyter notebook](https://jupyter.org/)
|
|
|
* [matplotlib](https://matplotlib.org/)
|
|
|
* [h5py](https://www.h5py.org/)
|
|
|
* [seaborn](https://seaborn.pydata.org/)
|
|
|
|
|
|
In the directory *pyOPALTools/opal/test/* you can find several notebooks that show the
|
|
|
usage of the library. In order to work properly you need to append the path of the root
|
|
|
directory of *pyOPALTools* to *PYTHONPATH*, i.e.
|
|
|
```bash
|
|
|
export PYTHONPATH=/path/to/root/of/pyOPALTools/:$PYTHONPATH
|
|
|
```
|
|
|
You can check if it works by importing the library in an interactive session, e.g.
|
|
|
```bash
|
|
|
>>> import opal
|
|
|
>>>
|
|
|
```
|
|
|
|
|
|
|
|
|
Installation of a virtual Python environment
|
|
|
===========================
|
|
|
It is recommended to create a virtual Python environment. You might need to install [Python3](https://www.python.org/) first.
|
|
|
|
|
|
#### Installation using virtualenv
|
|
|
If you do not have ```virtualenv``` installed, type
|
|
|
```bash
|
|
|
pip install virtualenv
|
|
|
```
|
|
|
in your terminal.
|
|
|
The *pyOPALTools* environment is installed with following steps:
|
|
|
|
|
|
```bash
|
|
|
virtualenv -p `which python3` pyOPALTools.venv
|
|
|
source pyOPALTools.venv/bin/activate
|
|
|
```
|
|
|
The virtual environment can be deactivated with
|
|
|
|
|
|
```bash
|
|
|
deactivate
|
|
|
```
|
|
|
|
|
|
#### Installation using venv
|
|
|
```bash
|
|
|
python3 -m venv pyOPALTools.venv
|
|
|
source pyOPALTools.venv/bin/activate
|
|
|
```
|
|
|
The virtual environment can be deactivated with
|
|
|
|
|
|
```bash
|
|
|
deactivate
|
|
|
```
|
|
|
|
|
|
After clone into xxx you need to update the **PYTHONPATH**
|
|
|
### Installation of dependent packages
|
|
|
|
|
|
`export PYTHONPATH = xxx/pyOPALTools:$PYTHONPATH `
|
|
|
Install Jupyter and additional software in the *activated* environment
|
|
|
|
|
|
In **xxx/pyOPALTools/tests** you find examples. To run type:
|
|
|
```bash
|
|
|
pip install numpy
|
|
|
pip install scipy
|
|
|
pip install jupyter\[notebook\] matplotlib
|
|
|
pip install h5py
|
|
|
pip install pyQt5
|
|
|
pip install seaborn
|
|
|
```
|
|
|
|
|
|
`python testStat-1.py`
|
|
|
![testStat-1](/uploads/e1f30e5b48e8e5da35252a46e9f5e045/testStat-1.png)
|
... | ... | |