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

Box2I(bbox.getMin(), bbox.getMax()) fails for an empty bbox

    Details

    • Type: Improvement
    • Status: Invalid
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None
    • Templates:
    • Story Points:
      1
    • Team:
      Data Release Production

      Description

      Empty Box2I cannot be round tripped:

      from lsst.afw.geom import Box2I
      b1 = Box2I()
      b2 = Box2I(b1.getMin(), b1.getMax())
      assert b2.isEmpty()

      It is confusing and surprising that this round tripping fails.

      It is also a trap for the unwary because saving min and max is the logical way to store boxes in afw tables. Records can contain points but not extents and so it saves casting back and forth and simplifies and clarifies the code to save max instead of extent. Thus that is the path most users will take, and the problem can be a time bomb: it could be quite some time before somebody tries to store an empty box and finds that it does not get retrieved correctly.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jbosch Jim Bosch
                Reporter:
                rowen Russell Owen
                Watchers:
                Jim Bosch, Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel