Functions
verify_input_sources (first, second, BoxSize, …) |
Verify that the input source objects have all of the required columns and appropriate box size attributes. |
Classes
CorrfuncResult (data) |
A class used internally holding the array like result of a pair counting algorithm from Corrfunc . |
PairCountBase (first, second[, show_progress]) |
An abstract base class for pair counting algorithms, either for a simulation box or survey data. |
SimulationBoxPairCount (mode, first, redges) |
Count (weighted) pairs of objects in a simulation box using the Corrfunc package. |
Exceptions
MissingCorrfuncError () |
nbodykit.algorithms.sim_paircount.
CorrfuncResult
(data)[source]¶A class used internally holding the array like result of a
pair counting algorithm from Corrfunc
.
This class is useful for summing pair count results, accounting for columns that are pair-weighted.
Parameters: | data (numpy.ndarray) – the numpy structured array result from Corrfunc |
---|
Attributes
dtype |
|
shape |
Methods
reshape (*args, **kwargs) |
nbodykit.algorithms.sim_paircount.
PairCountBase
(first, second, show_progress=True)[source]¶An abstract base class for pair counting algorithms, either for a simulation box or survey data.
Users should use one of the subclasses of this class.
Parameters: |
|
---|
Methods
load (output[, comm]) |
Load a result has been saved to disk with save() . |
save (output) |
Save result as a JSON file with name output |
nbodykit.algorithms.sim_paircount.
SimulationBoxPairCount
(mode, first, redges, BoxSize=None, periodic=True, second=None, Nmu=5, los='z', weight='Weight', show_progress=True, **config)[source]¶Count (weighted) pairs of objects in a simulation box using the
Corrfunc
package.
This uses the Corrfunc.theory.DD.DD()
and
Corrfunc.theory.DDsmu.DDsmu()
functions to count pairs.
Results are computed when the object is inititalized. See the documenation
of run()
for the attributes storing the
results.
Note
The algorithm expects the positions of particles in a simulation box to
be the Cartesian x
, y
, and z
vectors. To compute
pair counts on survey data, using right ascension, declination, and
redshift, see SurveyDataPairCount
.
Parameters: |
|
---|
Methods
load (output[, comm]) |
Load a result has been saved to disk with save() . |
run () |
Calculate the 3D pair-counts in a simulation box as a function of separation r or separation and angle to line-of-sight (r , mu ). |
save (output) |
Save result as a JSON file with name output |
run
()[source]¶Calculate the 3D pair-counts in a simulation box as a function
of separation r
or separation and angle to line-of-sight
(r
, mu
). This adds the following attributes to the class:
result
¶BinnedStatistic
– a BinnedStatistic object holding the pair count and correlation
function results. The coordinate grid is either r
or
r
and mu
. It stores the following variables:
r
: the mean separation value in the binxi
: the mean correlation function value in the bin, computed as
\(DD/RR - 1\), where \(RR\) is the number of random pairs
in the binnpairs
: the number of pairs in the binweightavg
: the average weight value in the bin; each pair
contributes the product of the individual weight values