Advertisement
Guest User

Untitled

a guest
Nov 24th, 2021
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. from skyfield.api import load, EarthSatellite
  2.  
  3. ts = load.timescale(builtin=True)
  4. conjunction = ts.utc(2021, 11, 25, 4, 18, [24 + 0.01*i for i in range(100)])
  5. line1 = '1 25544U 98067A   21328.19951010  .00003407  00000-0  70845-4 0  9994'
  6. line2 = '2 25544  51.6441 271.5215 0004374 235.8745 271.5482 15.48632762313390'
  7. iss = EarthSatellite(line1, line2, 'ISS (ZARYA)', ts)
  8.  
  9. line1 = '1 44296U 19029BP  21327.89422035  .00005500  00000-0  11185-3 0  9993'
  10. line2 = '2 44296  52.9987 137.7304 0006980 336.4135  23.6550 15.47973186142593'
  11. deb = EarthSatellite(line1, line2, 'FALCON 9 DEB (44296)', ts)
  12.  
  13. iss_pos = iss.at(conjunction)
  14. deb_pos = deb.at(conjunction)
  15.  
  16. min_dist, time = min(zip((iss_pos - deb_pos).distance().km, conjunction))
  17. print(f"Minimum distance of {min_dist:.3f} km on {time.utc_strftime(format='%Y-%m-%d %H:%M:')}{time.utc.second:5.2f} UTC")
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement