本文整理汇总了Python中WLanalysis.buildInterpolator方法的典型用法代码示例。如果您正苦于以下问题:Python WLanalysis.buildInterpolator方法的具体用法?Python WLanalysis.buildInterpolator怎么用?Python WLanalysis.buildInterpolator使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WLanalysis
的用法示例。
在下文中一共展示了WLanalysis.buildInterpolator方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sumMF
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import buildInterpolator [as 别名]
### to local for further analysis
#isumMF_cov = sumMF((0,0,0),loadcov=1)
#np.save('/home1/02977/jialiu/KSsim/MF_sum/MF_sum_cov',isumMF_cov)
#all_MF = array(map(sumMF, params))#shape=(91,1000,150)
#np.save('/home1/02977/jialiu/KSsim/MF_sum/MF_sum_91cosmo',all_MF.reshape(91,-1))
##########################################################
Mat_MF = np.load('/Users/jia/CFHTLenS/emulator/MF/MF_sum_91cosmo.npy').reshape(91,1000,-1)
avg_MF = mean(Mat_MF,axis=1)
obs_MF = np.load('/Users/jia/CFHTLenS/emulator/MF/obs.npy')
fidu_MF = np.load('/Users/jia/CFHTLenS/emulator/MF/MF_sum_cov.npy')
fidu_avg_MF = mean(fidu_MF,axis=0)
spline_interps = WLanalysis.buildInterpolator(avg_MF,params)
def interp_cosmo (params, spline_interps = spline_interps):
'''Interpolate the MF for certain param.
Params: list of 3 parameters = (om, w, si8)
'''
im, wm, sm = params
gen_MF = lambda ibin: spline_interps[ibin](im, wm, sm)
MF_interp = array(map(gen_MF, range(len(spline_interps))))
MF_interp = MF_interp.reshape(-1,1).squeeze()
return MF_interp
cov_mat = cov(fidu_MF, rowvar=0)
def probMap (obs, cov_mat, spline_interps, ms, ss):
'''return a probability map for observation'''