コード例 #1
0
    (nu_no_age, bias_no_age,
     _) = cmpn.calc_seljak_warren_w_cut(1000, 0.75, cosmo)
    for (t, s) in enumerate(snaps):
        z = zs[t]
        finaldir = '{0}Desktop/age-clustering-data/snap{1}{2}/attempt1_sub_form_jp/'.format(
            home, s, snap_id)  ##INPUT
        agelabel = 'Sub-Root-Form. Age'  ##INPUT
        col_j = ['k', 'b', 'c', 'g', 'm', 'r']  ##Predefined colors for age_i

        nu_res = []
        for age_i in range(0, 6):
            x = np.array([])
            y = np.array([])
            txt = np.array([], dtype=int)
            if age_i == 0:
                temp = cmpn.nu_eff(finaldir, (age_i, ), range(1, 7), cosmo, z,
                                   nu_no_age, bias_no_age)
                median_age = temp[5]
                mass_i_median_age = temp[0]
            else:
                nu_res.append(
                    cmpn.nu_eff(finaldir, (age_i, ), range(1, 7), cosmo, z,
                                nu_no_age, bias_no_age))
                for (idx, x_temp) in enumerate(nu_res[-1][5]):
                    if nu_res[-1][4][idx] > -100:
                        idx2 = np.where(
                            mass_i_median_age == nu_res[-1][0][idx])[0]
                        x = np.append(x, (x_temp - median_age[idx2]) /
                                      median_age[idx2])
                        y = np.append(y, nu_res[-1][4][idx])
                        txt = np.append(txt, nu_res[-1][0][idx])
                xtot.extend(x)
コード例 #2
0
ファイル: nu_eff_age.py プロジェクト: jpwalker/age-clustering
    xtot = []
    ytot = []
    (nu_no_age, bias_no_age, _) = cmpn.calc_seljak_warren_w_cut(1000, 0.75, cosmo)
    for (t, s) in enumerate(snaps):
        z = zs[t]
        finaldir = "{0}Desktop/age-clustering-data/snap{1}{2}/attempt1_sub_form_jp/".format(home, s, snap_id)  ##INPUT
        agelabel = "Sub-Root-Form. Age"  ##INPUT
        col_j = ["k", "b", "c", "g", "m", "r"]  ##Predefined colors for age_i

        nu_res = []
        for age_i in range(0, 6):
            x = np.array([])
            y = np.array([])
            txt = np.array([], dtype=int)
            if age_i == 0:
                temp = cmpn.nu_eff(finaldir, (age_i,), range(1, 7), cosmo, z, nu_no_age, bias_no_age)
                median_age = temp[5]
                mass_i_median_age = temp[0]
            else:
                nu_res.append(cmpn.nu_eff(finaldir, (age_i,), range(1, 7), cosmo, z, nu_no_age, bias_no_age))
                for (idx, x_temp) in enumerate(nu_res[-1][5]):
                    if nu_res[-1][4][idx] > -100:
                        idx2 = np.where(mass_i_median_age == nu_res[-1][0][idx])[0]
                        x = np.append(x, (x_temp - median_age[idx2]) / median_age[idx2])
                        y = np.append(y, nu_res[-1][4][idx])
                        txt = np.append(txt, nu_res[-1][0][idx])
                xtot.extend(x)
                ytot.extend(y)
                plt.plot(x, y, "*", color=col_j[age_i], label="{0}_{1}_{2}".format(agelabel, s, age_i))
    #                 for (i, txt_i) in enumerate(txt):
    #                     plt.text(x[i], y[i], txt_i)
