我正在使用 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.
发布评论
评论(1)
为了获得相同的 a_lm 系数值,有必要用像素表面对各个像素的值进行归一化 - 除以 4*pi/npix。
另一件事,以防它可能对某人有帮助。流出率可以通过
计算 (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
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!