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

removeMaskPlane function in multiband.py does not work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Story Points:
      3
    • Sprint:
      DRP F18-6
    • Team:
      Data Release Production

      Description

      In perusing the stack for examples of mask usage and manipulation, I came across this funtction:

      https://github.com/lsst/afw/blob/master/python/lsst/afw/image/image/multiband.py#L481-L490

      It looks like there are two issues with it:

      1) lsst.afw.image.MaskX has no attribute removeMaskPlaneDict, so any call to the function results in:

      AttributeError: type object 'lsst.afw.image.image.image.MaskX' has no attribute 'removeMaskPlaneDict'
      

      The fix appears to be removeMaskPlaneDict --> removeMaskPlane

      2) the function ignores the variable name, i.e. does not pass it to the call to [_sic_!] removeMaskPlaneDict(). Having corrected the function name to removeMaskPlane, the we get the following:

      TypeError: removeMaskPlane(): incompatible function arguments. The following argument types are supported:
          1. (arg0: str) -> None
      

      The fix here is to pass name to the function.

      Finally, I also noticed that the MultibandMask class is missing the removeAndClearMaskPlane() function. I don't think this was intentional, so one should be added.

        Attachments

          Activity

          Hide
          lauren Lauren MacArthur added a comment -

          I've pretty much had to fix these bugs in trying to figure out how things work, so I'm just picking it up now.

          Show
          lauren Lauren MacArthur added a comment - I've pretty much had to fix these bugs in trying to figure out how things work, so I'm just picking it up now.
          Hide
          lauren Lauren MacArthur added a comment - - edited

          Would you mind giving this a look?  I think you are currently the most likely consumer of the “multiband” classes and have some familiarity with their inner workings.  I’m most concerned about my new removeAndClearMaskPlane function.  While my unittest indicates the intended behaviour is being achieved, I’m not sure my implementation is appropriate/optimal.

          Jenkins is happy.  PR is here

          Show
          lauren Lauren MacArthur added a comment - - edited Would you mind giving this a look?  I think you are currently the most likely consumer of the “multiband” classes and have some familiarity with their inner workings.  I’m most concerned about my new removeAndClearMaskPlane function.  While my unittest indicates the intended behaviour is being achieved, I’m not sure my implementation is appropriate/optimal. Jenkins is happy .  PR is here
          Hide
          sullivan Ian Sullivan added a comment -

          Looks good, I had two minor suggestions on the pull request.

          Show
          sullivan Ian Sullivan added a comment - Looks good, I had two minor suggestions on the pull request.
          Hide
          lauren Lauren MacArthur added a comment -

          Thanks for the speedy review. Comments addressed and merged to master.

          Show
          lauren Lauren MacArthur added a comment - Thanks for the speedy review. Comments addressed and merged to master.

            People

            Assignee:
            lauren Lauren MacArthur
            Reporter:
            lauren Lauren MacArthur
            Reviewers:
            Ian Sullivan
            Watchers:
            Ian Sullivan, Jim Bosch, John Swinbank, Lauren MacArthur, Yusra AlSayyad
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.