do_mountain_projections = True if 1: def verify_cores_very_dumb(top1): if top1.rhomax < 1100: return False else: return True outname = "u302_tracks_core_258.h5" #kludge={'peak_id':[0,1,364, 113,u302_was258]}) #kludge={'peak_id':[258]} kludge = {'peak_id': [core_id]} MT = mountain_top.cut_mountain_top(this_simname, target_fname=mountain_top_name, do_projections=do_mountain_projections, verify=verify_cores_very_dumb, kludge=kludge) # # Get tracks. # if 1: """this set of parameters extracts all primitive quantities""" target_frame = dl.target_frames[this_simname] frame_list = [target_frame] #list(range(0,target_frame,10))+[target_frame] fields = [ 'x', 'y', 'z', 'density', 'velocity_magnitude', 'magnetic_field_strength', 'velocity_divergence' ] fields += ['velocity_x', 'velocity_y', 'velocity_z']
'u702': coreset_data.radius_u302, 'u703': coreset_data.radius_u303 }[this_simname] # # Make all the leaves and their overlaps. # if 'leaf_storage_all' not in dir(): #'leaf_storage' not in dir() and False: leaf_storage_all = {} k0, k1 = 11, 14 #kludge={'peak_id':list(range(100,200))} kludge = {} MT = mountain_top.cut_mountain_top(this_simname, target_fname=mountain_top_name, do_projections=False, verify=verifiers[this_simname], leaf_storage=leaf_storage_all, kludge=kludge, radius_dict=this_radius_dict) overlap_all = mountain_top.check_overlap(leaf_storage_all) if 1: new_thresholds = {} #this gets filled with new thresholds if 'all_peaks_tmp' not in dir(): all_peaks_tmp = defaultdict( dict) #this is just to reduce redundant work when debugging. mountain_top.split_all(this_simname, overlap_all, new_thresholds, all_peaks_tmp, do_projections=False,
new_thresholds_cleanup = {} if 'all_peaks_cleanup' not in dir() or True: all_peaks_cleanup = defaultdict(dict) if 1: mountain_top.split_all(this_simname, all_to_check, new_thresholds_cleanup, all_peaks_cleanup, do_projections=True) temp_threshold_name = "u302_cutoff_cleanup.h5" os.remove(temp_threshold_name) mountain_top.dump_cutoffs(temp_threshold_name, new_thresholds_cleanup) if 1: print("check the density in the file") pdb.set_trace() peak_list = list(all_to_check.keys()) kludge = {'peak_id': peak_list} clean_leaf_storage = {} temp_target = 'u302_mountain_tops_cleanupb.h5' MT = mountain_top.cut_mountain_top(this_simname, target_fname=temp_target, do_projections=True, verify=verify_cores_u302, kludge=kludge, leaf_storage=clean_leaf_storage, density_cut_fname=temp_threshold_name) overlap_cleanup = mountain_top.check_overlap(clean_leaf_storage)
if 1: outname = "u302_tracks_core_258.h5" #kludge={'peak_id':[0,1,364, 113,u302_was258]}) #kludge={'peak_id':[258]} #kludge={'peak_id':[core_id]} kludge = {} #kludge={'peak_id':[89,11,14,350, 349, 368, 369]} #kludge={'peak_id':[ 368, 369]} k0 = 186 k1 = 188 kludge = {'peak_id': [k0, k1]} leaf_storage_here = {} MT = mountain_top.cut_mountain_top(this_simname, target_fname=mountain_top_name, do_projections=True, verify=verify_cores_u302, kludge=kludge, leaf_storage=leaf_storage_here, radius_dict=coreset_data.radius_302) #density_cut_fname="u302_densiy_cut_working.h5") overlap_tmp = mountain_top.check_overlap(leaf_storage_here) reload(coreset_data) if 1: more_leaf_storage_here = {} split_density = mountain_top.split_peaks( this_simname, k0, k1, do_projections=True,
def verify_cores_u302(leaf, peak_density, peak_id): out = True if peak_density < 1100: out = False skip = [4, 89] if peak_id in skip: out = False return out if 'leaf_storage_all' not in dir(): #'leaf_storage' not in dir() and False: kludge = {} leaf_storage_all = {} MT = mountain_top.cut_mountain_top(this_simname, target_fname=mountain_top_name, do_projections=do_mountain_projections, verify=verify_cores_u302, kludge=kludge, leaf_storage=leaf_storage_all) #, #density_cut_fname="u302_contour_mins.h5") overlap_all = mountain_top.check_overlap(leaf_storage_all) if 'leaf_storage' not in dir(): #'leaf_storage' not in dir() and False: #kludge={'peak_id':[0,1,364, 113,u302_was258]}) #kludge={'peak_id':[258]} #kludge={'peak_id':[core_id]} kludge = {} #kludge={'peak_id':[89,11,14,350, 349, 368, 369]} #kludge={'peak_id':[ 368, 369]} kludge = {'peak_id': [367, 368]} leaf_storage = {} MT = mountain_top.cut_mountain_top(this_simname,
if peak_density < 1100: out = False return out if 'leaf_storage' not in dir(): #'leaf_storage' not in dir() and False: #kludge={'peak_id':[0,1,364, 113,u302_was258]}) #kludge={'peak_id':[258]} #kludge={'peak_id':[core_id]} kludge = {} #kludge={'peak_id':[89,11,14,350, 349, 368, 369]} #kludge={'peak_id':[ 368, 369]} leaf_storage = {} MT = mountain_top.cut_mountain_top(this_simname, target_fname=mountain_top_name, do_projections=do_mountain_projections, verify=verify_cores_u302, kludge=kludge, leaf_storage=leaf_storage) #density_cut_fname="u302_contour_mins.h5") if 'peak_rho1' not in dir(): peak_rho1 = mountain_top.get_peak_densities( this_simname, target_fname=mountain_top_name, do_projections=do_mountain_projections, verify=verify_cores_u302, kludge=kludge, leaf_storage=leaf_storage) #density_cut_fname="u302_contour_mins.h5") if 1: