Skip to content

Commit 0201274

Browse files
committed
Filtering correction about out dtype
1 parent df873cd commit 0201274

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/py_eddy_tracker/dataset/grid.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ def convolve_filter_with_dynamic_kernel(self, grid, kernel_func, lat_max=85, ext
10181018
nb_lines = self.y_c.shape[0]
10191019
dt = list()
10201020

1021-
debug_active = logger.getLogger().getEffectiveLevel() == logging.DEBUG
1021+
debug_active = logger.getEffectiveLevel() == logging.DEBUG
10221022

10231023
for i, lat in enumerate(self.y_c):
10241024
if abs(lat) > lat_max or data[:, i].mask.all():
@@ -1066,9 +1066,13 @@ def convolve_filter_with_dynamic_kernel(self, grid, kernel_func, lat_max=85, ext
10661066
if len(dt) == 100:
10671067
dt.pop(0)
10681068
if extend:
1069-
return ma.array(data_out, mask=data_out.mask)
1069+
out = ma.array(data_out, mask=data_out.mask)
10701070
else:
1071-
return ma.array(data_out, mask=data.mask + data_out.mask)
1071+
out = ma.array(data_out, mask=data.mask + data_out.mask)
1072+
print()
1073+
if out.dtype != data.dtype:
1074+
return out.astype(data.dtype)
1075+
return out
10721076

10731077
def lanczos_high_filter(self, grid_name, wave_length, order=1, lat_max=85):
10741078
data_out = self.convolve_filter_with_dynamic_kernel(

0 commit comments

Comments
 (0)