In [1]:
#Load a specific lightcurve file for testing purposes
import json
import sys
import numpy as np
import emcee
import george
import matplotlib.pyplot as plt
sys.path.append('../classification')
sys.path.append('../gen_lightcurves')
import os
filenames = ['../gen_lightcurves/gp_smoothed/SN2005el_gpsmoothed.json','../gen_lightcurves/gp_smoothed/SDSS-II SN 18165_gpsmoothed.json',
'../gen_lightcurves/gp_smoothed/SN2004dj_gpsmoothed.json']
file_data = {}
for filename in filenames:
with open(filename, 'r') as f:
temp_file_data = json.load(f)
print(temp_file_data.keys())
for key in temp_file_data:
file_data[key] = temp_file_data[key]
In [2]:
for filt in file_data:
mjd = np.array(file_data[filt]['mjd'])
mag = np.array(file_data[filt]['mag'])
magerr = np.array(file_data[filt]['dmag'])
modelmjd = file_data[filt]['modeldate']
modelmag = file_data[filt]['modelmag']
plt.errorbar(mjd,mag,yerr=magerr)
plt.plot(modelmjd, modelmag)
plt.title(filt)
plt.show()
In [ ]:
for filt in file_data: