Classes
BasePairCount2PCF (mode, data1, edges[, Nmu, …]) 
Base class for twopoint correlation function algorithms that use pair counting. 
SimulationBox2PCF (mode, data1, edges[, Nmu, …]) 
Compute the twopoint correlation function for data in a simulation box as a function of \(r\), \((r,\mu)\), \((r_p, \pi)\), or \(\theta\) using pair counting. 
SurveyData2PCF (mode, data1, randoms1, edges) 
Compute the twopoint correlation function for observational survey data as a function of \(r\), \((r,\mu)\), \((r_p, \pi)\), or \(\theta\) using pair counting. 
nbodykit.algorithms.paircount_tpcf.tpcf.
BasePairCount2PCF
(mode, data1, edges, Nmu=None, pimax=None, randoms1=None, randoms2=None, data2=None, R1R2=None, **kws)[source]¶Base class for twopoint correlation function algorithms that use
pair counting. The API largely follows that of
SimulationBoxPairCount
and
SurveyDataPairCount
.
Parameters: 


Methods
load (output[, comm]) 
Load a result has been saved to disk with save() . 
run () 
Run the twopoint correlation function algorithm. 
save (output) 
Save result as a JSON file with name output 
run
()[source]¶Run the twopoint correlation function algorithm.
There are two cases here:
Raises: 


nbodykit.algorithms.paircount_tpcf.tpcf.
SimulationBox2PCF
(mode, data1, edges, Nmu=None, pimax=None, data2=None, randoms1=None, randoms2=None, R1R2=None, periodic=True, BoxSize=None, los='z', weight='Weight', position='Position', show_progress=False, **config)[source]¶Compute the twopoint correlation function for data in a simulation box as a function of \(r\), \((r,\mu)\), \((r_p, \pi)\), or \(\theta\) using pair counting.
This uses analytic randoms when using periodic conditions, unless a randoms catalog is specified. The “natural” estimator (DD/RR1) is used in the former case, and the LandySzalay estimator (DD/RR  2DR/RR + 1) in the latter case.
Note
When using analytic randoms, the expected counts are assumed to be unweighted.
Parameters: 


Notes
This class can compute correlation functions using several different
coordinate choices, based on the value of the input argument mode
.
The choices are:
mode='1d'
: compute pairs as a function of the 3D separation \(r\)mode='2d'
: compute pairs as a function of the 3D separation \(r\)
and the cosine of the angle to the lineofsight, \(\mu\)mode='projected'
: compute pairs as a function of distance perpendicular
and parallel to the lineofsight, \(r_p\) and \(\pi\)mode='angular'
: compute pairs as a function of angle on the sky, \(\theta\)If mode='projected'
, the projected correlation function \(w_p(r_p)\)
is also computed, using the input \(\pi_\mathrm{max}\) value.
Methods
load (output[, comm]) 
Load a result has been saved to disk with save() . 
run () 
Run the twopoint correlation function algorithm. 
save (output) 
Save result as a JSON file with name output 
run
()[source]¶Run the twopoint correlation function algorithm. This attaches the following attributes:
SimulationBox2PCF.D1D2
SimulationBox2PCF.D1R2
SimulationBox2PCF.D2R1
SimulationBox2PCF.R1R2
SimulationBox2PCF.corr
SimulationBox2PCF.wp
(if mode='projected'
)D1D2
¶the data1  data2 pair counts
Type:  BinnedStatistic 

D1R2
¶the data1  randoms2 pair counts
Type:  BinnedStatistic 

D2R1
¶the data2  randoms1 pair counts
Type:  BinnedStatistic 

R1R2
¶the randoms1  randoms2 pair counts
Type:  BinnedStatistic 

corr
¶the correlation function values, stored as the corr
variable,
computed from the pair counts
Type:  BinnedStatistic 

wp
¶the projected correlation function, \(w_p(r_p)\), computed
if mode='projected'
; correlation is stored as the corr
variable
Type:  BinnedStatistic 

Notes
The D1D2
, D1R2
, D2R1
, and R1R2
attributes are identical to the
pairs
attribute
of SimulationBoxPairCount
.
save
(output)¶Save result as a JSON file with name output
nbodykit.algorithms.paircount_tpcf.tpcf.
SurveyData2PCF
(mode, data1, randoms1, edges, cosmo=None, Nmu=None, pimax=None, data2=None, randoms2=None, R1R2=None, ra='RA', dec='DEC', redshift='Redshift', weight='Weight', show_progress=False, **config)[source]¶Compute the twopoint correlation function for observational survey data as a function of \(r\), \((r,\mu)\), \((r_p, \pi)\), or \(\theta\) using pair counting.
The LandySzalay estimator (DD/RR  2 DD/RR + 1) is used to transform pair counts in to the correlation function.
Parameters: 


Notes
This class can compute correlation functions using several different
coordinate choices, based on the value of the input argument mode
.
The choices are:
mode='1d'
: compute pairs as a function of the 3D separation \(r\)mode='2d'
: compute pairs as a function of the 3D separation \(r\)
and the cosine of the angle to the lineofsight, \(\mu\)mode='projected'
: compute pairs as a function of distance perpendicular
and parallel to the lineofsight, \(r_p\) and \(\pi\)mode='angular'
: compute pairs as a function of angle on the sky, \(\theta\)If mode='projected'
, the projected correlation function \(w_p(r_p)\)
is also computed, using the input \(\pi_\mathrm{max}\) value.
Methods
load (output[, comm]) 
Load a result has been saved to disk with save() . 
run () 
Run the twopoint correlation function algorithm. 
save (output) 
Save result as a JSON file with name output 
run
()[source]¶Run the twopoint correlation function algorithm. This attaches the following attributes:
SurveyData2PCF.D1D2
SurveyData2PCF.D1R2
SurveyData2PCF.D2R1
SurveyData2PCF.R1R2
SurveyData2PCF.corr
SurveyData2PCF.wp
(if mode='projected'
)D1D2
¶the data1  data2 pair counts
Type:  BinnedStatistic 

D1R2
¶the data1  randoms2 pair counts
Type:  BinnedStatistic 

D2R1
¶the data2  randoms1 pair counts
Type:  BinnedStatistic 

R1R2
¶the randoms1  randoms2 pair counts
Type:  BinnedStatistic 

corr
¶the correlation function values, stored as the corr
variable,
computed from the pair counts
Type:  BinnedStatistic 

wp
¶the projected correlation function, \(w_p(r_p)\), computed
if mode='projected'
; correlation is stored as the corr
variable
Type:  BinnedStatistic 

Notes
The D1D2
, D1R2
, D2R1
, and R1R2
attributes are identical to the
pairs
attribute
of SurveyDataPairCount
.
save
(output)¶Save result as a JSON file with name output