Which correlation function to use?¶
Corrfunc has a variety of correlation functions to cover a broad range of Science applications. The basic distinction occurs if the input particles are directly from a simulation or from an observational survey (or equivalently, a simulation that has been processed to look like a survey). For simulation data, referred throughout as theory, the assumption is that the particle positions are Cartesian, comoving XYZ. For survey data, referred throughout as mocks, the assumption is that particle positions are Right Ascension (0 – 360 deg), Declination (90 – 90 deg) and CZ (speed of light multiplied by the redshift). Depending on the exact type of data, and the desired correlation function you want, the following table should help you figure out which code you should use.
Input Data 
Periodic 
Particle domain 
Desired correlation function 
Returns 
Python code 

X, Y, Z 
True 
Cube (box) 
wp(\(r_p\)) 
2D Projected Correlation 

\(\xi(r)\) 
3D Realspace Correlation 

X, Y, Z 
True or False 
Arbitrary 
\(\xi(r)\) 
Paircounts in 3D realspace 

\(\xi(r_p, \pi)\) 
Paircounts in 2D 

\(\xi(s, \mu)\) 
Paircounts in 2D 

ra, dec, cz 
False 
Arbitrary 
\(\xi(r_p, \pi)\) 
Paircounts in 2D 

\(\xi(s, \mu)\) 
Paircounts in 2D 

ra, dec 
False 
Arbitrary 
\(\omega(\theta)\) 
Paircounts in angular space 
In all cases where only paircounts are returned (e.g., all of the mocks routines), you will need to compute at least
an additional RR term. Please see Corrfunc.utils.convert_3d_counts_to_cf
to
convert 3D paircounts (or angular pair counts) into a correlation
function. For 2D paircounts, please use Corrfunc.utils.convert_rp_pi_counts_to_wp
to convert into a projected correlation function. If you want to compute
the \(\xi(r_p, \pi)\) from the 2D paircounts, then simply call
Corrfunc.utils.convert_3d_counts_to_cf
with the arrays.
Also, see Using the commandline interface in Corrfunc for a detailed list of the clustering statistics and the various available API interfaces.