当前位置: 首页>>代码示例>>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;未经允许,请勿转载。