-
Notifications
You must be signed in to change notification settings - Fork 259
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
nc4tonc3 chokes on least_significant_digit attribute #15
Comments
From whitaker.jeffrey@gmail.com on April 06, 2009 08:22:41 David: I just tried it on a file containing a variable with a -Jeff |
From david.huard on April 06, 2009 08:59:51 The file is 2Gb... I'll have a go at finding the bug. |
From david.huard on April 06, 2009 09:44:41 Okay, I'm on a 64 bits machine, so the dtype of the least_siginificant_digit is One solution is to open ncfile3 using netCDF3.Dataset, instead of netCDF4.Dataset, |
From david.huard on April 06, 2009 09:58:52 if array is 64 bit integers, cast to 32 bit integers
Is another, simpler, option. |
From whitaker.jeffrey@gmail.com on April 06, 2009 12:50:24 Just committed that, can you try it out and let me know? |
From david.huard on April 06, 2009 13:57:01 Looks good. |
From whitaker.jeffrey@gmail.com on May 25, 2009 05:58:26 Status: Verified |
From david.huard on April 06, 2009 08:15:20
I just needed an utility to convert netcdf4 to netcdf3 and noticed you
added it a couple of days ago !
I tried it and noticed it got
Traceback (most recent call last):
File "/usr/local/bin/nc4tonc3", line 114, in
nc3tonc4(filename4,filename3,clobber=overwritefile,quiet=quiet)
File "/usr/local/bin/nc4tonc3", line 37, in nc3tonc4
setattr(var,attname,getattr(ncvar,attname))
File "netCDF4.pyx", line 1804, in netCDF4.Variable.setattr
(netCDF4.c:12598)
File "netCDF4.pyx", line 714, in netCDF4._set_att (netCDF4.c:3020)
AttributeError: NetCDF: Not a valid data type or _FillValue type mismatch
So I added those lines to nc4tonc3.py the script see what happened
getattr(ncvar, attname)
and I got
huardda@angus:~/forcing/wind/80$ nc4tonc3 geowinds.nc geowinds.nc3
copying global attributes ..
copying dimensions ..
copying variable lat
copying variable uwnd
Could not set attribute least_significant_digit : 6
The uwnd variable is created using
That is, my netcdf variable is generated with
uwnd = root.createVariable('uwnd','f4',('time','y','x',),
zlib=True,least_significant_digit=6)
If you can't guess what the problem is right away, I'll hunt it later on.
Original issue: http://code.google.com/p/netcdf4-python/issues/detail?id=15
The text was updated successfully, but these errors were encountered: