new gpr
This commit is contained in:
@@ -50,7 +50,7 @@ def collection_has_gpr_payloads(collection: ResultCollection) -> bool:
|
||||
|
||||
|
||||
def gpr_object_rows(collection: ResultCollection) -> np.ndarray:
|
||||
"""Return object rows as `[x_m, z_m, pair_count]` from a GPR collection."""
|
||||
"""Return object rows as `[x_m, z_m, score]` from a GPR collection."""
|
||||
points_payload = collection_payload_by_name(collection, "gpr_points", kind=4)
|
||||
if points_payload is not None:
|
||||
points = np.asarray(points_payload.table, dtype=np.float32)
|
||||
@@ -68,17 +68,17 @@ def gpr_object_rows(collection: ResultCollection) -> np.ndarray:
|
||||
|
||||
def locator_observations_from_collection(
|
||||
collection: ResultCollection,
|
||||
min_pair_count: float,
|
||||
min_score: float,
|
||||
*,
|
||||
visible_bounds: tuple[float, float, float, float] | None = None,
|
||||
) -> list[dict[str, float]]:
|
||||
"""Build locator observations from GPR rows using pair threshold and optional X/Z bounds."""
|
||||
"""Build locator observations from GPR rows using score threshold and optional X/Z bounds."""
|
||||
rows = gpr_object_rows(collection)
|
||||
if rows.size == 0:
|
||||
return []
|
||||
|
||||
finite_mask = np.all(np.isfinite(rows[:, :3]), axis=1)
|
||||
visible_mask = finite_mask & (rows[:, 2] >= float(min_pair_count))
|
||||
visible_mask = finite_mask & (rows[:, 2] >= float(min_score))
|
||||
if visible_bounds is not None:
|
||||
x_min, x_max, z_min, z_max = (float(value) for value in visible_bounds)
|
||||
visible_mask &= (
|
||||
@@ -90,7 +90,7 @@ def locator_observations_from_collection(
|
||||
filtered = rows[visible_mask]
|
||||
|
||||
observations: list[dict[str, float]] = []
|
||||
for x_m, z_m, _pair_count in filtered:
|
||||
for x_m, z_m, _score in filtered:
|
||||
observations.append(
|
||||
{
|
||||
"dst": round(float(z_m), 2),
|
||||
|
||||
@@ -27,15 +27,13 @@ class ProcessingLiveConfig:
|
||||
gpr_output_positions: list[int] | None = None
|
||||
gpr_min_depth_m: float = 2.0
|
||||
gpr_max_depth_m: float = 14.0
|
||||
gpr_comp_power: float = 0.2
|
||||
gpr_range_comp_power: float = 0.28
|
||||
gpr_angle_comp_power: float = 0.10
|
||||
gpr_start_freq_mhz: float = 3000.0
|
||||
gpr_stop_freq_mhz: float = 6000.0
|
||||
gpr_speed_m_s: float = 0.0
|
||||
gpr_look_angle_deg: float = 0.0
|
||||
gpr_snr_thresh: float = 4.5
|
||||
gpr_snr_comp_max: float = 25.0
|
||||
gpr_background_subtract_enabled: bool = True
|
||||
gpr_background_mean_count: int = 10
|
||||
gpr_remove_sidelobe_objects_enabled: bool = True
|
||||
history_command_seq: int = 0
|
||||
history_command: str = "none"
|
||||
|
||||
@@ -69,15 +67,13 @@ class ProcessingLiveConfig:
|
||||
"gpr_output_positions": [int(value) for value in self.gpr_output_positions],
|
||||
"gpr_min_depth_m": float(self.gpr_min_depth_m),
|
||||
"gpr_max_depth_m": float(self.gpr_max_depth_m),
|
||||
"gpr_comp_power": float(self.gpr_comp_power),
|
||||
"gpr_range_comp_power": float(self.gpr_range_comp_power),
|
||||
"gpr_angle_comp_power": float(self.gpr_angle_comp_power),
|
||||
"gpr_start_freq_mhz": float(self.gpr_start_freq_mhz),
|
||||
"gpr_stop_freq_mhz": float(self.gpr_stop_freq_mhz),
|
||||
"gpr_speed_m_s": float(self.gpr_speed_m_s),
|
||||
"gpr_look_angle_deg": float(self.gpr_look_angle_deg),
|
||||
"gpr_snr_thresh": float(self.gpr_snr_thresh),
|
||||
"gpr_snr_comp_max": float(self.gpr_snr_comp_max),
|
||||
"gpr_background_subtract_enabled": bool(self.gpr_background_subtract_enabled),
|
||||
"gpr_background_mean_count": int(self.gpr_background_mean_count),
|
||||
"gpr_remove_sidelobe_objects_enabled": bool(self.gpr_remove_sidelobe_objects_enabled),
|
||||
"history_command_seq": int(self.history_command_seq),
|
||||
"history_command": str(self.history_command),
|
||||
}
|
||||
|
||||
@@ -183,14 +183,14 @@ class LocatorTcpService:
|
||||
def publish_collection(
|
||||
self,
|
||||
collection: ResultCollection,
|
||||
min_pair_count: float,
|
||||
min_score: float,
|
||||
*,
|
||||
visible_bounds: tuple[float, float, float, float] | None = None,
|
||||
) -> None:
|
||||
"""Publish one locator payload derived from a GPR result collection."""
|
||||
observations = locator_observations_from_collection(
|
||||
collection,
|
||||
min_pair_count,
|
||||
min_score,
|
||||
visible_bounds=visible_bounds,
|
||||
)
|
||||
payload = build_locator_payload(
|
||||
|
||||
Reference in New Issue
Block a user