geoslegend / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

python-netcdf 1.0.5 unable to read #202

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. from netCDF4 import Dataset
2. fid = Dataset('esrl_surface_flask_prepped_co2.flask.list.KUM_01D0.nc','r')
3. v = fid.variables['NOAA_QC_flags'][:]

What is the expected output? What do you see instead?

I expect to have the character array (699x3) read into the variable v. Instead, 
I get the following error:

TypeError                                 Traceback (most recent call last)
<ipython-input-4-4b28507b70f3> in <module>()
----> 1 v = fid.variables['NOAA_QC_flags'][:]

/home/sbasu/pythonpackages/lib/python2.7/site-packages/netCDF4.so in 
netCDF4.Variable.__getitem__ (netCDF4.c:34558)()

/home/sbasu/pythonpackages/lib/python2.7/site-packages/netCDF4.so in 
netCDF4.Variable._toma (netCDF4.c:35257)()

TypeError: Not implemented for this type

What version of the product are you using? On what operating system?

python-netcdf 1.0.5 with netcdf 4.3.0, on linux x86_64

Please provide any additional information below.

Reading character arrays used to work with python netcdf 1.0.4, and broke in 
1.0.5.

Original issue reported on code.google.com by sourish....@gmail.com on 5 Oct 2013 at 3:02

Attachments:

GoogleCodeExporter commented 8 years ago
I apologise for the incomplete title; I had meant to type "unable to read 
character arrays", but somehow missed the ending.

Original comment by sourish....@gmail.com on 5 Oct 2013 at 3:03

GoogleCodeExporter commented 8 years ago
I verified that this issue exists for python-netcdf 1.0.6 as well.

Original comment by sourish....@gmail.com on 14 Nov 2013 at 5:52

GoogleCodeExporter commented 8 years ago
This is now fixed in SVN, thanks for the report.  It's actually related to 
issue 206, and can be worked around with

v = fid.variables['NOAA_QC_flags'
v.set_auto_maskandscale(False)

before reading the data from the variable.

Original comment by whitaker.jeffrey@gmail.com on 14 Nov 2013 at 1:42

GoogleCodeExporter commented 8 years ago
Checked that the SVN code works for me, thanks!

Original comment by sourish....@gmail.com on 14 Nov 2013 at 4:20

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04