【问题标题】:Coordinate system used for healpy.query_disc()用于healpy.query_disc() 的坐标系
【发布时间】:2020-09-30 19:28:24
【问题描述】:

healpy.query_disc() 函数接受一个参数vec,它是一个定义圆盘中心的三分量单位向量。这里使用的是什么坐标系 - 为什么二维投影有第三维?这个向量的“尾巴”在哪一点?

【问题讨论】:

    标签: python physics astronomy healpy


    【解决方案1】:

    很好,您自己找到了解决方案,这里有一个完整的工作代码示例供以后参考:

    import healpy as hp
    import numpy as np
    
    
    # `lonlat=True` switches `ang2vec` from requiring colatitude $\theta$ and longitude $\phi$ in radians to longitude and latitude in degrees (notice that also the order changes)
    
    # in degrees
    lon = 60
    lat = 30
    vec = hp.ang2vec(lon, lat, lonlat=True)
    
    
    nside = 256
    large_disc = hp.query_disc(nside, vec, radius=np.radians(20))
    small_disc = hp.query_disc(nside, vec, radius=np.radians(8))
    tiny_disc = hp.query_disc(nside, vec, radius=np.radians(2))
    
    
    # `query_disc` returns a list of pixels, by default in RING ordering, let's check their length:
    
    list(map(len, [large_disc, small_disc, tiny_disc]))
    
    
    # ## Create a map and plot it in Mollweide projection
    
    m = np.zeros(hp.nside2npix(nside))
    
    
    m[large_disc] = 1
    m[small_disc] = 2
    m[tiny_disc] = 3
    
    
    hp.mollview(m)
    hp.graticule()
    

    在此处查看带有绘图的笔记本:https://zonca.dev/2020/10/example-healpy-query_disc.html

    【讨论】:

      【解决方案2】:

      解决了。使用ang2vec() 的输出来给出向量。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-09-06
        • 2013-08-08
        相关资源
        最近更新 更多