Package: py-spi
pyspiA python analysis framework for INTEGRAL/SPIPySPIprovides a plugin for3MLfor 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.InstallationPipPySPIcan be installed via pip.pipinstallpy-spiGithubTo install the latest release from Github rungitclonehttps://github.com/BjoernBiltzinger/pyspi.gitAfter that first install the packages from the requirement.txt file withcdpyspi
pipinstall-rrequirements.txtNow you can installPySPIwithpythonsetup.pyinstallAdditional Data FilesThere 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.wgethttps://grb.mpe.mpg.de/pyspi_datafolder&&unzippyspi_datafolder
mvdata/path/to/internal/data&&rm-fpyspi_datafolderEnvironment VariablesNext 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 byPySPIand one to define the path to the internal data folder we downloaded earlier.exportPYSPI=/path/to/external/datafolderexportPYSPI_PACKAGE_DATA=/path/to/internal/dataYou 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.FeaturesPlease have a look at thedocumentationto check out the featuresPySPIprovides. There is also afull example, how to perform a spectral fit for the data for GRB120711A, as well as how to localize the GRB withPySPI.ContributingContributions toPySPIare always welcome. They can come in the form of:IssuesPlease use theGithub issue tracking system for any bugs, for questions, bug reports and or feature requests.Add to Source CodeTo directly contribute to the source code ofPySPI, please fork the Github repository, add the changes to one of the branches in your forked repository and then create apull request to the master of the main repositoryfrom this branch. Code contribution is welcome for different topics:Add FunctionalityIfPySPIis 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 ImprovementYou 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 FixesFixing bugs that you found or that are mentioned in one of the issues is also a good way to contribute toPySPI. 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.DocumentationAdditions or examples, tutorials, or better explanations are always welcome. To ensure that the documentation builds with the current version of the software, we are usingjupytextto write the documentation in Markdown. These are automatically converted to and executed as jupyter notebooks when changes are pushed to Github.TestingIf one wants to run the test suite, simply installpytestandpytest-cov, then runpytest-vin the top level directory.