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

Make FlagHandler, SafeCentroidExtractor usable from Python

    Details

    • Type: Story
    • Status: Invalid
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: meas_base
    • Labels:
      None
    • Story Points:
      2
    • Team:
      Data Release Production

      Description

      The meas_base framework includes SafeCentroidExtractor, a convenience routine for extracting a centroid from a source record, setting a consistent set of flags if that's not possible or if the centroid is in some way compromised. This consistent flag handling is made possible by the use of the FlagHandler class.

      Unfortunately, FlagHandler is not meaningfully usable from Python, not least because it's impossible to define flags:

      >>> import lsst.meas.base as measBase
      >>> measBase.FlagDefinition("flag", "doc")
      [...]
      TypeError: __init__() takes exactly 1 argument (3 given)
      >>> fd = measBase.FlagDefinition()
      >>> fd.name = "flag"
      [...]
      AttributeError: You cannot add attributes to <lsst.meas.base.baseLib.FlagDefinition; proxy of <Swig Object of type 'lsst::meas::base::FlagDefinition *' at 0x10a82b900> >
      

      Looking further, even were we able to create FlagDefinitions, the FlagHandler is initialized with pointers to the beginning/end of a container of them, which seems like a stretch for Python code.

      Please add Python support for these routines.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                swinbank John Swinbank
                Watchers:
                John Swinbank
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel