Our current star selectors return a list of PsfCandidate s instead of source records. This makes them clumsy for many operations.
I propose the following changes:
- Add a base class for star selectors. Have this base class provide a method that turns a source catalog into a list of PsfCandidate. The default implementation will probably suffice in all cases, but if not, this offers natural way to override it.
- Change the selectStars method to return an lsst.pipe.base.Struct that contains a catalog of sources that are believed to be stars.
- Make star selectors into tasks. They are already configurable objects. This has several advantages, including adding a log object and eliminating the need for a registry. I suggest that the primary method retain the name selectStars, but if people prefer to rename it to run I don't mind.
- Eliminate the star selector registry, unless it is still wanted.
Note that there are alternatives to returning a source catalog that might do just as well, though I think a catalog is more natural:
- Have the task flag stars. This is somewhat clumsy because it requires that the star selector add a field (whose name will presumably be a config parameter) and users must then scan the catalog to find stars. It does have the advantage of saving space, and users can easily find stars or non-stars equally easily. Which brings up a point discussed below.
- Return a list of source IDs. This is somewhat clumsy for users but saves space.
Will users ever want an easy want to identify non stars? Neither the current interface nor my proposed changes support. Obvious options include:
- Set a flag in the catalog instead of returning a catalog, as mentioned above.
- Return two two catalogs: stars and non-stars.
- Have a flag that controls whether the output is stars or non-stars.
Note that lsst.ip.diffim.DiaCatalogSourceSelector already returns a list of sources (an ordinary python list) rather than a list of PsfCandidate. It should be made the same as the others, and probably renamed from ...SourceSelector to ...StarSelector.