Note
Click here to download the full example code
Using the heartbeat if implementedΒΆ
Out:
a : 7.0000e+06 x : 7.0000e+06
e : 0.0000e+00 y : 0.0000e+00
i : 6.9000e+01 z : 0.0000e+00
omega: 0.0000e+00 vx: -0.0000e+00
Omega: 0.0000e+00 vy: 2.7043e+03
anom : 0.0000e+00 vz: 7.0448e+03
We are now looking at a satellite 42 at 2453005.5
We are now looking at a satellite 42 at 2453005.611111111
We are now looking at a satellite 42 at 2453005.722222222
We are now looking at a satellite 42 at 2453005.8333333335
We are now looking at a satellite 42 at 2453005.9444444445
We are now looking at a satellite 42 at 2453006.0555555555
We are now looking at a satellite 42 at 2453006.1666666665
We are now looking at a satellite 42 at 2453006.277777778
We are now looking at a satellite 42 at 2453006.388888889
We are now looking at a satellite 42 at 2453006.5
import numpy as np
import pyorb
from astropy.time import Time
from sorts.propagator import SGP4
#it will run a bit slower since it cant use the "array" optimization of SGP4
class MySGP4(SGP4):
def heartbeat(self, t, state, satellite):
print(f'We are now looking at a satellite {satellite.satnum} at {t}')
prop = MySGP4(
settings = dict(
out_frame='TEME',
heartbeat=True,
),
)
orb = pyorb.Orbit(M0 = pyorb.M_earth, direct_update=True, auto_update=True, degrees = True, a=7000e3, e=0, i=69, omega=0, Omega=0, anom=0)
print(orb)
t = np.linspace(0,3600*24.0,num=10)
x = prop.propagate(
t,
orb.cartesian[:,0],
epoch=Time(53005, format='mjd', scale='utc'),
A=1.0,
A_std = 0.1,
relative_variation = True,
C_R = 1.0,
C_D = 1.0,
)
#stop the heartbeat
prop.set(heartbeat=False)
x = prop.propagate(
t,
orb.cartesian[:,0],
epoch=Time(53005, format='mjd', scale='utc'),
A=1.0,
A_std = 0.1,
relative_variation = True,
C_R = 1.0,
C_D = 1.0,
)
Total running time of the script: ( 0 minutes 0.009 seconds)