【问题标题】:Aitoff projections using healpy and projplot使用 healpy 和 projplot 进行 Aitoff 投影
【发布时间】:2019-08-19 16:11:49
【问题描述】:

我有一个范围的 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')  

并没有真正做任何事情。

【问题讨论】:

    标签: python matplotlib plot healpy


    【解决方案1】:

    hp.projplot 用于向现有绘图添加线条。如果您只是对在不同的投影上绘制线条感兴趣,我建议您查看matplotlib's 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)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-04-24
      • 1970-01-01
      • 2013-02-10
      • 2012-02-10
      • 2014-02-28
      • 2021-09-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多