Skip to content

Commit 197966d

Browse files
committed
update
1 parent 1332b88 commit 197966d

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

src/pygrib/_pygrib.pyx

+10-14
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,9 @@ def redtoreg(float_type[:] redgrid_data, int_type[:] lonsperlat, missval=None):
3636
Includes handling of missing values using nearest neighbor interpolation.
3737
"""
3838

39-
#cdef cython.Py_ssize_t nlons = np.max(lonsperlat)
40-
#cdef cython.Py_ssize_t nlats = lonsperlat.shape[0]
41-
cdef int nlons = np.max(lonsperlat)
42-
cdef int nlats = lonsperlat.shape[0]
43-
#cdef cython.Py_ssize_t i,j,indx,ilons,im,ip,nlona
44-
cdef int i,j,indx,ilons,im,ip,nlona
39+
cdef cython.Py_ssize_t nlons = np.max(lonsperlat)
40+
cdef cython.Py_ssize_t nlats = lonsperlat.shape[0]
41+
cdef cython.Py_ssize_t i,j,indx,ilons,im,ip,nlona
4542
cdef float_type zxi, zdx, flons, missvalc
4643
if float_type is float:
4744
float_dtype = np.float32
@@ -1199,15 +1196,14 @@ cdef class gribmessage(object):
11991196
raise RuntimeError(_get_error_message(err))
12001197
return longval
12011198
else: # array
1202-
if os.name == 'nt':
1203-
# this should not be necessary since np.int_ should
1204-
# be platform-dependent long, which should map to 32-bits on windows?
1205-
datarr = np.zeros(size, np.int32)
1206-
else:
1207-
datarr = np.zeros(size, np.int_)
1208-
print('getting long_array',size)
1199+
#if os.name == 'nt':
1200+
# # this should not be necessary since np.int_ should
1201+
# # be platform-dependent long, which should map to 32-bits on windows?
1202+
# datarr = np.zeros(size, np.int32)
1203+
#else:
1204+
# datarr = np.zeros(size, np.int_)
1205+
datarr = np.zeros(size, np.int_)
12091206
err = grib_get_long_array(self._gh, name, <long *>datarr.data, &size)
1210-
print('getting long_array',datarr.min(), datarr.max())
12111207
if err:
12121208
raise RuntimeError(_get_error_message(err))
12131209
if key == 'values':

0 commit comments

Comments
 (0)