Esempio n. 1
0
 def post_proposed(self):
     gtp.post_to_geysertimes(self.geyserID, self.loggerID,
                             self.proposed_times, self.durations)
        closest_actual = min(actual, key=lambda x:abs(x-calc_time))
        dist = abs(closest_actual - calc_time)
        if dist < sec_tolerance:
            true_positive.append(calc_time)
        else:
            false_positive.append(calc_time)
            
    for i in range(0, len(actual)):
        closest_calc = min(calc, key=lambda x:abs(x-actual[i]))
        dist = abs(closest_calc - actual[i])
        if dist > sec_tolerance:
            missed.append(actual[i])
    '''
    print "Total Calc Times: %s" % len(calc)
    print "True positives: %s" % len(true_positive)
    print "False positives: %s" % len(false_positive)
    print "Actual eruptions: %s" % len(actual)
    print "Missed eruptions: %s" % len(missed)
    '''
    results = {"calc": len(calc), "actual": len(actual), "true": len(true_positive), "false": len(false_positive), "missed": len(missed)}

    print false_positive
    
    return results
  
#plot_at_time(npx,npy,1353384061)  
big_loop(4,10,from_unix,to_unix)

    
gtapip.post_to_geysertimes(p['geyserID'],e_times)
Esempio n. 3
0
    for i in range(0, len(actual)):
        closest_calc = min(calc, key=lambda x: abs(x - actual[i]))
        dist = abs(closest_calc - actual[i])
        if dist > sec_tolerance:
            missed.append(actual[i])
    '''
    print "Total Calc Times: %s" % len(calc)
    print "True positives: %s" % len(true_positive)
    print "False positives: %s" % len(false_positive)
    print "Actual eruptions: %s" % len(actual)
    print "Missed eruptions: %s" % len(missed)
    '''
    results = {
        "calc": len(calc),
        "actual": len(actual),
        "true": len(true_positive),
        "false": len(false_positive),
        "missed": len(missed)
    }

    print false_positive

    return results


#plot_at_time(npx,npy,1353384061)
big_loop(4, 10, from_unix, to_unix)

gtapip.post_to_geysertimes(p['geyserID'], e_times)
 def post_proposed(self):
     gtp.post_to_geysertimes(self.geyserID, self.loggerID, self.proposed_times, self.durations)