Skip to content

Commit fe79f1b

Browse files
correction of example
1 parent fe6d3da commit fe79f1b

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

examples/16_network/pet_follow_particle.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,19 @@ def update(frame):
128128
# ^^^^^^^^^^^^^^^^^^
129129
step = 1 / 60.0
130130

131-
x, y = meshgrid(arange(24, 36, step), arange(31, 36, step))
132-
x0, y0 = x.reshape(-1), y.reshape(-1)
133-
# Pre-order to speed up
134-
_, i = group_obs(x0, y0, 1, 360)
135-
x0, y0 = x0[i], y0[i]
136-
137131
t_start, t_end = n.period
138132
dt = 14
139133

140134
shape = (n.obs.size, 2)
141135
# Forward run
142136
i_target_f, pct_target_f = -ones(shape, dtype="i4"), zeros(shape, dtype="i1")
143137
for t in range(t_start, t_end - dt):
144-
particle_candidate(x0, y0, c, n, t, i_target_f, pct_target_f, n_days=dt)
138+
particle_candidate(c, n, step, t, i_target_f, pct_target_f, n_days=dt)
145139

146140
# Backward run
147141
i_target_b, pct_target_b = -ones(shape, dtype="i4"), zeros(shape, dtype="i1")
148142
for t in range(t_start + dt, t_end):
149-
particle_candidate(x0, y0, c, n, t, i_target_b, pct_target_b, n_days=-dt)
143+
particle_candidate(c, n, step, t, i_target_b, pct_target_b, n_days=-dt)
150144

151145
# %%
152146
fig = plt.figure(figsize=(10, 10))

src/py_eddy_tracker/observations/groups.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,6 @@ def create_particles(eddies, step):
137137
def particle_candidate(c, eddies, step_mesh, t_start, i_target, pct, **kwargs):
138138
"""Select particles within eddies, advect them, return target observation and associated percentages
139139
140-
:param np.array(float) x: longitude of particles
141-
:param np.array(float) y: latitude of particles
142140
:param `~py_eddy_tracker.dataset.grid.GridCollection` c: GridCollection with speed for particles
143141
:param GroupEddiesObservations eddies: GroupEddiesObservations considered
144142
:param int t_start: julian day of the advection

0 commit comments

Comments
 (0)