astrorama / SourceXtractorPlusPlus

SourceXtractor++, the next generation SExtractor
https://astrorama.github.io/SourceXtractorPlusPlus/
GNU Lesser General Public License v3.0
72 stars 9 forks source link

Zero detections when using a weight image #481

Closed WillHartley closed 2 years ago

WillHartley commented 2 years ago

When supplying only a science image, SEPP finds 10K sources. When including a weight image (whether declared as absolute or not) zero sources are detected. There are bright objects in the image.

If I tell SEPP that the weight image is an RMS image, then I get detected objects.

mkuemmel commented 2 years ago

When giving the weight image had you specified the weight type? Default type is None, which should give an error when specifying a weight image name, but who knows.

Other that that it should work. We had a problem when scaling the weight image, but that's solved.

Spitting out the thresholded checkimage or the SNR checkimage or the variance check image may help to understand what's happening.

WillHartley commented 2 years ago

Thanks I'll try those checkimages. I was explicitly declaring it a weight image, yes.

WillHartley commented 2 years ago

Definitely something weird. If I set weight-absolute, then the thres map looks almost identical to the science image. If I set it to relative, then I get numbers like 10^-9 (but the pattern at least matches the weight map). I thought I had upgraded to the latest release, but if a similar bug has already been fixed, then maybe I haven't...

mkuemmel commented 2 years ago

I would also set an explicit weight threshold. The default is a type specific boost constant or so, but you never know whether that makes sense.

WillHartley commented 2 years ago

Ahhh interesting... weight-threshold was set to 9e15 (which I think I just copied from you, Martin). When I switch to 9e5 then I get detected objects.

mkuemmel commented 2 years ago

Also I get that one wrong most of the time dealing with a new dataset. For weight I usually use 1e-06, In MER we have rms and 9e+15 threshold, which is derived from the number BIG in SE2.

In the end, that number needs to be chosen with care.

WillHartley commented 2 years ago

Ahhh, of course, I was being stupid! I was reading it as an effective flag value to identify known bad pixels, rather than as a theshold to catch them on the fly.