ycut = y[selection] zcut = z[selection] tcut = t[selection] analyzer_lightcone = LightningAnalyzer(tcut, xcut, ycut, zcut, -1, weights=(1, 0), d_cut=1000) analyzer_lightcone.load_tree_from_file("Data_" + dataset + ".pickle") analyzer_mesh = MeshAnalyzer(tcut, xcut, ycut, zcut, min_voxel_size=50, max_voxel_size=300) analyzer_mesh.load_tree_from_file("Data_" + dataset + ".pickle") for i in range(analyzer_lightcone.nr_of_branches()): branch_t, _, _, _ = analyzer_lightcone.give_branch(i) lengths_lightcone.append(max(branch_t) - min(branch_t)) for i in range(analyzer_mesh.nr_of_branches()): branch_t, _, _, _ = analyzer_mesh.give_branch(i) lengths_mesh.append(max(branch_t) - min(branch_t)) dataset = 'subset_2' xmin = x > 3000 xmax = x < 7000
dataname = 'Data_subset_4' xmin = x > 6000 xmax = x < 10000 ymin = y > -13000 ymax = y < -10000 zmin = z > 0 zmax = z < 4000 tmin = t > 1.15 tmax = t < 1.17 selection = zmin * zmax * xmin * xmax * ymin * ymax * tmin * tmax xcut = x[selection] ycut = y[selection] zcut = z[selection] tcut = t[selection] # analyzer_lightcone = LightconeAnalyzer(tcut, xcut, ycut, zcut, -1, weights=(1, 0), d_cut=1000) # analyzer_lightcone.label() # analyzer_lightcone.save_tree_to_file(dataname+".pickle") # analyzer_lightcone.line_plot(dataname) analyzer_mesh = MeshAnalyzer(tcut, xcut, ycut, zcut, min_voxel_size=50, max_voxel_size=300) analyzer_mesh.label() analyzer_mesh.save_tree_to_file(dataname + ".pickle") analyzer_mesh.line_plot(dataname)
ycut = y[selection] zcut = z[selection] tcut = t[selection] analyzer_lightcone = LightconeAnalyzer(tcut, xcut, ycut, zcut, -1, weights=(1, 0), d_cut=1000) analyzer_lightcone.load_tree_from_file("Data_" + dataname + ".pickle") analyzer_mesh = MeshAnalyzer(tcut, xcut, ycut, zcut, min_voxel_size=50, max_voxel_size=300) analyzer_mesh.load_tree_from_file("Data_" + dataname + ".pickle") points_lightcone = [] for i in range(analyzer_lightcone.nr_of_branches()): node = analyzer_lightcone.give_branch_ind(i) points_lightcone.append(len(node)) points_mesh = [] for i in range(analyzer_mesh.nr_of_branches()): node = analyzer_mesh.give_branch_ind(i) points_mesh.append(len(node)) fig = plt.figure(figsize=(16, 8))
from numpy import genfromtxt from Mesh_approach.LightningAnalyzer import Analyzer data = genfromtxt("../Data/data.txt", delimiter=",") x = data[:, 0] y = data[:, 1] z = data[:, 2] t = data[:, 3] dataname = 'subset_3' xmin = x > -4500 xmax = x < -3000 ymin = y > -8500 ymax = y < -5000 zmin = z > 3000 zmax = z < 5000 selection = zmin * zmax * ymin * ymax * xmin * xmax xcut = x[selection] ycut = y[selection] zcut = z[selection] tcut = t[selection] tree = Analyzer(tcut, xcut, ycut, zcut, min_voxel_size=50, max_voxel_size=200) tree.octree.refine(min_side=tree.min_voxel_size, max_side=tree.max_voxel_size) tree.octree.make_voxel_graph(dataname + '_unflatten')