satelliteskycoord.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:MulensModel 作者: rpoleski 项目源码 文件源码
def get_satellite_coords(self, times):
        """
        Calculate the coordinates of the satellite for given times
        using interpolation.

        Parameters :
            times: *np.ndarray* or *list of floats*
                Epochs for which satellite coordinates will be calculated.

        Returns :
            satellite_skycoord: *Astropy.coordinates.SkyCord*
                *SkyCord* for satellite at epochs *times*.

        """
        if self._horizons is None:
            self._horizons = Horizons(self.ephemerides_file)
        # We should add some check if all values in times as within range
        # covered by self._horizons.time.

        x = np.interp(
                 times, self._horizons.time, self._horizons.xyz.x)
        y = np.interp(
                 times, self._horizons.time, self._horizons.xyz.y)
        z = np.interp(
                 times, self._horizons.time, self._horizons.xyz.z)

        self._satellite_skycoord = SkyCoord(
                  x=x, y=y, z=z, representation='cartesian')
        self._satellite_skycoord.representation = 'spherical'

        return self._satellite_skycoord
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号