Comprehensive Halotools Reference/API

halotools.empirical_models Package

Functions

behroozi10_model_dictionary([redshift]) Dictionary that can be passed to the SubhaloModelFactory to build a subhalo-based composite model using the stellar-to-halo-mass relation published in Behroozi et al.
bind_default_kwarg_mixin_safe(obj, …) Function used to ensure that a keyword argument passed to the constructor of an orthogonal mix-in class is not already an attribute bound to self.
cacciato09_model_dictionary([threshold]) Dictionary to build an CLF-style model based on Cacciato et al.
calculate_satellite_selection_mask(…[, …]) Function driving the selection of subhalos during HOD mock population.
conditional_abunmatch(x, y, x2, y2, nwin[, …]) Given a set of input points with primary property x and secondary property y, use conditional abundance matching to map new values ynew onto the input points such that \(P(<y_{\rm new} | x) = P(<y_2 | x)\), and also that y and ynew are in monotonic correspondence at fixed x.
conditional_abunmatch_bin_based(haloprop, …) Function used to model a correlation between two variables, haloprop and galprop, using conditional abundance matching (CAM).
create_composite_dtype(dtype_list) Find the union of the dtypes in the input list, and return a composite dtype after verifying consistency of typing of possibly repeated fields.
custom_incomplete_gamma(a, x) Incomplete gamma function.
custom_spline(table_abscissa, …) Convenience wrapper around InterpolatedUnivariateSpline, written specifically to handle the edge case of a spline table being built from a single point.
cython_bin_free_cam_kernel Kernel underlying the bin-free implementation of conditional abundance matching.
delta_vir(cosmology, redshift) The virial overdensity in units of the critical density, using the fitting formula of Bryan & Norman 1998, assuming \(\Omega_{\Lambda} = 0.\)
density_threshold(cosmology, redshift, mdef) The threshold density for a given spherical-overdensity mass definition.
enforce_periodicity_of_box(coords, box_length) Function used to apply periodic boundary conditions of the simulation, so that mock galaxies all lie in the range [0, Lbox].
get_halo_boundary_key(mdef) For the input mass definition, return the string used to access halo table column storing the halo radius.
get_halo_mass_key(mdef) For the input mass definition, return the string used to access halo table column storing the halo mass.
halo_mass_to_halo_radius(mass, cosmology, …) Spherical overdensity radius as a function of the input mass.
halo_mass_to_virial_velocity(total_mass, …) The circular velocity evaluated at the halo boundary, \(V_{\rm vir} \equiv \sqrt{GM_{\rm halo}/R_{\rm halo}}\).
halo_radius_to_halo_mass(radius, cosmology, …) Spherical overdensity mass as a function of the input radius.
hearin15_model_dictionary([…]) Dictionary to build an HOD-style model in which central and satellite occupations statistics are assembly-biased.
leauthaud11_model_dictionary([threshold]) Dictionary to build an HOD-style based on Leauthaud et al.
noisy_percentile(percentile, correlation_coeff) Starting from an input array storing the rank-order percentile of some quantity, add noise to these percentiles to achieve the desired Spearman rank-order correlation coefficient between percentile and noisy_percentile.
polynomial_from_table(table_abscissa, …) Method to evaluate an input polynomial at the input_abscissa.
randomly_resort(x, sigma[, seed]) Function randomizes the entries of x with an input level of stochasticity sigma.
smhm_binary_sfr_model_dictionary([…]) Dictionary to build a subhalo-based model for both stellar mass and star-formation rate.
solve_for_polynomial_coefficients(abscissa, …) Solves for coefficients of the unique, minimum-degree polynomial that passes through the input abscissa and attains values equal the input ordinates.
tinker13_model_dictionary([threshold]) Dictionary to build an HOD-style based on Tinker et al.
zheng07_model_dictionary([threshold, …]) Dictionary for an HOD-style based on Zheng et al.
zu_mandelbaum15_model_dictionary([…]) Dictionary to build an HOD-style based on Zu & Mandelbaum et al.
zu_mandelbaum16_model_dictionary([…]) Dictionary to build an HOD-style based on Zu & Mandelbaum et al.

Classes

