當前位置: 首頁>>代碼示例>>Python>>正文


Python WLanalysis.buildInterpolator2D方法代碼示例

本文整理匯總了Python中WLanalysis.buildInterpolator2D方法的典型用法代碼示例。如果您正苦於以下問題:Python WLanalysis.buildInterpolator2D方法的具體用法?Python WLanalysis.buildInterpolator2D怎麽用?Python WLanalysis.buildInterpolator2D使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WLanalysis的用法示例。


在下文中一共展示了WLanalysis.buildInterpolator2D方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_prob_plane

# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import buildInterpolator2D [as 別名]
def create_prob_plane(psPDFpk='pk', sigmaG_idx=0):
    if psPDFpk =='ps':
        idx2000=where(ell_gadget<10000)[0]
        obs_arr = load(CMBNG_dir+'mat/mat_ps_avg.npy')[:,idx2000]
        fidu_mat = load(CMBNG_dir+'mat/mat_ps_fidu.npy')[:,idx2000]
    else:
        obs_arr = load(CMBNG_dir+'mat/mat_%s_sigmaG%i_avg.npy'%(psPDFpk, sigmaG_idx))
        
        fidu_mat = load(CMBNG_dir+'mat/mat_%s_sigmaG%i_fidu.npy'%(psPDFpk, sigmaG_idx))
    
    idx = where(~isnan(mean(fidu_mat,axis=0))&(mean(fidu_mat,axis=0)!=0))[0]
    fidu_mat=fidu_mat[:,idx]
    interp_cosmo=WLanalysis.buildInterpolator2D(obs_arr[:,idx], cosmo_params)
    
    #cov_mat = 
    cov_mat = cov(fidu_mat,rowvar=0)/(2e4/12.5)
    cov_inv = mat(cov_mat).I
    
    def chisq_fcn(param1, param2):
        model = interp_cosmo((param1,param2))
        del_N = np.mat(model - mean(fidu_mat,axis=0))
        chisq = float(del_N*cov_inv*del_N.T)
        return chisq
        
    prob_plane = WLanalysis.prob_plane(chisq_fcn, om_arr, si8_arr)
    return prob_plane[1]
開發者ID:apetri,項目名稱:CFHTLens_analysis,代碼行數:28,代碼來源:cmbNG_plot.py

示例2: plane_gen

# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import buildInterpolator2D [as 別名]
def plane_gen (fidu_mat, ips_avg, obs_arr, cosmo_params, om_arr, si8_arr, method='clough'):
    
    interp_cosmo = WLanalysis.buildInterpolator2D(ips_avg, cosmo_params, method=method)
    cov_mat = cov(fidu_mat,rowvar=0)/(fsky_deg/12.5)# (2e4/12.5)#area factor for AdvACT
    cov_inv = mat(cov_mat).I

    def chisq_fcn(param1, param2):
        model = interp_cosmo((param1,param2))
        del_N = np.mat(model - obs_arr)
        chisq = float(del_N*cov_inv*del_N.T)
        return chisq
    prob_plane = WLanalysis.prob_plane(chisq_fcn, om_arr, si8_arr)[1]
    return prob_plane
開發者ID:apetri,項目名稱:CFHTLens_analysis,代碼行數:15,代碼來源:cmbNG_noisy.py

示例3: concatenate

# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import buildInterpolator2D [as 別名]
                #imshow(prob_plane,origin='lower',interpolation='nearest',extent=[si80,si81,om0,om1])#;show()
                #title('%sProb_fsky%i_%s_%s_%s_sigmaG%02d'%(['','filtered_'][filtered], fsky_deg, noise,istat, imethod, sigmaG_arr[ismooth]*10),fontsize=10)
                #savefig(CMBlensing_dir+'plot/optimize_%sProb_fsky%i_%s_%s_%s_sigmaG%02d.png'%(['','filtered_'][filtered], fsky_deg, noise,istat, imethod, sigmaG_arr[ismooth]*10))
                #close()
                


if compute_interp:
    ismooth=3
    om_fidu, si8_fidu=all_points[18]
    ips = concatenate([ps_noiseless46, PDF_noiseless46[:,ismooth,:],
                        peaks_noiseless46[:,ismooth,:]],axis=1)
    ips_fidu = concatenate([ps_fidu_noiseless, PDF_fidu_noiseless[:,ismooth,:], peaks_fidu_noiseless[:,ismooth,:]],axis=1)
    obs_arr=ips[1]
    
    interp_cosmo = WLanalysis.buildInterpolator2D(delete(ips,16,axis=0), delete(all_points46,16,axis=0), method='clough')
    
    save(CMBlensing_dir+'interp.npy',[mean(ips_fidu,axis=0),std(ips_fidu,axis=0),interp_cosmo(all_points46[16])])
    

if make_noisy_maps:
    #for cosmo in cosmo_noisy_arr:
        #print cosmo
        #[save(CMBlensing_dir+'colin_noisy/maps4andrea/reconMaps_%s/recon_%s%s_r%04d.npy'%(cosmo,['','filtered_'][filtered],cosmo, r),FT2real(cosmo, r, Gaus=0)) for r in range(1000)]
    def FT2real_fidu(r, Gaus=0):
        if Gaus:
            a = FTmapGen_Gaus(r)
        else:
            a = FTmapGen_fidu(r)
        if filtered:
            #print 'filtered'
開發者ID:apetri,項目名稱:CFHTLens_analysis,代碼行數:33,代碼來源:cmbNG_noisy.py


注:本文中的WLanalysis.buildInterpolator2D方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。