本文整理匯總了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