Closed jchiang87 closed 4 years ago
For the record, here are some light curves produced with the old version of the code, showing the incorrect behavior for different values of tau
:
and here are light curves generated with the corrected version in this PR:
I also computed the structure functions for different combinations of tau
and SF_inf
to see how the scaled versions compare to the expected behavior. Here are scaled structure functions obtained using the old version of the calculation:
and here are the structure functions using the corrected version:
For the record, here's the code I used to compute and plot the structure functions:
def SF(t, f):
'''Compute the structure function of f, assuming it is evenly sampled in time.'''
npts = len(f)
offsets = np.arange(1, npts//2)
my_sf = np.zeros(len(offsets))
for i, dt in enumerate(offsets):
df = f[slice(0, npts - dt)] - f[slice(dt, npts)]
my_sf[i] = np.sqrt(np.mean(df**2)/2.)
return offsets*(t[1] - t[0]), my_sf
delta_mags = agn_mag_norms(mjds, z, tau, SF_inf, seed)
dt, sf = SF(mjds, delta_mags)
plt.plot(dt/tau, sf/SF_inf, s=2)
I'll merge this at 9am PT tomorrow unless I hear otherwise.