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