Skip to main content

A python analysis framework for INTEGRAL-SPI

Project description

CI tests Docs codecov

pyspi

alt text

A python analysis framework for INTEGRAL/SPI

PySPI provides a plugin for 3ML for INTEGRAL/SPI data, which allows to analyze GRB data at the moment. In the future we plan to also add support for non transient sources.

Installation

Pip

PySPI can be installed via pip.

pip install py-spi

Github

To install the latest release from Github run

git clone https://github.com/BjoernBiltzinger/pyspi.git

After that first install the packages from the requirement.txt file with

cd pyspi
pip install -r requirements.txt

Now you can install PySPI with

python setup.py install

Additional Data Files

There are a few large data files for the background model and the response that are not included in the Github repository. To get these data files run and specify the path where this data folder should be stored on your local machine. Here you have to change the /path/to/internal/data with the path you want to use on your local computer.

wget https://grb.mpe.mpg.de/pyspi_datafolder && unzip pyspi_datafolder
mv data /path/to/internal/data && rm -f pyspi_datafolder

Environment Variables

Next you have to set two environment variable. One to define the path to the folder of the external data like the different SPI data files that will be downloaded by PySPI and one to define the path to the internal data folder we downloaded earlier.

export PYSPI=/path/to/external/datafolder
export PYSPI_PACKAGE_DATA=/path/to/internal/data

You should add these two line to your bashrc (or similar) file to automatically set this variable in every new terminal.

Now we are ready to go.

Features

Please have a look at the documentation to check out the features PySPI provides. There is also a full example, how to perform a spectral fit for the data for GRB120711A, as well as how to localize the GRB with PySPI.

Contributing

Contributions to PySPI are always welcome. They can come in the form of:

Issues

Please use the Github issue tracking system for any bugs, for questions, bug reports and or feature requests.

Add to Source Code

To directly contribute to the source code of PySPI, please fork the Github repository, add the changes to one of the branches in your forked repository and then create a pull request to the master of the main repository from this branch. Code contribution is welcome for different topics:

Add Functionality

If PySPI is missing some functionality that you need, you can either create an issue in the Github repository or add it to the code and create a pull request. Always make sure that the old tests do not break and adjust them if needed. Also please add tests and documentation for the new functionality in the pyspi/test folder. This ensures that the functionality will not get broken by future changes to the code and other people will know that this feature exists.

Code Improvement

You can also contribute code improvements, like making calculations faster or improve the style of the code. Please make sure that the results of the software do not change in this case.

Bug Fixes

Fixing bugs that you found or that are mentioned in one of the issues is also a good way to contribute to PySPI. Please also make sure to add tests for your changes to check that the bug is gone and that the bug will not recur in future versions of the code.

Documentation

Additions or examples, tutorials, or better explanations are always welcome. To ensure that the documentation builds with the current version of the software, we are using jupytext to write the documentation in Markdown. These are automatically converted to and executed as jupyter notebooks when changes are pushed to Github.

Testing

If one wants to run the test suite, simply install pytest and pytest-cov, then run

pytest -v

in the top level directory.

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

py-spi-1.0.0.tar.gz (44.9 kB view details)

Uploaded Source

File details

Details for the file py-spi-1.0.0.tar.gz.

File metadata

  • Download URL: py-spi-1.0.0.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.13

File hashes

Hashes for py-spi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 865ef459c620ca3b77c8ba01626868420a033465cda500dab83b6a32edefe9ce
MD5 b2d49b3bc529a839e42776ea48a55622
BLAKE2b-256 e736a92db0fc5fb483bbcd20940ee3bcc60edb5406e2d5f3efc64a52db473ca6

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