You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Presently, the function 'cwt' does not operate on complex input data. It calls '_check_dtype,' which causes a downcast to float, discarding the imaginary part of the input data. It is relatively simple to add 'complex' to the list of allowed dtypes inside '_check_dtype'; I have done it on my local copy and it works just fine afterwards.
The text was updated successfully, but these errors were encountered:
Thanks for raising this issue. The discrete wavelet transform routines currently also use that _check_dtype utility and the C code for convolution does not currently support complex data types. The cwt routine does not have this problem as it uses np.convolve which supports complex data types. I think a reasonable solution would be to just make a _check_dtype_cwt that has the behavior you describe and leave the _check_dtype cython function as is for now.
Are you interested in making a PR for this? I don't think it would even be necessary to have _check_dtype_cwt be in a Cython file. It could just be a function within cwt.py itself.
That said, in PR #300 I did add C99 complex support to the C-code convolution routines and the complex types you mention are included within _check_dtype as part of that PR. That PR is mainly concerned with the discrete transform (to remove the need for calling the transforms on the real and imaginary parts of the data independently as in the lines here). That PR has been stalled for a bit pending a decision on how best to handle detection of C99 support (which is lacking in MSVC), but if merged would also resolve the issue raised in this PR.
Presently, the function 'cwt' does not operate on complex input data. It calls '_check_dtype,' which causes a downcast to float, discarding the imaginary part of the input data. It is relatively simple to add 'complex' to the list of allowed dtypes inside '_check_dtype'; I have done it on my local copy and it works just fine afterwards.
The text was updated successfully, but these errors were encountered: