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

Mask operations don't work with bit masks returned by Mask's methods

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None

      Description

      mask = exposure.mask
      mask & mask.getPlaneBitMask("CROSSTALK")
      

      returns:

      TypeError: unsupported operand type(s) for &: 'lsst.afw.image.image.image.MaskX' and 'int'
      

       
       This should work; almost by definition the two types are consistent! The problem is presumably in the translation to python, but that means that we need to provide a translation back.

        Attachments

          Activity

          Hide
          czw Christopher Waters added a comment -

          This appears to have been resolved.

          mask = exp.getMask()
          mask & mask.getPlaneBitMask("SUSPECT")  # CROSSTALK not found in this exposure.
                                                  # This raises a NotImplementedError to 
                                                  # prevent temporary images.
          mask &= mask.getPlaneBitMask("SUSPECT")  # This succeeds.
          type(mask)  # <class 'lsst.afw.image.image.MaskX'>
          type(mask.getPlaneBitMask("SUSPECT")  # <class 'int'>

           

           

           

          Show
          czw Christopher Waters added a comment - This appears to have been resolved. mask = exp.getMask() mask & mask.getPlaneBitMask( "SUSPECT" ) # CROSSTALK not found in this exposure. # This raises a NotImplementedError to # prevent temporary images. mask &= mask.getPlaneBitMask( "SUSPECT" ) # This succeeds. type(mask) # < class 'lsst.afw.image.image.MaskX' > type(mask.getPlaneBitMask( "SUSPECT" ) # < class 'int' >      

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            rhl Robert Lupton
            Watchers:
            Christopher Waters, Robert Lupton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins Builds

                No builds found.