本文整理汇总了Python中WLanalysis.prob_plane方法的典型用法代码示例。如果您正苦于以下问题:Python WLanalysis.prob_plane方法的具体用法?Python WLanalysis.prob_plane怎么用?Python WLanalysis.prob_plane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WLanalysis
的用法示例。
在下文中一共展示了WLanalysis.prob_plane方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_prob_plane
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import prob_plane [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]
示例2: plane_gen
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import prob_plane [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