Metadata-Version: 2.4
Name: bayspec
Version: 0.1.16
Summary: Astronomical spectrum fitting tool
Home-page: https://github.com/jyangch/bayspec
Author: Jun Yang
Author-email: jyang@smail.nju.edu.cn
License: GPLv3
Project-URL: Source Code, https://github.com/jyangch/bayspec
Project-URL: Documentation, https://bayspec.readthedocs.io
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.20.4
Requires-Dist: pandas>=1.4.2
Requires-Dist: scipy>=1.8.0
Requires-Dist: toml>=0.10.2
Requires-Dist: tabulate>=0.9.0
Requires-Dist: plotly>=5.22.0
Requires-Dist: matplotlib>=3.2.1
Requires-Dist: corner>=2.2.1
Requires-Dist: astropy>=5.2.2
Requires-Dist: emcee>=3.1.1
Requires-Dist: pymultinest>=2.12
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# *Welcome* *To* *BAYSPEC* 👋

### A Bayesian Inference-based Spectral Fitting Tool for High-energy Astrophysical Data.

[![PyPI - Version](https://img.shields.io/pypi/v/bayspec?color=blue&logo=PyPI&logoColor=white&style=for-the-badge)](https://pypi.org/project/bayspec/)
[![License: GPL v3](https://img.shields.io/github/license/jyangch/bayspec?color=blue&logo=open-source-initiative&logoColor=white&style=for-the-badge)](https://www.gnu.org/licenses/gpl-3.0)


## Features
- **Bayesian inference-based**: implemented by MCMC (e.g., emcee) or nested sampling (e.g., multinest)
- **Multi-dimensional**: enabling the fit of time-evolving spectra with time-involved physical models
- **Multi-wavelength**: supporting for the joint fitting to multi-wavelength astronomical spectra
- **Friendly interface**: easy-to-use web application developed with streamlit
- **Others**: simultaneous fitting of multi-spectra and multi-models, freely combining available models and add new model


## Installation

_BaySpec_ is available via `pip`:
```bash
$ pip install bayspec
```

### Utilize `multinest` sampler
If you want to use [`Multinest`](https://github.com/rjw57/MultiNest) for Bayesian inference, you can follow the instructions in the [`pymultinest`](https://johannesbuchner.github.io/PyMultiNest/) documentation to install it.

### Access `Astromodels` models
To utilize models from [`Astromodels`](https://astromodels.readthedocs.io/en/latest/notebooks/function_list.html#), ensure that `Astromodels` is installed on your system.

### Access `Xspec` models
To utilize models from [`Xspec`](https://heasarc.gsfc.nasa.gov/xanadu/xspec/manual/Models.html), ensure that both `HEASoft` and `Xspec v12.12.1+` are installed on your system. After confirming that `HEASoft` environment is properly initialized, then you need install [`xspec-models-cxc`](https://github.com/cxcsds/xspec-models-cxc).

**NOTE**: _BaySpec_ currently only supports `Additive` and `Multiplicative` models in `Xspec`.


## BaySpec App

[_BaySpec App_](https://github.com/jyangch/bayspec_app) provides an easy-to-use web application implemented using [`streamlit`](https://streamlit.io/).

[![Open in Streamlit](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://bayspec.streamlit.app)


## Documentation

If you wish to learn about the usage, you may check the [`examples`](https://github.com/jyangch/bayspec/tree/main/examples) or read the [`documentation`](https://bayspec.readthedocs.io).


## License

_BaySpec_ is distributed under the terms of the [`GPL-3.0`](https://www.gnu.org/licenses/gpl-3.0-standalone.html) license.
