Closed winash12 closed 6 years ago
What is the shape of the array uwnd850
as reported by the uwnd850.shape
attribute?
It is 73,144.
Then you are telling prep_data
it has 4 dimensions (t
, y
, z
, x
) when it only has 2... What are you expecting will happen? If the data array is already just lat-lon then you don't need to call prep_data
.
I am getting the above error for a netCDF file with this ordering of dimensions - time,lat,lev,lon
and in my code I have this order -
uwnd, uwnd_info = prep_data(uwnd850, 'tyzx') vwnd, vwnd_info = prep_data(vwnd850, 'tyzx')
Traceback (most recent call last): File "monsoon_index.py", line 86, in
uwnd, uwnd_info = prep_data(uwnd850, 'tyzx')
File "/usr/local/lib/python3.5/dist-packages/windspharm-1.5.1-py3.5.egg/windspharm/tools.py", line 97, in prep_data
pdata, intorder = __order_dims(data, dimorder)
File "/usr/local/lib/python3.5/dist-packages/windspharm-1.5.1-py3.5.egg/windspharm/tools.py", line 35, in __order_dims
d = np.rollaxis(d, lonpos)
File "/usr/lib/python3/dist-packages/numpy/core/numeric.py", line 1450, in rollaxis
raise ValueError(msg % ('axis', axis, n))
ValueError: rollaxis: axis (3) must be >=0 and < 2
So line 86 is this line - uwnd, uwnd_info = prep_data(uwnd850, 'tyzx')