#!/usr/bin/python import sys lines = open(sys.argv[1], "r").readlines() values = sorted([tuple(map(float, line.split(",")[3:5])) for line in lines]) x0,y0 = values[0] #print(values) maxys = sorted([y for x,y in values]) maxys = set(maxys[-1000:]) for i,(x,y) in enumerate(values): if y in maxys: j = i while j >= 0 and values[j][1] == y: j -= 1 if (j >= 0 and values[j][1] > y) or (j >= 1 and values[j - 1][1] > y) or (j >= 2 and values[j - 2][1] > y): continue j = i while j < len(values) and values[j][1] == y: j += 1 if (j < len(values) and values[j][1] > y) or (j + 1 < len(values) and values[j + 1][1] > y) or (j + 2 < len(values) and values[j + 2][1] > y): continue if y < 0.02: continue print("%.5g,%.5g" % (x - x0, y))