Bug report in meas_extensions_astrometryNet

We’re using the astrometry.net extension to perform astrometry. In v15 and v16 of the stack, I’ve noticed that meas_extensions_astrometryNet/python/lsst/meas/extensions/astrometryNet/anetAstrometry.py refers to self.distortionContext (see here). However, it seems that the distortionContext function was removed on the 4th of November, 2017 by this commit. I may be mistaken, but this seems to be a bug introduced by not catching all references to distortionContext when making that commit.

I don’t know whether this is also affecting the call to wcs.hasDistortion() in the same file.

Finally, is this the best place to report suspected bugs?

1 Like

The best place to report bugs is JIRA. That said, I don’t know what permissions are required.

I don’t have an account on JIRA, I’m afraid. I can see bug reports on there, but I can’t submit my own. Am I eligible for an account (I’m a UK affiliate-PI)?

I am not sure, but I hope and expect that you are eligible for a JIRA account. Meanwhile I submitted a ticket: https://jira.lsstcorp.org/browse/DM-15008

1 Like

For those that do not have Jira accounts, please do continue to report bugs here in Community, either in Support (for code) or Data Q&A (for data products). We will transfer them to Jira (as Russell did) as needed.

It is also possible to report bugs as GitHub Issues, but we have a preference for Community over that pathway, and we don’t track work in GitHub Issues.

Thank you for the clear bug report.

I have a fix in review. on branch tickets/DM-15008. If you want to try it yourself see https://github.com/lsst/meas_extensions_astrometryNet/pull/11 and apply the trivial changes to your copy of python/lsst/meas/extensions/astrometryNet/anetAstrometry.py. If you do try it please let us know how it works out.

That’s perfect - thank you. Did you also look into the wcs.hasDistortion() in that same file? I can’t find any other reference to hasDistortion when searching the organization on github, so I wondered whether it also refers to a now-removed method.

Good catch. This change should fix that:

-            self.log.info("Astrometric scatter: %f arcsec (%s non-linear terms, %d matches, %d rejected)" %
-                          (scatter.asArcseconds(), "with" if wcs.hasDistortion() else "without",
-                           len(matches), numRejected))
+            self.log.info("Astrometric scatter: %f arcsec (%d matches, %d rejected)" %
+                          (scatter.asArcseconds(), len(matches), numRejected))

Great - thanks again.

The fix has been merged to master and includes a unit test for the task.