From ddd73a0d23c7cca4585aec26be1ac638392ca36b Mon Sep 17 00:00:00 2001 From: 30hours Date: Mon, 4 Mar 2024 12:02:39 +0000 Subject: [PATCH] Add timestamp_event --- event/algorithm/coordreg/EllipsoidParametric.py | 2 +- event/event.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/event/algorithm/coordreg/EllipsoidParametric.py b/event/algorithm/coordreg/EllipsoidParametric.py index 299340e..f20e0ca 100644 --- a/event/algorithm/coordreg/EllipsoidParametric.py +++ b/event/algorithm/coordreg/EllipsoidParametric.py @@ -81,7 +81,7 @@ class EllipsoidParametric: # find close points - ellipsoid 1 = master radar_keys = list(target_samples[target].keys()) samples_intersect = [] - threshold = 200 + threshold = 500 # loop points in master ellipsoid for point1 in target_samples[target][radar_keys[0]]: diff --git a/event/event.py b/event/event.py index baf9b2e..a7a7c17 100644 --- a/event/event.py +++ b/event/event.py @@ -103,7 +103,12 @@ async def event(): # processing associated_dets = associator.process(item["server"], radar_dict_item) - localised_dets = coordreg.process(associated_dets, radar_dict_item) + associated_dets_3_radars = { + key: value + for key, value in associated_dets.items() + if isinstance(value, list) and len(value) >= 3 + } + localised_dets = coordreg.process(associated_dets_3_radars, radar_dict_item) if associated_dets: print(associated_dets, flush=True) @@ -131,13 +136,14 @@ async def event(): [x_rx, y_rx, z_rx], radar["radar"] ) - points = ellipsoidParametric.sample(ellipsoid, radar["delay"]*1000, 30) + points = ellipsoidParametric.sample(ellipsoid, radar["delay"]*1000, 50) for i in range(len(points)): lat, lon, alt = Geometry.ecef2lla(points[i][0], points[i][1], points[i][2]) points[i] = ([round(lat, 3), round(lon, 3), round(alt)]) ellipsoids[radar["radar"]] = points # output data to API + item["timestamp_event"] = timestamp item["detections_associated"] = associated_dets item["detections_localised"] = localised_dets item["ellipsoids"] = ellipsoids