本文整理汇总了Python中WLanalysis.rndrot方法的典型用法代码示例。如果您正苦于以下问题:Python WLanalysis.rndrot方法的具体用法?Python WLanalysis.rndrot怎么用?Python WLanalysis.rndrot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WLanalysis
的用法示例。
在下文中一共展示了WLanalysis.rndrot方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: randmap
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import rndrot [as 别名]
def randmap (iseed, Wx=Wx):
Me1rnd, Me2rnd = WLanalysis.rndrot(Me1, Me2, iseed=iseed)
Me1smooth = WLanalysis.weighted_smooth(Me1rnd, Mwm)
Me2smooth = WLanalysis.weighted_smooth(Me2rnd, Mwm)
kmap_rand = WLanalysis.KSvw(Me1smooth, Me2smooth)
print Wx, iseed, kmap_rand.shape
np.save(bmap_fn(Wx, iseed), kmap_rand)
示例2: randmap
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import rndrot [as 别名]
def randmap (iseedWx):
iseed, Wx = iseedWx
Me1, Me2 = Me1_arr[Wx-1], Me2_arr[Wx-1]
Mwm = Mwm_arr[Wx-1]
Me1rnd, Me2rnd = WLanalysis.rndrot(Me1, Me2, iseed=iseed)
Me1smooth = WLanalysis.weighted_smooth(Me1rnd, Mwm)
Me2smooth = WLanalysis.weighted_smooth(Me2rnd, Mwm)
kmap_rand = WLanalysis.KSvw(Me1smooth, Me2smooth)
print Wx, iseed, kmap_rand.shape
np.save(bmap_fn(Wx, iseed), kmap_rand)
示例3: fileGen
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import rndrot [as 别名]
def fileGen(i, R, cosmo):
'''
Put catalogue to grid, with (1+m)w correction. Mw is already done.
also add randomly rotated noise
Input:
i: subfield range from (1, 2..13)
R: realization range from (1..1000)
cosmo: one of the 100 cosmos
Return:
Me1 = e1*w
Me2 = e2*w
'''
#y, x, e1, e2, w, m = yxewm_arr[i-1].T
s1, s2 = (WLanalysis.readFits(SIMfn(i,cosmo,R)).T)[[1,2]]
s1 *= (1+m)
s2 *= (1+m)
eint1, eint2 = WLanalysis.rndrot(e1, e2, iseed=R)#random rotation
e1red, e2red = s1+eint1, s2+eint2
A, galn = WLanalysis.coords2grid(x, y, array([e1red*w, e2red*w]))
Ms1, Ms2 = A
return Ms1, Ms2
示例4: Noise
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import rndrot [as 别名]
def Noise(iinput):
'''Input: (Wx, iseed)
Return: files of noise KS map, using randomly rotated galaxy.
'''
Wx, iseed = iinput
seed(iseed)
print 'Bmode - Wx, iseed:', Wx, iseed
bmap_fn = cat_dir+'Noise/W%i/W%i_Noise_sigmaG10_%04d.fit'%(Wx, Wx, iseed)
isfile_kmap, bmap = WLanalysis.TestFitsComplete(bmap_fn, return_file = True)
if isfile_kmap == False:
Me1_fn = cat_dir+'Me_Mw_galn/W%i_Me1w_1.3_lo.fit'%(Wx)
Me2_fn = cat_dir+'Me_Mw_galn/W%i_Me2w_1.3_lo.fit'%(Wx)
Mw_fn = cat_dir+'Me_Mw_galn/W%i_Mwm_1.3_lo.fit'%(Wx)
Me1_init = WLanalysis.readFits(Me1_fn)
Me2_init = WLanalysis.readFits(Me2_fn)
#### randomly rotate Me1, Me2 ###
Me1, Me2 = WLanalysis.rndrot(Me1_init, Me2_init)
#################################
Mw = WLanalysis.readFits(Mw_fn)
Me1_smooth = WLanalysis.weighted_smooth(Me1, Mw, PPA=PPA512, sigmaG=sigmaG)
Me2_smooth = WLanalysis.weighted_smooth(Me2, Mw, PPA=PPA512, sigmaG=sigmaG)
bmap = WLanalysis.KSvw(Me1_smooth, Me2_smooth)
WLanalysis.writeFits(bmap,bmap_fn)
示例5: arange
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import rndrot [as 别名]
#2. create KS maps, first rotate 45, then rand rotate
#3. plot out histogram for pixels
for i in arange(1,14):
sG_arr = array([1, 3.5, 5.3, 8.9])
for sG in sG_arr:
KS_45_fn = test_dir+'KS_45_%i_%i.fit'%(i,sG)
KS_rand_fn = test_dir+'KS_rand_%i_%i.fit'%(i,sG)
print i, sG
if os.path.isfile(KS_45_fn) and os.path.isfile(KS_rand_fn):
KS_45=WLanalysis.readFits(KS_45_fn)
KS_rand=WLanalysis.readFits(KS_rand_fn)
else:
print 'generating KS'
y, x, e1, e2, w = WLanalysis.readFits(test_dir+'yxew_subfield%i_zcut0213.fit'%(i)).T
e1_45, e2_45 = WLanalysis.rndrot(e1, e2, deg=45)
e1_rand, e2_rand = WLanalysis.rndrot(e1, e2, iseed=0)
mat_e1_45,mat_e2_45,mat_e1_rand,mat_e2_rand, Mw = WLanalysis.coords2grid(x, y, array([e1_45*w, e2_45*w, e1_rand*w, e2_rand*w, w]) )[0]
mat_e1_45_smoothed = WLanalysis.weighted_smooth(mat_e1_45 , Mw, sigmaG=sG)
mat_e2_45_smoothed = WLanalysis.weighted_smooth(mat_e2_45 , Mw, sigmaG=sG)
mat_e1_rand_smoothed= WLanalysis.weighted_smooth(mat_e1_rand, Mw, sigmaG=sG)
mat_e2_rand_smoothed= WLanalysis.weighted_smooth(mat_e2_rand, Mw, sigmaG=sG)
KS_45 =WLanalysis.KSvw(mat_e1_45_smoothed,mat_e2_45_smoothed)
KS_rand=WLanalysis.KSvw(mat_e1_rand_smoothed,mat_e2_rand_smoothed)
WLanalysis.writeFits(KS_45,KS_45_fn)
WLanalysis.writeFits(KS_rand,KS_rand_fn)
kappa_45 = KS_45.flatten()
示例6: eobs_analytical
# 需要导入模块: import WLanalysis [as 别名]
# 或者: from WLanalysis import rndrot [as 别名]
raytrace_cat=WLanalysis.readFits(SIMfn(1,cosmo,1000))[zcut_idx].T
kappa, s1o, s2o= raytrace_cat[[0, 1, 2]]
y, x, e1, e2, w, m = WLanalysis.readFits(KSsim_dir+'test_ells_asymm/yxewm_subfield1_zcut0213.fit').T
z = WLanalysis.readFits('/Users/jia/weaklensing/CFHTLenS/catalogue/emulator_galpos_zcut0213/emulator_subfield1_zcut0213.fit').T[-1]
znoise1 = eobs_analytical (z)
znoise2 = eobs_analytical (z)
znoise27 = np.random.normal(0, 0.29,size=len(z))
s1 = s1o*(1+m)
s2 = s2o*(1+m)
eint1, eint2 = WLanalysis.rndrot(e1, e2, iseed=1000)
eint1_45, eint2_45 = WLanalysis.rndrot(e1, e2, iseed=1000,deg=45.0)
e1_reduce, e2_reduce = eobs_fun(s1, s2, kappa, eint1, eint2)
e1_add, e2_add = s1+eint1, s2+eint2
A, galn = WLanalysis.coords2grid(x, y, array([e1_reduce*w, e2_reduce*w, w*(1+m), s1o, s2o, kappa, e1_add*w, e2_add*w, s1+znoise1, s2+znoise2, kappa+znoise1]))
#Mk, Ms1, Ms2 = A
Me1, Me2, Mw, Ms1, Ms2, Mk, Me1add, Me2add, Ms1n, Ms2n, Mkn = A
B, galn = WLanalysis.coords2grid(x, y, array([znoise1, eint1, eint2, eint1_45, eint2_45, znoise27]))
Mn, Men1, Men2, Men1b, Men2b, Mn27 = B
### pure analytical noise ######
Mn_smooth = WLanalysis.weighted_smooth(Mn, galn, sigmaG=0.5)
Mn27_smooth = WLanalysis.weighted_smooth(Mn27, galn, sigmaG=0.5)
Men1_smooth = WLanalysis.weighted_smooth(Men1, galn, sigmaG=0.5)