Skip to content

Commit 52422b8

Browse files
committed
add gaussian filtering in eddy_Detection
1 parent 88fcdc8 commit 52422b8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/py_eddy_tracker/dataset/grid.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,8 @@ def eddy_identification(
613613
force_speed_unit=None,
614614
vorticity_name='vrt',
615615
mle=1,
616+
filtering=False,
617+
filtering_scale=30,
616618
**kwargs,
617619
):
618620
"""
@@ -676,7 +678,7 @@ def eddy_identification(
676678
data = 1e10 * self.grid(grid_height).astype("f8")
677679
else:
678680
data = self.grid(grid_height).astype("f8")
679-
681+
680682
if grid_height in ['ow']:
681683
# Get vorticity as an aditional field (to identify cyc/acyc)
682684
vrt = self.grid(vorticity_name, indexs=self.indexs).astype('f8')
@@ -687,9 +689,13 @@ def eddy_identification(
687689
data.mask = zeros(data.shape, dtype="bool")
688690
data.mask[isnan(data)] = 1
689691

692+
if filtering and grid_height in ['zeta']:
693+
data = data - gaussian_filter(data, filtering_scale)
694+
690695
# we remove noisy information
691696
if precision is not None:
692697
data = (data / precision).round() * precision
698+
693699
# Compute levels for ssh/okubo
694700
if z_min is None or z_max is None:
695701
if grid_height in ['ow']:

0 commit comments

Comments
 (0)