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.

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.

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.3.tar.gz (9.2 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.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for emlineclipper-1.2.3.tar.gz
Algorithm Hash digest
SHA256 f6316f8f77d2d2927c9b610ae8852a625fae38a2e98750b0f48e65d093aad95d
MD5 eaf1d10da15f6c10d8206cefab5d4909
BLAKE2b-256 2aa8ad8ce0012bad1ec474393c9ec9001231082a6fcb38585efff680acbf6818

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: emlineclipper-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a96e6fa2ace331fda6f6dc4ddd478ca86e19ad1b4cce476be83497bbee613599
MD5 881a7b0c69f246e1dcd886dc22d2b60a
BLAKE2b-256 337d302868f2a661c096164acc5a2fefe40349f8ecb29521e1b6d13ed07c7787

See more details on using hashes here.

Provenance

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