def voronoiAnalysis(bin_file, density_factor, output_directory, min_size=30): # save a record of the clustering parameters. bin_dir = os.path.dirname(bin_file) if (len(bin_dir) == 0): bin_dir = "." with open(bin_dir + "/voroni.txt", "w") as fp: fp.write("density factor = " + str(density_factor) + "\n") fp.write("min_size = " + str(min_size) + "\n") cl_bin_file = output_directory + os.path.basename( bin_file)[:-8] + "srt_list.bin" # find clusters if True: voronoi.voronoi(bin_file, cl_bin_file, density_factor, min_size) # cluster stats if True: clusterStats.clusterStats(cl_bin_file, min_size - 1) # cluster size if True: clusterSize.clusterSize(cl_bin_file, cl_bin_file[:-8] + "size_list.bin")
def dbscanAnalysis(bin_file, channel, eps = 40, mc = 10, min_size = 50): # save a record of the clustering parameters. bin_dir = os.path.dirname(bin_file) if (len(bin_dir) == 0): bin_dir = "." with open(bin_dir + "/dbscan.txt", "w") as fp: fp.write("eps = " + str(eps) + "\n") fp.write("mc = " + str(mc) + "\n") fp.write("min_size = " + str(min_size) + "\n") cl_bin_file = bin_file[:-8] + "clusters_list.bin" # find clusters if True: findClusters.findClusters(bin_file, cl_bin_file, eps, mc) # cluster stats if True: clusterStats.clusterStats(cl_bin_file, min_size - 1) # cluster size if True: clusterSize.clusterSize(cl_bin_file, cl_bin_file[:-8] + "size_list.bin")
def voronoiAnalysis(bin_file, density_factor, output_directory, min_size = 30): # save a record of the clustering parameters. bin_dir = os.path.dirname(bin_file) if (len(bin_dir) == 0): bin_dir = "." with open(bin_dir + "/voroni.txt", "w") as fp: fp.write("density factor = " + str(density_factor) + "\n") fp.write("min_size = " + str(min_size) + "\n") cl_bin_file = output_directory + os.path.basename(bin_file)[:-8] + "srt_list.bin" # find clusters if True: voronoi.voronoi(bin_file, cl_bin_file, density_factor, min_size) # cluster stats if True: clusterStats.clusterStats(cl_bin_file, min_size - 1) # cluster size if True: clusterSize.clusterSize(cl_bin_file, cl_bin_file[:-8] + "size_list.bin")
def dbscanAnalysis(bin_file, channel, eps=40, mc=10, min_size=50): # save a record of the clustering parameters. bin_dir = os.path.dirname(bin_file) if (len(bin_dir) == 0): bin_dir = "." with open(bin_dir + "/dbscan.txt", "w") as fp: fp.write("eps = " + str(eps) + "\n") fp.write("mc = " + str(mc) + "\n") fp.write("min_size = " + str(min_size) + "\n") cl_bin_file = bin_file[:-8] + "clusters_list.bin" # find clusters if True: findClusters.findClusters(bin_file, cl_bin_file, eps, mc) # cluster stats if True: clusterStats.clusterStats(cl_bin_file, min_size - 1) # cluster size if True: clusterSize.clusterSize(cl_bin_file, cl_bin_file[:-8] + "size_list.bin")