Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combiner.sigma_clipping overwrites existing masks #849

Open
kbwestfall opened this issue Oct 22, 2024 · 1 comment
Open

Combiner.sigma_clipping overwrites existing masks #849

kbwestfall opened this issue Oct 22, 2024 · 1 comment

Comments

@kbwestfall
Copy link

astropy==6.1.4
ccdproc==2.4.2
numpy==2.1.2

The current implementation of Combine.sigma_clipping overwrites any existing mask. Is that intended?

I.e., instead of:

        self.data_arr.mask = sigma_clip(self.data_arr.data,
                                        sigma_lower=low_thresh,
                                        sigma_upper=high_thresh,
                                        axis=kwd.get('axis', 0),
                                        copy=kwd.get('copy', False),
                                        maxiters=kwd.get('maxiters', 1),
                                        cenfunc=func,
                                        stdfunc=dev_func,
                                        masked=True,
                                        **kwd).mask

would it make sense to instead do:

        self.data_arr.mask |= sigma_clip(self.data_arr.data,
                                         sigma_lower=low_thresh,
                                         sigma_upper=high_thresh,
                                         axis=kwd.get('axis', 0),
                                         copy=kwd.get('copy', False),
                                         maxiters=kwd.get('maxiters', 1),
                                         cenfunc=func,
                                         stdfunc=dev_func,
                                         masked=True,
                                         **kwd).mask

If so, I can submit a short PR.

@mwcraig
Copy link
Member

mwcraig commented Oct 22, 2024

Good catch, I think you are right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants