scarlet
scarlet copied to clipboard
Graceful end state for spurious detections
Detection methods occasionally produce false/spurious detection. There are several part in scarlet where we either flag that, throw an exception, or attempt to fit it. I'm not sure who well they work together or against each other.
This issue is two-fold:
- We should check, e.g. in HSC, how often we get zero-flux warnings during initialization, and what happens to such components.
- We should ensure that a robust model (e.g.
CompactExtendedSource
) is successfully fit to every source with a center, regardless of how weird the data may look.
As for the last part, there is no reason why a false detection should fail. We have constraints that specifically prevent an all-zero solution, so that there's always a tiny amount of flux in a component. We should flag sources that run against that constraint, but we should nonetheless fit them just fine.
This idea should even apply to sources for which the center (or even most of the relevant pixels) are masked.
On the HSC side there are two typical cases that cause this behavior:
- The center location does not have a real source. This can happen with the HSC pipeline because there is a convolution done before detection which can sometimes put a peak in a location with zero or negative flux.
- The source is a multiband source and the 2nd component was unable to initialize. I haven't looked deeply into exactly why this happens, but the sources that do have multi component initialization fail are almost always fit as an extended source.
As we talked about in a call last week, I think that we'll need to do some testing, but using S/N to determine if there is enough flux to use a multi component source or compact source is probably going to be useful in the future. But it will take a lot of testing to ensure no regressions, as the current scheme where we fit everything in HSC with two components (unless it fails) works better than anything else that I've tried so far.