Healpy map2alm和alm2map不一致?

时间:2014-09-22 17:42:32

标签: python healpy

我刚刚开始与Healpy合作,并注意到如果我使用地图来获取alm' s然后使用这些alm来生成新地图,我不会得到地图我开始。这就是我所看到的:

import numpy as np
import healpy as hp
nside = 2 # healpix nside parameter
m = np.arange(hp.nside2npix(nside)) # create a map to test
alm = hp.map2alm(m) # compute alm's
new_map = hp.alm2map(alm, nside) # create new map from computed alm's

# Let's look at two maps
print(m)
[ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47] # as expected

print(new_map)
[-23.30522233 -22.54434515 -21.50906755 -20.09203749 -19.48841773
-18.66392484 -16.99593867 -16.789984   -15.14587061 -14.57960049
-13.4403252  -13.35992138 -10.51368725 -10.49793946 -10.1262039
-8.6340571   -7.41789272  -6.87712224  -5.75765487  -3.75121764
-4.35825512  -1.6221964   -1.03902923  -0.41478954   0.52480646
 2.34629955   2.1511705    2.40325268   5.39576497   5.38390848
 5.78324832   7.24779083   8.4915595    9.0047257   10.15179735
 12.1306303   12.62672772  13.4512206   15.11920678  15.32516145
 16.96927483  17.53554496  18.67482024  18.75522407  20.42078855
 21.18166574  22.21694334  23.6339734 ] # not what I was expecting 

如您所见,new_map与输入映射m不匹配。我想这些我失踪的功能有些微妙。有什么想法吗?

1 个答案:

答案 0 :(得分:1)

我得到了不同的结果:

print(new_map) [ 0.15859344, 0.91947062, 1.95474822, 3.37177828, 4.01808325, 4.84257613, 6.51056231, 6.71651698, 8.36063036, 8.92690049, 10.06617577, 10.1465796 , 12.98620654, 13.00668621, 13.3736899 , 14.87056857, 16.08200108, 16.62750343, 17.74223892, 19.75340803, 19.13441288, 21.8704716 , 22.45363877, 23.07787846, 24.01747446, 25.83896755, 25.6438385 , 25.89592068, 28.89565876, 28.88853415, 29.28314212, 30.7524165 , 31.9914533 , 32.50935137, 33.65169114, 35.63525597, 36.13322869, 36.95772158, 38.62570775, 38.83166242, 40.47577581, 41.04204594, 42.18132122, 42.26172504, 43.88460433, 44.64548151, 45.68075911, 47.09778917]

较早版本的healpy会在转换前自动从地图中删除常量偏移量,最好将healpy更新为最新版本。

残差与像素化引入误差的事实有关,这个误差在低端时更大。