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.1.1.tar.gz (6.8 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.1.1-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for emlineclipper-1.1.1.tar.gz
Algorithm Hash digest
SHA256 355a30b37181d1a023ea2cae21a8d517f42427c9db5d1d16ce06042bcb70390f
MD5 0bd8a6a35ccb7e1a7eba65dc872521f2
BLAKE2b-256 681cc61faf906105c40320842e6c0e174794d89a106a40f9390668be4a496e8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for emlineclipper-1.1.1.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.1.1-py3-none-any.whl.

File metadata

  • Download URL: emlineclipper-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.9 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2bb4b33503f3d547ffdf38cfc98c32b8658bbabeccaba4111641eb22d69fca1f
MD5 3b2e1bb2d79cef3a7da453e6b642915e
BLAKE2b-256 cca8b25b52eb130ff37fa28c9fc9f69615882cb7a24f4b58fa04b40a23ade85c

See more details on using hashes here.

Provenance

The following attestation bundles were made for emlineclipper-1.1.1-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