# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python [default]
#     language: python
#     name: python3
# ---

from astropy.io import ascii as asc
import astropy.units as u
from matplotlib import pyplot as plt
from supernova import LightCurve2
import glob
import os
import sys
import numpy as np
import visualization as vis
# %matplotlib
plt.style.use('default')
#plt.style.use('seaborn-poster')

sn2012aw = LightCurve2('2012aw')
sn2005ay = LightCurve2('2005ay')
sn2013ej = LightCurve2('2013ej')
sn2009bw = LightCurve2('2009bw')
asassn15oz = LightCurve2('asassn-15oz')

sn2012aw.get_photometry()
sn2012aw.get_abs_mag()
sn2005ay.get_photometry()
sn2005ay.get_abs_mag()
sn2013ej.get_photometry()
sn2013ej.get_abs_mag()
sn2009bw.get_photometry()
sn2009bw.get_abs_mag()
asassn15oz.get_photometry()
asassn15oz.get_abs_mag()

#plt.plot(sn2005ay.phase['V'], sn2005ay.abs_mag['V'], 'o', label='SN2005ay')
plt.figure(figsize=[8.72, 5.19])
plt.plot(sn2012aw.phase['V'], sn2012aw.abs_mag['V'], 'o',  label = '2012aw')
plt.plot(sn2013ej.phase['V'], sn2013ej.abs_mag['V'], 's',label = '2013ej')
plt.plot(sn2009bw.phase['V'], sn2009bw.abs_mag['V'], 'gd',mec='k', label='2009bw')
plt.plot(asassn15oz.phase['V'], asassn15oz.abs_mag['V'], 'k*', label = 'ASAS-SN15oz')
plt.xlim(0, 200)
plt.ylim(-12, -18.5)
plt.title('Light Curve Diversity')
plt.legend(loc='best')
plt.xlabel('Phase (Days)')
plt.ylabel('Absolute Magntidue')
plt.tight_layout()
plt.savefig('../figures/lc_diversity.pdf')

plt.savefig('../figures/lc_diversity.pdf')

from matplotlib.ticker import (MultipleLocator)
fig = plt.figure(figsize=[8, 5])
ax = fig.add_subplot(1,1,1)
ax.plot(sn2013ej.phase['V'], sn2013ej.abs_mag['V'], 'o',markersize=3, label = '2013ej')
ax.set_xlim(-5, 150)
ax.set_ylim(-12, -18.5)
ax.set_xticks(np.arange(0, 150, 25))
minorLocator = MultipleLocator(5)
plt.gca().xaxis.set_minor_locator(minorLocator)
ax.set_title('Light Curve of SN2013ej')
#plt.legend(loc='best')
ax.set_xlabel('Phase (Days)')
ax.set_ylabel('Absolute Magntidue')
plt.tight_layout()
plt.savefig('../figures/lc_example.pdf')





StarcoderdataJupyterScriptsDedupFiltered