コード例 #3
0
    ytot = []
    (nu_no_age, bias_no_age) = cmpn.calc_seljak_warren(1000, cosmo)
    for (t, s) in enumerate(snaps):
        z = zs[t]
        finaldir = '{0}Desktop/age-clustering-data/snap{1}/attempt1_sub_form_gao/'.format(
            home, s)  ##INPUT
        agelabel = 'Sub-Root-Form. Age'  ##INPUT
        col_j = ['k', 'b', 'c', 'g', 'm', 'r']  ##Predefined colors for age_i

        nu_res = []
        for age_i in range(0, 6):
            x = np.array([])
            y = np.array([])
            txt = np.array([], dtype=int)
            if age_i == 0:
                temp = cmpn.nu_eff(finaldir, age_i, [1, 2, 3, 4, 5, 6, 7],
                                   cosmo, z, nu_no_age, bias_no_age)
                median_age = temp[5]
                mass_i_median_age = temp[0]
            else:
                nu_res.append(
                    cmpn.nu_eff(finaldir, age_i, [1, 2, 3, 4, 5, 6, 7], cosmo,
                                z, nu_no_age, bias_no_age))
                for (idx, x_temp) in enumerate(nu_res[-1][5]):
                    if nu_res[-1][4][idx] > -100:
                        idx2 = np.where(
                            mass_i_median_age == nu_res[-1][0][idx])[0]
                        x = np.append(x, x_temp / median_age[idx2] - 1.)
                        y = np.append(
                            y, (nu_res[-1][4][idx] - nu_res[-1][2][idx]) /
                            nu_res[-1][2][idx])
                        txt = np.append(txt, nu_res[-1][0][idx])
 p1 = np.empty(len(snaps), dtype = np.object)
 #Properties for the mass-age sample across all redshifts
 best_fits = []
 fit_age = np.empty(0, dtype = float)
 fit_nu = np.empty(0, dtype = float)
 fit_nueff = np.empty(0, dtype = float)
 fig = plt.figure()
 axi = (fig.add_subplot(131, projection = '3d'), 
        fig.add_subplot(132, projection = '3d'), 
        fig.add_subplot(133, projection = '3d')) 
 for (t, s) in enumerate(snaps): #Step through redshift
     z = zs[t]
     pnt = z_points[t]
     finaldir = '{0}Desktop/age-clustering-data/snap{1}{2}/attempt1_sub_form_jp/'.format(home, s, snap_identifier) ##INPUT
     agelabel = 'Sub-Max-Form. Age' ##INPUT ##Label for age definition
     nu_res = cmpn.nu_eff(finaldir, range(0, 6), range(1, 8), cosmo, z, nu_no_age, bias_no_age)
     for age_i in range(1, 6): #Step through mass_i and enumerate the age
         tot_agei = np.empty(0, dtype= int)
         tot_massi = np.empty(0, dtype = int)
         tot_age = np.empty(0, dtype = float)
         tot_nueff = np.empty(0, dtype = float)
         tot_nu = np.empty(0, dtype = float)
         tot_z = np.empty(0, dtype = float)
         color = col_j[age_i]
         for mass_i in range(1, 8):
             idx = index_nu_eff(nu_res, [age_i], [mass_i])[0]
             if nu_res[4][idx] > -100: ##If there is a nu_eff calculated for this object
                 idx2 = index_nu_eff(nu_res, [0], [mass_i])[0]
                 #Calculated values for mass_i and age_i sample
                 tot_agei = np.append(tot_agei, nu_res[1][idx])
                 tot_massi = np.append(tot_massi, nu_res[0][idx])
コード例 #5
0
 #Properties for the mass-age sample across all redshifts
 best_fits = []
 fit_age = np.empty(0, dtype=float)
 fit_nu = np.empty(0, dtype=float)
 fit_nueff = np.empty(0, dtype=float)
 fig = plt.figure()
 axi = (fig.add_subplot(131, projection='3d'),
        fig.add_subplot(132, projection='3d'),
        fig.add_subplot(133, projection='3d'))
 for (t, s) in enumerate(snaps):  #Step through redshift
     z = zs[t]
     pnt = z_points[t]
     finaldir = '{0}Desktop/age-clustering-data/snap{1}{2}/attempt1_sub_form_jp/'.format(
         home, s, snap_identifier)  ##INPUT
     agelabel = 'Sub-Max-Form. Age'  ##INPUT ##Label for age definition
     nu_res = cmpn.nu_eff(finaldir, range(0, 6), range(1, 8), cosmo, z,
                          nu_no_age, bias_no_age)
     for age_i in range(1, 6):  #Step through mass_i and enumerate the age
         tot_agei = np.empty(0, dtype=int)
         tot_massi = np.empty(0, dtype=int)
         tot_age = np.empty(0, dtype=float)
         tot_nueff = np.empty(0, dtype=float)
         tot_nu = np.empty(0, dtype=float)
         tot_z = np.empty(0, dtype=float)
         color = col_j[age_i]
         for mass_i in range(1, 8):
             idx = index_nu_eff(nu_res, [age_i], [mass_i])[0]
             if nu_res[4][
                     idx] > -100:  ##If there is a nu_eff calculated for this object
                 idx2 = index_nu_eff(nu_res, [0], [mass_i])[0]
                 #Calculated values for mass_i and age_i sample
                 tot_agei = np.append(tot_agei, nu_res[1][idx])
