Example #1
0
def reference_survey_paircount(pos1,
                               w1,
                               redges,
                               Nmu,
                               pos2=None,
                               w2=None,
                               los=2):
    """Reference pair counting via kdcount"""

    tree1 = correlate.points(pos1, boxsize=None, weights=w1)
    if pos2 is None:
        tree2 = tree1
    else:
        tree2 = correlate.points(pos2, boxsize=None, weights=w2)

    bins = correlate.RmuBinning(redges,
                                Nmu,
                                observer=(0, 0, 0),
                                mu_min=0.,
                                absmu=True)
    pc = correlate.paircount(tree1,
                             tree2,
                             bins,
                             np=0,
                             compute_mean_coords=True)
    return numpy.nan_to_num(pc.pair_counts), numpy.nan_to_num(
        pc.mean_centers[0]), pc.sum1
Example #2
0
def reference_2pcf_smu(sedges,muedges,position1,weight1,position2=None,weight2=None,los='midpoint'):
    """Reference pair counting via kdcount"""
    tree1 = correlate.points(position1,boxsize=None,weights=weight1)
    if position2 is None: tree2 = tree1
    else: tree2 = correlate.points(position2,boxsize=None,weights=weight2)
    if los=='midpoint':
        bins = correlate.RmuBinning(np.asarray(sedges),(len(muedges)-1),observer=(0,0,0),mu_min=muedges[0],mu_max=muedges[-1],absmu=False)
    else:
        bins = correlate.FlatSkyBinning(np.asarray(sedges),(len(muedges)-1),los='xyz'.index(los),mu_min=muedges[0],mu_max=muedges[-1],absmu=False)
    pc = correlate.paircount(tree2,tree1,bins,np=0,usefast=False,compute_mean_coords=True)
    return pc.sum1