HealPix 中不同 Nside 值的 a_lm 系数不同值

发布于 2025-01-15 12:41:28 字数 1243 浏览 4 评论 0 原文

我正在使用 HealPix 来计算粒子通过具有一定半径的球体的流出速率,并且我正在尝试确定球谐函数的系数(基本上将一些数据与球谐函数拟合)。

基本步骤是:

#I create a HealPix map of the outflow rate (values of the rate for every pixel) called dotM_map with a resolution determined by the nside parameter.
nside = 8
dotM_map = some_function(nside, ...)

#Then I calculate a_lm coefficients of spherical harmonics for this map.
a_lm = hp.map2alm(dotM_map,lmax=2)

但是,如果我更改相同 lmax 值的贴图分辨率(更改 nside),我会得到不同的系数值(不同的 a_lm 值)。 我尝试根据系数重现初始图

sph_harm_map = hp.alm2map(a_lm,nside=nside)

,结果非常吻合。为什么不同nside的a_lm值不同?我怎样才能获得不依赖于nside的a_lm系数?

我尝试使用像素权重

a_lm = hp.map2alm(hpxmap,lmax=2,use_weights=True)

,但没有显着的改进。我也尝试过

a_lm = hp.map2alm(hpxmap,lmax=2,use_pixel_weights=True)

,但出现错误: urllib.error.URLError: , 'https://github.com/healpy/healpy-data/releases/download/full_weights/healpix_full_weights_nside_0008.fits':}>

为什么会发生这种情况?如果有必要,我可以制作一个最小的例子。

I am using HealPix to calculate the outflow rate of particles through a sphere with some radius and I am trying to determine coefficients of spherical harmonics (basically fit some data with spherical harmonics).

The basic steps are:

#I create a HealPix map of the outflow rate (values of the rate for every pixel) called dotM_map with a resolution determined by the nside parameter.
nside = 8
dotM_map = some_function(nside, ...)

#Then I calculate a_lm coefficients of spherical harmonics for this map.
a_lm = hp.map2alm(dotM_map,lmax=2)

However, if I change the resolution of the map (change nside) for the same values of lmax I get different values of the coefficients (different values of a_lm).
I tried reproducing the initial map from the coefficients

sph_harm_map = hp.alm2map(a_lm,nside=nside)

and the results are in good agreement. Why are values of a_lm different for different nside? And how can I obtain a_lm coefficients that do not depend on nside??

I tried using pixel weights as

a_lm = hp.map2alm(hpxmap,lmax=2,use_weights=True)

but there was no significant improvement. I also tried

a_lm = hp.map2alm(hpxmap,lmax=2,use_pixel_weights=True)

but I got an error: urllib.error.URLError: <urlopen error Unable to open any source! Exceptions were {'https://healpy.github.io/healpy-data/full_weights/healpix_full_weights_nside_0008.fits': <HTTPError 404: 'Not Found'>, 'https://github.com/healpy/healpy-data/releases/download/full_weights/healpix_full_weights_nside_0008.fits': <HTTPError 404: 'Not Found'>}>

Why does this happen? And if necessary I can produce a minimal example.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

源来凯始玺欢你 2025-01-22 12:41:28

为了获得相同的 a_lm 系数值,有必要用像素表面对各个像素的值进行归一化 - 除以 4*pi/npix。

另一件事,以防它可能对某人有帮助。流出率可以通过

npix = healpy.nside2npix(nside) # total number of Healpix pixels on the sphere at a given Nside
pix = healpy.ang2pix(nside, theta, phi) # tells you in which pixel is each particle, considering the exact pixel boundary
count, edge = numpy.histogram(pix, bins=np.arange(npix+1)) # count is the number of particles in each Healpix pixel

计算 (count2 - count2)/(t2-t1) 轻松计算,其中 count2 = count(t2) 和 count1 = count(t1) 是两个不同时间单个像素中的粒子数。

这要归功于 HealPix 的支持 Eric Hivon。谢谢!

In order to get the same values of a_lm coefficients it is necessary to normalize values of individual pixels with the pixel surface - dividing with 4*pi/npix.

Another thing, in case it might be helpful to someone. The outflow rate can be easily computed from

npix = healpy.nside2npix(nside) # total number of Healpix pixels on the sphere at a given Nside
pix = healpy.ang2pix(nside, theta, phi) # tells you in which pixel is each particle, considering the exact pixel boundary
count, edge = numpy.histogram(pix, bins=np.arange(npix+1)) # count is the number of particles in each Healpix pixel

and calculating (count2 - count2)/(t2-t1), where count2 = count(t2) and count1 = count(t1) are the number of particles in individual pixels at two different times.

Credit goes to HealPix's support, Eric Hivon. Thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文