Exemplo n.º 1
0
def dispositionTask(clip):
    """Decide whether an event is a planet candidate or not

    TODO:
    Much of this should be parcelled off into a function
    """

    #Thresholds
    snrThreshold = clip['config.minSnrForDetection']
#    lppThreshold = clip['config.maxLppForTransit']
    offsetThreshold_sigma = clip['config.minCentroidSignifForFp']

    #Data on which to make a decision
    snr = clip['trapFit.snr']
    modshiftDict = clip['modshift']
    centroidArray = clip['diffImg.centroid_timeseries']

    out = clipboard.Clipboard(isSignificantEvent=True, isCandidate=True, \
        reasonForFail="None")
    if snr < snrThreshold:
        out['isSignificantEvent'] = False
        out['isCandidate'] = False
        out['reasonForFail'] = "SNR (%.1f) below threshold %.1f" \
            %(snr, snrThreshold)
        return out


    #Parse modshift results
    fluxVetDict = RoboVet.roboVet(modshiftDict)
    out['fluxVet'] = fluxVetDict
    assert(fluxVetDict['disp'] in ["candidate", "false positive"])

    if fluxVetDict['disp'] == "false positive":
        out['isCandidate'] = False
        out['reasonForFail'] = fluxVetDict['comments']
        return out

    #Compute centroid offset and significance
    result = cent.measureOffsetInTimeseries(centroidArray)
    out['centroidVet'] = result
    signif = result['signif']
    offset = result['offset']

    if signif > offsetThreshold_sigma:
        out['isCandidate'] = False
        out['reasonForFail'] = "Centroid offset of %.2f (%.1f sigma) detected" \
            %( offset, signif)
        return out

    clip['disposition'] = out

    #Enforce contract
    clip['disposition.isSignificantEvent']
    clip['disposition.isCandidate']
    clip['disposition.reasonForFail']
    return clip
Exemplo n.º 2
0
def dispositionTask(clip):
    """Decide whether an event is a planet candidate or not

    TODO:
    Much of this should be parcelled off into a function
    """

    #Thresholds
    snrThreshold = clip['config.minSnrForDetection']
    #    lppThreshold = clip['config.maxLppForTransit']
    offsetThreshold_sigma = clip['config.minCentroidSignifForFp']

    #Data on which to make a decision
    snr = clip['trapFit.snr']
    modshiftDict = clip['modshift']
    centroidArray = clip['diffImg.centroid_timeseries']

    out = clipboard.Clipboard(isSignificantEvent=True, isCandidate=True, \
        reasonForFail="None")
    if snr < snrThreshold:
        out['isSignificantEvent'] = False
        out['isCandidate'] = False
        out['reasonForFail'] = "SNR (%.1f) below threshold %.1f" \
            %(snr, snrThreshold)
        return out

    #Parse modshift results
    fluxVetDict = RoboVet.roboVet(modshiftDict)
    out['fluxVet'] = fluxVetDict
    assert (fluxVetDict['disp'] in ["candidate", "false positive"])

    if fluxVetDict['disp'] == "false positive":
        out['isCandidate'] = False
        out['reasonForFail'] = fluxVetDict['comments']
        return out

    #Compute centroid offset and significance
    result = cent.measureOffsetInTimeseries(centroidArray)
    out['centroidVet'] = result
    signif = result['signif']
    offset = result['offset']

    if signif > offsetThreshold_sigma:
        out['isCandidate'] = False
        out['reasonForFail'] = "Centroid offset of %.2f (%.1f sigma) detected" \
            %( offset, signif)
        return out

    clip['disposition'] = out

    #Enforce contract
    clip['disposition.isSignificantEvent']
    clip['disposition.isCandidate']
    clip['disposition.reasonForFail']
    return clip
