Skip to content

Commit ed41832

Browse files
committed
reduce vertices in case of point duplication
1 parent f9c3061 commit ed41832

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/py_eddy_tracker/observations/observation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2221,6 +2221,7 @@ def grid_count_pixel_in(
22212221
for i_ in range(nb):
22222222
x_, y_, x_ref_ = x[i_], y[i_], x_ref[i_]
22232223
x_ = (x_ - x_ref_) % 360 + x_ref_
2224+
x_, y_ = reduce_size(x_, y_)
22242225
v = create_vertice(x_, y_)
22252226
(x_start, x_stop), (y_start, y_stop) = bbox_indice_regular(
22262227
v,
@@ -2232,7 +2233,6 @@ def grid_count_pixel_in(
22322233
is_circular,
22332234
x_size,
22342235
)
2235-
22362236
i, j = get_pixel_in_regular(v, x_c, y_c, x_start, x_stop, y_start, y_stop)
22372237
grid_count_(grid, i, j)
22382238

src/py_eddy_tracker/poly.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def winding_number_poly(x, y, xy_poly):
209209
# loop through all edges of the polygon
210210
for i_elt in range(nb_elt):
211211
if i_elt + 1 == nb_elt:
212+
# We close polygon with first value (no need to duplicate first value)
212213
x_next = xy_poly[0, 0]
213214
y_next = xy_poly[0, 1]
214215
else:

0 commit comments

Comments
 (0)