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

check for crosstalk fails as a numpy array cannot be used as a boolean

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Team:
      DM Science

      Description

      lsst/afw/cameraGeom/cameraFactory.py uses the return from detectorConfig.getCrosstalk as a boolean; this doesn't work.

      The fix is to test against None

       

        Attachments

          Activity

          Hide
          rhl Robert Lupton added a comment -

          Can you check this one-line fix?

          $ git diff HEAD~
          diff --git a/python/lsst/afw/cameraGeom/cameraFactory.py b/python/lsst/afw/cameraGeom/cameraFactory.py
          index 76d0b46..8470c99 100644
          --- a/python/lsst/afw/cameraGeom/cameraFactory.py
          +++ b/python/lsst/afw/cameraGeom/cameraFactory.py
          @@ -52,7 +52,7 @@ def makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToField):
                   transforms,
               ]
               crosstalk = detectorConfig.getCrosstalk(len(ampInfoCatalog))
          -    if crosstalk:
          +    if crosstalk is not None:
                   args.append(crosstalk)
               return Detector(*args)

          Show
          rhl Robert Lupton added a comment - Can you check this one-line fix? $ git diff HEAD~ diff - - git a / python / lsst / afw / cameraGeom / cameraFactory.py b / python / lsst / afw / cameraGeom / cameraFactory.py index 76d0b46 .. 8470c99 100644 - - - a / python / lsst / afw / cameraGeom / cameraFactory.py + + + b / python / lsst / afw / cameraGeom / cameraFactory.py @@ - 52 , 7 + 52 , 7 @@ def makeDetector(detectorConfig, ampInfoCatalog, focalPlaneToField):          transforms,      ]      crosstalk = detectorConfig.getCrosstalk( len (ampInfoCatalog)) -     if crosstalk: +     if crosstalk is not None :          args.append(crosstalk)      return Detector( * args)
          Hide
          price Paul Price added a comment -

          This change looks fine.

          Show
          price Paul Price added a comment - This change looks fine.
          Hide
          rhl Robert Lupton added a comment -

          Merged and pushed

          Show
          rhl Robert Lupton added a comment - Merged and pushed

            People

            Assignee:
            rhl Robert Lupton
            Reporter:
            rhl Robert Lupton
            Reviewers:
            Paul Price
            Watchers:
            James Chiang, Paul Price, Robert Lupton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.