Skip to main content

Bayesian X-ray spectral analysis

Project description

About Bayesian X-ray Analysis (BXA)

BXA connects the X-ray spectral analysis environments Xspec/Sherpa to the nested sampling algorithm UltraNest for Bayesian Parameter Estimation and Model comparison.

BXA provides the following features:

  • parameter estimation in arbitrary dimensions, which involves:
    • finding the best fit

    • computing error bars

    • computing marginal probability distributions

  • plotting of spectral model vs. the data:
    • for the best fit

    • for each of the solutions (posterior samples)

    • for each component

  • model selection:
    • computing the evidence for the considered model, ready for use in Bayes factors

    • unlike likelihood-ratios, not limited to nested models

  • model discovery:
    • visualize deviations between model and data with Quantile-Quantile (QQ) plots. QQ-plots do not require binning and are more comprehensive than residuals. This will give you ideas on when to introduce more complex models, which may again be tested with model selection

BXA shines especially

  • when systematically analysing a large data-set, or

  • when comparing multiple models, or

  • when analysing low counts data-set

  • when you don’t want to babysit your fits

  • when you don’t want to test MCMC chains for their convergence

https://img.shields.io/pypi/v/BXA.svg https://coveralls.io/repos/github/JohannesBuchner/BXA/badge.svg Documentation Status Github repository

Who is using BXA?

  • Dr. Antonis Georgakakis, Dr. Angel Ruiz (NOA, Athens)

  • Dr. Mike Anderson (MPA, Munich)

  • Dr. Franz Bauer, Charlotte Simmonds (PUC, Jonathan Quirola Vásquez, Santiago)

  • Dr. Stéphane Paltani, Dr. Carlo Ferrigno (ISDC, Geneva)

  • Dr. Zhu Liu (NAO, Beijing)

  • Dr. Georgios Vasilopoulos (Yale, New Haven)

  • Dr. Francesca Civano, Dr. Aneta Siemiginowska (CfA/SAO, Cambridge)

  • Dr. Teng Liu, Adam Malyali, Riccardo Arcodia, Sophia Waddell, … (MPE, Garching)

  • Dr. Sibasish Laha, Dr. Alex Markowitz (UCSD, San Diego)

  • Dr. Arash Bahramian (MSU, East Lansing)

  • and you?

Documentation

BXA’s documentation is hosted at http://johannesbuchner.github.io/BXA/

Installation

First, you need to have Sherpa or Xspec installed and its environment loaded.

BXA itself can installed easily using pip or conda:

$ pip install bxa

If you want to install in your home directory, install with:

$ pip install bxa --user

The following commands should not yield any error message:

$ python -c 'import ultranest'
$ python -c 'import xspec'
$ sherpa

You may need to install required python packages through your package manager. For example:

$ yum install ipython python-matplotlib scipy numpy matplotlib
$ apt-get install python-numpy python-scipy python-matplotlib ipython

The source code is available from https://github.com/JohannesBuchner/BXA, so alternatively you can download and install it:

$ git clone https://github.com/JohannesBuchner/BXA
$ cd BXA
$ python setup.py install

Or if you only want to install it for the current user:

$ python setup.py install --user

Running

In Sherpa, load the package:

jbuchner@ds42 ~ $ sherpa
-----------------------------------------------------
Welcome to Sherpa: CXC's Modeling and Fitting Package
-----------------------------------------------------
CIAO 4.4 Sherpa version 2 Tuesday, June 5, 2012

sherpa-1> import bxa.sherpa as bxa
sherpa-2> bxa.BXASolver?

For Xspec, start python or ipython:

jbuchner@ds42 ~ $ ipython
In [1]: import xspec

In [2]: import bxa.xspec as bxa

In [3]: bxa.BXASolver?

Now you can use BXA.

Code

See the code repository page

Citing BXA correctly

Refer to the accompaning paper Buchner et al. (2014) which gives introduction and detailed discussion on the methodology and its statistical footing.

We suggest giving credit to the developers of Sherpa/Xspec, UltraNest and of this software. As an example:

For analysing X-ray spectra, we use the analysis software BXA (\ref{Buchner2014}),
which connects the nested sampling algorithm UltraNest (\ref{ultranest})
with the fitting environment CIAO/Sherpa (\ref{Fruscione2006}).

Where the BibTex entries are:

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

bxa-4.0.2.tar.gz (50.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bxa-4.0.2-py3.8.egg (4.1 MB view details)

Uploaded Egg

bxa-4.0.2-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file bxa-4.0.2.tar.gz.

File metadata

  • Download URL: bxa-4.0.2.tar.gz
  • Upload date:
  • Size: 50.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for bxa-4.0.2.tar.gz
Algorithm Hash digest
SHA256 85a81d6cfdffed4f02a78547f602456828777ad961c0517bb247379537538171
MD5 bf5e7fdab3a7664c3783f4ca7c4002bc
BLAKE2b-256 ad239436de6e5dfbf2a843256641dcb9d85fcdf33c1927b068ddf2a6c3b4f765

See more details on using hashes here.

File details

Details for the file bxa-4.0.2-py3.8.egg.

File metadata

  • Download URL: bxa-4.0.2-py3.8.egg
  • Upload date:
  • Size: 4.1 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for bxa-4.0.2-py3.8.egg
Algorithm Hash digest
SHA256 4915291fff246d0bc9b91dda19f8755d65fdf7addc35b0db6c760e0970aad232
MD5 6707c2582b7c67c3f4582da7b6f9d1a6
BLAKE2b-256 9d1ca500b4902348836ae5f61696e98b523a4e6a3822140161c0392d3ebdc437

See more details on using hashes here.

File details

Details for the file bxa-4.0.2-py3-none-any.whl.

File metadata

  • Download URL: bxa-4.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.30.0 CPython/3.8.5

File hashes

Hashes for bxa-4.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2aa429a90b8b39a3196f74fac381ba3ea33cf44bcfb88166e76506066b24ea4c
MD5 8b1335cf67459ea826b5a5b59c1e8da7
BLAKE2b-256 c138cdad31b4a739d54c5c991ddde7ff87d3220732d0ab960d2a69c32d924c1e

See more details on using hashes here.

Supported by

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