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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file PyUnfold-0.2.tar.gz.

File metadata

  • Download URL: PyUnfold-0.2.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PyUnfold-0.2.tar.gz
Algorithm Hash digest
SHA256 7e611914bc095e8de29bb40a3adf01fbced7c7282fd5671d2bb311e9e279923e
MD5 2e4309df5ce2219bb52835bfe3b1d3f0
BLAKE2b-256 96754a0a028fbb35ee18cf1763c1a7dadc2db558cab8eacec1c6ea0efc966bdd

See more details on using hashes here.

File details

Details for the file PyUnfold-0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for PyUnfold-0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0b4107d4d67cbe582409748b470cc7b78eb10781b220b41dfe33b147d64ec71c
MD5 19400f6d4b49d4436063c57180628ebc
BLAKE2b-256 a51206dd9bf9413d481ab49373d16e6d56ec031503f1646b089c2b6b5e0a1226

See more details on using hashes here.

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