@@ -618,7 +618,7 @@ def bbox_indice(self, vertices):
618
618
dist , idx = self .index_interp .query (vertices , k = 1 )
619
619
i_y = idx % self .x_c .shape [1 ]
620
620
i_x = int_ ((idx - i_y ) / self .x_c .shape [1 ])
621
- return slice (i_x .min () - self .N , i_x .max () + self .N + 1 ), slice (i_y .min () - self .N , i_y .max () + self .N + 1 )
621
+ return slice (int ( i_x .min () - self .N ), int ( i_x .max () + self .N + 1 )) , slice (int ( i_y .min () - self .N ), int ( i_y .max () + self .N + 1 ) )
622
622
623
623
def get_pixels_in (self , contour ):
624
624
slice_x , slice_y = self .bbox_indice (contour .vertices )
@@ -628,13 +628,13 @@ def get_pixels_in(self, contour):
628
628
i_x , i_y = where (mask )
629
629
i_x += slice_x .start
630
630
i_y += slice_y .start
631
- return i_x , i_y
631
+ return int ( i_x ), int ( i_y )
632
632
633
633
def nearest_grd_indice (self , x , y ):
634
634
dist , idx = self .index_interp .query ((x , y ), k = 1 )
635
635
i_y = idx % self .x_c .shape [1 ]
636
636
i_x = int_ ((idx - i_y ) / self .x_c .shape [1 ])
637
- return i_x , i_y
637
+ return int ( i_x ), int ( i_y )
638
638
639
639
def compute_pixel_path (self , x0 , y0 , x1 , y1 ):
640
640
pass
@@ -719,8 +719,8 @@ def bbox_indice(self, vertices):
719
719
lat_min , lat_max = lat .min (), lat .max ()
720
720
i_x0 , i_y0 = self .nearest_grd_indice (lon_min , lat_min )
721
721
i_x1 , i_y1 = self .nearest_grd_indice (lon_max , lat_max )
722
- slice_x = slice (i_x0 - self .N , i_x1 + self .N + 1 )
723
- slice_y = slice (i_y0 - self .N , i_y1 + self .N + 1 )
722
+ slice_x = slice (int ( i_x0 - self .N ), int ( i_x1 + self .N + 1 ) )
723
+ slice_y = slice (int ( i_y0 - self .N ), int ( i_y1 + self .N + 1 ) )
724
724
return slice_x , slice_y
725
725
726
726
def get_pixels_in (self , contour ):
0 commit comments