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

Support for CHI2 images and absolute thresholding? #440

Open hjmcc opened 2 years ago

hjmcc commented 2 years ago

Dear SE++ developers, thanks for all the hard work.

I have a question, is SE++ able to use CHI2 detection images produced by Swarp? In 'sextractor classic' these images were signalled by adding -THRESH_TYPE ABSOLUTE in the configuration file. I grepped the sources and documentation and couldn't find anything 😰😰😰 .

thanks !

mkuemmel commented 2 years ago

That parameter doe not exist, right. I am not aware we ever discussed this. I'll have a look. If it does not exist it shouldn't be difficult to implement.

Could you provide us with some example data (chi-square image plus SE2 catalog plus SE2 seg image)?

marcschefer commented 2 years ago

I'm not entirely sure what's in those images but we use the detection image to estimate the initial value of flux for model fitting so that could be a problem if doesn't give us a usable flux.

mkuemmel commented 2 years ago

That parameter to make the detection threshold absolute for CHI2 images does not exist yet, and we will implement it for the next version v0.17.

Until then you can:

That should result in the intended behaviour.

@hjmcc again, could you give us some example data?

hjmcc commented 2 years ago

Thank you @mkuemmel and @marcschefer for your help!

I put some images from COSMOS2020 (https://ui.adsabs.harvard.edu/abs/2021AAS...23721506W/abstract) in https://exchg.calet.org/hjmcc/sepp/

You can find a subimage of the chi-mean images in there, as well as the same segment of the i-band image. I include an image from the paper showing what the parameters we used in COSMOS2020.

My aim to is to try to run SE++ on the COSMOS2020 data with detection parameters as close as possible to SE2.

Thanks for the hint @mkuemmel , I will try that!

image
mkuemmel commented 2 years ago

@hjmcc I checked you images, the weight image is 1.0 everywhere, hence the detection threshold is absolute as expected for a chi-square image. This zip file: chi2.zip contains the configuration files (ascii and python) for the use case you described. Its kind of structural, so I did not try to put in all the parameters you listed above. It uses the chi-square image as detection and the i image as measurement image. There are some hints how to extend to several measurement images.

Have a look!

hjmcc commented 2 years ago

Thank you, @mkuemmel for the help and posting these scripts!

I tried your config and compared it to a similar config for SE2.0. Seems to work, it detects about ~20% more objects however, as you can see from the check-images (OBJECTS from SE2.0 and SEGMENTATION from SE++). So I understand that the SE++ deblending and splitting algorithm is different from SE2? I will make some more tests. GIF shows (chi2, SE2 and SE++). (We have quite an agressive threshold in SE2.0 to avoid too many spurious sources around the very bright objects in COSMOS.

2022-02-10 10-16-19 gifcask 2022-02-10 10_18_35

hjmcc commented 2 years ago

For reference, this is what happens near a bright star. It's the same order: chi2, se2, se++. Some tuning still!

biright-star

mkuemmel commented 2 years ago

Some comments from my side:

On the second image I think I switched background subtraction off, which to me seems to be appropriate for a chi2 image.

hjmcc commented 2 years ago

Thanks again @mkuemmel. I confirm that the minimum area is the same in both cases.

Note that you can set a second core threshold and discard objects with a small number of pixels above that core >threshold. This enlarges objects and suppresses false positives around bright extended objects.

Thanks for the hint. I guess you are referring to these parameters:

The core threshold level

core-threshold-value=0

The minimum pixel area for partitioning

core-minimum-area=0

Activate core threshold partitioning

partition-corethreshold=0

What should I set them to? I couldn't find anything in the documentation...

Cheers!

mkuemmel commented 2 years ago

Set:

The objects get larger which eliminates the halo objects around bright galaxies. False positives in the field are suppressed by the 'original', high core threshold.