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

Performing FFTs of collected data no longer working #76

Open
jtenbarg opened this issue May 15, 2023 · 1 comment
Open

Performing FFTs of collected data no longer working #76

jtenbarg opened this issue May 15, 2023 · 1 comment

Comments

@jtenbarg
Copy link

To see this problem, select a single point in a dataset and collect over several frames to produce, e.g., Bz(x=0,t).

pgkyl 'pkpm_alf_wave_p1-field_[0-9]*.gkyl' interp -b ms -p 1 sel --comp 5 --z0 0. collect fft -p pl

File "/home/tenbarge/postgkyl/postgkyl/commands/fft.py", line 36, in fft
diag.fft(dat, kwargs['psd'], kwargs['iso'], overwrite=True)
File "/home/tenbarge/postgkyl/postgkyl/diagnostics/fft.py", line 22, in fft
grid = np.delete(grid, idx)
File "<array_function internals>", line 200, in delete
File "/home/tenbarge/miniconda3/lib/python3.8/site-packages/numpy/lib/function_base.py", line 5126, in delete
arr = asarray(arr)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.

@jtenbarg
Copy link
Author

This problem arises because numpy no longer accepts ragged arrays. Older versions work, they just give the below warning.

/home/tenbarge/miniconda3/lib/python3.8/site-packages/numpy/lib/function_base.py:5030: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
arr = asarray(arr)

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