コード例 #6
0
 xtot = []
 ytot = []
 (nu_no_age, bias_no_age)  = cmpn.calc_seljak_warren(1000, cosmo)
 for (t, s) in enumerate(snaps):
     z = zs[t]
     finaldir = '{0}Desktop/age-clustering-data/snap{1}/attempt1_sub_form_gao/'.format(home, s) ##INPUT
     agelabel = 'Sub-Root-Form. Age' ##INPUT
     col_j = ['k', 'b', 'c', 'g', 'm', 'r'] ##Predefined colors for age_i
     
     nu_res = []
     for age_i in range(0,6):
         x = np.array([])
         y = np.array([])
         txt = np.array([],dtype = int)
         if age_i == 0:
             temp = cmpn.nu_eff(finaldir, age_i, [1, 2, 3, 4, 5, 6, 7], cosmo, z, nu_no_age, bias_no_age)
             median_age = temp[5]
             mass_i_median_age = temp[0]
         else:
             nu_res.append(cmpn.nu_eff(finaldir, age_i, [1, 2, 3, 4, 5, 6, 7], cosmo, z, nu_no_age, bias_no_age))
             for (idx, x_temp) in enumerate(nu_res[-1][5]):
                 if nu_res[-1][4][idx] > -100:
                     idx2 = np.where(mass_i_median_age == nu_res[-1][0][idx])[0]
                     x = np.append(x, x_temp / median_age[idx2] - 1.) 
                     y = np.append(y, (nu_res[-1][4][idx] - nu_res[-1][2][idx]) / nu_res[-1][2][idx])
                     txt = np.append(txt, nu_res[-1][0][idx])    
             xtot.extend(x)
             ytot.extend(y)
             plt.plot(x, y, '+', 
                      color = col_j[age_i], label = '{0}_{1}_{2}'.format(agelabel, s, age_i))
             for (i, txt_i) in enumerate(txt):
コード例 #7
0
ファイル: nu_age.py プロジェクト: jpwalker/age-clustering
    xtot = []
    ytot = []
    (nu_no_age, bias_no_age, _)  = calc_seljak_warren_w_cut(1000, 0.75, cosmo)
    for (t, s) in enumerate(snaps):
        z = zs[t]
        finaldir = '{0}Desktop/age-clustering-data/snap{1}{2}/attempt1_sub_form_jp/'.format(home, s, suffix) ##INPUT
        agelabel = 'Sub-Max-Form. Age' ##INPUT
        col_j = ['k', 'b', 'c', 'g', 'm', 'r'] ##Predefined colors for age_i
        
        nu_res = []
        for age_i in range(0,6):
            x = np.array([])
            y = np.array([])
            txt = np.array([],dtype = int)
            if age_i == 0:
                temp = nu_eff(finaldir, (age_i,), range(1, 9), cosmo, z, nu_no_age, bias_no_age)
                median_age = temp[5]
                mass_i_median_age = temp[0]
            else:
                nu_res.append(nu_eff(finaldir, (age_i,), range(1, 9), cosmo, z, nu_no_age, bias_no_age))
                for (idx, x_temp) in enumerate(nu_res[-1][5]):
                    idx2 = np.where(mass_i_median_age == nu_res[-1][0][idx])[0]
                    x = np.append(x, (x_temp - median_age[idx2]) / median_age[idx2]) 
                    y = np.append(y, nu_res[-1][2][idx])
                    txt = np.append(txt, nu_res[-1][0][idx])    
                xtot.extend(x)
                ytot.extend(y)
                plt.plot(x, y, '+', 
                         color = col_j[age_i], label = '{0}_{1}_{2}'.format(agelabel, s, age_i))
#                 for (i, txt_i) in enumerate(txt):
#                     plt.text(x[i], y[i], txt_i)
コード例 #8
0
    ytot = []
    (nu_no_age, bias_no_age, _) = calc_seljak_warren_w_cut(1000, 0.75, cosmo)
    for (t, s) in enumerate(snaps):
        z = zs[t]
        finaldir = '{0}Desktop/age-clustering-data/snap{1}{2}/attempt1_sub_form_jp/'.format(
            home, s, suffix)  ##INPUT
        agelabel = 'Sub-Max-Form. Age'  ##INPUT
        col_j = ['k', 'b', 'c', 'g', 'm', 'r']  ##Predefined colors for age_i

        nu_res = []
        for age_i in range(0, 6):
            x = np.array([])
            y = np.array([])
            txt = np.array([], dtype=int)
            if age_i == 0:
                temp = nu_eff(finaldir, (age_i, ), range(1, 9), cosmo, z,
                              nu_no_age, bias_no_age)
                median_age = temp[5]
                mass_i_median_age = temp[0]
            else:
                nu_res.append(
                    nu_eff(finaldir, (age_i, ), range(1, 9), cosmo, z,
                           nu_no_age, bias_no_age))
                for (idx, x_temp) in enumerate(nu_res[-1][5]):
                    idx2 = np.where(mass_i_median_age == nu_res[-1][0][idx])[0]
                    x = np.append(x, (x_temp - median_age[idx2]) /
                                  median_age[idx2])
                    y = np.append(y, nu_res[-1][2][idx])
                    txt = np.append(txt, nu_res[-1][0][idx])
                xtot.extend(x)
                ytot.extend(y)
                plt.plot(x,