示例#1
0
文件: someWd.py 项目: barentsen/dave
def main():
    epicList = """
    206169444
    206181269
    206197016
    206210269
    206216038
    206227856
    206233343
    206238453
    206242757
    206261621
    206270755
    206276634
    206284230
    206302487
    206335190
    206342949
    206364301""".split()

    cfg = dpf.loadMyConfiguration()
    cfg['debug'] = False
    cfg['taskList'][-1] = "dpp.saveClip"  #Save all clips
#    cfg['searchTaskList'][0] = "placeholderBls"

    for epic in epicList[:]:
        print "Running %s" %(epic)
        clip = dpf.runOne( int(epic), cfg)

        try:
            time = clip['serve.time']
            flux = clip['detrend.flux_frac']
            flags = clip['detrend.flags']

            tce = clip['eventList'][0]
            isReal = tce['disposition.isSignificantEvent']
            mp.clf()
            mp.plot(time[~flags], flux[~flags], 'ko')
            mp.title("%s: %i" %(epic, isReal))
            mp.pause(.01)
            mp.savefig("wd%s.png" %(epic))
        except Exception, e:
            print "Exception raised: %s %s" %(epic, e)
示例#2
0
def main():
    epicList = """
    206169444
    206181269
    206197016
    206210269
    206216038
    206227856
    206233343
    206238453
    206242757
    206261621
    206270755
    206276634
    206284230
    206302487
    206335190
    206342949
    206364301""".split()

    cfg = dpf.loadMyConfiguration()
    cfg['debug'] = False
    cfg['taskList'][-1] = "dpp.saveClip"  #Save all clips
    #    cfg['searchTaskList'][0] = "placeholderBls"

    for epic in epicList[:]:
        print "Running %s" % (epic)
        clip = dpf.runOne(int(epic), cfg)

        try:
            time = clip['serve.time']
            flux = clip['detrend.flux_frac']
            flags = clip['detrend.flags']

            tce = clip['eventList'][0]
            isReal = tce['disposition.isSignificantEvent']
            mp.clf()
            mp.plot(time[~flags], flux[~flags], 'ko')
            mp.title("%s: %i" % (epic, isReal))
            mp.pause(.01)
            mp.savefig("wd%s.png" % (epic))
        except Exception, e:
            print "Exception raised: %s %s" % (epic, e)
示例#3
0
targetchoice=np.random.randint(0,len(data),size=N)

cfg=loadInjConfig()

for n in targetchoice:
    epic=data[n,0]
    campaign=data[n,1]
    inject={}
    inject['period_days']=np.random.rand(1)*(periodRange[1]-periodRange[0])
    inject['depth_ppm']=np.random.rand(1)*(depthRange[1]-depthRange[0])
    inject['duration_hrs']=6.0
    inject['ingress_hrs']=1.0
    
    
    cfg['campaign']=campaign
    clip=dpf.runOne(epic,cfg,True)
    clip['inject']=inject
    clip.inject['epoch_bkjd']=clip.serve.time[0]+epochoffset
    #pdb.set_trace()        
    
    clip=injectTransitClip(clip)
    
    clip=findInjTransits(clip)
    
    clip=testInjResults(clip)
    
    print clip.inject
    print clip.inject['wasFound'], clip.trapFit.period_days, clip.trapFit.depth_frac*1e6