本文整理匯總了Python中WLanalysis.peaks_mask_hist方法的典型用法代碼示例。如果您正苦於以下問題:Python WLanalysis.peaks_mask_hist方法的具體用法?Python WLanalysis.peaks_mask_hist怎麽用?Python WLanalysis.peaks_mask_hist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WLanalysis
的用法示例。
在下文中一共展示了WLanalysis.peaks_mask_hist方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_pk
# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import peaks_mask_hist [as 別名]
def create_pk (iiRcosmoSigma):
'''grab KSmap, create 1, 1.8, 3.5, 5.7 peaks
each time create 1000 realizations for specifice i, cosmo, sigmaG
'''
i, R, cosmo, sigmaG = iiRcosmoSigma
kmap = KSmap_single(i, R, cosmo, sigmaG)
idx = int(where(sigmaG_arr==sigmaG)[0])
mask_all = mask_all_arr[idx]
mask_bad = mask_bad_arr[idx]
pspk_all = WLanalysis.peaks_mask_hist(kmap, mask_all, bins, kmin = kmin, kmax = kmax)
pspk_bad = WLanalysis.peaks_mask_hist(kmap, mask_bad, bins, kmin = kmin, kmax = kmax)
return pspk_all, pspk_bad
示例2: ips_pk_single
# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import peaks_mask_hist [as 別名]
def ips_pk_single (R):#, sigmaG, zg, bins):
kmap = WLanalysis.readFits(KSsim_fn(i, cosmo, R, sigmaG, zg))
if pk:#peaks
mask = WLanalysis.readFits(Mask_fn(i, sigmaG))
peaks_hist = WLanalysis.peaks_mask_hist(kmap, mask, bins, kmin=kmin, kmax=kmax)
return peaks_hist
else:#powspec
ell_arr, powspec = WLanalysis.PowerSpectrum(kmap, sizedeg=12.0)
return powspec
示例3: kmapPk_1sim
# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import peaks_mask_hist [as 別名]
def kmapPk_1sim (r):
print r,'1sim'
k, s1, s2 = kappaGen_1sim(r)[:3]
A, galn = WLanalysis.coords2grid(x, y, array([s1,s2]))
Ms1,Ms2 = A
s1_smooth = WLanalysis.weighted_smooth(Ms1, galn, PPA=PPA512, sigmaG=sigmaG)
s2_smooth = WLanalysis.weighted_smooth(Ms1, galn, PPA=PPA512, sigmaG=sigmaG)
kmap = WLanalysis.KSvw(s1_smooth, s2_smooth)
pk = WLanalysis.peaks_mask_hist(kmap, mask, bins=25, kmin = -0.04, kmax = 0.12)
return pk
示例4: Psingle_CFHT
# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import peaks_mask_hist [as 別名]
def Psingle_CFHT (i, sigmaG, bins, ps=0):
if ps:
fn = powspec_CFHT_fn(i, sigmaG)
else:
fn = peaks_CFHT_fn(i, sigmaG, bins)
if os.path.isfile(fn):
out = WLanalysis.readFits(fn)
elif ps:
kmap = WLanalysis.readFits(KSCFHT_fn(i, sigmaG))
out = WLanalysis.PowerSpectrum(kmap, sizedeg=12.0)
WLanalysis.writeFits(out,fn)
else:
kmap = WLanalysis.readFits(KSCFHT_fn(i, sigmaG))
mask = WLanalysis.readFits(Mask_fn(i, sigmaG))
out = WLanalysis.peaks_mask_hist(kmap, mask, bins, kmin=kmin, kmax=kmax)
WLanalysis.writeFits(out,fn)
return out
示例5: imshow
# 需要導入模塊: import WLanalysis [as 別名]
# 或者: from WLanalysis import peaks_mask_hist [as 別名]
if sigmaG == 0.5:
imshow(kmap)
savefig(plot_dir+'CFHT_KS_sigma05_subfield%02d_corrected.jpg'%(i))
close()
ps = WLanalysis.PowerSpectrum(kmap, sizedeg=12.0)
ps_fn = CFHT_dir + 'CFHT_powspec_sigma%02d_subfield%02d.fits'%(sigmaG*10,i)
try:
WLanalysis.writeFits(ps, ps_fn)
except Exception:
print ps_fn
pass
for bins in (25, 40):
pk = WLanalysis.peaks_mask_hist(kmap, mask, bins, kmin=kmin, kmax=kmax)
pk_fn = CFHT_dir + 'CFHT_peaks_sigma%02d_subfield%02d_%03dbins.fits'%(sigmaG*10,i, bins)
try:
WLanalysis.writeFits(pk, pk_fn)
except Exception:
print pk_fn
pass
#for sf in (11,13):
#kmap =WLanalysis.readFits( CFHT_dir+'CFHT_KS_sigma05_subfield%02d.fits'%(sf))
#imshow(kmap)
#title('subfield %i'%(sf))
#savefig(plot_dir+'CFHT_KS_sigma05_subfield%02d.jpg'%(sf))
#close()