#fig = pl.figure(figsize=(10,5)) #pl.plot(flarelc.cts, flarelc.clc) #fig.savefig('flaretimeseries.png') #fig.clf() #pl.close(fig) Or = bf.OddsRatioDetector( flarelc, bglen=bglen, bgorder=bgorder, flareparams={ 'taug': (0, 1.5 * 60 * 60, 10), 'taue': (0.5 * 60 * 60, 3. * 60 * 60, 10) }, noisepoly=True, noiseimpulse=True, noiseimpulseparams={'t0': (0, (bglen - 1.) * flarelc.dt(), bglen)}, noiseexpdecay=True, noiseexpdecayparams={'taue': (0.0, 0.25 * 60 * 60, 3)}, noiseexpdecaywithreverse=True, ignoreedges=True, noiseestmethod='tailveto', tvsigma=1.0) lnO, tst = Or.oddsratio() # find points above threshold lnOa = np.array(lnO) tstruncated = tst # times with edges removed
outdict["Rejected stars"].append(kids[i]["kepid"]) continue # check if star had already been analysed if starlist != None: if kids[i]["kepid"] in starlist: print "KIC %d has already been analysed" % kids[i]["kepid"] continue nf = nf + 1 outdict["No. stars analysed"] = nf # update number of stars outdict["Star list"].append(kids[i]["kepid"]) # append to star list # calculate odds ratio odds = bf.OddsRatioDetector(flarelc, noiseestmethod='tailveto', tvsigma=1.0) odds.set_noise_impulse(noiseimpulseparams={ 't0': (0, (odds.bglen - 1.) * flarelc.dt(), odds.bglen) }) lnO, ts = odds.oddsratio() # find flares flarelist, Nflares, maxlist = odds.thresholder(lnO, threshold, expand=expand) if i == 0: # set some analysis data outdict[
sys.exit(0) print "Noise estimate with '%s' method = %f" % (noiseest, sig) if not opts.lconly: # get the odds ratio Or = bf.OddsRatioDetector( flarelc, bglen=bglen, bgorder=bgorder, nsinusoids=nsinusoids, noiseestmethod=noiseest, psestfrac=opts.psest, tvsigma=opts.tvsigma, flareparams={ 'taugauss': (0, 1.5 * 60 * 60, 10), 'tauexp': (0.5 * 60 * 60, 3. * 60 * 60, 10) }, noisepoly=True, noiseimpulse=True, noiseimpulseparams={'t0': (0, (bglen - 1.) * flarelc.dt(), bglen)}, noiseexpdecay=True, noiseexpdecayparams={'tauexp': (0.0, 0.25 * 60 * 60, 3)}, noiseexpdecaywithreverse=True, ignoreedges=True) lnO, tst = Or.oddsratio() # set matplotlib defaults mplparams = { \ 'text.usetex': True, # use LaTeX for all text