SpiceObserverLocation#

class m4opt.observer.SpiceObserverLocation(target, *kernels)[source] [edit on github]#

Bases: ObserverLocation

A satellite whose orbit is specified by Spice kernels.

Examples

Load an example Spice kernel from a file:

>>> from astropy.time import Time
>>> from astropy import units as u
>>> from m4opt.observer import SpiceObserverLocation
>>> import numpy as np
>>> orbit = SpiceObserverLocation(
...     'MGS SIMULATION',
...     'https://archive.stsci.edu/missions/tess/models/TESS_EPH_PRE_LONG_2021252_21.bsp',
...     'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/earth_latest_high_prec.bpc',
...     'https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00010.tpc')
>>> t0 = Time('2021-10-31 00:00')
>>> orbit(t0)
<EarthLocation (259589.01504305, 267775.69181568, -6003.44398346) km>
>>> orbit(t0 + np.arange(4) * u.hour).shape
(4,)

Methods Summary

__call__(time)

Get the position and velocity of the satellite.

Methods Documentation

Parameters:
__call__(time)[source] [edit on github]#

Get the position and velocity of the satellite.

Parameters:

time – The time of the observation.

Returns:

The Earth-relative coordinates of the satellite.