AnalyticDensityProf(cosmology, redshift, …) Container class for any analytical radial profile model.
AssembiasLeauthaud11Cens(**kwargs) Assembly-biased modulation of Leauthaud11Cens.
AssembiasLeauthaud11Sats(**kwargs) Assembly-biased modulation of Leauthaud11Sats.
AssembiasTinker13Cens([threshold, …]) HOD-style model for a central galaxy occupation that derives from two distinct active/quiescent stellar-to-halo-mass relations.
AssembiasZheng07Cens(**kwargs) Assembly-biased modulation of Zheng07Cens.
AssembiasZheng07Sats(**kwargs) Assembly-biased modulation of Zheng07Sats.
Behroozi10SmHm(**kwargs) Stellar-to-halo-mass relation based on Behroozi et al 2010.
BiasedNFWPhaseSpace([profile_integration_tol]) Model for the phase space distribution of galaxies in isotropic Jeans equilibrium in an NFW halo profile, based on Navarro, Frenk and White (1995), where the concentration of the tracers is permitted to differ from the host halo concentration.
BinaryGalpropInterpolModel(galprop_abscissa, …) Component model for any binary-valued galaxy property whose assignment is determined by interpolating between points on a grid.
BinaryGalpropModel([prim_haloprop_key]) Container class for any component model of a binary-valued galaxy property.
Cacciato09Cens([threshold, …]) CLF-style model for the central galaxy occupation.
Cacciato09Sats([threshold, …]) CLF-style model for the satellite galaxy occupation.
HaloMassInterpolQuenching(halo_mass_key, …) Model for the quiescent fraction as a function of halo mass defined by interpolating between a set of input control points.
HeavisideAssembias(**kwargs) Class used as an orthogonal mix-in to introduce step function-style assembly-biased behavior into any component model.
HodMockFactory([Num_ptcl_requirement, …]) Class responsible for populating a simulation with a population of mock galaxies based on an HOD-style model built by the HodModelFactory class.
HodModelFactory(**kwargs) Class used to build HOD-style models of the galaxy-halo connection.
Leauthaud11Cens([threshold, …]) HOD-style model for any central galaxy occupation that derives from a stellar-to-halo-mass relation.
Leauthaud11Sats([threshold, …]) HOD-style model for any satellite galaxy occupation that derives from a stellar-to-halo-mass relation.
LogNormalScatterModel([prim_haloprop_key]) Simple model used to generate log-normal scatter in a stellar-to-halo-mass type relation.
MockFactory(**kwargs) Abstract base class responsible for populating a simulation with a synthetic galaxy population.
ModelFactory(input_model_dictionary, **kwargs) Abstract container class used to build any composite model of the galaxy-halo connection.
MonteCarloGalProf() Orthogonal mix-in class used to turn an analytical phase space model (e.g., NFWPhaseSpace) into a class that can generate the phase space distribution of a mock galaxy population.
Moster13SmHm(**kwargs) Stellar-to-halo-mass relation based on Moster et al.
NFWPhaseSpace(**kwargs) Model for the phase space distribution of mass and/or galaxies in isotropic Jeans equilibrium in an NFW halo profile, based on Navarro, Frenk and White (1995), where the concentration of the galaxies is the same as the concentration of the parent halo
NFWProfile([cosmology, H0, Om0, Tcmb0, …]) Model for the spatial distribution of mass and/or galaxies residing in an NFW halo profile, based on Navarro, Frenk and White (1995), arXiv:9508025.
OccupationComponent(**kwargs) Abstract base class of any occupation model.
PrebuiltHodModelFactory(model_nickname, **kwargs) Factory class providing instances of HodModelFactory models that come prebuilt with Halotools.
PrebuiltSubhaloModelFactory(model_nickname, …) Factory class providing instances of SubhaloModelFactory models that come prebuilt with Halotools.
PrimGalpropModel(galprop_name[, …]) Abstract container class for models connecting table to their primary galaxy property, e.g., stellar mass or luminosity.
SFRBiasedNFWPhaseSpace(**kwargs) Model for the phase space distribution of galaxies in isotropic Jeans equilibrium in an NFW halo profile, based on Navarro, Frenk and White (1995), where the concentration of the tracers is permitted to differ from the host halo concentration, independently for red and blue galaxies.
SubhaloMockFactory(**kwargs) Class responsible for populating a simulation with a population of mock galaxies based on models generated by SubhaloModelFactory.
SubhaloModelFactory(**kwargs) Class used to build models of the galaxy-halo connection in which galaxies live at the centers of subhalos.
SubhaloPhaseSpace(gal_type, host_haloprop_bins) Class using subhalo information to model the phase space of satellite galaxies.
Tinker13ActiveSats([threshold, …]) HOD-style model for a central galaxy occupation that derives from two distinct active/active stellar-to-halo-mass relations.
Tinker13Cens([threshold, prim_haloprop_key, …]) HOD-style model for a central galaxy occupation that derives from two distinct active/quiescent stellar-to-halo-mass relations.
Tinker13QuiescentSats([threshold, …]) HOD-style model for a central galaxy occupation that derives from two distinct active/quiescent stellar-to-halo-mass relations.
TrivialPhaseSpace([cosmology, H0, Om0, …]) Profile of central galaxies residing at the exact center of their host halo with the exact same velocity as the halo velocity.
TrivialProfile([cosmology, H0, Om0, Tcmb0, …]) Profile of dark matter halos with all their mass concentrated at exactly the halo center.
Zheng07Cens([threshold, prim_haloprop_key]) Erf function model for the occupation statistics of central galaxies, introduced in Zheng et al.
Zheng07Sats([threshold, prim_haloprop_key, …]) Power law model for the occupation statistics of satellite galaxies, introduced in Kravtsov et al.
ZuMandelbaum15Cens([threshold, …]) HOD-style model for any central galaxy occupation that derives from a stellar-to-halo-mass relation.
ZuMandelbaum15Sats([threshold, …]) HOD-style model for a satellite galaxy occupation based on Zu & Mandelbaum 2015.
ZuMandelbaum15SmHm([prim_haloprop_key]) Stellar-to-halo-mass relation based on Zu and Mandelbaum 2015.
ZuMandelbaum16QuenchingCens([prim_haloprop_key]) Model for the quiescent fraction of centrals as a function of halo mass defined by an exponential function of halo mass.
ZuMandelbaum16QuenchingSats([prim_haloprop_key]) Model for the quiescent fraction of satellites as a function of halo mass defined by an exponential function of halo mass.

