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

read_netcdf.py giving VaueError Need between 2 and (32) array objects (inclusive). #1

Open
nishadhka opened this issue Jan 30, 2014 · 1 comment

Comments

@nishadhka
Copy link

Hi,
Thank you very much for this script. While converting wrfout file (a file without having any .nc extension), I am getting error like this, please guide me to solve this hinder.
$ python read_netcdf.py
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Warning 1: No UNIDATA NC_GLOBAL:Conventions attribute
Traceback (most recent call last):
File "read_netcdf.py", line 130, in
p0 = numpy.choose(data_positions - 1, data_p)
File "/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 297, in choose
return choose(choices, out=out, mode=mode)
ValueError: Need between 2 and (32) array objects (inclusive).

Regards,
Nishadh

@nishadhka
Copy link
Author

Hi,
In line 130
p0 = numpy.choose(data_positions - 1, data_p)
data_p is a three dimensional array, seems giving error. Making data_p into a two dimensional array clears the error to convert netcdf file into geotiff without all other calculations.

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