0

我正在使用以下脚本来计算银河坐标(以度为单位)到天体坐标的银河中心 (GC) 位置:

import healpy as hp
r = hp.Rotator(coord = ['G', 'C'], deg=True)
ri = hp.Rotator(coord = ['C', 'G'], deg=True)
gz, ga = 0., 0.         # position of GC
gz_e, ga_e = r(gz, ga)
print gz_e, ga_e
zg, ag = ri(gz_e, ga_e)
print zg, ag

这些是我得到的结果:

1.09730865695 -2.91715324734  # celestial
0.0 -1.57079632679            # back to galactical

首先,天体坐标和银河坐标中的数字都是错误的。有可能我使用了错误的函数(我希望如此),或者函数本身有问题。有人知道出了什么问题吗?

第二:看来,我得到了以弧度表示的数字,对吗?

4

1 回答 1

0

deg仅指 中的角度rot,而不是Rotator自身。以弧度表示的Rotator需要theta(colatitude) 和phi(longitude),请参阅:

import healpy as hp
import numpy as np
r = hp.Rotator(coord = ['G', 'C'])
ri = hp.Rotator(coord = ['C', 'G'])
gz, ga = np.pi/2, 0.         # position of GC
gz_e, ga_e = r(gz, ga)

print("Galactic center in Celestial Coordinates")
print(gz_e, ga_e)
zg, ag = ri(gz_e, ga_e)
print("Back to galactic coordinates")
print(zg, ag)

输出:

Galactic center in Celestial Coordinates
2.07582709512 -1.63354890767
Back to galactic coordinates
1.57079632679 -1.11022302489e-16
于 2015-01-17T04:05:41.577 回答