In [1]:
import numpy as np
from astrotools import reader
from astrotools import interpolate
In [2]:
data = reader.read_slap('/Users/szymon/Dropbox/Projects/DES/data/Flux/DES15S2nr.dat')
data = reader.normalize_lc(data)
data = list(reader.slice_band_generator(data))
data = data[1] # Use only one band of the data
In [3]:
data = data.query('(mjd > 57200) & (mjd < 57500)')
In [4]:
gp = interpolate.GP()
gp.fit_reduce(data, init_kernel_size=1000)
In [5]:
x = np.linspace(data['mjd'].min(), data['mjd'].max(), 500)
mu, std = gp.predict(x)
In [6]:
import matplotlib.pyplot as plt
%matplotlib inline
plt.rcParams['figure.figsize'] = 12, 8
In [7]:
plt.errorbar(data['mjd'], data['flux'], yerr=data['flux_err'], fmt='o')
plt.fill_between(x, mu + std, mu - std, alpha=0.4)
plt.plot(x, mu)
Out[7]:
In [ ]: