本文整理汇总了Python中WLanalysis.gnom_inv方法的典型用法代码示例。如果您正苦于以下问题:Python WLanalysis.gnom_inv方法的具体用法?Python WLanalysis.gnom_inv怎么用?Python WLanalysis.gnom_inv使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WLanalysis
的用法示例。
在下文中一共展示了WLanalysis.gnom_inv方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PeakPos
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import gnom_inv [as 别名]
def PeakPos (Wx, z_lo=0.6, z_hi='0.6_lo',noise=False, Bmode=False):
'''For a map(kappa or bmode), find peaks, and its(RA, DEC)
return 3 columns: [kappa, RA, DEC]
'''
#print 'noise', noise, Wx
if Bmode:
kmap = bmodeGen(Wx, z=z_hi)
else:
kmap = kmapGen(Wx, z=z_hi)
ipeak_mat = WLanalysis.peaks_mat(kmap)
imask = maskGen (Wx, z=z_lo)
ipeak_mat[where(imask==0)]=nan #get ipeak_mat, masked region = nan
if noise: #find the index for peaks in noise map
idx_all = where((imask==1)&isnan(ipeak_mat))
sample = randint(0,len(idx_all[0])-1,sum(~isnan(ipeak_mat)))
idx = array([idx_all[0][sample],idx_all[1][sample]])
else:#find the index for peaks in kappa map
idx = where(~isnan(ipeak_mat)==True)
kappaPos_arr = zeros(shape=(len(idx[0]),3))#prepare array for output
for i in range(len(idx[0])):
x, y = idx[0][i], idx[1][i]#x, y
kappaPos_arr[i,0] = kmap[x, y]
x = int(x-sizes[Wx-1]/2)+1
y = int(y-sizes[Wx-1]/2)+1
x /= PPR512# convert from pixel to radians
y /= PPR512
kappaPos_arr[i,1:] = WLanalysis.gnom_inv((y, x), centers[Wx-1])
return kappaPos_arr.T