python - 使用 `healpy` : Why does the output map appear "patchy"? 平滑 HEALPix 贴图

标签 python astronomy healpy

我有一张 HEALPix 全天 map ,来自 AKARI 远红外测量仪数据库(公开发布)。我尝试使用 healpy 来“平滑” map ,但结果看起来很奇怪。有没有更好的办法?然而,我的问题涉及任何全天空 HEALPix map (即 IRAS、Planck、WISE、WMAP)。

我的目标是将 AKARI map 的有效点扩散函数“平滑”到 1 度的角分辨率(原始数据的 PSF 约为 1 角分)。这样我就可以将远红外 AKARI map 与较低分辨率的微波 map (特别是异常微波前景的 map )进行比较。

在下面的示例中,我使用的是 map 的降级版本,因此它足够小,可以上传到 Github。这意味着像素约为 3.42 弧分。通常,在 PSF 平滑之前,我不会大幅降低像素比例 - 但这只是一个示例:

#Load the packages needed for visualization, and HEALPix processing
%matplotlib inline
import matplotlib
import numpy as np
import matplotlib.pyplot as plt
import healpy as hp
import healpy.projector as pro

#Loads the HEALPix .FITS file into an array
map_in = hp.read_map("akari_WideL_1_1024.fits", nest = True)

#Visualizes the all-sky map, before any processing is done.
hp.mollview(map_in, title='AKARI All-Sky Map:', nest = True, norm = 'hist')

#Smoothes the map with a 1-degree FWHM Gaussian (fwhm given in radians).
map_out = hp.sphtfunc.smoothing(map_out, fwhm = 0.017, iter = 1)

#Visualizes the the map after smoothing
hp.mollview(map_out, title='AKARI All-Sky Map:', nest = True, norm = 'hist')

我尝试过healpy.sphtfunct.smoothing例程(https://healpy.readthedocs.org/en/latest/generated/healpy.sphtfunc.smoothing.html#healpy.sphtfunc.smoothing).As据我所知,smoothing将贴图转换为球谐函数,然后与高斯卷积,然后将其转换回空间 map 。

我已将 ipython 笔记本以及低分辨率 .FITS HEALpix map 保存在 github 存储库中:

https://github.com/aaroncnb/healpy_smoothing_test

(您需要安装 healpy 软件包)

通过在笔记本中运行代码,您可以轻松地想象出我遇到的问题 - 平滑 map 后,有一些奇怪的“伪像”,就好像像素已经被迭代地进行了盒平均,而不是用圆形高斯轮廓。我期望看到的只是输入 map 的模糊版本。

我认为在平滑完成之前我遗漏了一些关于球谐函数转换的基本知识。

之前有人尝试过在 HEALPix map 上进行这种全天空平滑吗?

我相信另一种选择是将 map 转换为标准的矩形阵列,然后进行平滑。不过,我仍然对在不离开 HEALPix 格式的情况下解决问题感到好奇。

最佳答案

看起来平滑仅适用于RINGed map (这对我来说很有意义,因为这似乎更容易在数学上处理)。因此,您需要将输入映射转换为 RINGed 格式:

map_ring = hp.pixelfunc.reorder(map_in, inp='NEST', out='RING')
map_out = hp.sphtfunc.smoothing(map_ring, fwhm = 0.17, iter = 1)
hp.mollview(map_out, title='AKARI All-Sky Map:', nest = False, norm = 'hist')

enter image description here


这个答案来自于一些试验和错误,因为我在文档中找不到任何明确的内容,而且我还没有深入研究源代码(不过,通过下面的结果,可能很容易验证是否通过查看相关源代码,我的假设是正确的)。
或者,您可能想直接询问healpix/healpy人员。

(我认为这实际上是文档中的一个缺点:healpy.sphtfunc.smoothing 的文档没有提到输入所需的形式。我想这是一个治愈问题/PR 改天。)

顺便说一句,在 Github 上创建 SSCCE 作为笔记本文件的奖励积分! (现在如果 StackOverflow 也渲染笔记本就好了。)

关于python - 使用 `healpy` : Why does the output map appear "patchy"? 平滑 HEALPix 贴图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33631079/

相关文章:

python - django-extensions shell_plus --kernel 指定连接文件

c# - Python XML Parse(使用模式生成数据集)

math - 根据太阳位置(方位角和仰角)以及纬度和经度计算日期和时间

python - 如何在 pandas DataFrame 中按索引仅保留一组特定行

python - 如何生成从赤道到 AltAz 的坐标转换表?

matplotlib - 更改healpy.mollview中的颜色条?

python - .string 和 .text BeautifulSoup 之间的区别

Python:选择多个已安装模块版本之一

python - 天体单位等效 - 干涉测量基线

python - 在healpy map 中进行分箱?