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

FFT not working for 2D signals #95

Open
magnunor opened this issue Jan 23, 2017 · 1 comment
Open

FFT not working for 2D signals #95

magnunor opened this issue Jan 23, 2017 · 1 comment

Comments

@magnunor
Copy link
Contributor

Pressing the FFT button for the signal s = hs.signals.Signal2D(np.random.random(size=(100,100))) gives:

Traceback (most recent call last):
  File "/home/magnunor/.virtualenvs/hyperspy_dev/lib/python3.5/site-packages/hyperspyui/plugins/fft.py", line 167, in fft
    for i in do_ffts():
  File "/home/magnunor/.virtualenvs/hyperspy_dev/lib/python3.5/site-packages/hyperspyui/plugins/fft.py", line 149, in do_ffts
    if u.endswith('-1'):
AttributeError: '_Undefined' object has no attribute 'endswith'
@magnunor
Copy link
Contributor Author

The changes in this commit fixes this, but its quite sloppy: magnunor@7124b1e

The fs.data = np.abs(fs.data) is due to matplotlib not being able to handle imaginary data.

The if str(u.__class__) == "<class 'traits.trait_base._Undefined'>": is due to the traits.trait_base._Undefined class not having an .endswith function.

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

1 participant