Getting started

Installing

Installing from PyPI (platform-independent)

Execute pip install pymepix. This should install pymepix including all dependencies.

Installing from git source directly (platform-independent)

You can clone pymepix from our main git repository:

git clone https://gitlab.desy.de/CMI/CMI-public/pymepix.git

Navigate into the pymepix library (cd pymepix) and run python -m pip install .

Build Documentation

To build the documentation for pymepix locally perform the following commands. The first line is only required if there are changes in the package structure or new classes or packages have been added. To only build the existing documentation only the second line must be executed.

1sphinx-apidoc -o ./doc/source/ ./pymepix
2sphinx-build -b html doc/ public/

Adapt pymepix/config/default.yaml according to your setup.

  • timepix:

  • ip: ‘127.0.0.1’ # TCP address of the timepix camera

  • port: 50000 # Port for TCP communication with timepix camera

  • udp_ip1: ‘127.0.0.1’ # IP address on which data is received from timepix 3 and 4

  • udp_ip2: ‘127.0.0.11’ # IP address on which data is received from timepix 4

  • data_port: 8110 # UDP Port receives data on this port

  • sophy_config: ‘path_to_sophy_config’ # ASI SPIDR SoPhy config

  • camera_generation: 3 # 3 or 4

  • zmq_port: 25000 # Port for pipeline ipc with ZeroMQ

  • trainID: (will soon be deprecated)

  • connected: False

  • device: ‘/dev/ttyUSB0’

Dependencies

The majority of pymepix only depends on numpy. To use centroiding, the scikit-learn package is required

  • numpy

  • scikit-learn: Centroiding and data reduction (Using DBSCAN algorithm for clustering)

  • scipy: Calculation of the centroids properties from the identified clusters

  • pyzmq: Inter process communication in the processing pipeline

  • h5py: Saving processed data as hdf5 files

  • tqdm: Display a progessbar for post processing

  • pyyaml: Konfiguration of camera (ip, port, …)

  • pyserial (optional): Only used for inclusion of USBTrainID at FLASH and XFEL