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.
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 )
-
class
skretrieval.platforms.satellite.
SatelliteKepler
(ut: Union[numpy.datetime64, datetime.datetime, float, str], period_from_seconds: Optional[float] = None, period_from_altitude: Optional[float] = None, inclination_radians: Optional[float] = None, inclination_is_sun_sync: bool = False, mean_anomaly: float = 0.0, argument_of_perigee: float = 0.0, localtime_of_ascending_node_hours: Optional[float] = None, longitude_of_ascending_node_degrees: Optional[float] = None, right_ascension_ascending_node: Optional[float] = None, eccentricity: float = 1e-07, orbitnumber: int = 0)¶ Implements a simple Kepler orbit orbiting the Earth. THe user will normally set all of the required orbital parameters in the instance constructor.
-
__init__
(ut: Union[numpy.datetime64, datetime.datetime, float, str], period_from_seconds: Optional[float] = None, period_from_altitude: Optional[float] = None, inclination_radians: Optional[float] = None, inclination_is_sun_sync: bool = False, mean_anomaly: float = 0.0, argument_of_perigee: float = 0.0, localtime_of_ascending_node_hours: Optional[float] = None, longitude_of_ascending_node_degrees: Optional[float] = None, right_ascension_ascending_node: Optional[float] = None, eccentricity: float = 1e-07, orbitnumber: int = 0)¶ Initializes the Kepler orbit. Multiple options are provided to describe the required orbit. A complete description of the various parameters is given in
from_elements()
- Parameters
utc – option identical to that described in
from_elements()
period_from_seconds – keyword option identical to that described in
from_elements()
period_from_altitude – keyword option identical to that described in
from_elements()
inclination_radians – keyword option identical to that described in
from_elements()
inclination_is_sun_sync – keyword option identical to that described in
from_elements()
mean_anomaly – keyword option identical to that described in
from_elements()
argument_of_perigee – keyword option identical to that described in
from_elements()
localtime_of_ascending_node_hours – keyword option identical to that described in
from_elements()
longitude_of_ascending_node_degrees – keyword option identical to that described in
from_elements()
right_ascension_ascending_node – keyword option identical to that described in
from_elements()
eccentricity – keyword option identical to that described in
from_elements()
orbitnumber – keyword option identical to that described in
from_elements()
-
eccentricity
() → float¶ Purely abstract method that returns the eccentricty of the satellite orbit. This is used in the base class when locating the next crossing of teh ascending node and only requires moderate precision.
- Returns
The eccentricty of the satellite orbit in seconds
- Return type
float
-
from_elements
(autc: datetime.datetime, period_from_seconds: Optional[float] = None, period_from_altitude: Optional[float] = None, inclination_radians: Optional[float] = None, inclination_is_sun_sync: bool = False, mean_anomaly: float = 0.0, argument_of_perigee: float = 0.0, localtime_of_ascending_node_hours: Optional[float] = None, longitude_of_ascending_node_degrees: Optional[float] = None, right_ascension_ascending_node: Optional[float] = None, eccentricity: float = 1e-07, orbitnumber: int = 0)¶ Define the Kepler orbit from the classic 6 Keplerian elements.
period
inclination
eccentricity
mean anomaly
right ascension of ascending node
argument of perigee
Several of the orbital elements can be specified in multiple ways. For example the orbital period can be defined directly with seconds or it can be defined using the altitude of the satellite. You must use only one of the options to specify a parameter otherwise exceptions will/should be raised.
The caller must ensure that they explictly set the following three orbital elements,
period or altitude must be set.
inclination must be set.
right ascension of the ascending node must be set.
Leaving the remaining three elements, (i) mean anomaly, (ii) argument of perigee and (iii) eccentricity as default values produces a circular orbit with the satellite initially placed at the location of the perigee (which for a circular orbit is somewhat undefined and arbitrary!).
- Parameters
platform_utc (datetime.datetime) – The UTC time of the elements
period_from_seconds (float) – specifies the orbital period in seconds. An alternative to specify the period is with the optional parameter period_from_altitude. One, but only one, of the two optional methods must be used.
period_from_altitude (float) – specifies the orbital period using the altitude of the satellite in meters. The altitude is nominal as we do not account for oblateness of the Earth etc. The radius of the Earth is internally assumed to be 6378000.0 meters. An alternative to specify the period is with the optional parameter period_from_seconds. One, but only one, of the two optional methods must be used.
inclination_radians (float) – Specifes the inclination of the orbit in radians. An alternative method to specify the inclination is with the optional parameter inclination_is_sun_sync. One, but only one, of the two optional methods must be used.
inclination_is_sun_sync (bool) – Default False. If True then specify the inclination of the orbit so it is sun-synchronous. This only works for orbits below an altitude of ~5974 km,. An alternative is to specify the inclination with the optional parameter inclination_radians. One, but only one, of the two optional methods may be used. Note this only sets the inclination of the orbit as a Kepler orbit propagator does not have the oblate Earth model (J2) necessary to model sun synchronicity.
localtime_of_ascending_node_hours (float) – Default: None. Specifies the nominal local time of the ascending node in hours (0-24). If set then its value represents the “hour” at which you want the ascending node for example a floating point value of 18.25 will set the node to 18:15 LT. This value is implemented by overwriting the “longitude_of_ascending_node_degrees” keyword used to initialize the kepler orbit. It also forces the satellite to be close to the ascending node at time platform_utc by changing the mean_anomaly value. Default is None.
longitude_of_ascending_node_degrees (float) – Default None. Specifies the geographic longitude of the ascending node (-180 to 360)at time platform_utc. This is an alternative method to using parameters localtime_of_ascending_node_hours and right_ascension_ascending_node to specify the right ascension of the ascending node. One, but only one, of the 3 optional methods may be used, if neither option is used the RAAN is set to 0.0. If this option is used then the satellite is forced to be close to the ascending node at time platform_utc by changing the mean_anomaly value. Note that longitude is in degrees not radians.
right_ascension_ascending_node (float) – Default None. Specifies the Right Ascension of the ascending node in radians (0 to 2.pi). This is an alternative method to parameter longitude_of_ascending_node_degrees to specify the right ascension of the ascending node. One, but only one, of the two optional methods must be used, if neither option is used the RAAN is set to 0.0.
mean_anomaly (float) – The mean anomaly in radians at time mjd (0-2.pi). This value will be overidden if you use options localtime_of_ascending_node_hours or longitude_of_ascending_node_degrees.
argument_of_perigee (float) – Default 0. The argument of perigree in radians (0 to 2.pi).
eccentricity (float) – Default 0. The eccentricity of the orbit (0 to 1)
orbitnumber (int) – Default 0. The orbit number at the epoch givern by mjd
-
from_state_vector
(autc: datetime.datetime, orbitnumber: int, r: numpy.ndarray, v: numpy.ndarray)¶ Update the object so it calculates orbits derived from the specified state vector
- Parameters
platform_utc (datetime) – The coordinated universal time of the state vector.
orbitnumber (int) – The orbit number at the epoch
r (np.ndarray [3]) – ECI coordinates at epoch (in metres) eciposition of the satellite
v (np.ndarray[3]) – ECI ecivelocity at epoch in m/s
-
make_two_line_elements
(first_derivative=0.0, second_derivative=0.0, bstar=0.0, satnum=1) → Tuple[str, str]¶ Returns the current orbital elements as two line elements. This is handy if you want to initialize an SGP4 predictor from a Kepler “starter orbit” using two line elements. The kepler orbit does not directly support drag terms, these have to be provided via the bstar parameter.
- Parameters
first_derivative (float) – The first derivative term of the SGP4 two line elements. This is usually not used and can be left as the default value of 0.0
second_derivative (float) – The second derivative term of the SGP4 two line elements. This is usually not used and can be left as the default value of 0.0
bstar (float) – The drag term used by SGP4. It is usually entered from empirical measurements. A value of 0.0 should disable drag terms in the SGP4 propagator
satnum (int) – The satellite number. This is provide for convenience
- Returns
Returns the two lines of the elements as a two element tuple of two strings
- Return type
tuple( str,str)
-
period
() → datetime.timedelta¶ Return the orbital period of this orbit. Uses keplers third law.
- Returns
The orbital period.
- Return type
datetime.timedelta
-
sun_synchronous_inclination
(semi_major_axis_meters: float) → float¶ Method that returns the inclination of a sun synchronous orbit given the semi-major axis. For reference see Sun-Synchronous orbit
- Parameters
semi_major_axis_meters (float) –
- Returns
- Return type
The required inclination of the orbit in radians
-
update_eci_position
(autc: Union[numpy.datetime64, datetime.datetime])¶ Updates the ECI position
-
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 or Celestrak 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.
-
class
skretrieval.platforms.satellite.satellitesgp4.
SatelliteSGP4
(twolines: Optional[Tuple[str, str]] = None)¶ Implements the SGP4 satellite propagator. This is just a shallow wrapper for the SGP4 python package from PyPi
-
__init__
(twolines: Optional[Tuple[str, str]] = None)¶ Creates and initializes the sgp4 orbit predictor using two line elements provided by the user. The lines must be in the promper two line format. It is possible to leave the lines as None and initialize the predictor after creation.
- Parameters
twolines (Tuple( str, str )) – Two strings that contain the two line elements used to initialize the sgp4 orbit predictor. This paremeter may be None, in which case, the object can be configured by calling
from_kepler_orbit()
orfrom_twoline_elements()
-
eccentricity
() → float¶ Purely abstract method that returns the eccentricty of the satellite orbit. This is used in the base class when locating the next crossing of teh ascending node and only requires moderate precision.
- Returns
The eccentricty of the satellite orbit in seconds
- Return type
float
-
from_kepler_orbit
(kepler: skretrieval.platforms.satellite.satellitekepler.SatelliteKepler, bstar=0.0)¶ Initializes the sgp4 orbit predictor with two line elements extracted from a kepler orbit. A simple algorithm that extracts two line elements from a kepler orbit and feeds them into the SGP4 model. Note that the kepler orbit does not correct coordinates to the true equator mean equinox (TEME) coordinates used by sgp4 so there will be minor issues for people seeking precision. On the other hand it is a simple way to fire up the SGP4 from a Kepler orbit, which is quite useful when modelling simple classes of orbit for study work.
- Parameters
kepler (SatelliteKepler) – The Kepler elements for the satellite. The two line elements are generated for the current time and eciposition stored in the kep[ler satellite.
bstar (float) – The B* drag term used by SGP4. This is not part of the Kepler elements and must be manually included by the user. We recommend you leave this as default 0.0 unless you know what you are doing as the drag term used by SGP4 is tricky to get right (it can change by one or two orders of magnitude for example)
-
from_twoline_elements
(line1: str, line2: str)¶ Initializes the sgp4 orbit predictor with classic two line elements.
- Parameters
line1 (str) – The first line of the two line elements
line2 (str) – The second line of the two line elements
-
period
() → datetime.timedelta¶ Return the orbital period of this orbit using the mean motion
- Returns
The orbital period in seconds
- Return type
float
-
update_eci_position
(autc: datetime.datetime)¶ All satellite classes must implement update_eci_position. This purely abstract method will update the internal attributes self._m_ecilocation, self._m_ecivelocity and self._m_time
- Parameters
utc (datetime) – Updates the ECI eciposition and ECI ecivelocity of the satellite to this Coordinated Universal Time
-
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.
-
class
skretrieval.platforms.satellite.
SatelliteSunSync
(utc: Union[numpy.datetime64, datetime.datetime, float, str], orbittype='sgp4', sgp4_bstar_drag=0.0, **kwargs)¶ Implements a sun-synchronous orbit. This model starts the chosen orbit propagator with appropriate initial conditions given by the user. The orbit inclination is chosen by the code so the orbit with the given period (or altitude) is sun-synchronous. The user can utilize a Keplerian or SGP4 orbit propagator. The kepler propagator is useful for short, one orbit, studies but will not actually precess the orbit. The SGP4 propagator is slower but will capture the sun-synchronous precession over a period of days and months.
-
__init__
(utc: Union[numpy.datetime64, datetime.datetime, float, str], orbittype='sgp4', sgp4_bstar_drag=0.0, **kwargs)¶ - Parameters
utc (datetime.datetime) – The UTC time of the elements. This is set as the time of the ascending node of the selected orbit.
period_from_seconds (float) – Optional, specifies the orbital period in seconds. An alternative to specify the period is with the optional parameter period_from_altitude. One, but only one, of the two optional methods must be used.
period_from_altitude (float) – Optional, specifies the orbital period using the altitude of the satellite in meters. The altitude is nominal as we do not account for oblateness of the Earth etc. The radius of the Earth is internally assumed to be 6378000.0 meters. An alternative to specify the period is with the optional parameter period_from_seconds. One, but only one, of the two optional methods must be used.
orbittype (str) – (default=’sgp4’). User can choose the orbit propagator. Currently accepted values are ‘kepler’ and ‘sgp4’.
sgp4_bstar_drag (float) – (default 0.0). Allows the user to add a drag term. This value is only used by the SGP4 predictor and must be compatible with the SGP4 predictor.
localtime_of_ascending_node_hours (float) – Specifies the nominal local time of the ascending node in hours (0-24). If set then its value represents the “hour” at which you want the ascending node for example a floating point value of 18.25 will set the node to 18:15 LT. The current implementation may not be exact but will be close.
longitude_of_ascending_node_degrees (float) – Specifies the geographic longitude of the ascending node (-180 to 360)at time platform_utc. This is an alternative method to using parameters localtime_of_ascending_node_hours and right_ascension_ascending_node to specify the right ascension of the ascending node. One, but only one, of the 3 optional methods may be used, if neither option is used the RAAN is set to 0.0.
right_ascension_ascending_node (float) – Specifies the Right Ascension of the ascending node in radians (0 to \(2\pi\)). This is an alternative method to parameter longitude_of_ascending_node_degrees to specify the right ascension of the ascending node. One, but only one, of the two optional methods must be used, if neither option is used the RAAN is set to 0.0.
argument_of_perigee (float) – Default 0. The argument of perigree in radians (0 to \(2\pi\)).
eccentricity (float) – Default 0. The eccentricity of the orbit (0 to 1)
orbitnumber (int) – Default 0. The orbit number at the epoch given by platform_utc
-
eccentricity
() → float¶ Purely abstract method that returns the eccentricty of the satellite orbit. This is used in the base class when locating the next crossing of teh ascending node and only requires moderate precision.
- Returns
The eccentricty of the satellite orbit in seconds
- Return type
float
-
period
() → float¶ Return the period of the satellite. For low earth orbit spacecraft this is accurate to about 0.1 seconds.
- Returns
The period of the satellite
- Return type
datetime.timedelta
-
set_sun_sync_from_elements
(utc: datetime.datetime, orbittype: str = 'sgp4', sgp4_bstar_drag: float = 0.0, **kwargs)¶ Defines the sun-synchronous orbit using Keplerian orbital elements. The sun-synchronous orbit is always kick-started using a Kepler based orbit and it can continue to use that kepler orbit to propagate the position and velocity or it can use the SGP4 model. This function is called by the class instance constructor and the user does not normally need to call this function directly.
- Parameters
utc (datetime.datetime) – The universal time of the orbital elements.
- orbittype: str
Specifies the type of orbit predictor to be used to propagate the orbit. It can be either ‘kepler’ or ‘sgp4’. Default is ‘sgp4’
- sgp4_bstar_drag: float
Optional argument that is only used if the sgp4 propagator is selected. This value is used as the bstar drag term in the SGP4 orbit predictor. The default value is 0.0 implying drag is ignored.
- kwargs: extra key word arguments.
These keywords are from the keyword options in
SatelliteKepler.from_elements()
. Note that parameter localtime_of_ascending_node will override, if set, the longitude_of_ascending_node_degrees setting in the key words options.
-
update_eci_position
(tnow: datetime.datetime)¶ Updates the eciposition and ecivelocity of the satellite at the given instant in time. The user does not usually call this function directly. It is usually called by the base class
SatelliteBase
- Parameters
tnow (datetime) – Updates the ECI eci-position and ECI eci-velocity of the satellite to this time
-
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)
-
class
skretrieval.platforms.satellite.
SatelliteMolniya
(utc: Union[datetime.datetime, numpy.datetime64, float, str], orbittype='kepler', period_from_seconds: float = 43080.0, inclination_user_defined: float = 1.106538745764405, argument_of_perigee: float = 4.71238898038469, eccentricity: float = 0.74, sgp4_bstar_drag: float = 0.0, **kwargs)¶ Implements a Molniya orbit. This model can internally utilize either a Keplerian or SGP4 orbit propagator. The SGP4 propagator will capture gravitational perturbations on the orbit but the Kepler will not. The user will typically initialize the molniya orbit in the constructor but this simply calls
set_molniya_from_elements()
. A full desccription of the optional keyword arguments is given in that function. A sensible default Molniya orbit is provided in the defaults-
__init__
(utc: Union[datetime.datetime, numpy.datetime64, float, str], orbittype='kepler', period_from_seconds: float = 43080.0, inclination_user_defined: float = 1.106538745764405, argument_of_perigee: float = 4.71238898038469, eccentricity: float = 0.74, sgp4_bstar_drag: float = 0.0, **kwargs)¶ Initialize self. See help(type(self)) for accurate signature.
-
eccentricity
() → float¶ Purely abstract method that returns the eccentricty of the satellite orbit. This is used in the base class when locating the next crossing of teh ascending node and only requires moderate precision.
- Returns
The eccentricty of the satellite orbit in seconds
- Return type
float
-
period
() → float¶ Return the period of the satellite. For low earth orbit spacecraft this is accurate to about 0.1 seconds.
- Returns
The period of the satellite
- Return type
datetime.timedelta
-
set_molniya_from_elements
(utc: datetime.datetime, orbittype='kepler', period_from_seconds: float = 43080.0, inclination_user_defined: float = 1.106538745764405, argument_of_perigee: float = 4.71238898038469, eccentricity: float = 0.74, sgp4_bstar_drag: float = 0.0, **kwargs)¶ Defines the Molniya orbit using Keplerian orbital elements. A default, standard Molniya orbit is provided via the default although the user must supply the right ascension of ascending node using one of the standard
SatelliteKepler
options (i) localtime_of_ascending_node_hours, (ii) longitude_of_ascending_node_degrees or (iii) right_ascension_ascending_nodeThe Molniya orbit is always kick-started using Keplerian orbital elements. It can continue to use the keplerian orbit to propagate the position and velocity or it can switch to an SGP4 model orbit propagator.
- Parameters
utc (datetime.datetime) – The universal time of the orbital elements.
orbittype (str) – Specifies the type of orbit predictor to be used to propagate the orbit. It can be either ‘kepler’ or ‘SGP4’. Default is ‘kepler’
sgp4_bstar_drag (float) – Optional argument that is only used if the sgp4 propagator is selected. This value is used as the bstar drag term in the SGP4 orbit predictor. The default value is 0.0 implying drag is ignored.
kwargs (extra key word arguments.) – These keywords are from the keyword options in
SatelliteKepler.from_elements()
.
-
update_eci_position
(tnow: datetime.datetime)¶ Updates the eciposition and ecivelocity of the satellite at the given instant in time.
- Parameters
tnow (datetime) – Updates the ECI eciposition and ECI ecivelocity of the stellite to this time
-
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 )
-
class
skretrieval.platforms.satellite.
SatelliteSimpleGeostationary
(longitude_degrees: float)¶ Implements a simple geostationary satellite that simply stays above a fixed location on the equator.
-
__init__
(longitude_degrees: float)¶ Create a geostationary orbit that remains fixed over the the given longitude.
- Parameters
longitude_degrees: – float: The geographic longitude of the geostationary orbit. expressed in degrees, +ve east.
-
eccentricity
() → float¶ Returns the eccentricity of the orbit. It will always be zero.
-
period
() → float¶ Returns the period of the geostationary orbit to be exactly one sidereal day.
- Returns
The period of the satellite in seconds
- Return type
float
-
update_eci_position
(utc: datetime.datetime)¶ Not usually used by users. Updates the ECI location of the satellite.
- Parameters
utc (datetime) – Updates the ECI position and ECI velocity of the satellite to this Coordinated Universal Time
-
SatelliteBase¶
The SatelliteBase is the base class that all satellites inherit from. Most users do not use this class.
-
class
skretrieval.platforms.satellite.
SatelliteBase
¶ The SatelliteBase is a base class for artificial satellites orbiting the Earth. The class derives from
PlatformLocation
which allows the SatelliteBase class and its derivatives to be used by the skretrieval package to calculate the location of instruments mounted on satellites. The ECI-TEME coordinate system is used for storage of satellite position and velocity. There is some looseness in the definition of Earth Centered Inertial. We use the definition of ECI employed by the SGP4 orbital propagator code which is a Celestial Reference system using the true equator and mean equinox, TEME, i.e. precession is accounted for but nutation is not. This system is not the same as the GCRS system commonly used in astronomy applications today so care must be taken when transforming coordinate systems. The conversion to and from ECI-TEME is provided by the eci functions in package sktime which have been checked to centimeter precision.The SatelliteBase class overrides and implements the following three functions of parent class
PlatformLocation
position
velocity
update_position()
Note that the above three functions return answers in the geographic geocentric system and not the eci system.
Child classes that implement specific satellite orbit propagator methods and derive from SatelliteBase must implement the following abstract methods:
Platform Locator methods These are methods required to support
PlatformLocator
-
update_position
(utc: Union[datetime.datetime, numpy.datetime64, float]) → numpy.ndarray¶ Overloads the methods from
PlatformLocation
. Updates the position of the satellite to the requested time. The geocentric ECEF/ITRF position of the satellite can be retrieved with attributeposition
. It is strongly recommended that time is always increasing in reasonable step sizes. Various orbit propagators will not step backwards in time and may fail if the time step is unreasonably large.- Parameters
utc (datetime) – The time at which to calculate the new position.
Satellite Abstract methods
-
abstract
update_eci_position
(utc: datetime.datetime)¶ All satellite classes must implement update_eci_position. This purely abstract method will update the internal attributes self._m_ecilocation, self._m_ecivelocity and self._m_time
- Parameters
utc (datetime) – Updates the ECI eciposition and ECI ecivelocity of the satellite to this Coordinated Universal Time
-
abstract
period
() → datetime.timedelta¶ Purely abstract method that returns the orbital period of the satellite in seconds. For low earth orbit spacecraft this only needs to be accurate to ~0.1 seconds.
- Returns
The period of the satellite in seconds
- Return type
timedelta
Regular methods
-
eciposition
() → numpy.ndarray¶ The ECI cartesian position of the satellite in meters after the last call to
update_eci_position()
.- Returns
The three element array specifying ECI location as (X,Y,Z) meters
- Return type
np.ndarray[3]
-
ecivelocity
() → numpy.ndarray¶ The ECI cartesian velocity of the satellite in meters per second
- Returns
The three element array specifying ECI velocity as (X,Y,Z) meters per second
- Return type
np.ndarray[3]
-
equator_crossing
(utc: datetime.datetime) → datetime.datetime¶ Determines the last equator crossing before or equal to Tnow.
- Parameters
Tnow (datetime.datetime) – Find the equator crossing before (or at) this time
- Returns
The time at which this satellite object crosses the equator
- Return type
datetime.datetime
-
set_orbit_number_from_last_equator_crossing
(orbitnumber: int, utc: datetime.datetime)¶ Sets the orbit number and calculates the start time/ascending node of the orbit.
- Parameters
orbitnumber (int) – The orbit number at time Tnow
Tnow (datetime.datetime) – The current time.
-
orbit_number
(utc: datetime.datetime) → Tuple[int, datetime.datetime]¶ Calculates the orbit number at time Tnow and returns the start time of that orbit.
- Parameters
utc (datetime) – The Coordinated Universal Time at which to calculate the orbit number
- Returns
Returns a two element tuple specifiying the orbit number and the time of the last equator crossing
- Return type
(int,datetime)
-
_set_current_state
(ecipos: numpy.ndarray, ecivel: numpy.ndarray, t: datetime.datetime)¶ Sets the ECI position, ECI velocity and current time of the satellite. This is typically called by child satellite implementation classes at the end of a call to method update_eci_position
- Parameters
ecipos (np.ndarray[3]) – The three element (X,Y,Z) array specifying ECI position in meters .
ecivel (np.ndarray[3]) – The three element (X,Y,Z) array specifying ECI velocity in meters/second
t (datetime.datetime) – The current UTC time of the eciposition and ecivelocity.
Sun, Moon, Stars¶
skretrieval provides a small wrapper around astropy to support stars
skretrieval.platforms.celestialbodies.
star_unitvector_itrf
(utc: datetime.datetime, body: str) → numpy.ndarray¶Fetches the ITRF geocentric unit vector from the center of the Earth to the desired star at the requested time. This currently does not account for proper motion of the star.
- Parameters
utc (datetime, np.datetime64, str) – The UTC time at which the position of the star is required
body (str) – The name of the star, e.g. “Betelgeuse”
- Returns
np.ndarray(3)
- Return type
The geocentric unit vector toward the requested star as a 3 element column vector. Dimensionless Unit vector.
skretrieval.platforms.celestialbodies.
solsys_body_vector_itrf
(utc: datetime.datetime, body: str) → numpy.ndarray¶Fetches the ITRF geocentric vector from the center of the Earth to the solar system body at the requested time.
- Parameters
utc (datetime, np.datetime64, str) – The UTC time at which the position of the body is required
body (str) – The name of the solar system body, e.g. “moon”, “sun”
- Returns
np.ndarray(3)
- Return type
The geocentric positon of the requested body as a 3 element column vector. Expressed in meters.