Skip to main content

PyUnfold: A Python package for iterative unfolding

Project description

PyUnfold

Build Status Build status codecov pypi version PyPI - Python Version license

PyUnfold is a Python package for implementing the D'Agostini iterative unfolding algorithm.

Installation

Release version

PyUnfold can be easily installed via pip

pip install pyunfold

Development version

The latest development version of PyUnfold can be installed directly from GitHub

pip install git+https://github.com/jrbourbeau/pyunfold.git

or you can fork the GitHub repository and install PyUnfold on your local machine via

git clone https://github.com/<your-username>/pyunfold.git
pip install pyunfold

Quickstart

from pyunfold import iterative_unfold

# Counts distributions
data = [100, 150]
data_err = [10, 12.2]
# Response matrix
response = [[0.9, 0.1],
            [0.1, 0.9]]
response_err = [[0.01, 0.01],
                [0.01, 0.01]]
# Detection efficiencies
efficiencies = [1, 1]
efficiencies_err = [0.01, 0.01]
# Perform iterative unfolding
unfolded = iterative_unfold(data, data_err,
                            response, response_err,
                            efficiencies, efficiencies_err)

The returned unfolded result is a dictionary containing:

  • unfolded: Unfolded cause distribution
  • stat_err: Statistical (Poisson) errors
  • sys_err: Systematic errors associated with limited statistics in the response matrix
print(unfolded)             
{'unfolded': array([ 94.48002622, 155.51997378]),
 'sys_err': array([0.66204237, 0.6620424 ]),
 'stat_err': array([11.2351567 , 13.75617997])}

License

MIT License

Copyright (c) 2018 James Bourbeau, Zigfried Hampel-Arias

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyUnfold-0.2.tar.gz (17.7 kB view hashes)

Uploaded Source

Built Distribution

PyUnfold-0.2-py2.py3-none-any.whl (25.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page