有没有一种方法可以将地球位置的地心坐标转换为某个特定位置的切线坐标?

时间:2019-05-15 13:23:39

标签: coordinates astropy

对于某些模拟,我正在使用astropy。我有一组EarthLocations,我想将其转换为指向某个天空坐标的XYZ坐标系。这是一个非常简单的坐标旋转。

我有一些接近工作的代码(请参见下文)。 xyz是从EarthLocation.geocentric导出的地心坐标。 ha是ra-本地恒星时间,dec是源的纬度。 ra和dec来自SkyCoord。我更喜欢使用EarthLocations和SkyCoords进行此操作。输出坐标应与地球相切,并且其一个轴指向SkyCoord。

def xyz_to_uvw(xyz, ha, dec):
    """
    Rotate :math:`(x,y,z)` positions in earth coordinates to
    :math:`(u,v,w)` coordinates relative to astronomical source
    position :math:`(ha, dec)`. Can be used for both antenna positions
    as well as for baselines.

    Hour angle and declination can be given as single values or arrays
    of the same length. Angles can be given as radians or astropy
    quantities with a valid conversion.

    :param xyz: :math:`(x,y,z)` co-ordinates of antennas in array
    :param ha: hour angle of phase tracking centre (:math:`ha = ra - lst`)
    :param dec: declination of phase tracking centre.
    """

    x, y, z = numpy.hsplit(xyz, 3)

    # Two rotations:
    #  1. by 'ha' along the z axis
    #  2. by '90-dec' along the u axis
    u = x * numpy.cos(ha) - y * numpy.sin(ha)
    v0 = x * numpy.sin(ha) + y * numpy.cos(ha)
    w = z * numpy.sin(dec) - v0 * numpy.cos(dec)
    v = z * numpy.cos(dec) + v0 * numpy.sin(dec)

    return numpy.hstack([v0, v, w])

我认为输出应该是参考特定框架的一组EarthLocations。

我已经研究了文档,但是看不到该怎么做。

0 个答案:

没有答案