Class Inheritance Diagram

Inheritance diagram of halotools.empirical_models.phase_space_models.analytic_models.profile_model_template.AnalyticDensityProf, halotools.empirical_models.occupation_models.leauthaud11_components.AssembiasLeauthaud11Cens, halotools.empirical_models.occupation_models.leauthaud11_components.AssembiasLeauthaud11Sats, halotools.empirical_models.occupation_models.tinker13_components.AssembiasTinker13Cens, halotools.empirical_models.occupation_models.zheng07_components.AssembiasZheng07Cens, halotools.empirical_models.occupation_models.zheng07_components.AssembiasZheng07Sats, halotools.empirical_models.smhm_models.behroozi10.Behroozi10SmHm, halotools.empirical_models.phase_space_models.analytic_models.satellites.nfw.biased_nfw_phase_space.BiasedNFWPhaseSpace, halotools.empirical_models.component_model_templates.binary_galprop_models.BinaryGalpropInterpolModel, halotools.empirical_models.component_model_templates.binary_galprop_models.BinaryGalpropModel, halotools.empirical_models.occupation_models.cacciato09_components.Cacciato09Cens, halotools.empirical_models.occupation_models.cacciato09_components.Cacciato09Sats, halotools.empirical_models.sfr_models.halo_mass_quenching.HaloMassInterpolQuenching, halotools.empirical_models.assembias_models.heaviside_assembias.HeavisideAssembias, halotools.empirical_models.factories.hod_mock_factory.HodMockFactory, halotools.empirical_models.factories.hod_model_factory.HodModelFactory, halotools.empirical_models.occupation_models.leauthaud11_components.Leauthaud11Cens, halotools.empirical_models.occupation_models.leauthaud11_components.Leauthaud11Sats, halotools.empirical_models.component_model_templates.scatter_models.LogNormalScatterModel, halotools.empirical_models.factories.mock_factory_template.MockFactory, halotools.empirical_models.factories.model_factory_template.ModelFactory, halotools.empirical_models.phase_space_models.analytic_models.monte_carlo_helpers.MonteCarloGalProf, halotools.empirical_models.smhm_models.moster13.Moster13SmHm, halotools.empirical_models.phase_space_models.analytic_models.satellites.nfw.nfw_phase_space.NFWPhaseSpace, halotools.empirical_models.phase_space_models.analytic_models.satellites.nfw.nfw_profile.NFWProfile, halotools.empirical_models.occupation_models.occupation_model_template.OccupationComponent, halotools.empirical_models.factories.prebuilt_model_factory.PrebuiltHodModelFactory, halotools.empirical_models.factories.prebuilt_model_factory.PrebuiltSubhaloModelFactory, halotools.empirical_models.component_model_templates.prim_galprop_model.PrimGalpropModel, halotools.empirical_models.phase_space_models.analytic_models.satellites.nfw.sfr_biased_nfw_phase_space.SFRBiasedNFWPhaseSpace, halotools.empirical_models.factories.subhalo_mock_factory.SubhaloMockFactory, halotools.empirical_models.factories.subhalo_model_factory.SubhaloModelFactory, halotools.empirical_models.phase_space_models.subhalo_based_models.subhalo_phase_space.SubhaloPhaseSpace, halotools.empirical_models.occupation_models.tinker13_components.Tinker13ActiveSats, halotools.empirical_models.occupation_models.tinker13_components.Tinker13Cens, halotools.empirical_models.occupation_models.tinker13_components.Tinker13QuiescentSats, halotools.empirical_models.phase_space_models.analytic_models.centrals.trivial_phase_space.TrivialPhaseSpace, halotools.empirical_models.phase_space_models.analytic_models.centrals.trivial_profile.TrivialProfile, halotools.empirical_models.occupation_models.zheng07_components.Zheng07Cens, halotools.empirical_models.occupation_models.zheng07_components.Zheng07Sats, halotools.empirical_models.occupation_models.zu_mandelbaum15_components.ZuMandelbaum15Cens, halotools.empirical_models.occupation_models.zu_mandelbaum15_components.ZuMandelbaum15Sats, halotools.empirical_models.smhm_models.zu_mandelbaum15.ZuMandelbaum15SmHm, halotools.empirical_models.sfr_models.zu_mandelbaum16.ZuMandelbaum16QuenchingCens, halotools.empirical_models.sfr_models.zu_mandelbaum16.ZuMandelbaum16QuenchingSats

