@@ -516,7 +516,7 @@ def basic_formula_ellips_major_axis(lats, cmin=1.5, cmax=10., c0=1.5, lat1=13.5,
516
516
m = abs_lats > lat1
517
517
m += abs_lats < lat2
518
518
519
- major_axis [- m ] = a * abs_lats [- m ] + b
519
+ major_axis [~ m ] = a * abs_lats [~ m ] + b
520
520
if not degrees :
521
521
major_axis *= 111.2
522
522
return major_axis
@@ -583,7 +583,7 @@ def solve_simultaneous(cost):
583
583
584
584
@staticmethod
585
585
def solve_first (cost , multiple_link = False ):
586
- mask = - cost .mask
586
+ mask = ~ cost .mask
587
587
# Count number of link by self obs and other obs
588
588
self_links = mask .sum (axis = 1 )
589
589
other_links = mask .sum (axis = 0 )
@@ -607,7 +607,7 @@ def solve_first(cost, multiple_link=False):
607
607
# Cost to resolve conflict
608
608
cost_reduce = cost [i_self_keep ][:, i_other_keep ]
609
609
shape = cost_reduce .shape
610
- nb_conflict = (- cost_reduce .mask ).sum ()
610
+ nb_conflict = (~ cost_reduce .mask ).sum ()
611
611
logging .debug ('Shape conflict matrix : %s, %d conflicts' , shape , nb_conflict )
612
612
613
613
if nb_conflict >= (shape [0 ] + shape [1 ]):
@@ -647,8 +647,6 @@ def tracking(self, other):
647
647
mask_accept_dist = self .mask_function (other )
648
648
indexs_closest = where (mask_accept_dist )
649
649
650
- # self.across_ground(self.obs[indexs_closest[0]], other.obs[indexs_closest[1]])
651
-
652
650
cost_values = self .cost_function (
653
651
self .obs [indexs_closest [0 ]],
654
652
other .obs [indexs_closest [1 ]],
@@ -726,58 +724,6 @@ def elements(self):
726
724
elements .extend (['track' , 'segment_size' , 'dlon' , 'dlat' ])
727
725
return elements
728
726
729
- @classmethod
730
- def init_move_function (cls , obs_a , obs_b , out ):
731
- """Store information to init move function
732
- """
733
- out ['dlon' ] = obs_b ['lon' ] - obs_a ['lon' ]
734
- out ['dlat' ] = obs_b ['lat' ] - obs_a ['lat' ]
735
-
736
- @classmethod
737
- def move_function (cls , obs_a , obs_b , out ):
738
- """Basic move on the previous one
739
- Position N-2 : A
740
- Position N-1 : B
741
- Forecast Position : C
742
-
743
- New position C = B + AB
744
- """
745
- out ['lon' ] = obs_b ['lon' ] + out ['dlon' ]
746
- out ['lat' ] = obs_b ['lat' ] + out ['dlat' ]
747
-
748
- @classmethod
749
- def forecast_move (cls , obs_a , obs_b , out ):
750
- """Forecast move of an eddy
751
- work to do
752
- """
753
- # New dead
754
- for key in obs_b .dtype .fields .keys ():
755
- # Copy all parameters (which are not listed below)
756
- # from the previous observations
757
- if key in ['lon' , 'lat' , 'time' , 'segment_size' ,
758
- 'dlon' , 'dlat' ] or 'contour_' in key :
759
- continue
760
- out [key ] = obs_b [key ]
761
- cls .init_move_function (obs_a , obs_b , out )
762
- cls .move_function (obs_a , obs_b , out )
763
-
764
- # Previous dead eddies
765
- # Add previous virtual
766
- if nb_virtual_extend > 0 :
767
- obs_to_extend = self .previous_virtual_obs .obs [i_virtual_dead_id
768
- ][alive_virtual_obs ]
769
- for key in obs_b .dtype .fields .keys ():
770
- if key in ['lon' , 'lat' , 'time' , 'track' , 'segment_size' ,
771
- 'dlon' , 'dlat' ] or 'contour_' in key :
772
- continue
773
- out [key ][nb_dead :] = obs_to_extend [key ]
774
- out ['lon' ][nb_dead :] = obs_to_extend ['lon' ] + obs_to_extend ['dlon' ]
775
- out ['lat' ][nb_dead :] = obs_to_extend ['lat' ] + obs_to_extend ['dlat' ]
776
- out ['track' ][nb_dead :] = obs_to_extend ['track' ]
777
- out ['segment_size' ][nb_dead :] = obs_to_extend ['segment_size' ]
778
- # Count
779
- out ['segment_size' ][:] += 1
780
-
781
727
782
728
class TrackEddiesObservations (EddiesObservations ):
783
729
"""Class to practice Tracking on observations
0 commit comments