A Python-based pipeline module to easily handle data calibration from Chandra, Swift-XRT, XMM-Newton, and NuSTAR data. Additionally, spectral fitting and analysis are available with the help of XSPEC
Project description
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.
More analysis functions can be made upon requests :)
Contents
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.
- 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.
Recommended Dependencies
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xsnap-0.2.5.tar.gz
.
File metadata
- Download URL: xsnap-0.2.5.tar.gz
- Upload date:
- Size: 56.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
1150b2416b40a93474634caaefd030fc34b5adf0aa64ab600fea51d45892f305
|
|
MD5 |
55a579d0bcf01da313cbb92afcff9804
|
|
BLAKE2b-256 |
571421b3d048e73ec3022d197cdffbcca07beccb4f0c459c6c60962e3e27f50a
|
Provenance
The following attestation bundles were made for xsnap-0.2.5.tar.gz
:
Publisher:
publish.yml
on fercananything/XSNAP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
xsnap-0.2.5.tar.gz
-
Subject digest:
1150b2416b40a93474634caaefd030fc34b5adf0aa64ab600fea51d45892f305
- Sigstore transparency entry: 350767706
- Sigstore integration time:
-
Permalink:
fercananything/XSNAP@3b1368d4f7e425a4fa0cf8a72f36456619be44e6
-
Branch / Tag:
refs/tags/v0.2.5
- Owner: https://github.com/fercananything
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@3b1368d4f7e425a4fa0cf8a72f36456619be44e6
-
Trigger Event:
push
-
Statement type:
File details
Details for the file xsnap-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: xsnap-0.2.5-py3-none-any.whl
- Upload date:
- Size: 57.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
79636eb859d6648eda9f1a61bc0a247bdcb10a20df64a33f62c2c448457f80c8
|
|
MD5 |
0561377dd485db504911108ef4bc454d
|
|
BLAKE2b-256 |
d7a6d155acec1285cda3982a71c78af0d03b7f682b69a40af7bccd677ebf77a5
|
Provenance
The following attestation bundles were made for xsnap-0.2.5-py3-none-any.whl
:
Publisher:
publish.yml
on fercananything/XSNAP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
xsnap-0.2.5-py3-none-any.whl
-
Subject digest:
79636eb859d6648eda9f1a61bc0a247bdcb10a20df64a33f62c2c448457f80c8
- Sigstore transparency entry: 350767724
- Sigstore integration time:
-
Permalink:
fercananything/XSNAP@3b1368d4f7e425a4fa0cf8a72f36456619be44e6
-
Branch / Tag:
refs/tags/v0.2.5
- Owner: https://github.com/fercananything
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@3b1368d4f7e425a4fa0cf8a72f36456619be44e6
-
Trigger Event:
push
-
Statement type: