New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tickets/DM-2755: Iteration and convergence fixes #10
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Improved the way matchOptimisticB keeps track of which reference objects have been used in FinalVerify. Formerly metadata was used in RecordProxy but this didn't allow saving the closest match. Now a boost multiindex is used and the match distance is recorded. In theory one can keep the closer match. In practice this is not being done because it may not be necessary.
Added documentation for the one field in MatchOptimisticBControl that had none, and made minor improvements to the documentation of a few other fields. Also documented the value returned by matchOptimisticB.
Renamed showAstrometry to displayAstrometry (ds9) and moved to display.py Renamed plotMatches to plotAstrometry (matplotlib) and moved to display.py Made plotAstrometry more like the older displayAstrometry by using the same symbols and colors. Modified displayAstrometry to show the matches by drawing a line connecting the source and reference object (like plotAstrometry).
…sToSources The new maxMatchDistArcSec argument allows reducing the match distance during iteration, which can greatly improve the astrometric fit. Added class attribute MatchOptimisticBTask.SourceInfoClass, to make it easier to override the selection criteria for usable and good sources. I also cleaned up SourceInfo a bit, including adding some additional keys that may prove useful for screening sources and simplified the names isUsableSource and isGoodSource by removing "Source". Improved error messages if no sources are usable. Increased the default maxMatchDistArcSec from 1 to 3 because the improved matcher and iteration allow it, and it will work for more telescopes. Simplified and sped up the code a bit; formerly the matcher would first try on usable sources, then on good sources. It appears sufficient to just try on usable sources, and that is what Vello Tabur recommends. Bug fix: _doMatch could return None if no matches; it must always return a list. Switch from "import numpy" to standard "import numpy as np".
AstrometryTask now iterates the match and fit WCS cycle in a smarter way: - It checks if each iteration has improved the fit and stops if not or if the fit is so good there is no point continuing. - If a WCS fit fails it either gives up (if it's the first fit) or uses the previous iteration - It reduces the maximum matching distance for each iteration based on the measured quality of the fit. Improved FitTanSipWcsTask in two ways: - It iterates the fit (since the existing C++ code fits X first, then Y, which is something we plan to fix at some point). - If the fit is terrible it raises an exception.
Change two matchOptimisticB parameters from radians to degrees, rename one to make its purpose clearer, and update MatchOptimisticBTask accordingly. Also document some parameters better (there is still one I don't understand).
Two values that were supposed to be different were the same, due to a typo.
Added two config parameters that control termination of match + fit WCS iteration (rather than using magic numbers). Improved logging to avoid info-level log messages in a loop.
Renamed SourceInfo._iResolved to isMultiple for accuracy. Changed SourceInfo.interpolatedKey to SourceInfo.interpolatedCenterKey because it is more likely useful for detecting sources with untrustworthy centroids. Corrected documentation if SourceInfo.isUsable, which had some incorrect criteria listed.
MatchOptimisticBTask was not culling non-good sources from the match list before returning. That was a bug I accidentally introduced while making other changes. I also changed the definition of good sources as those that are have no interpolated pixels in their center, as recommended by Paul Price; this catches cosmic rays and bad pixels, as well as saturation. The result of re-introducing the culling is that the CFHT demo not reaches 18.6 mas scatter of bright stars in only 3 iterations of the outer loop in AstrometryTask, so I reduced the default accordingly (still not quite the 2 Paul Price requested, but close).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.