skyfielders / python-skyfield

Elegant astronomy for Python
MIT License
1.43k stars 214 forks source link

How to calculate the distance between two satellites and predict the probability of a possible collision #767

Closed leonbusy closed 2 years ago

leonbusy commented 2 years ago

Hi, I wish you all the best. I am recently working on using python and the sgp4 algorithm to calculate the distance between two satellites and possibly predict the probability of a collision between them, but I don't know how to implement my idea, can you give me some advice, thanks.

davidmikolas commented 2 years ago

if you get positions for two satellites using their TLEs at the same times, you can get the distance between them (fairly accurately) by simply subtracting, squaring, summing over x, y, z and taking the square root.

But remember TLEs and SGP4 are only accurate to a few kilometers at most, so while potentially dangerous (parts per million) situations can be flagged using them, real predictions of collisions use much more accurate models that aren't readily available to the general public.

You can read more about potential collisions which in spaceflight words are called "conjunctions" here: https://celestrak.org/SOCRATES/ and you can use those predictions to check your own calculations

All of that said, predicting collisions is fun! So here are some links in Space Exploration Stack Exchange you might find interesting: