In [10]:
import pandas as pd
import numpy as np
import pandas as pd
import numpy as np
import json
import os
import glob 
import inspect
import optparse
import time
import copy
import os
import pylab as pl
import numpy as np
import scipy
import json
import sys
import pickle as pkl


cmd_folder = os.path.realpath(os.getenv("SESNCFAlib"))

if cmd_folder not in sys.path:
     sys.path.insert(0, cmd_folder)

import snclasses as snstuff
import templutils as templutils
import utils as snutils
import fitutils as fitutils
import myastrotools as myas
import matplotlib as mpl

pl.rcParams["figure.figsize"] = (10,10)
import urllib, json
import readOSNC
import readlcv_func as readf
reload(snstuff)
reload(readf)

IIbsOSC = pd.read_csv("IIbOSC.csv")

IIbsOSC

print "all:", IIbsOSC.shape[0]
print "no data:", IIbsOSC[np.array(["-" == b for b in IIbsOSC.bump.values])].shape[0]
print "cant tell:", IIbsOSC[np.array(["cant tell" in b for b in IIbsOSC.bump.values])].shape[0]
print "no bump:", IIbsOSC[np.array(["no bump" in b for b in IIbsOSC.bump.values])].shape[0]
print "yes:", IIbsOSC[np.array(["yes" in b for b in IIbsOSC.bump.values])].shape[0]
print "maybe:", IIbsOSC[np.array(["maybe" in b for b in IIbsOSC.bump.values])].shape[0]

     
#pl.ion()
opts = {'yoff':0.5,
        'offdb':False,
        'locdb':False,
        'bin':None, 
        'hostebmv':False,
        'abs':False, 
        'noylabel':False, 
        'ticklabelsz':13,
        'showme':False}
 
#readf.doit(['SN2012P'],opts)


all: 56
no data: 24
cant tell: 18
no bump: 5
yes: 3
maybe: 4

YES!


In [2]:
for i,f in enumerate(IIbsOSC.Name.values):
    #url = "https://sne.space/astrocats/astrocats/supernovae/output/json/%s.json"%f
    if  "yes" in IIbsOSC.bump.values[i]:
        #readOSNC.doit(sn=f, url=url)
        readf.doit([f],opts)


//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn1993J.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
/Users/fbianco/science/Dropbox//strippedcfaSN/SESNCFAlib/snclasses.py:980: FutureWarning: elementwise == comparison failed and returning scalar instead; this will raise an error or perform elementwise comparison in the future.
  if self.lc == {}:
reading small file
Vmax 2449095.23
True



##############  THIS SUPERNOVA IS: ###############

name:  sn1993J
type:  IIb
Vmax date: 2449095.230
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 401, 'I': 365, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 398, 'u': 0, 'w2': 0, 'w1': 0, 'V': 459, 'U': 191, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn1993J ###############
plotting...
//anaconda/lib/python2.7/site-packages/matplotlib/axes/_axes.py:2818: MatplotlibDeprecationWarning: Use of None object as fmt keyword argument to suppress plotting of data values is deprecated since 1.4; use the string "none" instead.
  warnings.warn(msg, mplDeprecation, stacklevel=1)
<matplotlib.figure.Figure at 0x10f2facd0>
<matplotlib.figure.Figure at 0x111933190>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2011dh.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2455733.06
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2011dh
type:  IIb
Vmax date: 2455733.060
Vmax  mag: 0.00
filters:  {'m2': 38, 'B': 145, 'I': 68, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 65, 'u': 0, 'w2': 39, 'w1': 38, 'V': 808, 'U': 77, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2011dh ###############
plotting...
<matplotlib.figure.Figure at 0x10c517a50>
<matplotlib.figure.Figure at 0x1117b0a50>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2013df.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2456470.01
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2013df
type:  IIb
Vmax date: 2456470.010
Vmax  mag: 0.00
filters:  {'m2': 22, 'B': 22, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 0, 'u': 0, 'w2': 24, 'w1': 22, 'V': 21, 'U': 23, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2013df ###############
plotting...
<matplotlib.figure.Figure at 0x1117c0990>
<matplotlib.figure.Figure at 0x104553b90>

Maybe??


In [3]:
for i,f in enumerate(IIbsOSC.Name.values):
    #url = "https://sne.space/astrocats/astrocats/supernovae/output/json/%s.json"%f
    if  "maybe" in IIbsOSC.bump.values[i]:
        #readOSNC.doit(sn=f, url=url)
        readf.doit([f],opts)


//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2008ax.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2454549.88
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2008ax
type:  IIb
Vmax date: 2454549.880
Vmax  mag: 0.00
filters:  {'m2': 10, 'B': 76, 'I': 33, 'H': 32, 'K': 36, 'J': 33, 'i': 60, 'R': 41, 'u': 29, 'w2': 12, 'w1': 19, 'V': 98, 'U': 28, 'r': 104}

##################################################




##############  PLOTTING SUPERNOVA :  sn2008ax ###############
plotting...
<matplotlib.figure.Figure at 0x10477e650>
<matplotlib.figure.Figure at 0x104526810>
loading lit data
trying again /Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/phot/slc.sn08bo.f
reading small file
Vmax 2454569.74
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2008bo
type:  IIb
Vmax date: 2454569.740
Vmax  mag: 0.00
filters:  {'m2': 21, 'B': 66, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 41, 'R': 0, 'u': 0, 'w2': 26, 'w1': 40, 'V': 72, 'U': 28, 'r': 38}

##################################################




##############  PLOTTING SUPERNOVA :  sn2008bo ###############
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2008bo.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
plotting...
<matplotlib.figure.Figure at 0x101bb38d0>
<matplotlib.figure.Figure at 0x101bd0fd0>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2011hs.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2455889.18
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2011hs
type:  IIb
Vmax date: 2455889.180
Vmax  mag: 0.00
filters:  {'m2': 6, 'B': 41, 'I': 14, 'H': 0, 'K': 0, 'J': 0, 'i': 19, 'R': 21, 'u': 6, 'w2': 7, 'w1': 7, 'V': 44, 'U': 17, 'r': 20}

##################################################




##############  PLOTTING SUPERNOVA :  sn2011hs ###############
plotting...
<matplotlib.figure.Figure at 0x112fd00d0>
<matplotlib.figure.Figure at 0x111858990>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2012P.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2455951.885
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2012P
type:  IIb
Vmax date: 2455951.885
Vmax  mag: 0.00
filters:  {'m2': 6, 'B': 32, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 61, 'R': 0, 'u': 0, 'w2': 6, 'w1': 6, 'V': 4, 'U': 6, 'r': 85}

##################################################




##############  PLOTTING SUPERNOVA :  sn2012P ###############
plotting...
<matplotlib.figure.Figure at 0x114caee50>
<matplotlib.figure.Figure at 0x111792fd0>

nope


In [4]:
for i,f in enumerate(IIbsOSC.Name.values):
    #url = "https://sne.space/astrocats/astrocats/supernovae/output/json/%s.json"%f
    if "no bump" in IIbsOSC.bump.values[i]:
        #readOSNC.doit(sn=f, url=url)
        readf.doit([f],opts)


//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/DES16S1kt.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2457643.0
True



##############  THIS SUPERNOVA IS: ###############

name:  DES16S1kt
type:  IIb
Vmax date: 2457643.000
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 0, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 23, 'R': 0, 'u': 0, 'w2': 0, 'w1': 0, 'V': 0, 'U': 0, 'r': 25}

##################################################




##############  PLOTTING SUPERNOVA :  DES16S1kt ###############
plotting...
<matplotlib.figure.Figure at 0x112f89d50>
<matplotlib.figure.Figure at 0x113e41290>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/OGLE16ekf.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2457680.0
True



##############  THIS SUPERNOVA IS: ###############

name:  OGLE16ekf
type:  IIb
Vmax date: 2457680.000
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 0, 'I': 60, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 0, 'u': 0, 'w2': 0, 'w1': 0, 'V': 0, 'U': 0, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  OGLE16ekf ###############
plotting...
<matplotlib.figure.Figure at 0x113e203d0>
<matplotlib.figure.Figure at 0x111c66b10>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2005em.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2453650.0
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2005em
type:  IIb
Vmax date: 2453650.000
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 0, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 23, 'R': 0, 'u': 24, 'w2': 0, 'w1': 0, 'V': 0, 'U': 0, 'r': 23}

##################################################




##############  PLOTTING SUPERNOVA :  sn2005em ###############
plotting...
<matplotlib.figure.Figure at 0x111961790>
<matplotlib.figure.Figure at 0x114cae050>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/sn2012cd.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2456034.6
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2012cd
type:  IIb
Vmax date: 2456034.600
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 0, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 44, 'u': 0, 'w2': 0, 'w1': 0, 'V': 0, 'U': 0, 'r': 14}

##################################################




##############  PLOTTING SUPERNOVA :  sn2012cd ###############
plotting...
<matplotlib.figure.Figure at 0x1045a0f10>
<matplotlib.figure.Figure at 0x101bb49d0>
//anaconda/lib/python2.7/site-packages/numpy/lib/npyio.py:893: UserWarning: loadtxt: Empty input file: "/Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/nirphot/CSS121015-004244+132827.dat"
  warnings.warn('loadtxt: Empty input file: "%s"' % fname)
reading small file
Vmax 2456225.0
True



##############  THIS SUPERNOVA IS: ###############

name:  CSS121015-004244+132827
type:  IIb
Vmax date: 2456225.000
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 29, 'I': 50, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 53, 'u': 0, 'w2': 0, 'w1': 0, 'V': 39, 'U': 16, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  CSS121015-004244+132827 ###############
plotting...
<matplotlib.figure.Figure at 0x10f266550>
<matplotlib.figure.Figure at 0x11200b050>

cant tell


In [11]:
for i,f in enumerate(IIbsOSC.Name.values):
    #url = "https://sne.space/astrocats/astrocats/supernovae/output/json/%s.json"%f
    if "cant tell" in IIbsOSC.bump.values[i]:
        #readOSNC.doit(sn=f, url=url)
        readf.doit([f],opts)