Exemplo n.º 3
0
def runOneDv(sector,tic,planetNum,debugMode=True):
    
    cfg = createConfig(sector,tic,planetNum,debugMode=True)
    
    clip = tessPipeline.runOne(cfg,returnClip=True)
    
    # This is an attempt at quickly vetting the signals.
    # This should be its own task.
    try:
        rv = RoboVet.roboVet(clip.modshift)
    except:
        rv={}
        rv['disp'] = 'candidate'
        rv['comments'] = 'NO_MODSHIFT'
        rv['not_trans_like'] = 0
        rv['sig_sec'] = 0
    
    lpp_th = 4  #Threshold for LPP
    
    if clip.lpp.TLpp > lpp_th:
        rv['disp'] = 'false positive'
        rv['comments']= rv['comments'] + "-LPP_TOO_HIGH"
        rv['not_trans_like']=1
    
    sweet_th = 3.5
    if (clip.sweet.amp[0,-1] > sweet_th) | \
       (clip.sweet.amp[1,-1] >sweet_th) | \
       (clip.sweet.amp[2,-1] > sweet_th):
           rv['disp']='false positive'
           rv['comments']=rv['comments'] + "-SWEET_FAIL"
           rv['not_trans_like']=1
    
    clip['robovet']=rv
    

    return clip
Exemplo n.º 4
0
    centVet['isCentroidFail'] = False
    if np.isfinite(prob):
        if prob > minProbForFail:
            centVet['isCentroidFail'] = True
            out['isCandidate'] = False
            out['reasonForFail'] = "Centroid offset probability is %.1e" % (
                prob)
    else:
        centVet['Warning'] = "Probability is Nan"

    out['centroidVet'] = centVet

    ####################################################

    #Parse modshift results
    fluxVetDict = RoboVet.roboVet(modshiftDict)
    out['fluxVet'] = fluxVetDict
    assert (fluxVetDict['disp'] in ["candidate", "false positive"])

    if fluxVetDict['disp'] == "false positive":
        out['isCandidate'] = False
        out['reasonForFail'] = fluxVetDict['comments']

        if fluxVetDict['not_trans_like'] > 0:
            out['isSignificantEvent'] = False

    #Check LPP, if it's available
    Tlpp_linear = clip.get('lpp.TLpp', 0)
    if Tlpp_linear > lppThreshold:
        out['isSignificantEvent'] = False
        out['isCandidate'] = False
Exemplo n.º 5
0
    centVet['isCentroidFail'] = False
    if np.isfinite(prob):
        if prob > minProbForFail:
            centVet['isCentroidFail'] = True
            out['isCandidate'] = False
            out['reasonForFail'] = "Centroid offset probability is %.1e" %(prob)
    else:
        centVet['Warning'] = "Probability is Nan"

    out['centroidVet'] = centVet


    ####################################################

    #Parse modshift results
    fluxVetDict = RoboVet.roboVet(modshiftDict)
    out['fluxVet'] = fluxVetDict
    assert(fluxVetDict['disp'] in ["candidate", "false positive"])

    if fluxVetDict['disp'] == "false positive":
        out['isCandidate'] = False
        out['reasonForFail'] = fluxVetDict['comments']

        if fluxVetDict['not_trans_like'] > 0:
            out['isSignificantEvent'] = False



    #Check LPP, if it's available
    Tlpp_linear = clip.get('lpp.TLpp', 0)
    if Tlpp_linear > lppThreshold:
Exemplo n.º 6
0
    centVet['probabilityOfOffset'] = prob
    centVet['chiSquaredOfOffset'] = chisq
    centVet['numTransitsWithCentroids'] = int( np.sum(centroids[:,0] > 0))

    centVet['isCentroidFail'] = False
    if np.isfinite(prob):
	if prob > minProbForFail:
		centVet['isCentroidFail'] = True
		out['isCandidate'] = False
		out['reasonForFail'] = "Centroid offset probability is %.1e" %(prob)

    out['centroidVet'] = centVet

# FLUX VET
    try:
        fluxVet = RoboVet.roboVet(clip.modshift)
	assert(fluxVet['disp'] in ["candidate", "false positive"])

    except:
        fluxVet ={}
        fluxVet['disp'] = 'candidate'
        fluxVet['not_trans_like'] = 0
        fluxVet['sig_sec'] = 0
	fluxVet['comments'] = 'NO_MODSHIFT'

    out['fluxVet'] = fluxVet
    
    lpp_th = 4  #Threshold for LPP   
    if clip.lpp.TLpp > lpp_th:
        fluxVet['disp'] = 'false positive'
        fluxVet['comments']= fluxVet['comments'] + "-LPP_TOO_HIGH"