Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
- change parameter in particle_candidate
- add test for mask in contains
- minor english
  • Loading branch information
CoriPegliasco committed May 26, 2021
commit 3d705bec3cc46969c62f6416b1ae64061d9b6da3
4 changes: 2 additions & 2 deletions src/py_eddy_tracker/observations/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ def date2file(julian_day):
_t,
i_target_f,
pct_target_f,
delta_t=dt_advect,
n_days=dt_advect,
)

itf_final[slice_track] = i_target_f
Expand Down Expand Up @@ -1495,7 +1495,7 @@ def date2file(julian_day):
_t,
i_target_b,
pct_target_b,
delta_t=-dt_advect,
n_days=-dt_advect,
)

itb_final[slice_track] = i_target_b
Expand Down
3 changes: 2 additions & 1 deletion src/py_eddy_tracker/observations/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,8 @@ def contains(self, x, y, intern=False):
xname, yname = self.intern(intern)
m = ~(isnan(x) + isnan(y))
i = -ones(x.shape, dtype="i4")
if x.size != 0:

if x.size != 0 and True in m:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use m.any() instead of True in m

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

i[m] = poly_indexs(x[m], y[m], self[xname], self[yname])
return i

Expand Down
4 changes: 2 additions & 2 deletions src/py_eddy_tracker/poly.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ def poly_indexs(x_p, y_p, x_c, y_c):
"""
Index of contour for each postion inside a contour, -1 in case of no contour

:param array x_p: longitude to test (must be define, no nan)
:param array y_p: latitude to test (must be define, no nan)
:param array x_p: longitude to test (must be defined, no nan)
:param array y_p: latitude to test (must be defined, no nan)
:param array x_c: longitude of contours
:param array y_c: latitude of contours
"""
Expand Down