halotools.empirical_models.model_defaults Module

Module expressing various default settings of the empirical modeling sub-package.

Functions

get_halo_boundary_key(mdef) For the input mass definition, return the string used to access halo table column storing the halo radius.
get_halo_mass_key(mdef) For the input mass definition, return the string used to access halo table column storing the halo mass.

halotools.custom_exceptions Module

Classes for all Halotools-specific exceptions.

Classes

HalotoolsError(message) Base class of all Halotools-specific exceptions.
InvalidCacheLogEntry(message) Base class of all Halotools-specific exceptions.

Class Inheritance Diagram

Inheritance diagram of halotools.custom_exceptions.HalotoolsError, halotools.custom_exceptions.InvalidCacheLogEntry

halotools.sim_manager Package

The sim_manager sub-package is responsible for downloading halo catalogs, reading ascii data, storing hdf5 binaries and keeping a persistent memory of their location on disk and associated metadata.

Classes

CachedHaloCatalog(*args, **kwargs) Container class for the halo catalogs and particle data that are stored in the Halotools cache log.
DownloadManager() Class used to scrape the web for simulation data and cache the downloaded catalogs.
FakeSim([num_massbins, …]) Fake simulation data used in the test suite of empirical_models.
HaloTableCache([read_log_from_standard_loc]) Object providing a collection of halo catalogs for use with Halotools.
PtclTableCache([read_log_from_standard_loc]) Object providing a collection of particle catalogs for use with Halotools.
RockstarHlistReader(input_fname, …[, …]) The RockstarHlistReader reads Rockstar hlist ASCII files, stores them as hdf5 files in the Halotools cache, and updates the cache log.
TabularAsciiReader(input_fname, …[, …]) Class providing a memory-efficient algorithm for reading a very large ascii file that stores tabular data of a data type that is known in advance.
UserSuppliedHaloCatalog(**kwargs) Class used to transform a user-provided halo catalog into the standard form recognized by Halotools.
UserSuppliedPtclCatalog(**kwargs) Class used to transform a user-provided particle catalog into the standard form recognized by Halotools.

Class Inheritance Diagram

