dft working with dask but not withouth
See original GitHub issueThe following works:
import numpy as np
import xarray as xr
import xrft
ds = xr.Dataset(coords={'time': ('time', np.arange(3000)*3600.), 'depth': ('depth', np.arange(10))})
ds = ds.assign(u=np.cos(2.*np.pi*2/86400.*ds.time)+0.*ds.depth)
ds = ds.chunk({'depth': 1})
u_fft = xrft.dft(ds.u.fillna(0.), dim=['time'], shift=False, detrend='linear', window=True)
print(u_fft.values)
But turning off chunking does not work:
import numpy as np
import xarray as xr
import xrft
ds = xr.Dataset(coords={'time': ('time', np.arange(3000)*3600.), 'depth': ('depth', np.arange(10))})
ds = ds.assign(u=np.cos(2.*np.pi*2/86400.*ds.time)+0.*ds.depth)
#ds = ds.chunk({'depth': 1})
u_fft = xrft.dft(ds.u.fillna(0.), dim=['time'], shift=False, detrend='linear', window=True)
print(u_fft.values)
And leads to:
(equinox) r2i2n0 datahome/aponte% python test_rft.py
Traceback (most recent call last):
File "test_rft.py", line 9, in <module>
u_fft = xrft.dft(ds.u.fillna(0.), dim=['time'], shift=False, detrend='linear', window=True)
File "/home1/datahome/aponte/xrft/xrft/xrft.py", line 238, in dft
da = _apply_detrend(da, axis_num)
File "/home1/datahome/aponte/xrft/xrft/xrft.py", line 156, in _apply_detrend
da = detrendn(da, axes=axis_num)
File "/home1/datahome/aponte/xrft/xrft/xrft.py", line 100, in detrendn
raise NotImplementedError("Detrending over more than 4 axes is "
NotImplementedError: Detrending over more than 4 axes is not implemented.
This looks like a bug but I could not decipher xrft enough in order to fix it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Dask Best Practices - Dask documentation
This is a short overview of Dask best practices. This document specifically focuses on best practices that are shared among all of the...
Read more >dask.array.fft.rfft
This function computes the one-dimensional n-point discrete Fourier Transform (DFT) of a real-valued array by means of an efficient algorithm called the Fast ......
Read more >Best Practices - Dask documentation
It is easy to get started with Dask delayed, but using it well does require some experience. This page contains suggestions for best...
Read more >dask.array.fft. - Dask documentation
FFT (Fast Fourier Transform) refers to a way the discrete Fourier Transform (DFT) can be calculated efficiently, by using symmetries in the calculated...
Read more >Dask DataFrames Best Practices
It has a schema, and so there's no ambiguity about what types the columns are. This avoids confusing errors. It supports more advanced...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s great when bugs fix themselves! 😄
I’m going to close this issue since the current version of
xrft
doesn’t seem to produce this error.