# ------------ simulate curves ----------------------------- lc = lcsim(psdindexlow, psdindexhigh, breakfreq,curve) # simulate curve # ------------- calculate powerlaws ------------------------- time = arange(1.0,float(len(lc)+1)) dt=time[-1]-time[0] df=1.0*(dt**(-1)) avflux = numpy.mean(lc) dff = [] freq = [] pl, npoints = powcal( df, time, lc, avflux) for j in range(npoints): dff.append(pl[j]) freq.append(df*(j+1)) freq.append(freq[-1]) lfreq, blff, blperr = binps(npoints,freq,dff,minb,bfac) print len(blff) if first == 1: lcpl = zeros(len(blff)) first = 0
for curve in range(ncurves): # ------------ simulate curves ----------------------------- lc, testpl,pos = lcsim(psdindexlow, psdindexhigh, breakfreq,curve, sd, mean,length) # simulate curve print np.std(lc), np.mean(lc) # ------------- calculate powerlaws ------------------------- time = arange(1.0,float(len(lc)+1)) dt= time[-1]-time[0] df= dt**(-1) avflux = numpy.mean(lc) dff = [] freq = [] pl, npoints = powcal( df, time, lc, avflux, bwidth) for j in range(npoints): dff.append(pl[j]) freq.append(df*(j+1)) freq.append(freq[-1]) lfreq, blff = binps(npoints,freq,dff) if first == 1: lcpl = zeros(len(blff)) first = 0