Inheritance diagram of halotools.sim_manager.cached_halo_catalog.CachedHaloCatalog, halotools.sim_manager.download_manager.DownloadManager, halotools.sim_manager.fake_sim.FakeSim, halotools.sim_manager.halo_table_cache.HaloTableCache, halotools.sim_manager.ptcl_table_cache.PtclTableCache, halotools.sim_manager.rockstar_hlist_reader.RockstarHlistReader, halotools.sim_manager.tabular_ascii_reader.TabularAsciiReader, halotools.sim_manager.user_supplied_halo_catalog.UserSuppliedHaloCatalog, halotools.sim_manager.user_supplied_ptcl_catalog.UserSuppliedPtclCatalog

halotools.sim_manager.sim_defaults Module

Module expressing various default settings of the simulation manager sub-package.

All values hard-coded here appear as unique variables throughout the entire Halotools code base. This allows you to customize your default settings and be guaranteed that whatever changes you make will correctly propagate to all relevant behavior. See the in-line comments in the halotools/sim_manager/sim_defaults.py source code for descriptions of the purpose of each variable defined in this module.

halotools.utils Package

This module contains helper functions used throughout the Halotools package.

Functions

add_halo_hostid(table[, …]) Function creates a new column halo_hostid for the input table.
angles_between_list_of_vectors(v0, v1[, tol]) Calculate the angle between a collection of 3d vectors
array_is_monotonic(array[, strict]) Method determines whether an input array is monotonic.
bijective_distribution_matching(x_in, x_desired) Replace the values in x_in with x_desired, preserving the rank-order of x_in
broadcast_host_halo_property(table, …[, …]) Calculate a property of the host of a group system and broadcast that property to all group members, e.g., calculate host halo mass.
build_cdf_lookup(y[, npts_lookup_table]) Compute a lookup table for the cumulative distribution function specified by the input set of y values.
calculate_entry_multiplicity(…[, testing_mode]) Given an array of possible hostids, and a sorted array of (possibly repeated) hostids, return the number of appearances of each hostid.
calculate_first_idx_unique_array_vals(…[, …]) Given an integer array with possibly repeated entries in ascending order, return the indices of the first appearance of each unique value.
calculate_last_idx_unique_array_vals(…[, …]) Given an integer array with possibly repeated entries in ascending order, return the indices of the last appearance of each unique value.
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.
chord_to_cartesian(theta[, radians]) Calculate chord distance on a unit sphere given an angular distance between two points.
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.
crossmatch(x, y[, skip_bounds_checking]) Finds where the elements of x appear in the array y, including repeats.
custom_len(x) Simple method to return a zero-valued 1-D numpy array with the length of the input x.
distribution_matching_indices(…[, seed]) Calcuate a set of indices that will resample (with replacement) input_distribution so that it matches output_distribution.
download_file_from_url(url, fname) Function to download a file from the web to a specific location, and print a progress bar along the way.
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.
file_len(fname)
find_idx_nearest_val(array, value) Method returns the index where the input array is closest to the input value.
fuzzy_digitize(x, centroids[, min_counts, seed]) Function assigns each element of the input array x to a centroid number.
group_member_generator(data, grouping_key, …) Generator used to loop over grouped data and yield requested properties of members of a group.
monte_carlo_from_cdf_lookup(x_table, y_table) Randomly draw a set of num_draws points from any arbitrary input distribution function.
normalized_vectors(vectors) Return a unit-vector for each 3d vector in the input list of 3d points.
random_indices_within_bin(…[, seed, …]) Given two equal-length arrays, with desired_binned_occupations defining the number of desired random draws per bin, and binned_multiplicity defining the number of indices in each bin that are available to be randomly drawn, return a set of indices such that only the appropriate indices will be drawn for each bin, and the total number of such random draws is in accord with the input desired_binned_occupations.
randomly_downsample_data(array, num_downsample) Method returns a length-num_downsample random downsampling of the input array.
rank_order_percentile(y) Return the rank-order percentile of the values of an input distribution y.
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.
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.
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.
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.
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.
sample_spherical_surface(N_points[, seed]) Randomly sample the sky.
sliding_conditional_percentile(x, y, …[, …]) Estimate the cumulative distribution function Prob(< y | x).
spherical_to_cartesian(ra, dec) Calculate cartesian coordinates on a unit sphere given two angular coordinates.
sum_in_bins(arr, sorted_bin_numbers[, …]) Given an array of values arr and another equal-length array sorted_bin_numbers storing how these values have been binned into Nbins, calculate the sum of the values in each bin.
unsorting_indices(sorting_indices) Return the indexing array that inverts numpy.argsort.
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.
vectors_normal_to_planes(x, y) Given a collection of 3d vectors x and y, return a collection of 3d unit-vectors that are orthogonal to x and y.

