Ejemplo n.º 1
0
def findInjTransits(clip):
    """
    Now that the light curve has a transit in it, run the rest of the pipeline.
    dpp.lppMetricTask 
        dpp.modshiftTask dpp.measureDiffImgCentroidsTask dpp.dispositionTask
        dpp.saveClip 
    """
    
    clip=dpp.detrendDataTask(clip)
    clip=dpp.fblsTask(clip)
    clip=dpp.trapezoidFitTask(clip)
    clip=dpp.dispositionTask(clip)
    clip=dpp.lppMetricTask(clip)
    clip=dpp.saveClip(clip)
    
    return clip
Ejemplo n.º 2
0
def countThermFlags(clip):

    thermal=dict()
    #Create the light curves.
    clip['config']['dataStorePath']='/home/smullall/Science/datastore'

    clip=pipe.serveTask(clip)
    clip=pipe.trapezoidFitTask(clip)  
    
    #Get just the interesting flags
    thruster=2**20;
    safemode=2**1;
    desat=2**5
    isbad=np.bitwise_and(clip.serve.flags,thruster+safemode+desat) != 0
    thermal['isBad'] = isbad

    time=clip.serve.time
    period=clip.trapFit.period_days
    epoch=clip.trapFit.epoch_bkjd
    #phi = np.fmod(time-epoch + .25*period, period)
    phiorig = (time-epoch + .25*period) % period
    phi = phiorig[np.isfinite(phiorig)] 
    dur=clip.trapFit.duration_hrs/24;
    
    #Calculate the phase range of the folded transit model.
    phi1=0.25*period - 0.5*dur;
    phi2=0.25*period + 0.5*dur;
    thermal['phimin']=phi1;
    thermal['phimax']=phi2;
    thermal['inTransCadTot'] = len( phi[[phi>phi1] and [phi<phi2]] )    
    
    #How many isbads exist in that phase range.
    phiisbad=phiorig[isbad]
    countBad=0
    for (i,v) in enumerate(phiisbad):
        if v > phi1 and v< phi2:
            countBad=countBad+1
            
    thermal['inTransCadBad'] = countBad
    thermal['numTrans']=np.floor((time[-1]-time[0])/period)
    clip['thermal']=thermal
    
    
    return clip