diff --git a/event/algorithm/localisation/EllipseParametric.py b/event/algorithm/localisation/EllipseParametric.py index f65d19d..0ab2acb 100644 --- a/event/algorithm/localisation/EllipseParametric.py +++ b/event/algorithm/localisation/EllipseParametric.py @@ -103,6 +103,9 @@ class EllipseParametric: if valid_point: samples_intersect.append(point1) + if len(samples_intersect) == 0: + continue + average_point = Geometry.average_points(samples_intersect) samples_intersect = [average_point] @@ -132,7 +135,7 @@ class EllipseParametric: if min_point1 is not None: samples_intersect.append(min_point1) else: - return output + continue else: print('Invalid method.') @@ -142,8 +145,6 @@ class EllipseParametric: output[target] = {} output[target]["points"] = [] for i in range(len(samples_intersect)): - print('err??', flush=True) - print(samples_intersect, flush=True) samples_intersect[i] = Geometry.ecef2lla( samples_intersect[i][0], samples_intersect[i][1], diff --git a/event/algorithm/localisation/EllipsoidParametric.py b/event/algorithm/localisation/EllipsoidParametric.py index 741412a..588edd6 100644 --- a/event/algorithm/localisation/EllipsoidParametric.py +++ b/event/algorithm/localisation/EllipsoidParametric.py @@ -100,12 +100,12 @@ class EllipsoidParametric: if valid_point: samples_intersect.append(point1) + if len(samples_intersect) == 0: + continue + average_point = Geometry.average_points(samples_intersect) samples_intersect = [average_point] - if len(samples_intersect) == 0: - return output - elif self.method == "minimum": min_distance = self.threshold @@ -132,7 +132,7 @@ class EllipsoidParametric: if min_point1 is not None: samples_intersect.append(min_point1) else: - return output + continue else: print('Invalid method.') @@ -141,6 +141,10 @@ class EllipsoidParametric: # remove duplicates and convert to LLA output[target] = {} output[target]["points"] = [] + + print('test', flush=True) + print(samples_intersect, flush=True) + for i in range(len(samples_intersect)): samples_intersect[i] = Geometry.ecef2lla( samples_intersect[i][0], diff --git a/script/plot_accuracy.py b/script/plot_accuracy.py index 34f1d21..6625ae2 100644 --- a/script/plot_accuracy.py +++ b/script/plot_accuracy.py @@ -99,8 +99,8 @@ def main(): method_localisation = method["localisation"] # override skip a method - if method_localisation == "spherical-intersection": - continue + #if method_localisation == "spherical-intersection": + #continue if method_localisation not in position: position[method_localisation] = {}