예제 #1
0
def filter_dists(ctx):
    dbname = ctx.obj['dbname']
    db = DB(dbname, ctx.obj['config'])
    db.open()
    infile = ctx.obj['infile']
    outfile = ctx.obj['outfile']
    max_dist = float(ctx.obj['max_dist'])
    fd = FilterDists(db)
    fd.filter(infile, outfile, max_dist)
    db.close()
예제 #2
0
    def generate_graphs(self, db, scale, table):
        fd = FilterDists(db)
        
        graph_file = self.graph_path(100)

        if os.path.isfile(graph_file):
            print('full graph file found: %s' % graph_file)
        else:
            print('generating: %s' % graph_file)
            gg = GenGraph(db, outfile=graph_file, table=table)
            gg.generate()

        for per in self.percent_range():
            if per < 100:
                filtered_file = self.graph_path(per)
                print('generating: %s' % filtered_file)
                max_dist = self.dist(per, scale)
                fd.filter(graph_file, filtered_file, max_dist)

        print('done.')