ed_3d_one_two_halo_decomp¶
- halotools.mock_observables.ed_3d_one_two_halo_decomp(sample1, orientations1, sample1_host_halo_id, sample2, sample2_host_halo_id, rbins, weights1=None, weights2=None, mask1=None, mask2=None, period=None, num_threads=1, approx_cell1_size=None, approx_cell2_size=None)[source]¶
Calculate the one and two halo componenents of the 3-D ellipticity-direction correlation function (ED), \(\omega_{\rm 1h}(r)\), and \(\omega_{\rm 2h}(r)\).
- Parameters:
- sample1array_like
Npts1 x 3 numpy array containing 3-D positions of points with associated orientations. See the Formatting your xyz coordinates for Mock Observables calculations documentation page, or the Examples section below, for instructions on how to transform your coordinate position arrays into the format accepted by the
sample1
andsample2
arguments. Length units are comoving and assumed to be in Mpc/h, here and throughout Halotools.- orientations1array_like
Npts1 x 3 numpy array containing orientation vectors for each point in
sample1
. these will be normalized if not already.- sample1_host_halo_idarray_like
Npts1 length integer array of host halo ids.
- sample2array_like, optional
Npts2 x 3 array containing 3-D positions of points.
- sample2_host_halo_idarray_like
Npts2 length integer array of host halo ids.
- rbinsarray_like
array of boundaries defining the radial bins in which pairs are counted. Length units are comoving and assumed to be in Mpc/h, here and throughout Halotools.
- weights1array_like, optional
Npts1 array of weights. If this parameter is not specified, it is set to numpy.ones(Npts1).
- weights2array_like, optional
Npts2 array of weights. If this parameter is not specified, it is set to numpy.ones(Npts2).
- mask1array_like, optional
Npts1 boolean array indicating which galaxies in
sample1
contributes to the ED correlation function. The default is np.array([True]*Npts1).- mask2array_lile, optional
Npts2 boolean array indicating which galaxies in
sample2
contributes to the ED correlation function. The default is np.array([True]*Npts2).- periodarray_like, optional
Length-3 sequence defining the periodic boundary conditions in each dimension. If you instead provide a single scalar, Lbox, period is assumed to be the same in all Cartesian directions. If set to None (the default option), PBCs are set to infinity, in which case
randoms
must be provided. Length units are comoving and assumed to be in Mpc/h, here and throughout Halotools.- num_threadsint, optional
Number of threads to use in calculation, where parallelization is performed using the python
multiprocessing
module. Default is 1 for a purely serial calculation, in which case a multiprocessing Pool object will never be instantiated. A string ‘max’ may be used to indicate that the pair counters should use all available cores on the machine.- approx_cell1_sizearray_like, optional
Length-3 array serving as a guess for the optimal manner by how points will be apportioned into subvolumes of the simulation box. The optimum choice unavoidably depends on the specs of your machine. Default choice is to use Lbox/10 in each dimension, which will return reasonable result performance for most use-cases. Performance can vary sensitively with this parameter, so it is highly recommended that you experiment with this parameter when carrying out performance-critical calculations.
- approx_cell2_sizearray_like, optional
Analogous to
approx_cell1_size
, but for sample2. See comments forapprox_cell1_size
for details.
- Returns:
- correlation_functionsnumpy.array
Two len(rbins)-1 length array containing the correlation function \(\omega_{1\rm h}(r)\) and \(\omega_{2\rm h}(r)\) computed in each of the bins defined by input
rbins
.
Notes
The ellipticity-direction correlation function is defined as:
\[\omega = \frac{\sum_{i \neq j}w_iw_j|\hat{e}_i \cdot \hat{r}_{ij}|^2}{\sum_{i \neq j} w_iw_j} - \frac{1}{3}\]where e.g. \(\hat{e}_i\) is the orientation of the \(i\)-th galaxy, and \(\hat{r}_{ij}\) is the normalized vector in the direction of the \(j\)-th galaxy from the \(i\)-th galaxy. \(w_i\) and \(w_j\) are the weights associated with the \(i\)-th and \(j\)-th galaxy. The weights default to 1 if not set.