【问题标题】:Healpy map2alm function does not return expected number of alm valuesHealpy map2alm 函数不返回预期数量的 alm 值
【发布时间】:2015-09-02 12:43:59
【问题描述】:

healpy.map2alm 计算输入 Healpix 映射的 alm 值数组。

功能是

healpy.sphtfunc.map2alm(maps, lmax=None, mmax=None, iter=3, pol=True, use_weights=False, regression=True, datapath=None)`

参数lmax决定了alm系数的个数。一个设置输入 lmax 并且代码返回 '(lmax+1)**2` 数量的 alm 系数。

l=0 返回a00

l=1 返回 a11, a10, a1-1 + a00,即 4 个系数。

l=2 返回a22, a21, a20, a2-1, a2-2,即 5+3+1 = 9 个系数。那是(lmax+1)**2 = 3**2 = 9 系数。

但是,使用healpy,这不是我得到的输出,无论我选择的地图是什么。

import numpy as np
import healpy as hp
nside = 16                         # healpix nside parameter

filename = "cmb_fullsky_map.fits"  # generic name for sky map

readmap = hp.read_map(filename)    # read in the map

# We then use healpy.map2alm(readmap) to generate an array of alm values

ell0 = hp.map2alm(readmap, lmax = 0)    # lmax = 0 should output a00
ell0.shape                              # 1 value
print "l=0 has " + str(len(ell0))
print ell0

ell1 = hp.map2alm(readmap, lmax = 1)    # lmax = 1 should outputs
ell1.shape                              # a11, a10, a1-1 
print "l=1 has " + str(len(ell1))       # 3 values
print ell1

ell2 = hp.map2alm(readmap, lmax = 2)    # lmax = 2 should output
ell2.shape                              # a22, a21, a20, a2-1, a2-2
print "l=2 has " + str(len(ell2))       # 5 values
print ell2

ell3 = hp.map2alm(readmap, lmax = 3)    # lmax = 3 should output 
ell3.shape                              # a33, a32, a31, a30, a3-1, a3-2, a3-3
print "l=3 has " + str(len(ell3))       # 7 values
print ell3

ell4 = hp.map2alm(readmap, lmax = 4)    # lmax = 4 should output
ell4.shape                              # a44, a43, a42, a41, a40, a4-1, a4-2,
print "l=4 has " + str(len(ell4))       # a4-3 a4-4
print ell4                              # 9 values

ell32 = hp.map2alm(readmap, lmax = 32)  # lmax = 32 should output
ell32.shape                             # (lmax+1)**2 = 33**2 = 1089 coefficients
print "l=32 has " + str(len(ell32))     # 65 values

我的输出不是我所期望的 (lmax+1)**2。

l=0 has 1
[  2.39883065e-06+0.j]
l=1 has 3
[  2.39883065e-06 +0.00000000e+00j   4.49747594e-06 +0.00000000e+00j
  -5.39401197e-07 +1.07974023e-06j]
l=2 has 6
[  2.38695037e-06 +0.00000000e+00j   4.49747594e-06 +0.00000000e+00j
  -2.93559509e-05 +0.00000000e+00j  -5.39401197e-07 +1.07974023e-06j
  -1.75256654e-05 -1.57729954e-05j   1.65489261e-05 -1.41571515e-05j]
l=3 has 10
[  2.38695037e-06 +0.00000000e+00j   4.51148696e-06 +0.00000000e+00j
  -2.93559509e-05 +0.00000000e+00j   1.19817810e-05 +0.00000000e+00j
  -5.37909950e-07 +1.07783971e-06j  -1.75256654e-05 -1.57729954e-05j
  -7.17416081e-06 +9.14176685e-06j   1.65489261e-05 -1.41571515e-05j
  -2.64725172e-06 -3.09988314e-05j  -7.25462692e-06 -6.33251313e-07j]
l=4 has 15
[  2.38534350e-06 +0.00000000e+00j   4.51148696e-06 +0.00000000e+00j
  -2.93586471e-05 +0.00000000e+00j   1.19817810e-05 +0.00000000e+00j
  -1.72252485e-06 +0.00000000e+00j  -5.37909950e-07 +1.07783971e-06j
  -1.75253044e-05 -1.57728790e-05j  -7.17416081e-06 +9.14176685e-06j
  -1.30606717e-05 -4.21675061e-06j   1.65464103e-05 -1.41578955e-05j
  -2.64725172e-06 -3.09988314e-05j   1.09072312e-05 +3.22054569e-06j
  -7.25462692e-06 -6.33251313e-07j  -1.10079209e-06 +9.39495982e-07j
  -8.01588627e-06 -8.03762608e-06j]
l=32 has 561

你看到差异了吗?

对于lmax=0,我预计总共有 1 个。healpy 输出 1 个

对于lmax=1,我预计总共有 4 个。healpy 输出 3 个

对于lmax=2,我预计总共有 9 个。healpy 输出 6 个

对于lmax=3,我预计总共有 16 个。healpy 输出 10 个

对于lmax=4,我预计总共有 25 个。healpy 输出 15 个

对于lmax=32,我预计总共有 1089 个。healpy 输出 561

问题:为了得到正确的数组总数,我应该一起输出吗?

请问map2alm如何执行这个操作。

【问题讨论】:

标签: healpy


【解决方案1】:

这是由于对称性。 m=-1m=1 具有相同的变换,因此 HEALPix 仅考虑 m>=0

例如lmax=2 我们有:

  • a00
  • a10
  • a11
  • a20
  • a21
  • a22

总共 6 个系数。

alm 数组的长度预计为:mmax * (2 * lmax + 1 - mmax) / 2 + lmax + 1)

【讨论】:

  • 感谢您的帮助!使用healpym<0 系数输出到alm 数组的推荐方法是什么?我的理解是 Healpix 代码将复杂的 alm 存储在一个数组中,该数组具有二维以包含正 m 值和负 m 值的系数。然后 l,m 映射到数组的索引中。
  • m<0 系数与m>0 相同
  • 我现在明白了。 a_lm 与 a_l(-m) 的值相同。 a11=a1-1、a21=a2-1 等
  • 问题:hp.map2alm 是否按一定顺序输出 a_lm 系数?我猜输出数组是[a_00, a_10, a_11, a_20, a_21, a_22, a_30, a_31, a_32, a_33,....],对吗?
  • 有一个给出命令的函数,查看文档,我现在看不到。
【解决方案2】:

我最近也遇到了这个问题。 Healpix 给出所有积极的 m 值。可以使用a(l,m1) = -a(l,-m)* 找到负数,其中* 是复共轭。

【讨论】:

    猜你喜欢
    • 2014-11-16
    • 2016-08-15
    • 1970-01-01
    • 2019-10-12
    • 1970-01-01
    • 2012-08-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多