gpt4 book ai didi

python - Healpy map2alm 和 alm2map 不一致?

转载 作者:太空宇宙 更新时间:2023-11-04 05:59:18 24 4
gpt4 key购买 nike

我刚开始使用 Healpy 并注意到如果我使用 map 获取 alm's,然后使用这些 alm's 生成新 map ,我不会得到我开始使用的 map 。这是我正在查看的内容:

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 与输入 map m 不匹配。我想我遗漏了这些功能的一些微妙之处。有什么想法吗?

最佳答案

我得到了不同的结果:

打印(新 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 的旧版本会在转换前自动从 map 中删除常量偏移量,最好将 healpy 更新到最新版本。

残差与像素化引入误差有关,低nside误差较大。

关于python - Healpy map2alm 和 alm2map 不一致?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25980039/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com