Skip to content

sk7372/SESNspectraPCA

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SESNspectraPCA

This repository contains the code for running the PCA + SVM spectral analysis on Stripped-Envelope Core-Collapse Supernovae found in Williamson & Modjaz & Bianco (2019). There are also data products associated with the new SNID templates that were added to the SESNe spectral library compiled from Liu et al. 2016 and Modjaz et al. 2016. The repository is organized into the following folders:

  • /Data contains the pickled spectral datasets used in Williamson & Modjaz & Bianco (2019) at phases 0, 5, 10, 15 days relative to V-band maximum. The spectra have been preprocessed. These pickled files are used in the Tutorial notebook.
  • /SNePCAplots contains final figures showing PCA reconstruction of SN2011ei, cumulative variance captured by principal components, time evolution of the eigenspectra, comparison of mean spectra vs eigenspectra, and SVM classification of SESNe.
  • /code contains the SNePCA.py which implements the PCA and SVM analysis used in Williamson & Modjaz & Bianco (2019). It also contains SNIDsn.py and SNIDdataset.py which are used to load the SNID template files (*.lnw files) and compile them into a dataset for easy use. There are tutorial jupyter notebooks, which generates plots from Williamson & Modjaz & Bianco (2019) and demonstrates how the code is run.

Installing SESNspectraPCA

In order to install the code, you will need conda. Clone or Fork the SESNspectraPCA repository (we encourage pull requests!) then install the conda virtual environment:

conda env create -f sesn_env.yml

The code only supports Python 3, and pickled dataproducts use protocol=2 which is compatible for Python 3 and Python 2. Check out the tutorial notebook to get started.

How to Use the Code

  • Classify new SN spectra -- You may want to use the classification method from Williamson & Modjaz & Bianco (2019) to classify your own spectra. To get started, see the Classify_New_SN_Tutorial.ipynb notebook in the /code directory.
  • Create your own SNID dataset -- If you are doing your own research using SNID templates, you may find the functionality of the SNIDsn class and SNIDdataset module extremely helpful. To get started using these resources, see the SNIDdataset_SNIDsn_Tutorial.ipynb notebook in the /code directory.

Compiling the SESNe SNID Dataset

If you are interested in conducting your own research on stripped-envelope supernovae, you may want to compile our entire SESNe SNID template dataset. This includes the dataset of SuperNova IDentification (SNID); Blondin & Tonry 2007 as well as new and modified SNID templates from our group. Follow these steps:

  1. Download the default SNID library -- The default library of SESNe spectra for SNID can be found on Stephan Blondin's website
  2. Add SNID Templates from nyusngroup -- The research group at New York University (NYU) lead by Professor Maryam Modjaz has published multiple papers presenting new SNID templates of SESNe in the literature, along with making adjustments to the SNID templates in the default SNID library. SESNtemple contains the new and adjusted SNID templates from Liu & Modjaz 2014, Liu et al. 2016 and in Modjaz et al. (2016), that are based on both CfA Data (initially released in Liu & Modjaz 2014) and the rest of literature data (included in Liu et al. 2016 for IIb and Ib, Modjaz et al. 2016 for Ic and Ic-bl). There are also SNID templates for the superluminous SNe presented in Liu, Modjaz & Bianco (2017), based on literature data. Finally, the new SNID templates for SESNe in the literature through August 2018 presented in Williamson & Modjaz & Bianco (2019) are included.
  3. Set up SNID Template Directory -- Gather all of the SNID templates from the above two steps in a directory, and consider defining an environmental variable to be the path to your directory.

Acknowledgement:

If you use data products or the analysis in this code, please acknowledge this work by citing in your paper: Williamson & Modjaz & Bianco (2019).

Williamson & Modjaz & Bianco (2019):

@article{Williamson_2019,
  doi = {10.3847/2041-8213/ab2edb},
  url = {https://doi.org/10.3847%2F2041-8213%2Fab2edb},
  year = 2019,
  month = {jul},
  publisher = {American Astronomical Society},
  volume = {880},
  number = {2},
  pages = {L22},
  author = {Marc Williamson and Maryam Modjaz and Federica B. Bianco},
  title = {Optimal Classification and Outlier Detection for Stripped-envelope Core-collapse Supernovae},
  journal = {The Astrophysical Journal}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 99.0%
  • Python 1.0%