Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-10785

setBrightObjectMasks does not properly construct footprint.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: pipe_tasks
    • Labels:
      None

      Description

      This causes coaddDriver to fail when bright object masks are turned on, e.g.

      Traceback (most recent call last):
        File "/software/lsstsw/stack/Linux64/ctrl_pool/13.0-4-g98e8074+2/python/lsst/ctrl/pool/parallel.py", line 495, in logOperation
          yield
        File "/software/lsstsw/stack/Linux64/pipe_drivers/13.0-5-g7e5c55c/python/lsst/pipe/drivers/coaddDriver.py", line 261, in coadd
          coaddResults = self.assembleCoadd.run(patchRef, selectDataList)
        File "/software/lsstsw/stack/Linux64/pipe_base/13.0-5-g0e05785/python/lsst/pipe/base/timer.py", line 121, in wrapper
          res = func(self, *args, **keyArgs)
        File "/software/lsstsw/stack/Linux64/pipe_tasks/13.0-31-gbcfe521/python/lsst/pipe/tasks/assembleCoadd.py", line 357, in run
          self.setBrightObjectMasks(coaddExp, dataRef.dataId, brightObjectMasks)
        File "/software/lsstsw/stack/Linux64/pipe_tasks/13.0-31-gbcfe521/python/lsst/pipe/tasks/assembleCoadd.py", line 788, in setBrightObjectMasks
          foot = afwDetect.Footprint(center, radius, exposure.getBBox())
      TypeError: __init__(): incompatible constructor arguments. The following argument types are supported:
          1. lsst.afw.detection._footprint.Footprint(inputSpans: lsst.afw.geom.spanSet.SpanSet, region: lsst.afw.geom.box.Box2I=Box2D(minimum=Point2I(0, 0), dimensions=Extent2I(0, 0)))
          2. lsst.afw.detection._footprint.Footprint(inputSpans: lsst.afw.geom.spanSet.SpanSet, peakSchema: lsst.afw.table.schema.schema.Schema, region: lsst.afw.geom.box.Box2I=Box2D(minimum=Point2I(0, 0), dimensions=Extent2I(0, 0)))
          3. lsst.afw.detection._footprint.Footprint(arg0: lsst.afw.detection._footprint.Footprint)
          4. lsst.afw.detection._footprint.Footprint()
       
      Invoked with: Point2I(30655, 33041), 51.792857142857095, Box2D(minimum=Point2I(27900, 31900), dimensions=Extent2I(4200, 4100))
      

      This should be covered in a unit test as well. Probably a good idea to do a quick scan for similar issues elsewhere too.

        Attachments

          Issue Links

            Activity

            Hide
            tmorton Tim Morton added a comment -

            For the purposes of getting this fixed quickly, I'll opt not to add a unit test for this right now, but I do note for the future that setBrightObjectMasks should be tested at some point. Nate Lust can you look quickly at these few lines and confirm that I'm initializing the footprints correctly?

            Show
            tmorton Tim Morton added a comment - For the purposes of getting this fixed quickly, I'll opt not to add a unit test for this right now, but I do note for the future that setBrightObjectMasks should be tested at some point. Nate Lust can you look quickly at these few lines and confirm that I'm initializing the footprints correctly?
            Hide
            tmorton Tim Morton added a comment -
            Show
            tmorton Tim Morton added a comment - PR is here: https://github.com/lsst/pipe_tasks/pull/126
            Hide
            nlust Nate Lust added a comment -

            It looks right to me. I can't test it on the train (reviews from your phone feel like the future!) I trust you to run the appropriate checks (meaning the code now executes I guess, and or that the output mask planes look ok)

            Show
            nlust Nate Lust added a comment - It looks right to me. I can't test it on the train (reviews from your phone feel like the future!) I trust you to run the appropriate checks (meaning the code now executes I guess, and or that the output mask planes look ok)
            Hide
            tmorton Tim Morton added a comment -

            Thanks! Coadd is now running when it wasn't before, so I will consider that tested.

            Show
            tmorton Tim Morton added a comment - Thanks! Coadd is now running when it wasn't before, so I will consider that tested.
            Hide
            tmorton Tim Morton added a comment -

            Putting this back into review because the suggested solution doesn't work:

            109317 INFO  2017-06-02T15:17:51.868-0500 coaddDriver: lsst-verify-worker05:109317: Traceback:
            Traceback (most recent call last):
              File "/software/lsstsw/stack/Linux64/ctrl_pool/13.0-4-g98e8074+2/python/lsst/ctrl/pool/parallel.py", line 495, in logOperation
                yield
              File "/software/lsstsw/stack/Linux64/pipe_drivers/13.0-5-g7e5c55c/python/lsst/pipe/drivers/coaddDriver.py", line 261, in coadd
                coaddResults = self.assembleCoadd.run(patchRef, selectDataList)
              File "/software/lsstsw/stack/Linux64/pipe_base/13.0-5-g0e05785/python/lsst/pipe/base/timer.py", line 121, in wrapper
                res = func(self, *args, **keyArgs)
              File "/home/tmorton/repositories/pipe_tasks/python/lsst/pipe/tasks/assembleCoadd.py", line 357, in run
                self.setBrightObjectMasks(coaddExp, dataRef.dataId, brightObjectMasks)
              File "/home/tmorton/repositories/pipe_tasks/python/lsst/pipe/tasks/assembleCoadd.py", line 788, in setBrightObjectMasks
                spans = afwGeom.SpanSet.fromShape(radius, offset=center)
            TypeError: fromShape(): incompatible function arguments. The following argument types are supported:
                1. (radius: int, stencil: lsst.afw.geom.spanSet.Stencil=Stencil.CIRCLE, offset: lsst.afw.geom.coordinates.coordinates.Point2I=Point2I(0, 0)) -> lsst.afw.geom.spanSet.SpanSet
                2. (radius: int, stencil: lsst.afw.geom.spanSet.Stencil=Stencil.CIRCLE, offset: Tuple[int, int]=(0L, 0L)) -> lsst.afw.geom.spanSet.SpanSet
                3. (arg0: lsst::afw::geom::ellipses::Ellipse) -> lsst.afw.geom.spanSet.SpanSet
            

            Show
            tmorton Tim Morton added a comment - Putting this back into review because the suggested solution doesn't work: 109317 INFO 2017-06-02T15:17:51.868-0500 coaddDriver: lsst-verify-worker05:109317: Traceback: Traceback (most recent call last): File "/software/lsstsw/stack/Linux64/ctrl_pool/13.0-4-g98e8074+2/python/lsst/ctrl/pool/parallel.py", line 495, in logOperation yield File "/software/lsstsw/stack/Linux64/pipe_drivers/13.0-5-g7e5c55c/python/lsst/pipe/drivers/coaddDriver.py", line 261, in coadd coaddResults = self.assembleCoadd.run(patchRef, selectDataList) File "/software/lsstsw/stack/Linux64/pipe_base/13.0-5-g0e05785/python/lsst/pipe/base/timer.py", line 121, in wrapper res = func(self, *args, **keyArgs) File "/home/tmorton/repositories/pipe_tasks/python/lsst/pipe/tasks/assembleCoadd.py", line 357, in run self.setBrightObjectMasks(coaddExp, dataRef.dataId, brightObjectMasks) File "/home/tmorton/repositories/pipe_tasks/python/lsst/pipe/tasks/assembleCoadd.py", line 788, in setBrightObjectMasks spans = afwGeom.SpanSet.fromShape(radius, offset=center) TypeError: fromShape(): incompatible function arguments. The following argument types are supported: 1. (radius: int, stencil: lsst.afw.geom.spanSet.Stencil=Stencil.CIRCLE, offset: lsst.afw.geom.coordinates.coordinates.Point2I=Point2I(0, 0)) -> lsst.afw.geom.spanSet.SpanSet 2. (radius: int, stencil: lsst.afw.geom.spanSet.Stencil=Stencil.CIRCLE, offset: Tuple[int, int]=(0L, 0L)) -> lsst.afw.geom.spanSet.SpanSet 3. (arg0: lsst::afw::geom::ellipses::Ellipse) -> lsst.afw.geom.spanSet.SpanSet
            Hide
            tmorton Tim Morton added a comment -

            OK, everything is now confirmed to work; coadds are made properly, which means the bright object masks are being set as desired. The new PR is at https://github.com/lsst/pipe_tasks/pull/128

            Show
            tmorton Tim Morton added a comment - OK, everything is now confirmed to work; coadds are made properly, which means the bright object masks are being set as desired. The new PR is at https://github.com/lsst/pipe_tasks/pull/128
            Hide
            tmorton Tim Morton added a comment -

            Nate Lust whenever you get a chance go ahead and mark this reviewed (the last solution we put in together worked).

            Show
            tmorton Tim Morton added a comment - Nate Lust whenever you get a chance go ahead and mark this reviewed (the last solution we put in together worked).

              People

              Assignee:
              tmorton Tim Morton
              Reporter:
              tmorton Tim Morton
              Reviewers:
              Nate Lust
              Watchers:
              Nate Lust, Tim Morton
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: