Yash-10 / galmask

Unsupervised galaxy masking to remove background source detections
https://galmask.readthedocs.io/en/latest/
MIT License
7 stars 0 forks source link

Prevent `photutils` warning on deblending mode #2

Open Yash-10 opened 2 years ago

Yash-10 commented 2 years ago

If the source has negative values, the deblending procedure from photutils outputs warnings like this:

WARNING: Source "2" contains negative values, setting deblending mode to "linear" [photutils.segmentation.deblend]

It would be helpful to handle such situations within galmask itself to prevent long, verbose warning messages.

Eg:

if np.any(source < 0):
    # set deblending mode to linear
else:
    # keep it as default
Yash-10 commented 2 years ago

I think this could be a non-issue. Is it helpful to explicitly see what deblending mode is set? If yes, we should close this, else tackle this..