def gen_fake(self): ''' make fake lightcurves :return: mf.myfake arguments are wavelengths: enter the wavelengths (-1 indicates an emission line light curve modelled with a top-hat response), snr: set the signal-to-noise relative to light curve rms cadence:set the mean cadence top hat centroid: set the centroid for the top-hat (I think thats what this does but the line lag thing is still newish so Im used to just making continuum light curve) ''' synthetic_data = mf.myfake(self.fake_wavelength, self.fake_snr, self.fake_cadence, thcent=20.0) self.dat = synthetic_data['echo light curves']
def gen_fake(self, iseed=-1): ''' make fake lightcurves :return: mf.myfake arguments are wavelengths: enter the wavelengths (-1 indicates an emission line light curve modelled with a top-hat response), snr: set the signal-to-noise relative to light curve rms cadence:set the mean cadence top hat centroid: set the centroid for the top-hat (I think thats what this does but the line lag thing is still newish so Im used to just making continuum light curve) ''' synthetic_data = mf.myfake(self.fake_wavelength, self.fake_snr, self.fake_cadence, embh=self.BHMass, er=self.EddRat, eta=self.BHefficiency, thcent=self.line_lag, degi=self.disk_inc, thi=self.time_baseline, iseed=iseed, sx=self.disk_TXslope) self.dat = synthetic_data['echo light curves']
import astropy_stark.myfake as mf import matplotlib.pylab as plt import numpy as np output_directory = 'fit_synthetic_lightcurves_background_polynomial' ''' same as test_pycecream.py but using a background polynomial light curve ''' synthetic_data = mf.myfake( [4000.0,5000.0,5000.0,7000.0], [50.0,50.0,10.0,50.0], [1.0,1.0,2.0,1.0], thcent = 20.0 ) '''This recovers the synthetic data''' dat = synthetic_data['echo light curves'] ''' Now append a simple polynomial model''' tlo = dat[0][:,0] thi = dat[0][:,-1] n = len(dat[0]) t = np.arange(n)/n*(thi - tlo) + tlo x = 5.0 + 2.0*t + 0.1*t**2 x = (x - np.mean(x))/np.std(x) sig = np.ones(n)*0.05
import astropy_stark.myfake as mf import matplotlib.pylab as plt lc1 = mf.myfake([-1.0, -1.0], [50.0, 100.], [1.0, 2.0], sdforcein=[1.0, 1.0], meanforcein=[0.0, 0.0], thcent=20.0, iseed=12345)['echo light curves'] lc2 = mf.myfake([-1.0], [50.0], [1.0], thcent=5.0, sdforcein=[2.0], meanforcein=[5.0], iseed=12345)['echo light curves'] dat = lc1 + lc2 #plot the light curves here to demonstrate fig = plt.figure() ax1 = fig.add_subplot(111) for i in range(len(dat)): ax1.errorbar(dat[i][:, 0], dat[i][:, 1], dat[i][:, 2], ls=None) plt.show()