reading small file
Vmax nan
reading small file
Vmax nan
reading small file
Vmax nan
reading small file
Vmax nan
reading small file
Vmax 2451585.5
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2000H
type:  IIb
Vmax date: 2451585.500
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 3, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 6, 'u': 0, 'w2': 0, 'w1': 0, 'V': 3, 'U': 0, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2000H ###############
plotting...
<matplotlib.figure.Figure at 0x111f40d50>
<matplotlib.figure.Figure at 0x111f40490>
reading small file
Vmax nan
reading small file
Vmax 2453314.92



##############  THIS SUPERNOVA IS: ###############

name:  sn2004ff
type:  IIb
Vmax date: 2453314.920
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 0, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 0, 'u': 0, 'w2': 0, 'w1': 0, 'V': 0, 'U': 0, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2004ff ###############
plotting...
reading small file
Vmax 2453504.0
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2005by
type:  IIb
Vmax date: 2453504.000
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 10, 'I': 18, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 18, 'u': 0, 'w2': 0, 'w1': 0, 'V': 19, 'U': 0, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2005by ###############
plotting...
<matplotlib.figure.Figure at 0x10458f950>
<matplotlib.figure.Figure at 0x114c96350>


CfA3



reading small file
Vmax 2453825.71
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2006ba
type:  IIb
Vmax date: 2453825.710
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 5, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 8, 'R': 0, 'u': 0, 'w2': 0, 'w1': 0, 'V': 8, 'U': 0, 'r': 8}

##################################################




##############  PLOTTING SUPERNOVA :  sn2006ba ###############
plotting...
<matplotlib.figure.Figure at 0x112f4c1d0>
<matplotlib.figure.Figure at 0x1125244d0>
reading small file
Vmax 2453984.68
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2006el
type:  IIb
Vmax date: 2453984.680
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 15, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 29, 'R': 0, 'u': 0, 'w2': 0, 'w1': 0, 'V': 32, 'U': 0, 'r': 31}

##################################################




##############  PLOTTING SUPERNOVA :  sn2006el ###############
plotting...
<matplotlib.figure.Figure at 0x111903750>
<matplotlib.figure.Figure at 0x112f23f50>


CfA3



loading lit data
trying again /Users/fbianco/science/Dropbox//strippedcfaSN//literaturedata/phot/slc.sn08aq.f
reading small file
Vmax 2454532.74
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2008aq
type:  IIb
Vmax date: 2454532.740
Vmax  mag: 0.00
filters:  {'m2': 7, 'B': 18, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 14, 'R': 0, 'u': 0, 'w2': 7, 'w1': 7, 'V': 20, 'U': 9, 'r': 14}

##################################################




##############  PLOTTING SUPERNOVA :  sn2008aq ###############
plotting...
<matplotlib.figure.Figure at 0x111ef07d0>
<matplotlib.figure.Figure at 0x114c9cc50>
reading small file
Vmax 2454620.77
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2008cw
type:  IIb
Vmax date: 2454620.770
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 7, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 9, 'R': 0, 'u': 0, 'w2': 0, 'w1': 0, 'V': 7, 'U': 0, 'r': 9}

##################################################




##############  PLOTTING SUPERNOVA :  sn2008cw ###############
plotting...
<matplotlib.figure.Figure at 0x10453bbd0>
<matplotlib.figure.Figure at 0x112eff150>
reading small file
Vmax 2455787.23
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2011ei
type:  IIb
Vmax date: 2455787.230
Vmax  mag: 0.00
filters:  {'m2': 22, 'B': 24, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 0, 'u': 0, 'w2': 23, 'w1': 23, 'V': 24, 'U': 25, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2011ei ###############
plotting...
<matplotlib.figure.Figure at 0x111e20310>
<matplotlib.figure.Figure at 0x112fb2510>
reading small file
Vmax 2455878.89
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2011hg
type:  IIb
Vmax date: 2455878.890
Vmax  mag: 0.00
filters:  {'m2': 1, 'B': 8, 'I': 0, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 0, 'u': 0, 'w2': 1, 'w1': 1, 'V': 8, 'U': 8, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2011hg ###############
plotting...
<matplotlib.figure.Figure at 0x114e60e10>
<matplotlib.figure.Figure at 0x111e109d0>
reading small file
Vmax nan
reading small file
Vmax nan
reading small file
Vmax nan
reading small file
Vmax 2452721.02
True



##############  THIS SUPERNOVA IS: ###############

name:  sn2003bg
type:  IIb
Vmax date: 2452721.020
Vmax  mag: 0.00
filters:  {'m2': 0, 'B': 19, 'I': 17, 'H': 0, 'K': 0, 'J': 0, 'i': 0, 'R': 11, 'u': 0, 'w2': 0, 'w1': 0, 'V': 23, 'U': 0, 'r': 0}

##################################################




##############  PLOTTING SUPERNOVA :  sn2003bg ###############
plotting...
<matplotlib.figure.Figure at 0x113f2cb90>
<matplotlib.figure.Figure at 0x1124d65d0>

In [12]:
!pwd


/Users/fbianco/science/Dropbox/strippedcfaSN/literaturedata

In [ ]: