..  _satellitekepler_class:

SatelliteKepler
===============
Implements a classic Keplerian orbit which generates elliptical orbits with the centre of the Earth located at one focus.
This is quick and fast but keep in mind that it has no gravitational perturbations so it can never truly mimic
sun-synchronous or other classes of orbit that depend up gravitional torques etc.

    * :meth:`~.SatelliteKepler.__init__`
    * :meth:`~.SatelliteKepler.from_elements`
    * :meth:`~.SatelliteKepler.from_state_vector`
    * :meth:`~.SatelliteKepler.make_two_line_elements`

Example::

    from skretrieval.platforms.satellite  import SatelliteKepler
    .
    .
    kepler  = SatelliteKepler ( platform_utc, period_from_altitude = 600000.0, inclination_radians= radians(97.0), longitude_of_ascending_node_degrees = 82.0, eccentricity= 0.05)
    .
    .
    pos = kepler.update_position( tnew )

.. autoclass:: skretrieval.platforms.satellite.SatelliteKepler
    :members:
    :special-members: __init__

..  _satellitesgp4_class:

SatelliteSGP4
=============
A satellite class that uses the SGP4 satellite propagation model implemented in python package `sgp4`.  The classic
usage is to initialize the code with two line elements that you have obtained from `Space Trak <https://www.space-track.org/>`_
or `Celestrak <https://celestrak.com/>`_ or elsewhere. Example using two line elements::

    platform_utc     = datetime(2019,7,26, hour =20, minute=15, second=00)

    line1   = "1 26702U 01007A   19206.65122582  .00000348  00000-0  26798-4 0  9995"
    line2   = "2 26702  97.5720 223.8268 0009640 316.2599  43.7864 15.07871693  7426"
    sgp4    = SatelliteSGP4   ( twolines= [line1,line2] )

The class also provides the option to initialize the SGP4 propagator with the state vector and orbital parameters from a
Kepler orbit. This feature is used to implement some of the other satellite classes (eg sun-sync) in `skretrieval` and provides
a convenient way to use the gravitational perturbations in the SGP4 model without needing a set of two line elements.

.. autoclass:: skretrieval.platforms.satellite.satellitesgp4.SatelliteSGP4
    :members:
    :special-members: __init__

SatelliteSunSync
================
Create a satellite which is sun-synchronous. The class is intended for modelling/simulation work where a sun-synchronous
orbit is required. The code simulates the sun-synchronous orbit by setting the initial orbit inclination, it is the underlying
orbit propagator's job to calculate the orbit precession. The 'sgp4' orbit propagator will precess the orbit properly at
one degree per day. A simple 'kepler' orbit propagator can also be used but will not precess the orbit, this is satisfactory
for short period simulations over a few hours but should not be used for multi-day or longer studies.

For example, the following code will create a sun-synchronous orbit at a *nominal* altitude of 600 kms awith an ascending node at 18:15LT::

    sunsync = SatelliteSunSync( platform_utc, orbittype='sgp4',
                                period_from_altitude=600000.0,
                                localtime_of_ascending_node_hours=18.25)


Regardless of orbit propagator chosen, the sun synchronous orbit is kick-started with a state vector generated by a Kepler orbit
with the appropriate sun-synchronous inclination.  The state vector is fed to the orbit propagator which then calculates all future
platform_ecef_positions of the satellite.

.. autoclass:: skretrieval.platforms.satellite.SatelliteSunSync
    :members:
    :special-members: __init__

SatelliteMolniya
================
Create a satellite which follows a Molniya orbit. The class is intended for modelling/simulation work and can use either
a simple Kepler orbit or an SGP4 orbit. For example, the following code will create a molniya orbit::

    molniya   = SatelliteMolniya(  self._utc,
                                   orbittype='sgp4',
                                   longitude_of_ascending_node_degrees=-124.0)


.. autoclass:: skretrieval.platforms.satellite.SatelliteMolniya
    :members:
    :special-members: __init__


SatelliteSimpleGeostationary
============================
Create a satellite which follows a Geostationary orbit. This model is a very simple, idealized geostationary orbit that stays
fixed over a given geographic point.  It is useful for modelling/simulation work. For example, the following code will
create a geostationary orbit directly above -80 degree lonngitude::

    geostat = SatelliteSimpleGeostationary( -80.0 )

.. autoclass:: skretrieval.platforms.satellite.SatelliteSimpleGeostationary
    :members:
    :special-members: __init__


.. x SatelliteTudat
.. x --------------
.. x SatelliteTudat is an experimental class and is not yet available for general usage.
.. x
.. x .. autoclass:: skretrieval.platforms.satellite.satellitetudat.SatelliteTudat
.. x   :members:
.. x    :special-members: __init__

..  _satellitebase_class:

SatelliteBase
=============
The SatelliteBase is the base class that all satellites inherit from. Most users do not use this class.

.. autoclass:: skretrieval.platforms.satellite.SatelliteBase
    :members:

Sun, Moon, Stars
=================
skretrieval provides a small wrapper around astropy to support stars

    .. autofunction:: skretrieval.platforms.celestialbodies.star_unitvector_itrf

    .. autofunction:: skretrieval.platforms.celestialbodies.solsys_body_vector_itrf
