A hands-on walkthrough of computing and plotting solar eclipse paths using Python. The approach uses Astropy to calculate sun-moon angular separation, then applies black-box optimization via scipy's Nelder-Mead method to find the latitude/longitude of eclipse totality for any given timestamp. To find all eclipses in the 2020-2030 decade, the author performs a coarse hourly scan followed by minute-by-minute refinement, parallelized using Modal for cloud execution. Results are plotted on a world map using Matplotlib's Basemap, successfully identifying 14 eclipses matching known astronomical records — all in roughly 100 lines of Python.
Table of contents
Solving for the coordinates using black-box optimizationFinding all the eclipsesPlotting itNotesSort: