A tool for the removal of emission lines from supernova spectra. Follows Finneran et al. (2024). See: https://arxiv.org/abs/2411.11503.
Project description
emlineclipper
Python library to clip emission lines in supernova spectra. Developed by Gabriel Finneran at University College Dublin, Ireland.
Full documentation is available at readthedocs. Further information may be found in Finneran et al. (2024) (see below for details on how to cite this work!).
This package can be installed from PyPI using pip:
pip install emlineclipper
You can also contact me at gabfin15@gmail.com.
How it works
The code takes a spectrum from the user and plots it. It then asks the user to double click the plot at the edges of emission lines to remove.
On each click, a line is drawn. Every pair of clicks is assumed to bracket a line that needs to be removed, these are called bounding lines. Groups of emission lines can be bounded using just two bounding lines, provided they are sufficiently close (a couple of samples apart).
The code then iterates over each pair of bounding lines. The code selects a chunk of the input flux array +/-100Å away from the lower/upper bounding lines by default.
Values within the bounding lines in this chunk are removed before performing a spline fit to the flux (with 5 knots by default). If other user-defined emission lines are present in the fitting window, they are removed as well.
Within the chunk, residuals between the spline and the original spectrum outside the bounding lines are computed. The mean and standard deviation of the difference array is calculated. This is used to resample the spectrum by adding noise to the spline between the bounding lines.
This is performed iteratively from the blue end of the spectrum for each pair of bounding lines.
The code returns the array of flux with the emission lines removed and resampled using hte uncertainty arrays generated during fitting.
Note: Even when a line has been fit, the code performs the next for the next line on the original spectrum, i.e. without removing the previously fit line.
Spectra of SN1997ef from the Weizmann Interactive Supernova Data Repository WISeREP
How to cite this code in your work
If you use emlineclipper in your work, please consider citing (see below for bibtex). I would also appreciated if you could add an acknowledgement such as:
This work has made use of \texttt{emlineclipper}, developed by Gabriel Finneran and available at: \url{https://github.com/GabrielF98/emlineclipper}
@ARTICLE{2024arXiv241111503F,
author = {{Finneran}, Gabriel and {Cotter}, Laura and {Martin-Carrillo}, Antonio},
title = "{Velocity evolution of broad-line Ic supernovae with and without gamma-ray bursts}",
journal = {arXiv e-prints},
keywords = {Astrophysics - High Energy Astrophysical Phenomena},
year = 2024,
month = nov,
eid = {arXiv:2411.11503},
pages = {arXiv:2411.11503},
archivePrefix = {arXiv},
eprint = {2411.11503},
primaryClass = {astro-ph.HE},
adsurl = {https://ui.adsabs.harvard.edu/abs/2024arXiv241111503F},
adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}
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 emlineclipper-1.2.4.tar.gz.
File metadata
- Download URL: emlineclipper-1.2.4.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e861051ff9265afdb39f300ff2ff2efa7ccf6e6f65c0de18160a778519c779c
|
|
| MD5 |
0ec4e97e3515f5bcb68da8273c29449c
|
|
| BLAKE2b-256 |
90d35254526388026a7bbbfe690be0ff4bdf69ed49c37618f70cbce400711734
|
Provenance
The following attestation bundles were made for emlineclipper-1.2.4.tar.gz:
Publisher:
python-publish.yml on GabrielF98/emlineclipper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emlineclipper-1.2.4.tar.gz -
Subject digest:
3e861051ff9265afdb39f300ff2ff2efa7ccf6e6f65c0de18160a778519c779c - Sigstore transparency entry: 150642331
- Sigstore integration time:
-
Permalink:
GabrielF98/emlineclipper@689ef2556ad9c6eb3221a818a15b53860c27397d -
Branch / Tag:
refs/tags/v1.2.4 - Owner: https://github.com/GabrielF98
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@689ef2556ad9c6eb3221a818a15b53860c27397d -
Trigger Event:
release
-
Statement type:
File details
Details for the file emlineclipper-1.2.4-py3-none-any.whl.
File metadata
- Download URL: emlineclipper-1.2.4-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
498406fc91efff08183b5664b38e9d459f798f4bf52eb1571fc7893763cf21af
|
|
| MD5 |
90cabdd279d6d60e82748e65cbb22fb0
|
|
| BLAKE2b-256 |
e8696c6a9bbbd4fc758cfb453db8456029a2ec5a7dc6bdea4a3767e1ecad896b
|
Provenance
The following attestation bundles were made for emlineclipper-1.2.4-py3-none-any.whl:
Publisher:
python-publish.yml on GabrielF98/emlineclipper
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
emlineclipper-1.2.4-py3-none-any.whl -
Subject digest:
498406fc91efff08183b5664b38e9d459f798f4bf52eb1571fc7893763cf21af - Sigstore transparency entry: 150642332
- Sigstore integration time:
-
Permalink:
GabrielF98/emlineclipper@689ef2556ad9c6eb3221a818a15b53860c27397d -
Branch / Tag:
refs/tags/v1.2.4 - Owner: https://github.com/GabrielF98
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@689ef2556ad9c6eb3221a818a15b53860c27397d -
Trigger Event:
release
-
Statement type: