Stargrazer82301 / CAAPR

CAAPR: the Comprehensive & Adaptable Aperture Photometry Routine. A highly-customisable astronomical aperture photometry pipeline. (see CJR Clark et al., 2018)
https://ui.adsabs.harvard.edu/abs/2018A%26A...609A..37C/abstract
MIT License
9 stars 2 forks source link

indexing and masking issue for AstroMagic #1

Open izff opened 5 years ago

izff commented 5 years ago

This is more of the issue with PTS rather than CAAPR. When PTS/AstroMagic try to remove ambient stars near the target source, if the star is brighter (flux speaking) than the target, the star will be giving an index of 0 in the segment fits file.

see line 670 and line 679 in code CAAPR/CAAPR/CAAPR_AstroMagic/PTS/pts/magic/sources/starfinder.py

And this 0 marking the bright star would be confused with 0 marking the background.
So when the software try to mark the star for removal, the star removal would fail.

see line 305 in code CAAPR/CAAPR/CAAPR_AstroMagic/PTS/pts/magic/sources/extractor.py

If the target is brighter than the stars, which is true for most cases, the target will also be marked 0. But as the target do not go through the star removal procedure, everything would be fine. The code still works perfectly.

Per my understanding, a simple workaround would be changing the index in both places from "index" to "index + 1". This seems to be working for me. But I do not know the whole code very well, I am not sure if I am introducing new bugs. I would like to know better fix to this issue if possible.

Anyway, thank you for this handy software.

Stargrazer82301 commented 5 years ago

Interesting, thanks for pointing this out... @samverstocken, what are your thoughts?