seeing-things / track

Automates tracking of targets with a telescope using ephemeris (TLE files) and/or optical tracking.
MIT License
7 stars 0 forks source link

Alignment not ordering positions optimally #276

Closed bgottula closed 3 days ago

bgottula commented 1 year ago

align is supposed to visit a set of locations on the sky in a (nearly) optimum order, using a travelling salesman solver. I just ran align after some recent upgrades and it very clearly was not following the optimum path. It performed several meridian flips when only one meridian crossing should be necessary.

Related to this: Right now I'm using ortools or something from Google, however I recently learned that the networkx package may have similar functionality in case I need a replacement.

bgottula commented 2 months ago

I root caused the bad behavior to the dtype of the distance_matrix Numpy array in tsp.solve_route(). The dtype of the array was left to the default which is a floating point type, but Google's OR-Tools expects integer distances. Apparently some older version of OR-Tools was able to coerce the floats to integers, but now passing a floating point distance (even if the value stored in the float is an integer) results in solutions that are clearly suboptimal.