Fix AutoPlatepar CALSTARS requirement and misleading success message#853
Fix AutoPlatepar CALSTARS requirement and misleading success message#853dvida merged 3 commits intoprereleasefrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates AutoPlatepar.autoFitPlatepar() to better match SkyFit2 behavior by auto-generating a CALSTARS file when one is missing, and by returning None (instead of an intermediate/unvalidated platepar) when star matching/final fit fails to avoid misleading “SUCCESS” outcomes.
Changes:
- Auto-generate CALSTARS via
extractStarsAndSavewhen no CALSTARS file exists in the directory. - Adjust verbose output to distinguish between loaded vs generated CALSTARS.
- Change several failure returns to return
Nonefor the platepar (and currentlyNonefor matched stars) rather than returning an intermediate result.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
I've replaced the brute-force matchStars in CyFunctions.pyx with a scipy.spatial.cKDTree implementation. The new version lives in RMS/Astrometry/MatchStars.py and is a drop-in replacement with the same signature and return format. |
|
Is the new approach really faster? Building KD trees takes time and by definition querying is faster only when done multiple times. Here, the KD tree is built for each run. |
Cython wins for very small inputs (20×50), that's 20 detected stars x 50 catalog stars, but those are 0.002ms - nobody will notice, and that's not a typical scenario. At typical RMS sizes it's a wash, and it scales much better for larger inputs. matchStars works in pixel space, so the pixel positions change every time and the KD-tree has to be rebuilt for each frame. |
Noneinstead of unvalidated intermediate platepar when star matching fails, preventing misleading "SUCCESS" after "ERROR"