Project: datamanagement
Issue DM-4925: Make FlagHandler, SafeCentroidExtractor usable from Python
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: {code:python} >>> 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 > {code} 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.
Story points: 2