Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-355

Change the python template instantiation of masks from MaskU to MaskX

    Details

    • Type: RFC
    • Status: Implemented
    • Resolution: Done
    • Component/s: DM
    • Labels:
      None

      Description

      I am currently working on changing the number of bits in afw Mask from 16 to 32 bits, as per RFC-25. Currently Masks use unsigned shorts (16bit) to store mask plane information. However moving to unsigned int (32 bit) necessitated instantiating many c++ classes with that type as well. To avoid code bloat we have opted to go with signed ints to store mask plane information. The difference between signed and unsigned is not meaningful in our code base as we only use bitwise operators on mask planes.

      Python requires an instantiation of all C++ templated types, with a unique name for each instantiation. Masks are currently suffixed with a U, as an homage to the underlying data type. However with the data type moving to signed integer, this would no longer hold. As the name carries no real significance, it is possible for Masks to stay instantiated as MaskU and simply have the U not mean anything about the data type. However the LSST stack also has images instantiated for unsigned short types with the name ImageU. I feel having two similar sounding names for similar objects, with different data types to be potentially confusing.

      I propose the name given to the python instantiation then to use the letter X, a common stand in variable name. This would also decouple the data type from the object entirely, and give greater flexibility in the future if mask planes change numbers of bits, or change to different sorts of objects entirely.

        Attachments

          Container Issues

            Issue Links

              Activity

                People

                • Assignee:
                  nlust Nate Lust
                  Reporter:
                  nlust Nate Lust
                  Watchers:
                  Jim Bosch, John Swinbank, Kian-Tat Lim, Nate Lust, Paul Price, Robert Lupton, Tim Jenness
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  7 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Planned End:

                    Summary Panel