Project: datamanagement
Issue DM-3455: ProcessImageTask.matchSources fails if using ANetAstrometryTask
ProcessImageTask.matchSources fails when using ANetAstrometryTask with the following error: {code} processCcd.calibrate.astrometry: Applying distortion correction processCcd FATAL: Failed on dataId={'taiObs': '2013-11-03', 'pointing': 672, 'visit': 904400, 'dateObs': '2013-11-03', 'filter': 'HSC-Y', 'field': 'STRIPE82L', 'ccd': 50, 'expTime': 30.0}: File "src/table/Schema.cc", line 239, in lsst::afw::table::SchemaItem lsst::afw::table::detail::SchemaImpl::find(const string&) const [with T = double; std::string = std::basic_string] Field or subfield withname 'astrom_distorted_x' not found with type 'D'. {0} lsst::pex::exceptions::NotFoundError: 'Field or subfield withname 'astrom_distorted_x' not found with type 'D'.' Traceback (most recent call last): File "/ssd/rowen/lsstsw/stack/Linux64/pipe_base/10.1-4-g6ba0cc7+3/python/lsst/pipe/base/cmdLineTask.py", line 320, in __call__ result = task.run(dataRef, **kwargs) File "/ssd/rowen/lsstsw/stack/Linux64/pipe_base/10.1-4-g6ba0cc7+3/python/lsst/pipe/base/timer.py", line 118, in wrapper res = func(self, *args, **keyArgs) File "/ssd/rowen/lsstsw/stack/Linux64/pipe_tasks/tickets.DM-3453-g086c9ddd0a/python/lsst/pipe/tasks/processCcd.py", line 85, in run result = self.process(sensorRef, postIsrExposure) File "/ssd/rowen/lsstsw/stack/Linux64/pipe_base/10.1-4-g6ba0cc7+3/python/lsst/pipe/base/timer.py", line 118, in wrapper res = func(self, *args, **keyArgs) File "/ssd/rowen/lsstsw/stack/Linux64/pipe_tasks/tickets.DM-3453-g086c9ddd0a/python/lsst/pipe/tasks/processImage.py", line 219, in process srcMatches, srcMatchMeta = self.matchSources(calExposure, sources) File "/ssd/rowen/lsstsw/stack/Linux64/pipe_tasks/tickets.DM-3453-g086c9ddd0a/python/lsst/pipe/tasks/processImage.py", line 250, in matchSources astromRet = astrometry.loadAndMatch(exposure=exposure, sourceCat=sources) File "/ssd/rowen/lsstsw/stack/Linux64/pipe_base/10.1-4-g6ba0cc7+3/python/lsst/pipe/base/timer.py", line 118, in wrapper res = func(self, *args, **keyArgs) File "/ssd/rowen/lsstsw/stack/Linux64/meas_astrom/tickets.DM-3453-gbb2ad1f49c/python/lsst/meas/astrom/anetAstrometry.py", line 321, in loadAndMatch with self.distortionContext(sourceCat=sourceCat, exposure=exposure) as bbox: File "/ssd/rowen/lsstsw/anaconda/lib/python2.7/contextlib.py", line 17, in __enter__ return self.gen.next() File "/ssd/rowen/lsstsw/stack/Linux64/meas_astrom/tickets.DM-3453-gbb2ad1f49c/python/lsst/meas/astrom/anetAstrometry.py", line 295, in distortionContext sourceCat.table.defineCentroid(self.distortedName) File "/ssd/rowen/lsstsw/stack/Linux64/afw/10.1-37-gaedf466/python/lsst/afw/table/tableLib.py", line 8887, in defineCentroid return _tableLib.SourceTable_defineCentroid(self, *args) NotFoundError: File "src/table/Schema.cc", line 239, in lsst::afw::table::SchemaItem lsst::afw::table::detail::SchemaImpl::find(const string&) const [with T = double; std::string = std::basic_string] Field or subfield withname 'astrom_distorted_x' not found with type 'D'. {0} lsst::pex::exceptions::NotFoundError: 'Field or subfield withname 'astrom_distorted_x' not found with type 'D'.' {code} This is probably a result of DM-2939. The basic problem is that the distortion context in ANetAstrometryTask should not be run at that point in processing. [~price] suggests that a simple clean fix is to make the distortion context a no-op if the WCS already contains distortion, if that works. This is what I will try first.
Story points: 1