2

是否可以从healpy mollview plot中找到命中图特定值的坐标?

例如:如果我有一个平滑的命中图并想使用遮罩:

mask = (hitmap > 2.054) & (hitmap < 2.056)

在命中图上找到所需的值。

命中图用于创建如下所示的 mollview 图:

hp.mollview(hitmap, xsize=2000)

那么是否可以通过使用掩码找到与mollview 图中满足掩码的像素对应的坐标 (lon,lat) ?

提前谢谢了!

4

1 回答 1

0

最好的方法是通过hp.pix2ang()

import healpy as hp
import numpy as hp

# Get the nside and number of pixels in your map
nside = hp.get_nside(mask)
npix = hp.nside2npix(nside)

# Use pix2ang to get the (l, b) coordinates for each pixel
glons, glats = hp.pix2ang(nside, np.arange(npix), lonlat=True)

这将为您提供地图中每个像素的所有坐标 (l, b) 的列表。要仅获取掩码中的那些,只需使用:

glons_eff = glons[mask]
glats_eff = glats[mask]
于 2018-08-13T01:23:24.847 回答