Deleters

class stonesoup.deleter.base.Deleter(delete_last_pred: bool = False)[source]

Bases: Base

Deleter base class.

Proposes tracks for deletion.

Parameters:

delete_last_pred (bool, optional) – Remove the state that caused a track to be deleted if it is a prediction.

delete_last_pred: bool

Remove the state that caused a track to be deleted if it is a prediction.

abstract check_for_deletion(track: Track, **kwargs) bool[source]

Check if a given track should be deleted.

Parameters:

track (Track) – A track object to be checked for deletion.

Returns:

True if track should be deleted, False otherwise.

Return type:

bool

delete_tracks(tracks: Set[Track], **kwargs) Set[Track][source]

Generic/Base track deletion method.

Iterates through all tracks in a given list and calls check_for_deletion() to determine which tracks should be deleted and which should survive.

Parameters:

tracks (set of Track) – A set of Track objects

Returns:

Set of tracks proposed for deletion.

Return type:

set of Track

Error Based

Contains collection of error based deleters

class stonesoup.deleter.error.CovarianceBasedDeleter(covar_trace_thresh: float, delete_last_pred: bool = False, mapping: Sequence[int] = None)[source]

Bases: Deleter

Track deleter based on covariance matrix size.

Deletes tracks whose state covariance matrix (more specifically its trace) exceeds a given threshold.

Parameters:
  • covar_trace_thresh (float) – Covariance matrix trace threshold

  • delete_last_pred (bool, optional) – Remove the state that caused a track to be deleted if it is a prediction.

  • mapping (Sequence[int], optional) – Track state vector indices whose corresponding covariances’ sum is to be considered. Defaults toNone, whereby the entire track covariance trace is considered.

covar_trace_thresh: float

Covariance matrix trace threshold

mapping: Sequence[int]

Track state vector indices whose corresponding covariances’ sum is to be considered. Defaults toNone, whereby the entire track covariance trace is considered.

check_for_deletion(track, **kwargs)[source]

Check if a given track should be deleted

A track is flagged for deletion if the trace of its state covariance matrix is higher than covar_trace_thresh.

Parameters:

track (Track) – A track object to be checked for deletion.

Returns:

True if track should be deleted, False otherwise.

Return type:

bool

delete_last_pred: bool

Remove the state that caused a track to be deleted if it is a prediction.

delete_tracks(tracks: Set[Track], **kwargs) Set[Track]

Generic/Base track deletion method.

Iterates through all tracks in a given list and calls check_for_deletion() to determine which tracks should be deleted and which should survive.

Parameters:

tracks (set of Track) – A set of Track objects

Returns:

Set of tracks proposed for deletion.

Return type:

set of Track

Time Based

Contains collection of time based deleters

class stonesoup.deleter.time.UpdateTimeStepsDeleter(time_steps_since_update: int, delete_last_pred: bool = False)[source]

Bases: Deleter

Update Time based deleter

Identify tracks for deletion which an Update has occurred in last time_steps_since_update.

Parameters:
  • time_steps_since_update (int) – Maximum time steps since last update

  • delete_last_pred (bool, optional) – Remove the state that caused a track to be deleted if it is a prediction.

time_steps_since_update: int

Maximum time steps since last update

check_for_deletion(track, **kwargs)[source]

Delete track without update with measurements within time steps

Parameters:

track (Track) – Track to check for deletion

Returns:

False if track has an Update with measurements within time steps; True otherwise.

Return type:

bool

delete_last_pred: bool

Remove the state that caused a track to be deleted if it is a prediction.

delete_tracks(tracks: Set[Track], **kwargs) Set[Track]

Generic/Base track deletion method.

Iterates through all tracks in a given list and calls check_for_deletion() to determine which tracks should be deleted and which should survive.

Parameters:

tracks (set of Track) – A set of Track objects

Returns:

Set of tracks proposed for deletion.

Return type:

set of Track

class stonesoup.deleter.time.UpdateTimeDeleter(time_since_update: timedelta, delete_last_pred: bool = False)[source]

Bases: Deleter

Update Time based deleter

Identify tracks for deletion which time of last Update with measurements is greater than time_since_update.

Parameters:
  • time_since_update (datetime.timedelta) – Maximum time since last update

  • delete_last_pred (bool, optional) – Remove the state that caused a track to be deleted if it is a prediction.

time_since_update: timedelta

Maximum time since last update

check_for_deletion(track, timestamp=None, **kwargs)[source]

Delete track based on time of last update with measurements

Parameters:
  • track (Track) – Track to check for deletion

  • timestamp (datetime.datetime, optional) – Timestamp to calculate deletion time from. Default None, where the track’s latest timestamp will be used.

Returns:

False if track has an Update with measurements within time; True otherwise.

Return type:

bool

delete_last_pred: bool

Remove the state that caused a track to be deleted if it is a prediction.

delete_tracks(tracks: Set[Track], **kwargs) Set[Track]

Generic/Base track deletion method.

Iterates through all tracks in a given list and calls check_for_deletion() to determine which tracks should be deleted and which should survive.

Parameters:

tracks (set of Track) – A set of Track objects

Returns:

Set of tracks proposed for deletion.

Return type:

set of Track

Multi

Contains deleters which use a composite of deleters to decide whether a track is to be deleted

class stonesoup.deleter.multi.CompositeDeleter(deleters: Collection[Deleter], delete_last_pred: bool = False, intersect: bool = True)[source]

Bases: Deleter

Track deleter composed of multiple deleters.

If intersect is True, deletes tracks if they satisfy the deletion conditions of each deleter listed in deleters. Otherwise deletes tracks if they satisfy the conditions of at least one deleter listed.

Parameters:
  • deleters (Collection[Deleter]) – List of deleters to be applied to the track

  • delete_last_pred (bool, optional) – Remove the state that caused a track to be deleted if it is a prediction.

  • intersect (bool, optional) – Boolean that determines whether the composite deleter will intersect or unify deletion results. Default is True, applying an intersection.

deleters: Collection[Deleter]

List of deleters to be applied to the track

intersect: bool

Boolean that determines whether the composite deleter will intersect or unify deletion results. Default is True, applying an intersection.

check_for_deletion(track, **kwargs)[source]

Check if a given track should be deleted.

Parameters:

track (Track) – A track object to be checked for deletion.

Returns:

True if track should be deleted, False otherwise.

Return type:

bool

delete_last_pred: bool

Remove the state that caused a track to be deleted if it is a prediction.

delete_tracks(tracks: Set[Track], **kwargs) Set[Track]

Generic/Base track deletion method.

Iterates through all tracks in a given list and calls check_for_deletion() to determine which tracks should be deleted and which should survive.

Parameters:

tracks (set of Track) – A set of Track objects

Returns:

Set of tracks proposed for deletion.

Return type:

set of Track