1

我有一系列 theta 和 phi 使用 healpy pix2ang 命令,然后转换为 RA, Decl.::

ra = np.rad2deg(phi)
dec = np.rad2deg(0.5 * np.pi - theta)

我只是想将这些投影到例如 Aitoff 类型的投影上,但是对于我的生活来说,我无法通过以下方式弄清楚如何做到这一点: https ://healpy.readthedocs.io/en/latest/generated/healpy.visufunc .projplot.html

projplot(ra, dec, 'bo')  

并没有真正做任何事情。

4

1 回答 1

1

hp.projplot用于向现有绘图添加线条。如果您只是对在不同的投影上绘制线条感兴趣,我建议您查看matplotlib 的 projections

对于healpy,请在下面找到一个简单的示例。

import healpy as hp
import numpy as np

nside = 64
npix = hp.nside2npix(nside)
arr = np.random.randn(npix)

# Draw a circle
r = np.full(100, 20.)
phi = np.linspace(0., 2*np.pi, 100)
x = np.cos(phi)*r
y = np.sin(phi)*r

# Plot the map and the circle
hp.mollview(arr)
hp.projplot(x, y, c='r', lonlat=True)

在此处输入图像描述

于 2019-08-19T17:35:08.863 回答