Classes

SampleSelector Container class for commonly used sample selections.

Class Inheritance Diagram

Inheritance diagram of halotools.utils.table_utils.SampleSelector

halotools.mock_observables Package

This sub-package contains the functions used to make astronomical observations on mock galaxy populations, and also analyze halo catalogs and other point data in periodic cubes.

Functions

angular_tpcf(sample1, theta_bins[, sample2, …]) Calculate the angular two-point correlation function, \(w(\theta)\).
apply_zspace_distortion(true_pos, …[, Lbox]) Apply redshift-space distortions to the comoving simulation coordinate, optionally accounting for periodic boundary conditions.
conditional_cylindrical_isolation(sample1, …) Determine whether a set of points, sample1, is isolated, i.e.
conditional_spherical_isolation(sample1, …) Determine whether a set of points, sample1, is isolated, i.e.
counts_in_cylinders(sample1, sample2, …[, …]) Function counts the number of points in sample2 separated by a xy-distance r and z-distance z from each point in sample1, where r and z are defined by the input proj_search_radius and cylinder_half_length, respectively.
cuboid_subvolume_labels(sample, Nsub, Lbox) Return integer labels indicating which cubical subvolume of a larger cubical volume a set of points occupy.
cylindrical_isolation(sample1, sample2, …) Determine whether a set of points, sample1, is isolated, i.e.
delta_sigma(galaxies, particles, …[, …]) Calculate \(\Delta\Sigma(r_p)\), the galaxy-galaxy lensing signal as a function of projected distance.
delta_sigma_from_precomputed_pairs(galaxies, …) Calculate \(\Delta\Sigma(r_p)\), the galaxy-galaxy lensing signal as a function of projected distance, assuming the mass around each galaxy has been precomputed.
get_haloprop_of_galaxies(halo_id_galaxies, …) Calculate the host halo property of every galaxy with a halo_id that matches one of the input halos.
hod_from_mock(haloprop_galaxies, haloprop_halos) Calculate the HOD of a mock galaxy sample.
inertia_tensor_per_object(sample1, sample2, …) For each point in sample1, identify all sample2 points within the input smoothing_scale; using those points together with the input weights2, the inertia_tensor_per_object function calculates the inertia tensor of the mass distribution surrounding each point in sample1.
large_scale_density_spherical_annulus(…[, …]) Calculate the mean density of the input sample from an input set of tracer particles using a spherical annulus centered on each point in the input sample as the tracer volume.
large_scale_density_spherical_volume(sample, …) Calculate the mean density of the input sample from an input set of tracer particles using a sphere centered on each point in the input sample as the tracer volume.
los_pvd_vs_rp(sample1, velocities1, rp_bins, …) Calculate the pairwise line-of-sight (LOS) velocity dispersion (PVD), \(\sigma_{z12}(r_p)\).
marked_npairs_3d(sample1, sample2, rbins[, …]) Calculate the number of weighted pairs with separations greater than or equal to r, \(W(>r)\).
marked_npairs_xy_z(sample1, sample2, …[, …]) Calculate the number of weighted pairs with separations greater than or equal to \(r_{\perp}\) and \(r_{\parallel}\), \(W(>r_{\perp},>r_{\parallel})\).
marked_tpcf(sample1, rbins[, sample2, …]) Calculate the real space marked two-point correlation function, \(\mathcal{M}(r)\).
mean_los_velocity_vs_rp(sample1, …[, …]) Calculate the mean pairwise line-of-sight (LOS) velocity as a function of projected separation, \(\bar{v}_{z,12}(r_p)\).
mean_radial_velocity_vs_r(sample1, velocities1) Calculate the mean pairwise velocity, \(\bar{v}_{12}(r)\).
mean_y_vs_x(x, y[, error_estimator]) Estimate the mean value of the property y as a function of x for an input sample of galaxies/halos, optionally returning an error estimate.
npairs_3d(sample1, sample2, rbins[, period, …]) Function counts the number of pairs of points separated by a three-dimensional distance smaller than the input rbins.
npairs_projected(sample1, sample2, rp_bins, …) Function counts the number of pairs of points with separation in the xy-plane less than the input rp_bins and separation in the z-dimension less than the input pi_max.
npairs_xy_z(sample1, sample2, rp_bins, pi_bins) Function counts the number of pairs of points with separation in the xy-plane less than the input rp_bins and separation in the z-dimension less than the input pi_bins.
principal_axes_from_inertia_tensors(…) Calculate the principal eigenvector of each of the input inertia tensors.
ra_dec_z(x, v[, cosmo]) Calculate the ra, dec, and redshift assuming an observer placed at (0,0,0).
radial_distance(xs, ys, zs, xc, yc, zc, period) Calculate the radial distance between the positions of a set of satellites and their centrals, accounting for periodic boundary conditions.
radial_distance_and_velocity(xs, ys, zs, …) Calculate the radial distance between the positions of a set of satellites and their centrals, accounting for periodic boundary conditions.
radial_profile_3d(sample1, sample2, …[, …]) Function used to calculate the mean value of some quantity in sample2 as a function of 3d distance from the points in sample1.
radial_pvd_vs_r(sample1, velocities1[, …]) Calculate the pairwise radial velocity dispersion as a function of absolute distance, or as a function of \(s = r / R_{\rm vir}\).
relative_positions_and_velocities(x1, x2[, …]) Return the vector pointing from x2 towards x1, that is, x1 - x2, accounting for periodic boundary conditions.
return_xyz_formatted_array(x, y, z[, …]) Returns a Numpy array of shape (Npts, 3) storing the xyz-positions in the format used throughout the mock_observables package, optionally applying redshift-space distortions according to the input velocity, redshift and cosmology.
rp_pi_tpcf(sample1, rp_bins, pi_bins[, …]) Calculate the redshift space correlation function, \(\xi(r_{p}, \pi)\)
rp_pi_tpcf_jackknife(sample1, randoms, …) redshift space correlation function, \(\xi(r_{p}, \pi)\) and the covariance matrix, \({C}_{ij}\), between ith and jth bin.
s_mu_tpcf(sample1, s_bins, mu_bins[, …]) Calculate the redshift space correlation function, \(\xi(s, \mu)\)
sign_pbc(x1, x2[, period, …]) Return the sign of the unit vector pointing from x2 towards x1, that is, the sign of (x1 - x2), accounting for periodic boundary conditions.
spherical_isolation(sample1, sample2, r_max) Determine whether a set of points, sample1, is isolated, i.e.
sphericity_from_inertia_tensors(inertia_tensors) Calculate the sphericity \(\mathcal{S}_{\rm i}\) of each of the \(i=1,\dots,N_{\rm points}\) mass distributions defined by the input inertia tensors \(\mathcal{I}_{\rm i}\).
total_mass_enclosed_per_cylinder(centers, …) Calculate the total mass enclosed in a set of cylinders of infinite length.
tpcf(sample1, rbins[, sample2, randoms, …]) Calculate the real space two-point correlation function, \(\xi(r)\).
tpcf_jackknife(sample1, randoms, rbins[, …]) Calculate the two-point correlation function, \(\xi(r)\) and the covariance matrix, \({C}_{ij}\), between ith and jth radial bin.
tpcf_multipole(s_mu_tcpf_result, mu_bins[, …]) Calculate the multipoles of the two point correlation function after first computing s_mu_tpcf.
tpcf_one_two_halo_decomp(sample1, …[, …]) Calculate the real space one-halo and two-halo decomposed two-point correlation functions, \(\xi^{1h}(r)\) and \(\xi^{2h}(r)\).
triaxility_from_inertia_tensors(inertia_tensors) Calculate the triaxility \(\mathcal{T}_{\rm i}\) of each of the \(i=1,\dots,N_{\rm points}\) mass distributions defined by the input inertia tensors \(\mathcal{I}_{\rm i}\).
underdensity_prob_func(sample1, rbins[, …]) Calculate the underdensity probability function (UPF), \(P_U(r)\).
void_prob_func(sample1, rbins[, n_ran, …]) Calculate the void probability function (VPF), \(P_0(r)\), defined as the probability that a random sphere of radius r contains zero points in the input sample.
wp(sample1, rp_bins, pi_max[, sample2, …]) Calculate the projected two point correlation function, \(w_{p}(r_p)\), where \(r_p\) is the separation perpendicular to the line-of-sight (LOS).
wp_jackknife(sample1, randoms, rp_bins, pi_max) Calculate the projected two-point correlation function, \(w_p(r_p)\) and the covariance matrix, \({C}_{ij}\), between ith and jth projected radial bin.

