[lsst-dm-stack-users] Problem visualizing astrometry matches; getX() fails

Michael Wood-Vasey wmwv at pitt.edu
Sun Jun 22 12:35:37 PDT 2014


Dear DM Users:

* Summary: Visualizing matches fails to get the X attribute of the matches in tag 8.0.0.3 (release/Winter2014): i.e., .getX() fails from an element of the matches list.

* Question to list: Has anyone succeeded in visualizing astrometry matches using display('astrometry', ...)?

Reported
DM-893 -- https://jira.lsstcorp.org/browse/DM-468

* In brief from output log file:
"""
  File "/Users/wmwv/stackdir/DarwinX86/pipe_tasks/8.0.0.1+3/python/lsst/pipe/tasks/astrometry.py", line 209, in astrometry
    self.display('astrometry', exposure=exposure, sources=sources, matches=matches)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/task.py", line 306, in display
    x1, y1 = first.getX() - x0, first.getY() - y0
  File "/Users/wmwv/stackdir/DarwinX86/afw/8.0.0.3/python/lsst/afw/table/tableLib.py", line 6891, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, SimpleRecord, name)
  File "/Users/wmwv/stackdir/DarwinX86/afw/8.0.0.3/python/lsst/afw/table/tableLib.py", line 63, in _swig_getattr
    raise AttributeError(name)
AttributeError: getX

"""

* Context and Details:

I'm working on running some images from WIYN+WHIRC.  They're already ISRed and combined.  I'm just trying out measurement of sources and astrometry.  Simon has been most helpful in getting obs_file updated and sharing with me LSSTish astrometry.net indexes for 2MASS.

I'm finding that the astrometry solution calculated by the astrometry step is wrong.  I'd like to use the built in lsst.pipe.base.tasks.Task.display('astrometry',exposure=exposure,sources=sources,matches=matches) to investigate the matches.  But when I do this it fails at the step of plotting up the matches with the error message below.  As the individual matches are swigged objects I don't really know how to easily inspect them in Python.  Have the parameter names or the way of accessing them been changed since Task.display was last updated?

Here's the relevant snippet of code where the error above comes from:

"""
        if matches:
            with ds9.Buffering():
                for first, second, d in matches:
                    i = len(sources)    # counter for ptypes/ctypes

                    x1, y1 = first.getX() - x0, first.getY() - y0

                    ctype = ctypes[i%len(ctypes)]
                    ptype = ptypes[i%len(ptypes)]
                    size  = 2*sizes[i%len(sizes)]
                    ds9.dot(ptype, x1, y1, size=8, frame=frame, ctype=ctype)
                    i += 1

                    ctype = ctypes[i%len(ctypes)]
                    ptype = ptypes[i%len(ptypes)]
                    size  = 2*sizes[i%len(sizes)]
                    x2, y2 = second.getX() - x0, second.getY() - y0
                    ds9.dot(ptype, x2, y2, size=8, frame=frame, ctype=ctype)
                    i += 1

""

processFile.py 20131025/06.stack/iPTF13dge___H_OPEN.lsst.fits  \
  --output output \
  --clobber-output --clobber-config \
  -c gain=3.4 \
  isBackgroundSubtracted=True 

I added to \file{obs_file/python/lsst/obs/file/processFile.py the import of debug.py, and my local debug.py is just

"""
import lsstDebug
lsstDebug.Info("lsst.pipe.tasks.astrometry").display = {'astrometry': True}
"""

(which took me a couple of hours to figure out, but that's a different ticket).

Full log output below

 - Michael

: Loading config overrride file '/Users/wmwv/lsst/obs_file/config/processFile.py'
: Loading config overrride file '/Users/wmwv/lsst/obs_file/config/processFile.py'
: Removing output repo /Users/wmwv/Research/SweetSpot/workspace/output for --clobber-output
: input=/Users/wmwv/Research/SweetSpot/workspace/20131025/06.stack
: output=/Users/wmwv/Research/SweetSpot/workspace/output
CameraMapper WARNING: Unable to locate registry registry in root: /Users/wmwv/Research/SweetSpot/workspace/output/registry.sqlite3
CameraMapper WARNING: Unable to locate registry registry in current dir: ./registry.sqlite3
CameraMapper WARNING: No registry loaded; proceeding without one
processFile: Processing {'calexp': 'iPTF13dge___H_OPEN.lsst'}
processFile.calibrate: installInitialPsf fwhm=10.1447826423 pixels; size=15 pixels
processFile.calibrate.repair: Identified 24 cosmic rays.
processFile.calibrate.detection: Detected 30 positive sources to 5 sigma.
processFile.calibrate.detection: Resubtracting the background after object detection
processFile.calibrate.initialMeasurement: Measuring 30 sources
processFile.calibrate.astrometry WARNING: No detector associated with exposure; assuming null distortion
processFile.calibrate.astrometry: Null distortion correction
processFile.calibrate.astrometry: Solving astrometry
processFile.calibrate.astrometry WARNING: Unable to find 236 index files
processFile.calibrate.astrometry: Got astrometric solution from Astrometry.net
processFile.calibrate.astrometry WARNING: No column in configuration for filter 'H'; using default 'j_mag'
processFile.calibrate.astrometry WARNING: No column in configuration for filter 'H'; using default ''
processFile.calibrate.astrometry: 9 astrometric matches
processFile FATAL: Failed on dataId={'calexp': 'iPTF13dge___H_OPEN.lsst'}: getX
Traceback (most recent call last):
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/cmdLineTask.py", line 220, in __call__
    result = task.run(dataRef, **kwargs)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/timer.py", line 111, in wrapper
    res = func(self, *args, **keyArgs)
  File "/Users/wmwv/lsst/obs_file/python/lsst/obs/file/processFile.py", line 133, in run
    result = self.process(sensorRef, postIsrExposure)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/timer.py", line 111, in wrapper
    res = func(self, *args, **keyArgs)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_tasks/8.0.0.1+3/python/lsst/pipe/tasks/processImage.py", line 147, in process
    calib = self.calibrate.run(inputExposure, idFactory=idFactory)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/timer.py", line 111, in wrapper
    res = func(self, *args, **keyArgs)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_tasks/8.0.0.1+3/python/lsst/pipe/tasks/calibrate.py", line 188, in run
    astromRet = self.astrometry.run(exposure, sources)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/timer.py", line 111, in wrapper
    res = func(self, *args, **keyArgs)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_tasks/8.0.0.1+3/python/lsst/pipe/tasks/astrometry.py", line 84, in run
    results = self.astrometry(exposure, sources, bbox=bbox)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/timer.py", line 111, in wrapper
    res = func(self, *args, **keyArgs)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_tasks/8.0.0.1+3/python/lsst/pipe/tasks/astrometry.py", line 209, in astrometry
    self.display('astrometry', exposure=exposure, sources=sources, matches=matches)
  File "/Users/wmwv/stackdir/DarwinX86/pipe_base/8.0.0.0+3/python/lsst/pipe/base/task.py", line 306, in display
    x1, y1 = first.getX() - x0, first.getY() - y0
  File "/Users/wmwv/stackdir/DarwinX86/afw/8.0.0.3/python/lsst/afw/table/tableLib.py", line 6891, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, SimpleRecord, name)
  File "/Users/wmwv/stackdir/DarwinX86/afw/8.0.0.3/python/lsst/afw/table/tableLib.py", line 63, in _swig_getattr
    raise AttributeError(name)
AttributeError: getX






More information about the dm-users mailing list