Skip to content

A port of Sergey Uvarov's pulse finding code into Python using Boost.python

Notifications You must be signed in to change notification settings

jamesmorad/Python_pulse_processing

Repository files navigation

This directory contains the PulseFinder_BlackBox code as developed by Sergey Uvarov at UC Davis for the LUX collaboration.

The pulse finding algorithm is documented in his thesis.

To use this library in Python, you must first compile the shared object. Assuming a development environment is installed, you will
also need the BOOST libraries as well as the BOOST Python libraries.

http://www.boost.org/users/download/

http://www.boost.org/doc/libs/1_58_0/libs/python/doc/

These can be easily installed with most package managers for your OS of choice. 

Ensure that you have environment variables pointing to the location of the includes and libs for the following:

BOOST_INC --> Points to folder: /path/to/boost_install/boost/BOOSTVERSION#/include
PYTHON_INC --> Points to folder: /path/to/python_install/PYTHONVERSION#/include/pythonPYTHONVERSION#
BOOST_LIB --> Points to folder containing libboost_python.a
PYTHON_LIB --> Points to folder containing libpython2.7.a

Once you have made the shared object, it can be imported in python and used like so:

>> ipython
IPython 3.1.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import PulseFinder_BlackBox
In [2]: myWaveform = [3,4,2,4,6,7,1,1,1,1,1,1,2,3,45,6,7,2,1,1,1] # any python list object will work for this
In [3]: pf = PulseFinder_BlackBox.PulseFinder()
In [4]: pf.Initilize()
In [5]: pf.wave = PulseFinder_BlackBox.to_std_vector(myWaveform)
In [6]: pf.Execute()
In [7]: pulse_bounds = PulseFinder_BlackBox.std_vector_to_py_list_int(pf.borders)

About

A port of Sergey Uvarov's pulse finding code into Python using Boost.python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published