NCAR / pynio

PyNIO is a multi-format data I/O package with a NetCDF-style interface
http://www.pyngl.ucar.edu/Nio.shtml
Apache License 2.0
112 stars 37 forks source link

when shape is unexpected, pynio return "check dtype" #39

Open mektpoy opened 4 years ago

mektpoy commented 4 years ago

The error is:

Traceback (most recent call last): File "interp2d.py", line 60, in outf.variables['lat'].assign_value(ersst_lat) File "/etc/anaconda2/envs/ml/lib/python3.8/site-packages/PyNIO/Nio.py", line 444, in assign_value self._obj.assign_value(value) Nio.NIOError: failed to write array (check dtype)

but acctually this caused by wrong numpy.shape

changemode commented 3 years ago

Maybe, You can check data type.I use the np.zeros find the list default type is float64 and i can not write in nc file , so i change the np.zeros dtype is float32, its OK.