diff --git a/src/trackers.py b/src/trackers.py index 555e14b4ce30920a7d6803a09a579071a2a92057..9f4ed2f5da9bc7c4cbdf42b6b80d1791f6d90066 100644 --- a/src/trackers.py +++ b/src/trackers.py @@ -804,29 +804,3 @@ def get_association_matrix(meas, tracks, logic_params, gater): py = stats.multivariate_normal.pdf(val_meas.squeeze().T, mean=yhat.flatten(), cov=H@track['P'][-1]@H.T+track['filt'].sensor_model['R']) association_matrix[validation_matrix[:, ti], ti] = np.log(track['filt'].sensor_model['PD']*py/(1-track['filt'].sensor_model['PD'])) # PG assumed = 1 return association_matrix, validation_matrix - -### Obsolete -def compute_prob(association_matrix, validation_matrix, logic_params): - # Association matrix is assumed to consist of tracks and FA, no NT. - ny = association_matrix.shape[0] - ntracks = association_matrix.shape[1]-ny - P = np.zeros((ny, ntracks)) - - def rec_find_associations(association_matrix, assoc_done, logic_params): - inds = np.where(association_matrix[0, :] != -np.inf)[0] # These are the nodes necessary to look at - this_assoc = [] - for k, i in enumerate(inds): - if i not in assoc_done: - if association_matrix.shape[0] != 1: - assoc = rec_compute_prob(association_matrix[1:, :], [[i]], logic_params) - this_assoc.extend(assoc) - else: - this_assoc.append([i]) - result = [] - for assoc in assoc_done: - for th_assoc in this_assoc: - result.append(assoc + th_assoc) - return result - - possible_associations = rec_find_associations(association_matrix, [[]], logic_params) # Recursively finds possible measurement hypothesis - return res