I am having problems when converting numpy float arrays using the prep_data command with recent versions of windpharm. The following code:
import numpy as np
from windspharm.tools import prep_data
u = np.zeros([180,360], np.float)
uwnd, uwnd_info = prep_data(u, 'yx')
Causes the following error:
Traceback (most recent call last):
File "test.py", line 9, in <module>
uwnd, uwnd_info = prep_data(u, 'yx')
File "/home/tom/tmp/windpharm-bug/two/windspharm/lib/windspharm/tools.py", line 98, in prep_data
pdata, intshape = __reshape(pdata)
File "/home/tom/tmp/windpharm-bug/two/windspharm/lib/windspharm/tools.py", line 46, in __reshape
out = d.reshape(d.shape[:2] + (np.prod(d.shape[2:]),))
TypeError: 'numpy.float64' object cannot be interpreted as an index
With numpy 1.12 and 1.13 (anaconda nomkl installs).
I am having problems when converting numpy float arrays using the prep_data command with recent versions of windpharm. The following code:
Causes the following error:
With numpy 1.12 and 1.13 (anaconda nomkl installs).
However, I may be using prep_data incorrectly?