Cross-matching catalogs with a common object ID¶

 crossmatch(x, y[, skip_bounds_checking]) Finds where the elements of x appear in the array y, including repeats. unsorting_indices(sorting_indices) Return the indexing array that inverts numpy.argsort.

Calculating quantities for objects grouped into a common halo¶

 group_member_generator(data, grouping_key, …) Generator used to loop over grouped data and yield requested properties of members of a group. compute_richness(unique_halo_ids, …) For every ID in unique_halo_ids, calculate the number of times the ID appears in halo_id_of_galaxies.

Generating Monte Carlo realizations¶

 monte_carlo_from_cdf_lookup(x_table, y_table) Randomly draw a set of num_draws points from any arbitrary input distribution function. build_cdf_lookup(y[, npts_lookup_table]) Compute a lookup table for the cumulative distribution function specified by the input set of y values.

Matching one distribution to another¶

 distribution_matching_indices(…[, seed]) Calcuate a set of indices that will resample (with replacement) input_distribution so that it matches output_distribution. resample_x_to_match_y(x, y, bins[, seed]) Return the indices that resample x (with replacement) so that the resampled distribution matches the histogram of y. bijective_distribution_matching(x_in, x_desired) Replace the values in x_in with x_desired, preserving the rank-order of x_in

Rotations, dot products, and other operations in 3d space¶

 elementwise_dot(x, y) Calculate the dot product between each pair of elements in two input lists of 3d points. elementwise_norm(x) Calculate the normalization of each element in a list of 3d points. angles_between_list_of_vectors(v0, v1[, tol]) Calculate the angle between a collection of 3d vectors vectors_between_list_of_vectors(x, y, p) Starting from two input lists of vectors, return a list of unit-vectors that lie in the same plane as the corresponding input vectors, and where the input p controls the angle between the returned vs. rotation_matrices_from_angles(angles, directions) Calculate a collection of rotation matrices defined by an input collection of rotation angles and rotation axes. rotation_matrices_from_vectors(v0, v1) Calculate a collection of rotation matrices defined by the unique transformation rotating v1 into v2 about the mutually perpendicular axis. rotate_vector_collection(rotation_matrices, …) Given a collection of rotation matrices and a collection of 3d vectors, apply each matrix to rotate the corresponding vector.

Probabilistic binning¶

 fuzzy_digitize(x, centroids[, min_counts, seed]) Function assigns each element of the input array x to a centroid number.

Estimating two-dimensional PDFs¶

 sliding_conditional_percentile(x, y, …[, …]) Estimate the cumulative distribution function Prob(< y | x).

Satellite orientations and intra-halo positions¶

 rotate_satellite_vectors(satellite_vectors, …) Rotate an input set of satellite_vectors by the input satellite_rotation_angles about the axis associated with each satellite’s host halo. calculate_satellite_radial_vector(…) For each satellite, calculate the radial vector pointing from the associated host halo to the satellite, accounting for periodic boundary conditions. reposition_satellites_from_radial_vectors(…) Given original and new host-centric coordinates for satellites, reposition the satellites to their new spatial coordinates, accounting for periodic boundary conditions.