Open cnavacch-spire opened 4 months ago
Welcome to Astropy 👋 and thank you for your first issue!
A project member will respond to you as soon as possible; in the meantime, please double-check the guidelines for submitting issues and make sure you've provided the requested details.
GitHub issues in the Astropy repository are used to track bug reports and feature requests; If your issue poses a question about how to use Astropy, please instead raise your question in the Astropy Discourse user forum and close this issue.
If you feel that this issue has not been responded to in a timely manner, please send a message directly to the development mailing list. If the issue is urgent or sensitive in nature (e.g., a security vulnerability) please send an e-mail directly to the private e-mail feedback@astropy.org.
@keflavich , are you able to advise? Thanks!
Yes, this looks like a bug in convolve
; the convolve_fft
behavior looks correct, and the convolve
behavior is correct if a nan
is present in the data originally. I think a fix is straightforward, either catching this case or removing the special-case for no NaNs in convolve.
Description
astropy.convolution.convolve
returns different results depending on if NaN values are present in the input array or not. If no NaN value is present, then the result has a NaN buffer ofkernel_size//2
. If a NaN value is present, then the result is as expected and matches the output ofastropy.convolution.convolve_fft
.Expected behavior
astropy.convolution.convolve
should not have a NaN buffer ofkernel_size//2
if no NaN value is present in the data. In addition the result should not differ depending on NaN values present in the data or not.How to Reproduce
Versions