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

Python crashes when measuring flux from invalid shape parameters

    XMLWordPrintable

    Details

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

      Description

      Running the following snippet causes the Python kernel crashes:

      import lsst.afw.geom as afwGeom
      import lsst.afw.image as afwImage
      import lsst.meas.base as measBase
      import numpy as np
       
      img = afwImage.ImageD(np.random.randn(16,16))
      shape = afwGeom.Quadrupole(-2, -2, 0)  # <-- This is invalid
      flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                 img.getBBox().getCenter())
      
      

      This is yet another example of a user error that causes a complete crash instead of raising Exceptions. The correct way is to set `normalize=True` when constructing the `shape` variable.

        Attachments

          Issue Links

            Activity

            kannawad Arun Kannawadi created issue -
            kannawad Arun Kannawadi made changes -
            Field Original Value New Value
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                                                                        img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                                                    img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            kannawad Arun Kannawadi made changes -
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                                                    img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                        img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            kannawad Arun Kannawadi made changes -
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                        img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                              img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            kannawad Arun Kannawadi made changes -
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                              img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                          img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            kannawad Arun Kannawadi made changes -
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                          img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                        img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            kannawad Arun Kannawadi made changes -
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                        img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                       img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            kannawad Arun Kannawadi made changes -
            Description Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # This is incorrect
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                       img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions
            Running the following snippet causes the Python kernel crashes:

            {code:python}
            import lsst.afw.geom as afwGeom
            import lsst.afw.image as afwImage
            import lsst.meas.base as measBase
            import numpy as np

            img = afwImage.ImageD(np.random.randn(16,16))
            shape = afwGeom.Quadrupole(-2, -2, 0) # <-- This is invalid
            flux = measBase.SdssShapeAlgorithm.computeFixedMomentsFlux(img, shape,
                                                                       img.getBBox().getCenter())

            {code}

            This is yet another example of a user error that causes a complete crash instead of raising Exceptions. The correct way is to set `normalize=True` when constructing the `shape` variable.
            wittgen Matthias Wittgen made changes -
            Assignee Matthias Wittgen [ wittgen ]
            wittgen Matthias Wittgen made changes -
            Status To Do [ 10001 ] In Progress [ 3 ]
            wittgen Matthias Wittgen made changes -
            Component/s meas_base [ 10750 ]
            wittgen Matthias Wittgen made changes -
            Reviewers Arun Kannawadi [ kannawad ]
            Status In Progress [ 3 ] In Review [ 10004 ]
            wittgen Matthias Wittgen made changes -
            Link This issue relates to DM-3476 [ DM-3476 ]
            kannawad Arun Kannawadi made changes -
            Status In Review [ 10004 ] Reviewed [ 10101 ]
            wittgen Matthias Wittgen made changes -
            Epic Link PREOPS-995 [ 1078856 ]
            wittgen Matthias Wittgen made changes -
            Story Points 4
            wittgen Matthias Wittgen made changes -
            Resolution Done [ 10000 ]
            Status Reviewed [ 10101 ] Done [ 10002 ]
            yusra Yusra AlSayyad made changes -
            Epic Link PREOPS-995 [ 1078856 ] PREOPS-1161 [ 1475339 ]
            tjenness Tim Jenness made changes -
            Team Data Release Production [ 10301 ] Architecture [ 10304 ]
            tjenness Tim Jenness made changes -
            Epic Link PREOPS-1161 [ 1475339 ]
            igoodenow Iain Goodenow made changes -
            Epic Link PREOPS-1161 [ 1475339 ]

              People

              Assignee:
              wittgen Matthias Wittgen
              Reporter:
              kannawad Arun Kannawadi
              Reviewers:
              Arun Kannawadi
              Watchers:
              Arun Kannawadi, Matthias Wittgen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.