Skip to main content

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

GitHub Release Publish with PyPI

Python library to clip emission lines in supernova spectra. Developed by Gabriel Finneran at University College Dublin, Ireland. A full description of the tool is given here, and may also be found in Finneran et al. (2024). See below for how to cite this work!

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.

Screenshot 2024-06-04 at 16 20 23

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}
}

Sources for the spectra

Spectra of SN1997ef from the Weizmann Interactive Supernova Data Repository WISeREP

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

emlineclipper-1.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emlineclipper-1.2.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file emlineclipper-1.2.0.tar.gz.

File metadata

  • Download URL: emlineclipper-1.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for emlineclipper-1.2.0.tar.gz
Algorithm Hash digest
SHA256 66d1e36c3a1c01abe1ac4c9673dc30aea3b769eb8d01961a60406261a2881322
MD5 30107081907bac0c8c2456acf9be8fb9
BLAKE2b-256 b4b8a68cfcdb21857c0948475eab504a031e7e986b3c930a6731f609223d805d

See more details on using hashes here.

Provenance

The following attestation bundles were made for emlineclipper-1.2.0.tar.gz:

Publisher: python-publish.yml on GabrielF98/emlineclipper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file emlineclipper-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: emlineclipper-1.2.0-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

Hashes for emlineclipper-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f59939f67c6d7a0ed1a56e69e960d786b8d08fa5a3f8cb232561c83c9097c1b
MD5 ddb6be7892f9d8fde793932954c3425f
BLAKE2b-256 feedfe8097478c535498f88b6b385883164362a316ada1cabe3953898d46b4de

See more details on using hashes here.

Provenance

The following attestation bundles were made for emlineclipper-1.2.0-py3-none-any.whl:

Publisher: python-publish.yml on GabrielF98/emlineclipper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page