Skip to content

Commit e479827

Browse files
committed
update grid for zooming with roms outputs and ow
1 parent 38f7bf2 commit e479827

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/py_eddy_tracker/dataset/grid.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,7 @@ def load(self):
385385
"""
386386
x_name, y_name = self.coordinates
387387
with Dataset(self.filename) as h:
388+
388389
self.x_dim = h.variables[x_name].dimensions
389390
self.y_dim = h.variables[y_name].dimensions
390391

@@ -665,11 +666,11 @@ def eddy_identification(
665666
precision /= factor
666667

667668
# Get ssh grid
668-
data = self.grid(grid_height).astype("f8")
669+
data = 1e10*self.grid(grid_height).astype("f8")
669670

670671
if grid_height in ['ow']:
671672
# Get vorticity as an aditional field (to identify cyc/acyc)
672-
vrt = self.grid(vorticity_name, indexs=dict(xi_u=slice(None),eta_v=slice(None))).astype('f8')
673+
vrt = self.grid(vorticity_name, indexs=self.indexs).astype('f8')
673674
if vorticity_name=='vrt': vrt = self.psi2rho(vrt)
674675

675676
# In case of a reduced mask
@@ -706,7 +707,7 @@ def eddy_identification(
706707
z_min, z_max = z_min_p, z_max_p
707708

708709
print('step1 z_min, z_max, step',z_min, z_max, step) #debug
709-
levels = arange(z_min - z_min % step, z_max - z_max % step + 2 * step, step)
710+
levels = arange(z_min - z_min % step, z_max - z_max % step + step, step)
710711

711712
# Get x and y values
712713
x, y = self.x_c, self.y_c
@@ -803,7 +804,6 @@ def eddy_identification(
803804

804805
# Here the considered contour passed shape_error test, masked_pixels test,
805806
# values strictly above (AEs) or below (CEs) the contour, number_pixels test)
806-
807807
# Compute amplitude
808808
reset_centroid, amp = self.get_amplitude(
809809
contour,
@@ -815,6 +815,7 @@ def eddy_identification(
815815
mle=mle,
816816
**kwargs,
817817
)
818+
818819
# If we have a valid amplitude
819820
if (not amp.within_amplitude_limits()) or (amp.amplitude == 0):
820821
contour.reject = 4
@@ -985,6 +986,7 @@ def get_uavg(
985986
all_contours.iter(start=level_start + step, step=step)
986987
):
987988
level_contour = coll.get_nearest_path_bbox_contain_pt(centlon_e, centlat_e)
989+
988990
# Leave loop if no contours at level
989991
if level_contour is None:
990992
break
@@ -1078,6 +1080,7 @@ class UnRegularGridDataset(GridDataset):
10781080
def load(self):
10791081
"""Load variable (data)"""
10801082
x_name, y_name = self.coordinates
1083+
10811084
with Dataset(self.filename) as h:
10821085
self.x_dim = h.variables[x_name].dimensions
10831086
self.y_dim = h.variables[y_name].dimensions
@@ -1091,7 +1094,8 @@ def load(self):
10911094
self.y_c = self.vars[y_name]
10921095

10931096
self.init_pos_interpolator()
1094-
1097+
1098+
10951099
@property
10961100
def bounds(self):
10971101
"""Give bounds"""

0 commit comments

Comments
 (0)