Skip to content
Merged
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
optimisation on time
  • Loading branch information
ludwigVonKoopa committed Mar 19, 2021
commit c4ad072c582d6b2efb487218f7ec85950fcb4c05
8 changes: 5 additions & 3 deletions src/py_eddy_tracker/observations/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,16 @@ def event_timeline(self, ax, field=None, method=None, factor=1, colors_mode="rol

# TODO : fill mappables dict
y_seg = dict()
_time = self.time

if field is not None and method != "all":
for i, b0, _ in self.iter_on("segment"):
y = self[field][i]
if y.shape[0] != 0:
y_seg[b0] = y.mean() * factor
mappables = dict()
for i, b0, b1 in self.iter_on("segment"):
x = self.time[i]
x = _time[i]
if x.shape[0] == 0:
continue

Expand Down Expand Up @@ -532,7 +534,7 @@ def event_timeline(self, ax, field=None, method=None, factor=1, colors_mode="rol
else y_seg[seg_next]
)
)
ax.plot((x[-1], self.time[i_n]), (y0, y1), **event_kw)[0]
ax.plot((x[-1], _time[i_n]), (y0, y1), **event_kw)[0]
events["merging"].append((x[-1], y0))

if i_p != -1:
Expand All @@ -548,7 +550,7 @@ def event_timeline(self, ax, field=None, method=None, factor=1, colors_mode="rol
else y_seg[seg_previous]
)
)
ax.plot((x[0], self.time[i_p]), (y0, y1), **event_kw)[0]
ax.plot((x[0], _time[i_p]), (y0, y1), **event_kw)[0]
events["spliting"].append((x[0], y0))

j += 1
Expand Down