analysis.algorithms.point_matching module

analysis.algorithms.point_matching.match_points_to_particles(ppn_points: numpy.ndarray, particles: List[analysis.classes.Particle.Particle], semantic_type=None, ppn_distance_threshold=2)[source]

Function for matching ppn points to particles.

For each particle, match ppn_points that have hausdorff distance less than <threshold> and inplace update particle.ppn_candidates

If semantic_type is set to a class integer value, points will be matched to particles with the same predicted semantic type.

Parameters
  • ppn_points ((N x 4 np.array)) – PPN point array with (coords, point_type)

  • particles (list of <Particle> objects) – List of particles for which to match ppn points.

  • semantic_type (int) – If set to an integer, only match ppn points with prescribed semantic type

  • ppn_distance_threshold (int or float) – Maximum distance required to assign ppn point to particle.

Returns

Return type

None (operation is in-place)

analysis.algorithms.point_matching.get_track_endpoints(particle: analysis.classes.Particle.Particle, verbose=False)[source]

Function for getting endpoints of tracks (DEPRECATED)

Using ppn_candiates attached to <Particle>, get two endpoints of tracks by farthest distance from the track’s spatial centroid.

Parameters
  • particle (<Particle> object) – Track particle for which to obtain endpoint coordinates

  • verbose (bool) – If set to True, output print message indicating whether particle has no or only one PPN candidate.

Returns

endpoints – Xyz coordinates of two endpoints predicted or manually found by network.

Return type

(2, 3) np.array

analysis.algorithms.point_matching.get_track_endpoints_centroid(particle)[source]

Helper function for getting track endpoints.

Computes track endpoints without ppn predictions by selecting the farthest two points from the coordinate centroid.

Parameters

particle (<Particle> object) –

Returns

endpoints – Xyz coordinates of two endpoints predicted or manually found by network.

Return type

(2, 3) np.array

analysis.algorithms.point_matching.get_shower_startpoint(particle: analysis.classes.Particle.Particle, verbose=False)[source]

Function for getting startpoint of EM showers. (DEPRECATED)

Using ppn_candiates attached to <Particle>, get one startpoint of shower by nearest hausdorff distance.

Parameters
  • particle (<Particle> object) – Track particle for which to obtain endpoint coordinates

  • verbose (bool) – If set to True, output print message indicating whether particle has no or only one PPN candidate.

Returns

endpoints – Xyz coordinates of two endpoints predicted or manually found by network.

Return type

(2, 3) np.array