I am trying to display different subpoint plots for different orbit height of satellites and use the lines for further analysis.
So I wrote myself a satellite create function that computes inclination and mean motion:
def create_sat (a,orbit_type='ISS',e=0.0008835,epoch=26317,number=1):
a=(a+6378)*1000
if orbit_type=='ISS':
i=0.90058989402907
else:
i=np.arccos(-(((a)/(12352000))**(7/2)))
mu=3.986004418*(10**14)
pii=3.14159265359793
p=np.sqrt((a**3*4*pii**2)/(mu))/60
mean_motion=((2*pii)/p)
satrec = Satrec()
satrec.sgp4init(
WGS84, # gravity model
'i', # 'a' = old AFSPC mode, 'i' = improved mode
number, # satnum: Satellite number
epoch, # epoch: days since 1949 December 31 00:00 UT
2.2, # bstar: drag coefficient (/earth radii)
6.969196665e-13, # ndot: ballistic coefficient (revs/day)
0.0, # nddot: second derivative of mean motion (revs/day^3)
e, # ecco: eccentricity
0, # argpo: argument of perigee (radians)
i, # inclo: inclination (radians)
0, # mo: mean anomaly (radians)
mean_motion, # no_kozai: mean motion (radians/minute)
2, # nodeo: right ascension of ascending node (radians)
)
print(p)
print(1/(p/60))
print(mean_motion)
print(i)
ts = load.timescale()
sat = EarthSatellite.from_satrec(satrec, ts)
return sat
However when I try to compute the subpoint with the skyfiled package I get an error:
\toposlib.py:232: RuntimeWarning: invalid value encountered in remainder
lon = (arctan2(y, x) - pi) % tau - pi
I figured out that _compute_latitude(self, position)
of skyfields toposlib.py returns nan for x, y, and z.
If I choose different values for inclination i
and mean_motion
it works, but not for the calculated values. (the calculation is correct though)
Why does it return nan and what are the boundaries for the calculation?
Thanks in advance!