Prerequisite:
- python3
- rust
- Python libraries: setuptools setuptools-rust
./setup.py build sudo .:setup install
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.
-
The environment of RUST should be installed beforehand. Read the installation guide of gp_daq as a reference.
-
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
- 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
- Install necessary python packages:
$> sudo pip install setuptools-rust
$> sudo pip install setuptools
- change the directory
$> cd pyef
Compile and install
python3 setup.py build
sudo python3 setup.py install
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.
Update README?