MHT
- class ssapy.correlate_tracks.MHT(data, nsat=1000, truth=None, hypotheses=None, propagator=None, mode='rv', fitonly=None, approximate=False, orbitattr=None, priors=None)[source][source]
Bases:
object
Multiple Hypothesis Tracking of many hypotheses explaining data.
This class manages the assessment of which hypothesis are most likely to explain data, building a set of tracks observation by observation.
Initialize the MHT with the data, do mht.run(), and inspect the most likely hypotheses using [h.lnprob for h in mht.hypotheses].
- Parameters:
data (array_like[N]) – data to model. Must contain angles of observations, observer locations and velocities, times, detection IDs, etc.
nsat (int) – total number of satellites in the sky. Affects the overall prior and the preference for new tracks vs. additional assignments to existing tracks.
truth (dict) – when true assignments are known, this argument can provide debug information about when the tracker has lost the true assignment
hypotheses (list of Hypothesis) – initialize the MHT with this existing list of Hypotheses. Default None.
propagator (instance of ssa Propagator) – propagator to use. Default to None (Keplerian)
fitonly (ndarray[N] bool) – entries in data to fit
Methods Summary
add_tracklet
(satid, **kw)Add an observation from data to the MHT analysis.
flag_inconsistency
(track2hyp, hyp)Debug method checking to see if there are any inconsistencies between the tracks tracked by the MHT and the hypotheses tracked by the MHT.
prune
(satid[, nkeepmax, pkeep, ...])Prune unlikely hypotheses from the MHT.
prune_stale_hypotheses
(newdeadtracks)Prune hypotheses that are different from better hypotheses only in dead tracks.
prune_tracks
(satid[, nconfirm])Prune tracks that are now nearly identical from the MHT analysis.
run
([first, last, verbose, order])Run the MHT analysis.
Methods Documentation
- add_tracklet(satid, **kw)[source][source]
Add an observation from data to the MHT analysis.
- Parameters:
satid (int) – the ID of the observation to add.
- static flag_inconsistency(track2hyp, hyp)[source][source]
Debug method checking to see if there are any inconsistencies between the tracks tracked by the MHT and the hypotheses tracked by the MHT. Should only be needed for debugging.
Every hypothesis in track2hyp[track] should include the Track track. Every hypothesis in hyp should be in the list of track2hyp[track] for each of its tracks. Every track should be in a hypothesis.
- Parameters:
track2hyp (dict[Track -> list(Hypothesis)]) –
hyp (list(Hypothesis)) –
- Return type:
True if everything is consistent.
- prune(satid, nkeepmax=10000, pkeep=1e-09, keeponlytrue=False, nconfirm=6)[source][source]
Prune unlikely hypotheses from the MHT.
- Parameters:
satid (int) – the detection ID most recently added to the MHT
nkeepmax (int) – keep no more than nkeepmax hypotheses
pkeep (float) – keep no hypotheses more than pkeep times less likely than the most likely hypothesis
keeponlytrue (bool) – keep only the single hypothesis known to be true for speed comparison purposes.
nconfirm (int) – only keep one variant of tracks that agree in the last nconfirm detections
- prune_stale_hypotheses(newdeadtracks)[source][source]
Prune hypotheses that are different from better hypotheses only in dead tracks.
Note: implentation relies on identical tracks always having the same id. The MHT code tries to guarantee this—otherwise it must do extra work matching identical tracks to new detections, etc. But using id(Track) feels horrible to me.
- prune_tracks(satid, nconfirm=6)[source][source]
Prune tracks that are now nearly identical from the MHT analysis.
As the MHT adds observations to tracks, eventually some tracks have a number of confirming observations. For these long tracks, we really only need to keep different Tracks and Hypotheses for cases where there are recent disagreements with how those tracks continue; if hypotheses agree that the track continues in the same way, we don’t need to continue tracking the past differences. So we prune out cases of former disagreement.
This tries to identify such overlapping tracks and keep only one of them.