aerospaceresearch / orbitdeterminator

determination of satellite orbits and more
MIT License
181 stars 113 forks source link

Added Exception for IndexError in Lamberts Kalman #190

Closed Curious-Nikhil closed 4 years ago

Curious-Nikhil commented 4 years ago

Hi, When running OD using Lamberts Kalman method xhat = np.mean(kep[:, I]) in kalman_lambert.kalman will result in IndexError because the distance units are in km. Changing the units to metres fixes the issue.

But currently, there is no error handling. This commit adds a simple try-except block for IndexError which returns a message requesting the user to change units to metres. Use this command - python3 main.py -u m

image

Thanks!

Originally mentioned by @aryadas98 in https://github.com/aerospaceresearch/orbitdeterminator/pull/106#issuecomment-371790274

aryadas98 commented 4 years ago

Can you squash the two commits into one?