@@ -626,7 +626,7 @@ def split_network(self, intern=True, **kwargs):
626
626
local_ids ["next_obs" ][m ] += i_s
627
627
return ids
628
628
629
- def set_tracks (self , x , y , ids , window ):
629
+ def set_tracks (self , x , y , ids , window , ** kwargs ):
630
630
"""
631
631
Will split one group in tracks
632
632
@@ -645,20 +645,20 @@ def set_tracks(self, x, y, ids, window):
645
645
# If observation already in one track, we go to the next one
646
646
if used [i ]:
647
647
continue
648
- self .follow_obs (i , track_id , used , ids , x , y , * time_index , window )
648
+ self .follow_obs (i , track_id , used , ids , x , y , * time_index , window , ** kwargs )
649
649
track_id += 1
650
650
# Search a possible ancestor
651
- self .previous_obs (i , ids , x , y , * time_index , window )
651
+ self .previous_obs (i , ids , x , y , * time_index , window , ** kwargs )
652
652
653
653
@classmethod
654
- def follow_obs (cls , i_next , track_id , used , ids , * args ):
654
+ def follow_obs (cls , i_next , track_id , used , ids , * args , ** kwargs ):
655
655
while i_next != - 1 :
656
656
# Flag
657
657
used [i_next ] = True
658
658
# Assign id
659
659
ids ["track" ][i_next ] = track_id
660
660
# Search next
661
- i_next_ = cls .next_obs (i_next , ids , * args )
661
+ i_next_ = cls .next_obs (i_next , ids , * args , ** kwargs )
662
662
if i_next_ == - 1 :
663
663
break
664
664
ids ["next_obs" ][i_next ] = i_next_
@@ -674,7 +674,7 @@ def follow_obs(cls, i_next, track_id, used, ids, *args):
674
674
i_next = i_next_
675
675
676
676
@staticmethod
677
- def previous_obs (i_current , ids , x , y , time_s , time_e , time_ref , window ):
677
+ def previous_obs (i_current , ids , x , y , time_s , time_e , time_ref , window , ** kwargs ):
678
678
time_cur = ids ["time" ][i_current ]
679
679
t0 , t1 = time_cur - 1 - time_ref , max (time_cur - window - time_ref , 0 )
680
680
for t_step in range (t0 , t1 - 1 , - 1 ):
@@ -688,9 +688,9 @@ def previous_obs(i_current, ids, x, y, time_s, time_e, time_ref, window):
688
688
if len (ii ) == 0 :
689
689
continue
690
690
c = zeros (len (xj ))
691
- c [ij ] = vertice_overlap (xi [ii ], yi [ii ], xj [ij ], yj [ij ], minimal_area = True )
691
+ c [ij ] = vertice_overlap (xi [ii ], yi [ii ], xj [ij ], yj [ij ], ** kwargs )
692
692
# We remove low overlap
693
- c [c < 0.1 ] = 0
693
+ c [c < 0.01 ] = 0
694
694
# We get index of maximal overlap
695
695
i = c .argmax ()
696
696
c_i = c [i ]
@@ -702,7 +702,7 @@ def previous_obs(i_current, ids, x, y, time_s, time_e, time_ref, window):
702
702
break
703
703
704
704
@staticmethod
705
- def next_obs (i_current , ids , x , y , time_s , time_e , time_ref , window ):
705
+ def next_obs (i_current , ids , x , y , time_s , time_e , time_ref , window , ** kwargs ):
706
706
time_max = time_e .shape [0 ] - 1
707
707
time_cur = ids ["time" ][i_current ]
708
708
t0 , t1 = time_cur + 1 - time_ref , min (time_cur + window - time_ref , time_max )
@@ -719,9 +719,9 @@ def next_obs(i_current, ids, x, y, time_s, time_e, time_ref, window):
719
719
if len (ii ) == 0 :
720
720
continue
721
721
c = zeros (len (xj ))
722
- c [ij ] = vertice_overlap (xi [ii ], yi [ii ], xj [ij ], yj [ij ], minimal_area = True )
722
+ c [ij ] = vertice_overlap (xi [ii ], yi [ii ], xj [ij ], yj [ij ], ** kwargs )
723
723
# We remove low overlap
724
- c [c < 0.1 ] = 0
724
+ c [c < 0.01 ] = 0
725
725
# We get index of maximal overlap
726
726
i = c .argmax ()
727
727
c_i = c [i ]
0 commit comments