Classes

FoFGroups(positions, b_perp, b_para[, …]) Friends-of-friends (FoF) groups class.

Class Inheritance Diagram

Inheritance diagram of halotools.mock_observables.group_identification.fof_groups.FoFGroups

halotools.mock_observables.pair_counters Package

Functions

marked_npairs_3d(sample1, sample2, rbins[, …]) Calculate the number of weighted pairs with separations greater than or equal to r, \(W(>r)\).
marked_npairs_xy_z(sample1, sample2, …[, …]) Calculate the number of weighted pairs with separations greater than or equal to \(r_{\perp}\) and \(r_{\parallel}\), \(W(>r_{\perp},>r_{\parallel})\).
npairs_3d(sample1, sample2, rbins[, period, …]) Function counts the number of pairs of points separated by a three-dimensional distance smaller than the input rbins.
npairs_jackknife_3d(sample1, sample2, rbins) Pair counter used to make jackknife error estimates of real-space pair counter npairs.
npairs_jackknife_xy_z(sample1, sample2, …) Pair counter used to make jackknife error estimates of redshift-space pair counter npairs_xy_z.
npairs_per_object_3d(sample1, sample2, rbins) Function counts the number of points in sample2 separated by a distance r from each point in sample1, where r is defined by the input rbins.
npairs_projected(sample1, sample2, rp_bins, …) Function counts the number of pairs of points with separation in the xy-plane less than the input rp_bins and separation in the z-dimension less than the input pi_max.
npairs_s_mu(sample1, sample2, s_bins, mu_bins) Function counts the number of pairs of points separated by less than radial separation, \(s\), given by s_bins and angular distance, \(\mu\equiv\cos(\theta_{\rm los})\), given by mu_bins, where \(\theta_{\rm los}\) is the angle between \(\vec{s}\) and the line-of-sight (LOS).
npairs_xy_z(sample1, sample2, rp_bins, pi_bins) Function counts the number of pairs of points with separation in the xy-plane less than the input rp_bins and separation in the z-dimension less than the input pi_bins.
pairwise_distance_3d(data1, data2, r_max[, …]) Function returns pairs of points separated by a three-dimensional distance smaller than or eqaul to the input r_max.
pairwise_distance_xy_z(data1, data2, rp_max, …) Function returns pairs of points separated by a xy-projected distance smaller than or eqaul to the input rp_max and z distance pi_max.
weighted_npairs_s_mu(sample1, sample2, …) Function performs a weighted count of the number of pairs of points separated by less than radial separation, \(s\), given by s_bins and angular distance, \(\mu\equiv\cos(\theta_{\rm los})\), given by mu_bins, where \(\theta_{\rm los}\) is the angle between \(\vec{s}\) and the line-of-sight (LOS).

Classes

RectangularDoubleMesh(x1, y1, z1, x2, y2, …) Fundamental data structure of the mock_observables sub-package.
RectangularDoubleMesh2D(x1, y1, x2, y2, …) Fundamental data structure of the mock_observables sub-package.

Class Inheritance Diagram

Inheritance diagram of halotools.mock_observables.pair_counters.rectangular_mesh.RectangularDoubleMesh, halotools.mock_observables.pair_counters.rectangular_mesh_2d.RectangularDoubleMesh2D

halotools.mock_observables.pair_counters.marked_cpairs Package

Functions

conditional_pairwise_distance_no_pbc Calculate the conditional limited pairwise distance matrix, \(d_{ij}\).
conditional_pairwise_xy_z_distance_no_pbc Calculate the conditional limited pairwise distance matrices, \(d_{{\perp}ij}\) and \(d_{{\parallel}ij}\).
marked_npairs_3d_engine Cython engine for counting pairs of points as a function of three-dimensional separation.
marked_npairs_xy_z_engine Cython engine for counting pairs of points as a function of three-dimensional separation.