Bayesian X-ray Analysis (BXA) v4.0

Bayesian X-ray Analysis (BXA) v4.0 - Published in JOSS (2021)

https://github.com/johannesbuchner/bxa

Science Score: 95.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in JOSS metadata
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    4 of 10 committers (40.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

model-selection nested-sampling python sherpa spectroscopy x-ray-astronomy xspec
Last synced: 4 months ago · JSON representation

Repository

Bayesian X-ray analysis (nested sampling for Xspec and Sherpa)

Basic Info
Statistics
  • Stars: 64
  • Watchers: 6
  • Forks: 20
  • Open Issues: 3
  • Releases: 8
Topics
model-selection nested-sampling python sherpa spectroscopy x-ray-astronomy xspec
Created almost 12 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Contributing License

README.rst

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
   * parallelisation with MPI
* 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
* when analysing low counts data-set with realistic models

because its robust and unsupervised fitting algorithm explores
even complicated parameter spaces in an automated fashion.
The user does not need to initialise to good starting points.
The `algorithm `_ automatically runs until convergence, and slows down to sample
carefully if complicated parameter spaces are encountered. This allows building automated analysis pipelines.

.. image:: https://img.shields.io/pypi/v/BXA.svg
        :target: https://pypi.python.org/pypi/BXA

.. image:: https://coveralls.io/repos/github/JohannesBuchner/BXA/badge.svg
        :target: https://coveralls.io/github/JohannesBuchner/BXA

.. image:: https://img.shields.io/badge/docs-published-ok.svg
        :target: https://johannesbuchner.github.io/BXA/
        :alt: Documentation Status

.. image:: https://img.shields.io/badge/GitHub-JohannesBuchner%2FBXA-blue.svg?style=flat
        :target: https://github.com/JohannesBuchner/BXA/
        :alt: Github repository

Contributors
------------

* David Kaltenbrunner @DaKalt
* David Homan @dshoman
* Ruiz Angel @ruizca
* Liu Teng @lewtonstein
* Carlo Ferrigno @ferrigno
* Charlotte Simmonds
* Brian Refsdal @brefsdal

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, Torben Simm, ... (MPE, Garching)
* Dr. Sibasish Laha, Dr. Alex Markowitz (UCSD, San Diego)
* Dr. Arash Bahramian (Curtin University, Perth)
* Dr. Peter Boorman (U of Southampton, Southampton; ASU, Prague)
* and `you `_?

Documentation
----------------

BXA's `documentation `_ is hosted at http://johannesbuchner.github.io/BXA/

Installation
-------------

First, you need to have either `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 python and some basic 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

BXA requires the following python packages: requests corner astropy h5py cython scipy tqdm.
They should be downloaded automatically. If they are not, install them
also with pip/conda.

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

**Supported operating systems**: 
BXA runs on all operating systems supported by 
`ciao/sherpa `_ or 
`heasoft/xspec `_.
The support is systematically tested for every BXA release by 
`Travis CI `_, but only for Ubuntu Linux.


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. See the documentation pages for how
to perform analyses. Several examples are included.

.. _ultranest: http://johannesbuchner.github.io/UltraNest/

.. _Sherpa: http://cxc.harvard.edu/sherpa/

.. _Xspec: http://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/

Code
-------------------------------

See the `code repository page `_ 

.. _cite:

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:

* for BXA and the contributions to X-ray spectral analysis methodology (model comparison, model discovery, Experiment design, Model discovery through QQ-plots):

	- Buchner et al. (2014) A&A
	- The paper is available at `arXiv:1402.0004 `_
	- `bibtex entry `_

* for UltraNest: see https://johannesbuchner.github.io/UltraNest/issues.html#how-should-i-cite-ultranest
* for Sherpa: see `Sherpa`_
* for Xspec: see `Xspec`_

Owner

  • Name: Johannes Buchner
  • Login: JohannesBuchner
  • Kind: user

JOSS Publication

Bayesian X-ray Analysis (BXA) v4.0
Published
May 01, 2021
Volume 6, Issue 61, Page 3045
Authors
Johannes Buchner ORCID
Max Planck Institute for Extraterrestrial Physics, Giessenbachstrasse, 85741 Garching, Germany, Millenium Institute of Astrophysics, Vicuña MacKenna 4860, 7820436 Macul, Santiago, Chile, Pontificia Universidad Católica de Chile, Instituto de Astrofísica, Casilla 306, Santiago 22, Chile, Excellence Cluster Universe, Boltzmannstr. 2, D-85748, Garching, Germany
Editor
Jeff Gostick ORCID
Tags
X-rays Bayesian inference Nested Sampling Spectroscopy Bayes factors

GitHub Events

Total
  • Issues event: 5
  • Watch event: 5
  • Issue comment event: 8
  • Push event: 21
  • Pull request event: 5
  • Fork event: 1
  • Create event: 3
Last Year
  • Issues event: 5
  • Watch event: 5
  • Issue comment event: 8
  • Push event: 21
  • Pull request event: 5
  • Fork event: 1
  • Create event: 3

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 621
  • Total Committers: 10
  • Avg Commits per committer: 62.1
  • Development Distribution Score (DDS): 0.045
Past Year
  • Commits: 55
  • Committers: 2
  • Avg Commits per committer: 27.5
  • Development Distribution Score (DDS): 0.145
Top Committers
Name Email Commits
Johannes Buchner j****d@g****m 593
DaKalt k****d@m****e 8
Brian Refsdal b****l@h****u 8
David Homan d****n@a****e 6
ruizca 3****a 1
Liu Teng l****u@m****e 1
Carlo Ferrigno f****o@g****m 1
Brian Refsdal b****l@g****m 1
Alberto Masini a****i@d****u 1
Angel Ruiz r****a@n****r 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 45
  • Total pull requests: 14
  • Average time to close issues: about 1 year
  • Average time to close pull requests: 4 months
  • Total issue authors: 25
  • Total pull request authors: 7
  • Average comments per issue: 3.76
  • Average comments per pull request: 0.93
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 4
  • Average time to close issues: 4 months
  • Average time to close pull requests: 3 months
  • Issue authors: 1
  • Pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • grburgess (6)
  • alexkolo (4)
  • JohannesBuchner (3)
  • pboorm (3)
  • ferrigno (3)
  • jpbreuer (2)
  • ivvv (2)
  • cescalara (2)
  • ellot (2)
  • fcotizelati (2)
  • DevangLiya (2)
  • rarcodia (1)
  • kchoX14 (1)
  • facero (1)
  • ghost (1)
Pull Request Authors
  • dshoman (8)
  • ruizca (5)
  • DaKalt (5)
  • jpbreuer (1)
  • bwgref (1)
  • ferrigno (1)
  • amasini90 (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 515 last-month
  • Total docker downloads: 18
  • Total dependent packages: 1
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 42
  • Total maintainers: 1
pypi.org: bxa

Bayesian X-ray spectral analysis

  • Versions: 34
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 515 Last month
  • Docker Downloads: 18
Rankings
Dependent packages count: 4.7%
Forks count: 9.3%
Stargazers count: 9.6%
Average: 10.3%
Dependent repos count: 11.6%
Downloads: 16.0%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: bxa

Bayesian X-ray Analysis (BXA) allows reliable parameter inference and model comparison in X-ray astronomy. BXA connects the nested sampling algorithms MultiNest and UltraNest to the X-ray spectral analysis environments Xspec (https://heasarc.gsfc.nasa.gov/xanadu/xspec/) and Sherpa (http://cxc.cfa.harvard.edu/sherpa/). This allows reliable and automatic Bayesian parameter estimation and model comparison.

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 34.0%
Forks count: 37.3%
Stargazers count: 38.8%
Average: 40.3%
Dependent packages count: 51.2%
Last synced: 4 months ago

Dependencies

setup.py pypi
  • astropy *
  • corner *
  • h5py *
  • matplotlib *
  • numpy *
  • tqdm *
  • ultranest *
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • conda-incubator/setup-miniconda v2 composite
  • coverallsapp/github-action master composite
  • pat-s/always-upload-cache v2.1.5 composite
docker/Dockerfile docker
  • ldouchy/bxa_ciao latest build
.github/workflows/ciao-conda-env.yml actions