sidescanpy.targets.score#

Score candidate targets (e.g. detector output) against a reference catalog.

match_targets() pairs each candidate with at most one catalog target within a distance, closest pairs first, and reports hits, false alarms and misses with precision and recall. Distances are geodesic on the WGS84 ellipsoid, so both lists need latitude and longitude.

2026 rshomberg@uri.edu

Contents

TargetMatch

Candidates matched to a catalog.

match_targets

Match candidate targets to a reference catalog by position.

class sidescanpy.targets.score.TargetMatch(max_distance_m, min_score, matches=<factory>, false_alarms=<factory>, misses=<factory>, skipped_candidates=<factory>, skipped_catalog=<factory>)#

Bases: object

Candidates matched to a catalog.

Attributes:
max_distance_mfloat

Largest distance accepted as a match.

min_scorefloat or None

Candidates scoring below this were left out before matching.

matcheslist of (int, int, float)

(candidate index, catalog index, distance in metres), one per hit, indices into the lists given to match_targets().

false_alarmslist of int

Candidates with no catalog target in range (indices).

misseslist of int

Catalog targets no candidate matched (indices).

skipped_candidates, skipped_cataloglist of int

Entries without a position, or (candidates) below min_score; not counted in precision or recall.

property precision#

Hits over scored candidates (NaN when there are none).

property recall#

Hits over positioned catalog targets (NaN when there are none).

summary()#

One line: hits, false alarms, misses, precision and recall.

sidescanpy.targets.score.match_targets(candidates, catalog, *, max_distance_m, min_score=None)#

Match candidate targets to a reference catalog by position.

Every candidate-catalog pair within max_distance_m is a possible match; pairs are accepted closest first, and each candidate and each catalog target is used at most once. Category is not compared.

Parameters:
candidatessequence of Target

E.g. detector output from boxes_to_targets(); their extra_attributes["score"] is used with min_score.

catalogsequence of Target

The reference (ground truth) targets.

max_distance_mfloat

Largest distance (m) between a candidate and its catalog target.

min_scorefloat, optional

Leave out candidates scoring below this (candidates without a score are kept).

Returns:
TargetMatch