@@ -893,24 +893,38 @@ def intern(flag, public_label=False):
893893 labels = [VAR_DESCR [label ]["nc_name" ] for label in labels ]
894894 return labels
895895
896- def match (self , other , intern = False , cmin = 0 ):
896+ def match (self , other , method = "overlap" , intern = False , cmin = 0 , ** kwargs ):
897897 """return index and score compute with area
898898
899899 :param EddiesObservations other: Observations to compare
900+ :param str method:
901+ if method is "overlap" method will use contour to compute score,
902+ if method is "circle" method will apply a formula of circle overlap
900903 :param bool intern: if True, speed contour will be used
901904 :param float cmin: 0 < cmin < 1, return only couple above cmin
905+ :param dict kwargs: look at :py:meth:`vertice_overlap`
902906 :return: return index of couple in self and other and cost value
903907 :rtype: (array(int), array(int), array(float))
904908
905909 .. minigallery:: py_eddy_tracker.EddiesObservations.match
906910 """
907911 x_name , y_name = self .intern (intern )
908- i , j = bbox_intersection (
909- self [x_name ], self [y_name ], other [x_name ], other [y_name ]
910- )
911- c = vertice_overlap (
912- self [x_name ][i ], self [y_name ][i ], other [x_name ][j ], other [y_name ][j ]
913- )
912+ if method == "overlap" :
913+ i , j = bbox_intersection (
914+ self [x_name ], self [y_name ], other [x_name ], other [y_name ]
915+ )
916+ c = vertice_overlap (
917+ self [x_name ][i ],
918+ self [y_name ][i ],
919+ other [x_name ][j ],
920+ other [y_name ][j ],
921+ ** kwargs ,
922+ )
923+ elif method == "close_center" :
924+ i , j , c = close_center (
925+ self .latitude , self .longitude , other .latitude , other .longitude , ** kwargs
926+ )
927+
914928 m = c > cmin
915929 return i [m ], j [m ], c [m ]
916930
0 commit comments