pmelchior / scarlet

hyperspectral galaxy modeling and deblending
MIT License
50 stars 22 forks source link

Graceful end state for spurious detections #223

Open pmelchior opened 3 years ago

pmelchior commented 3 years ago

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:

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.

fred3m commented 3 years ago

On the HSC side there are two typical cases that cause this behavior:

  1. 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.
  2. 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.