Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.01 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.01 KB

PETSIRD basic Python example

This directory contains some Python example code to read/write PETSIRD data.

Install

Some python code is generated by yardl and included in the PyPI distribution.

python3 -m venv ~/petsirdenv
source ~/petsirdenv/bin/activate
pip install petsird

Local Development

(This option needs the yardl binary, either download it, or use our devcontainer or GitHub CodeSpace.)

You need to yardl generate in the model directory first. This will create the Python package files in a petsird subfolder.

cd ../model
yardl generate
pip install --editable ../python

Usage

The Python code shows piping the compact binary format to standard out and reading it from standard in. This can be used as follows:

  1. From the repo root cd python
  2. python petsird_generator.py | python petsird_analysis.py

There is also a very basic utility to plot the scanner geometry. For instance

python petsird_generator.py > test.bin
python petsird_plot_scanner.py < test.bin