### Before we calculated the pdfs, we want to know what the over densities ### are in each of the regions calculated on the area we consider. print("Calculating region densities...") pdf_maker.compute_region_densities(z_bin_edge_array, args.z_max) if args.output_region_pickle_file is not None: pdf_maker.write_region_densities(args.output_region_pickle_file, args) ### Now that we've "collapsed" the estimate around the target object we need ### to bin up the results in redshift and create our final PDF. print("Calculating pdf...") if args.bootstrap_samples is None: pdf_maker.compute_pdf_bootstrap(args.n_bootstrap) else: bootstrap_region_array = np.loadtxt(args.bootstrap_samples, dtype = np.int_) pdf_maker._compute_pdf_bootstrap(bootstrap_region_array) ### Write individual bootstraps to file. if args.output_bootstraps_file is not None: pdf_maker.write_bootstrap_samples_to_ascii(args.output_bootstraps_file, args) ### Now that we have the results. We just need to write them to file and we ### are done. print("Writing...") output_file = _core_utils.create_ascii_file(args.output_pdf_file_name, args) pdf_maker.write_pdf_to_ascii(output_file) output_file.close() ### TODO: ### Include bootstrapping and writing of the raw boostrap samples. print("Done!")
# finder pair_finder = _pair_maker_utils.RawPairFinder(unknown_itree, target_vector, target_ids, stomp_map) # We need to tell the pair finder what scale we would like to run over # before we begin. min_scale_list = args.min_scale.split(',') max_scale_list = args.max_scale.split(',') print(min_scale_list) print(max_scale_list) if len(min_scale_list) != len(max_scale_list): print("Number of min scales requested does not match number of max" "sales. Exitting.") sys.exit() over_density_list = [] # Loop over the min/max scales requested. output_file = _core_utils.create_ascii_file(args.output_pair_hdf5_file, args) output_file.writelines('#type0 = redshift\n') for scale_idx, min_scale, max_scale in enumerate(zip(min_scale_list, max_scale_list)): output_file.writelines('#type%i = kpc%st%s\n' % (scale_idx + 1, min_scale, max_scale)) print("Running scale: %s to %s" % (min_scale, max_scale)) # Pair finder does what it says. It also computes the areas, unmasked # fractions for target object. pair_finder.find_pairs(np.float_(min_scale), np.float_(max_scale)) # This is an optional part of the pair finder. It takes as an argument # the a stomp tree map containing uniform random points as generated # by the stomp. For non-uniform randoms it is recommened that the # user run this software with said randoms as the unknown sample. if args.n_randoms > 0: pair_finder.random_loop(np.float_(min_scale), np.float_(max_scale),