コード例 #1
0
def get_points(R_proj, num_points, weights):

    rd = []
    dp = []
    edp = []

    for i in range(len(R_proj) / num_points - 1):
        r_biweight = bwt_ave(R_proj[num_points * i:num_points * \
                                    (i + 1)])
        rd.append(r_biweight[0][0])
        if i == 0:
            r1 = 0.
        if i > 0:
            r1 = r2
        r2 = R_proj[num_points * (i + 1)]
        weight = np.sum(weights[num_points * i:num_points * (i + 1)])
        dp.append(weight / (np.pi * (r2**2 - r1**2)))
        edp.append(np.sqrt(num_points) / num_points * weight / \
                   (np.pi * (r2 ** 2 - r1 ** 2)))

    return np.array(rd), np.array(dp), np.array(edp)
コード例 #2
0
ファイル: cluster_profile.py プロジェクト: EiffL/python_lib
def get_points(R_proj, num_points, weights):
        
    radial_pt = []
    density_pt = []
    density_pt_err = []

    for i in range(len(R_proj) / num_points - 1): 
        r_biweight = bwt_ave(R_proj[num_points * i:num_points * \
                                    (i + 1)])
        radial_pt.append(r_biweight[0][0])
        if i == 0:
            r1 = 0.
        if i > 0:
            r1 = r2
        r2 = R_proj[num_points * (i + 1)]
        weight = np.sum(weights[num_points * i:num_points * (i + 1)])
        density_pt.append(weight / (np.pi * (r2 ** 2 - r1 ** 2)))
        density_pt_err.append(np.sqrt(num_points) / num_points * weight / \
                   (np.pi * (r2 ** 2 - r1 ** 2)))

    return np.array(radial_pt), np.array(density_pt), np.array(density_pt_err)
コード例 #3
0
def get_points(R_proj, num_points, weights):

    radial_pt = []
    density_pt = []
    density_pt_err = []

    for i in range(len(R_proj) / num_points - 1):
        r_biweight = bwt_ave(R_proj[num_points * i:num_points * \
                                    (i + 1)])
        radial_pt.append(r_biweight[0][0])
        if i == 0:
            r1 = 0.
        if i > 0:
            r1 = r2
        r2 = R_proj[num_points * (i + 1)]
        weight = np.sum(weights[num_points * i:num_points * (i + 1)])
        density_pt.append(weight / (np.pi * (r2**2 - r1**2)))
        density_pt_err.append(np.sqrt(num_points) / num_points * weight / \
                   (np.pi * (r2 ** 2 - r1 ** 2)))

    return np.array(radial_pt), np.array(density_pt), np.array(density_pt_err)
コード例 #4
0
ファイル: cluster_profile.py プロジェクト: jodarie/python_lib
def get_points(R_proj, num_points, weights):
        
    rd = []
    dp = []
    edp = []

    for i in range(len(R_proj) / num_points - 1): 
        r_biweight = bwt_ave(R_proj[num_points * i:num_points * \
                                    (i + 1)])
        rd.append(r_biweight[0][0])
        if i == 0:
            r1 = 0.
        if i > 0:
            r1 = r2
        r2 = R_proj[num_points * (i + 1)]
        weight = np.sum(weights[num_points * i:num_points * (i + 1)])
        dp.append(weight / (np.pi * (r2 ** 2 - r1 ** 2)))
        edp.append(np.sqrt(num_points) / num_points * weight / \
                   (np.pi * (r2 ** 2 - r1 ** 2)))

    return np.array(rd), np.array(dp), np.array(edp)