Skip to main content

Perform Fourier de-noising of supernova spectra (Liu et al., 2016). Follows Finneran et al. (2024). See: https://arxiv.org/abs/2411.12574.

Project description

pyspecdenoise documentation

GitHub Release Publish with PyPI

Python library for removing noise from supernova spectra using a Fourier method. Implemented by Gabriel Finneran at University College Dublin, Ireland.

Here is an example showing the input and result for a spectrum of SN2004gq (spectrum taken from WISeREP).

Spectrum Example

A full description of the tool is given here. Further information may be found in Finneran et al. (2024) (see below for details on how to cite this work!).

This algorithm is based on the procedure presented in Liu et al. (2016) (see their Appendix B). This is the first publicly available implementation of this algorithm written in Python.

An IDL version of this code is available from the original developers.

This package can be installed from PyPI using pip:

pip install pyspecdenoise

Full documentation is available here.

Issues can be logged here.

You can also contact me via email.

Basic description

  1. Rebin the spectrum on a log-wavelength axis.
  2. Resample spectrum into equal-width bins. Uses the smallest dispersion as the bin width.
  3. Take the FFT of the flux.
  4. Define the range of wavenumbers/velocities for spectral features (see notes); the FFT indices are determined using k_low and k_high.
  5. Fit the magnitude (M) spectrum with a power law between k_low and k_high.
  6. Compute MEAN(M).
  7. k_noise is the point of intersection between the power law fit and MEAN(M).
  8. Set M = 0 for k > k_noise.
  9. Invert FFT.
  10. Resample spectrum to the original linear grid.

Here is an example image showing the procedure used to determine k_noise (using the same spectrum of SN2004gq from WISeREP):

Spectrum Example

Notes:

  • k is related to the velocity of spectral features in the SN spectrum by k = c/v.
  • k can be chosen to exclude high and low velocity features that are likely not due to the SN.
  • The default values of k are k=300 (3000 km/s) and k=3 (100000 km/s) (Liu et al. 2016).

How to cite this code in your work

If you use pyspecdenoise in your work, please consider citing Finneran et al. (2024) (see below for bibtex).

I would also appreciate it if you could add an acknowledgment such as:

To remove noise from supernova spectra, this work has made use of \texttt{pyspecdenoise},
implemented by Gabriel Finneran and available at: \url{https://github.com/GabrielF98/fouriersmooth}.
@ARTICLE{2024arXiv241112574F,
      author = {{Finneran}, Gabriel and {Martin-Carrillo}, Antonio},
      title = "{Measuring the expansion velocities of broad-line Ic supernovae: An investigation of neglected sources of error in two popular methods}",
      journal = {arXiv e-prints},
      keywords = {Astrophysics - High Energy Astrophysical Phenomena},
      year = 2024,
      month = nov,
      eid = {arXiv:2411.12574},
      pages = {arXiv:2411.12574},
      doi = {10.48550/arXiv.2411.12574},
      archivePrefix = {arXiv},
      eprint = {2411.12574},
      primaryClass = {astro-ph.HE},
      adsurl = {https://ui.adsabs.harvard.edu/abs/2024arXiv241112574F},
      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

pyspecdenoise-1.0.2.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

pyspecdenoise-1.0.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pyspecdenoise-1.0.2.tar.gz.

File metadata

  • Download URL: pyspecdenoise-1.0.2.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyspecdenoise-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3a12b0711c3700804ff4ccdbfc557160073c312df49fdaebb98787d59765ddf0
MD5 b95dc9c9541d78cd86645be9f96ccea1
BLAKE2b-256 f8558e377f366b2ae84478b5b2dd545120abe81686115e2784c84a0b7f1fd6b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspecdenoise-1.0.2.tar.gz:

Publisher: python-publish.yml on GabrielF98/fouriersmooth

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

File details

Details for the file pyspecdenoise-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pyspecdenoise-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for pyspecdenoise-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b07a7e354aed6cbc492cf898d843b20497dbd51ab7301c0579c1d02ba52bedff
MD5 785437f33dac21c3b064bf6fe8f8fe49
BLAKE2b-256 e9a798ec2fa8bcf56adef0b2b8955ddd0e08c39375bb707b4ffafcb24610924d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspecdenoise-1.0.2-py3-none-any.whl:

Publisher: python-publish.yml on GabrielF98/fouriersmooth

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