Skip to main content

PyPI - Version PyPI - Python Version Downloads

My Project logo

XSNAP: X-ray Supernova Analysis Pipeline

XSNAP (X-ray Supernova Analysis Pipeline) is a Python-based pipeline module that automates every step of X-ray supernova data reduction and analysis, from raw event processing and region selection to spectral fitting. XSNAP provides dedicated standard data calibration and spectral extraction scripts for Chandra X-ray Observatory (CXO), Swift-XRT, XMM-Newton, and NuSTAR data.

XSNAP, with the help of PyXspec, is able to model and fit spectra using a wide range of astrophysical models (e.g., Thermal-Bremsstrahlung and Powerlaw). Additionally, XSNAP can generate photometric data through the fitted spectra.

A follow-up analysis using the Thermal-Bremsstrahlung model can be made, specifically for Type II Supernova. From luminosity fitting to estimating Circumstellar Medium (CSM) densities and mass-loss rates of the supernova progenitors, XSNAP streamines the workflow so you can spend less time on rewriting each analysis manually.

Documentation of XSNAP can be seen in this page

More on analysis functions can be made upon requests :)

Contents

  1. Introduction
  2. Installation
  3. Dependencies
  4. Usage and Example
  5. Problems and Questions

Installing XSNAP

We strongly recommend that you make use of Python virtual environments, or (even better) Conda virtual environments when installing XSNAP.

Currently, XSNAP is available for download in the popular Python Package Index (PyPI).

pip install xsnap

Additionally, XSNAP should be able to be downloaded by cloning this Github repository and run:

git clone https://github.com/fercananything/XSNAP/
cd XNAP
python -m pip install .

Dependencies

Required Dependencies

XSNAP analysis depends heavily on two non-Python softwares:

  • HEASOFT - Version 6.35. Other recent versions should be compatible even if I have yet to test it. It is best to install all the packages; otherwise, install at least NuSTAR, Swift, all of General-Use FTOOLS, and all of XANADU.
  • HEASOFT's PyXspec - Version 2.1.4 (or XSPEC - Version 12.15.0). Other recent versions should be compatible even if I have yet to test it. Additionally, PyXspec should be automatically installed when you install HEASOFT.

While it's not necessarily required, it is strongly recommended to download these non-Python softwares:

  • Chandra Interactive Analysis of Observations (CIAO) - Version 4.17. CIAO is needed if you want to do the spectral extraction from CXO data. It is recommended to install CIAO using the conda create command, i.e. install on a different Python/Conda virtual environment. This is to seperate HEASOFT (and XSPEC) with CIAO and avoid clashes between modules.
  • XMM Science Analysis System (SAS) - Version 22.1. However, other recent versions should still be compatible. SAS is needed if you want to do data calibration and spectral extraction for XMM-Newton. A few extra steps for SAS installation can be found here.
  • HEASARC Calibration Database (CALDB) - Version 2009 Aug 04. The HEASARC CALDB is needed if you want to do data calibration and spectral extraction for Swift-XRT and NuSTAR.
  • CALDB Files for Swift-XRT and NuSTAR. In addition to the CALDB, the CALDB files are needed to be downloaded too. These files are needed if you want to do data calibration and spectral extraction for Swift-XRT and NuSTAR.

Keep in mind, without these softwares, you are only able to import the spectra fitting and analysis modules. These softwares help with the scripts dealing for data calibration and spectral extraction.

Optional Dependencies

This software is completely optional and has minimal impact on the user experience.

  • DS9 - Version 4.1 and above. DS9 is needed to help user's interactivity in making region files.

How to use the module

XSNAP is organized into two main parts: command-line scripts (where users can invoke on the shell or jupyter notebook) and a built-in module or Python API (where you can import functions and classes).

There are six scripts available for users to run:

Script Description
extract-chandra Calibrate & extract spectrum from Chandra observations.
extract-swift Calibrate & extract spectrum from Swift-XRT (PC/WT mode available).
swift-stack-pc Bin & stack Swift-XRT PC-mode data (default 1-day bins).
extract-xmm Calibrate & extract spectrum from XMM-Newton.
extract-nustar Calibrate & extract spectrum from NuSTAR.
make-region Generate ICRS source/background region files. (Physical region files will also be made if user has DS9)

A short tutorial on how to use XSNAP is available in jupyter notebooks here

Problems and Questions

If you encounter a bug, or would like to make a feature request, please use the GitHub issues page.

In addition, if you have further questions, feel free to send me an email at support@xsnap.org

Metadata

Release files for xsnap 0.2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xsnap 0.2.9
File Size Uploaded
xsnap-0.2.9.tar.gz 61.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xsnap 0.2.9
File Interpreter ABI Platform
xsnap-0.2.9-py3-none-any.whl Python 3 none any Details

Total release size: 125.0 kB

Release files / xsnap-0.2.9.tar.gz

Download URL xsnap-0.2.9.tar.gz
Size 61.1 kB
Tags Source
SHA-256 checksum
How to use checksums
11fbe10960d7763e87575577c969b5380e603f28d4bcc3d3255082865853248a
BLAKE2b-256 checksum
How to use checksums
1ca2df8194d34d8717573cc09e1c310285aaaedd06cd21145c1aad0fed5d8f82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 23, 2026.

Transparency log

Release files / xsnap-0.2.9-py3-none-any.whl

Download URL xsnap-0.2.9-py3-none-any.whl
Size 63.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e2c23cd1c0f9eb6c0f427bfff1c067e4ed61e77c225cdf547259f2a537b7c64
BLAKE2b-256 checksum
How to use checksums
5a26e09916c440199d28635c6414b33c8ae429c60dc46afcf99c030c5443a0e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 23, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.9 This release

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page