16
16
You should have received a copy of the GNU General Public License
17
17
along with py-eddy-tracker. If not, see <http://www.gnu.org/licenses/>.
18
18
19
- Copyright (c) 2014-2015 by Evan Mason
19
+ Copyright (c) 2014-2017 by Evan Mason and Antoine Delepoulle
20
20
21
21
===========================================================================
22
22
23
+ observations.py
23
24
24
- py_eddy_tracker_amplitude.py
25
-
26
- Version 2.0.3
25
+ Version 3.0.0
27
26
28
27
===========================================================================
29
28
@@ -509,7 +508,7 @@ def solve_conflict(cost):
509
508
510
509
@staticmethod
511
510
def solve_simultaneous (cost ):
512
- mask = - cost .mask
511
+ mask = ~ cost .mask
513
512
# Count number of link by self obs and other obs
514
513
self_links = mask .sum (axis = 1 )
515
514
other_links = mask .sum (axis = 0 )
@@ -533,7 +532,7 @@ def solve_simultaneous(cost):
533
532
# Cost to resolve conflict
534
533
cost_reduce = cost [i_self_keep ][:, i_other_keep ]
535
534
shape = cost_reduce .shape
536
- nb_conflict = (- cost_reduce .mask ).sum ()
535
+ nb_conflict = (~ cost_reduce .mask ).sum ()
537
536
logging .debug ('Shape conflict matrix : %s, %d conflicts' , shape , nb_conflict )
538
537
539
538
if nb_conflict >= (shape [0 ] + shape [1 ]):
@@ -637,7 +636,7 @@ def tracking(self, other):
637
636
dist [mask_accept_dist ])
638
637
639
638
cost_mat = ma .empty (mask_accept_dist .shape , dtype = 'f4' )
640
- cost_mat .mask = - mask_accept_dist
639
+ cost_mat .mask = ~ mask_accept_dist
641
640
cost_mat [mask_accept_dist ] = cost_values
642
641
643
642
i_self , i_other = self .solve_function (cost_mat )
@@ -727,8 +726,8 @@ def filled_by_interpolation(self, mask):
727
726
var = field [0 ]
728
727
if var in ['n' , 'virtual' , 'track' ] or var in self .array_variables :
729
728
continue
730
- self .obs [var ][mask ] = interp (index [mask ], index [- mask ],
731
- self .obs [var ][- mask ])
729
+ self .obs [var ][mask ] = interp (index [mask ], index [~ mask ],
730
+ self .obs [var ][~ mask ])
732
731
733
732
def extract_longer_eddies (self , nb_min , nb_obs , compress_id = True ):
734
733
"""Select eddies which are longer than nb_min
0 commit comments