Skip to content
/ pyef Public
forked from astrojhgu/pyef

Package providing tools to read GP35 event files with python

Notifications You must be signed in to change notification settings

TREND50/pyef

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Package for Reading the Eventfile

OMH 11/02/2019

Prerequisite:

  • python3
  • rust
  • Python libraries: setuptools setuptools-rust

./setup.py build sudo .:setup install

Supported python version

This lib relies on pyo3, which supports both python 2 and 3. However in order to support different python version, some parameters must be set when compiling this (pyef) lib. So currently I decide to only support python3.

Installation

  1. The environment of RUST should be installed beforehand. Read the installation guide of gp_daq as a reference.

  2. To make everything tidy and clean, we create a new directory to contain everything needed and no other things, for example:

$> export BUILD_ROOT='$HOME/build' #can be set as other path
$> mkdir $BUILD_ROOT
$> cd $BUILD_ROOT
  1. Then get necessary libs:
$> git clone https://github.com/PyO3/pyo3.git
$> git clone [email protected]:TREND50/gp_daq.git
$> git clone [email protected]:astrojhgu/pyef.git
  1. Install necessary python packages:
$> sudo pip install setuptools-rust
$> sudo pip install setuptools
  1. change the directory
$> cd pyef

Compile and install

python3 setup.py build
sudo python3 setup.py install

Usage

Launch a ipython shell

import pyef
data=pyef.read_file('somefilename.bin')

Check file header values:

data.header.runnr

Here runnr can be replaced by other keys. Simply type data.header. and press twice, a list of possible keys will appear.

Check the length of event list:

len(data.event_list)

Check the event header:

h=data.event_list[0]
h.header.eventnr

eventnr can be replaced by other keys, use can list possible keys.

Get ADC data:

data.event_list[0].local_station_list[0].adc_buffer

Currently for GRAND, the first [0] can be replaced by other [i] and the second [0] is a fixed value (i.e., every event only contains one local station.

ToDo:

Update README?

About

Package providing tools to read GP35 event files with python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 96.9%
  • Python 3.1%