@@ -21,7 +21,8 @@ def DDrppi(autocorr, nthreads, pimax, binfile, X1, Y1, Z1, weights1=None,
21
21
zbin_refine_factor = 1 , max_cells_per_dim = 100 ,
22
22
copy_particles = True , enable_min_sep_opt = True ,
23
23
c_api_timer = False , isa = 'fastest' ,
24
- weight_type = None , bin_type = 'custom' ):
24
+ weight_type = None , bin_type = 'custom' ,
25
+ pair_weights = None , sep_pair_weights = None ):
25
26
"""
26
27
Calculate the 3-D pair-counts corresponding to the real-space correlation
27
28
function, :math:`\\ xi(r_p, \pi)` or :math:`\\ wp(r_p)`. Pairs which are
@@ -174,6 +175,12 @@ def DDrppi(autocorr, nthreads, pimax, binfile, X1, Y1, Z1, weights1=None,
174
175
``rtol = 1e-05`` *and* ``atol = 1e-08`` (relative and absolute tolerance)
175
176
of ``np.linspace(binfile[0], binfile[-1], len(binfile))``.
176
177
178
+ pair_weights : array-like, optional. Default: None.
179
+ Array of pair weights.
180
+
181
+ sep_pair_weights : array-like, optional. Default: None.
182
+ Array of separations corresponding to ``pair_weights``.
183
+
177
184
Returns
178
185
--------
179
186
@@ -290,14 +297,22 @@ def DDrppi(autocorr, nthreads, pimax, binfile, X1, Y1, Z1, weights1=None,
290
297
weights1 , weights2 = process_weights (weights1 , weights2 , X1 , X2 , weight_type , autocorr )
291
298
292
299
# Ensure all input arrays are native endian
293
- X1 , Y1 , Z1 , weights1 , X2 , Y2 , Z2 , weights2 = [
300
+ X1 , Y1 , Z1 , X2 , Y2 , Z2 = [
294
301
convert_to_native_endian (arr , warn = True ) for arr in
295
- [X1 , Y1 , Z1 , weights1 , X2 , Y2 , Z2 , weights2 ]]
302
+ [X1 , Y1 , Z1 , X2 , Y2 , Z2 ]]
303
+ if weight_type is not None :
304
+ weights1 = [convert_to_native_endian (arr , warn = True ) for arr in weights1 ]
305
+ weights2 = [convert_to_native_endian (arr , warn = True ) for arr in weights2 ]
306
+
307
+ if pair_weights is not None :
308
+ pair_weights = convert_to_native_endian (pair_weights , warn = True )
309
+ sep_pair_weights = convert_to_native_endian (sep_pair_weights , warn = True )
296
310
297
311
# Passing None parameters breaks the parsing code, so avoid this
298
312
kwargs = {}
299
313
for k in ['weights1' , 'weights2' , 'weight_type' ,
300
- 'X2' , 'Y2' , 'Z2' , 'boxsize' ]:
314
+ 'X2' , 'Y2' , 'Z2' , 'boxsize' ,
315
+ 'pair_weights' , 'sep_pair_weights' ]:
301
316
v = locals ()[k ]
302
317
if v is not None :
303
318
kwargs [k ] = v
0 commit comments