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
评论列表
文章目录