コード例 #1
0
    mms = [1e8, 1e9, 1e10, 1e11, 1e12]
       
 
if doexp:
    mtpath = mtpath + '/Mexp/'
    if mexp is not None:
        mtpath = mtpath[:-1] + '%02d/'%(mexp*100)
    try: os.makedirs(mtpath)
    except: pass

###########################################
for M0 in mms:
    print('For M0 = %0.2e'%M0)

    fig, ax = plt.subplots(3, 3, figsize = (14, 12))
    fit0 = dg.plot_noise(datas, predicts, M0=M0, binfit=bins, c='k', axin=ax, func=func, mbin=mbinsm, retfit=True, lsf='--')[0]
    #fit0 = dg.plot_noise(datapR.value, predictR.value, M0=M0, binfit=bins, c='k', axin=ax, func=func, mbin=mbinsm, retfit=True, lsf='--')[0]
    
    fits = []
    for i, sg in enumerate(sgs):     
        #fitt = dg.plot_noise(datasgR.value, predictR.value, M0=M0, binfit=bins, c=colors[i], axin=ax, func=func, mbin=mbinsm, retfit=True)[0]
        fitt = dg.plot_noise(datasgs[i], predicts, M0=M0, binfit=bins, c=colors[i], axin=ax, func=func, mbin=mbinsm, retfit=True)[0]
        fits.append(fitt)

    fig.savefig(mtpath + 'noisehist_M%02d_3seed.png'%(10*np.log10(M0)))

    tosave = []
    for i, res in enumerate(fit0):
        #print(res)
        tosave.append([msave[i], msave[i+1], res.x[1], res.x[2]])
    fpath = mtpath + 'hist_M%02d_3seed.txt'%(10*np.log10(M0))
コード例 #2
0
    logl = logl + t
    halomass2 = 10**logl
    sort2 = np.argsort(halomass2)[::-1]
    halomass2 = halomass2[sort2]
    halopos2 = hpos[sort2]
    return halomass2, halopos2


smin, smax = 0.1, 0.2
for M0 in [1e8, 1e9, 1e10, 1e11, 1e12]:
    fig, ax = plt.subplots(3, 3, figsize=(14, 12))
    fit0 = dg.plot_noise(datapR.value,
                         predictR.value,
                         M0=M0,
                         binfit=bins,
                         c='k',
                         axin=ax,
                         func=func,
                         mbin=mbinsm,
                         retfit=True,
                         lsf='--')[0]

    fits = []
    sgs = [0.2]
    for i, sg in enumerate(sgs):

        hmass, hpos = dg.scatter_catalog(hdictf['mass'],
                                         hdictf['position'],
                                         sigma=sg)
        datasg = pm.paint(hpos[:num], hmass[:num])
        datasgR = ft.smooth(datasg, 3, 'fingauss')
        fitt = dg.plot_noise(datasgR.value,