Initiators¶
-
class
stonesoup.initiator.base.Initiator[source]¶ Bases:
stonesoup.base.BaseInitiator base class
Creates zero or more tracks based on provided detections.
-
abstract
initiate(detections: Set[Detection], timestamp: datetime.datetime, **kwargs) → Set[stonesoup.types.track.Track][source]¶ Generate tracks from detections.
- Parameters
detections (set of
Detection) – Detections used to generate set of trackstimestamp (datetime.datetime) – Current timestamp
- Returns
Tracks generated from detections
- Return type
set of
Track
-
abstract
-
class
stonesoup.initiator.base.GaussianInitiator[source]¶ Bases:
stonesoup.initiator.base.InitiatorGaussian Initiator base class
Base class for initiator’s which initialises tracks with a
GaussianState
-
class
stonesoup.initiator.base.ParticleInitiator[source]¶ Bases:
stonesoup.initiator.base.InitiatorParticle Initiator base class
Base class for initiator’s which initialises tracks with a
ParticleState
-
class
stonesoup.initiator.simple.SinglePointInitiator(prior_state: GaussianState, measurement_model: MeasurementModel)[source]¶ Bases:
stonesoup.initiator.base.GaussianInitiatorSinglePointInitiator class
This uses an
ExtendedKalmanUpdaterto carry out an update using providedprior_statefor each unassociated detection.- Parameters
prior_state (
GaussianState) – Prior state informationmeasurement_model (
MeasurementModel) – Measurement model
-
prior_state: stonesoup.types.state.GaussianState¶ Prior state information
-
measurement_model: stonesoup.models.measurement.base.MeasurementModel¶ Measurement model
-
initiate(detections, timestamp, **kwargs)[source]¶ Initiates tracks given unassociated measurements
- Parameters
detections (set of
Detection) – A list of unassociated detectionstimestamp (datetime.datetime) – Current timestamp
- Returns
A list of new tracks with an initial
GaussianState- Return type
set of
Track
-
class
stonesoup.initiator.simple.SimpleMeasurementInitiator(prior_state: GaussianState, measurement_model: MeasurementModel, skip_non_reversible: bool = False, diag_load: float = 0.0)[source]¶ Bases:
stonesoup.initiator.base.GaussianInitiatorInitiator that maps measurement space to state space
Works for both linear and non-linear co-ordinate input
This initiator utilises the
MeasurementModelmatrix to convertDetectionstate vector and model covariance into state space.Utilises the ReversibleModel inverse function to convert non-linear spherical co-ordinates into Cartesian x/y co-ordinates for use in predictions and mapping.
This then replaces mapped values in the
prior_stateto form the initialGaussianStateof theTrack.The diagonal loading value is used to try to ensure that the estimated covariance matrix is positive definite, especially for subsequent Cholesky decompositions.
- Parameters
prior_state (
GaussianState) – Prior state informationmeasurement_model (
MeasurementModel) – Measurement modelskip_non_reversible (
bool, optional) –diag_load (
float, optional) – Positive float value for diagonal loading
-
prior_state: stonesoup.types.state.GaussianState¶ Prior state information
-
measurement_model: stonesoup.models.measurement.base.MeasurementModel¶ Measurement model
-
initiate(detections, timestamp, **kwargs)[source]¶ Generate tracks from detections.
- Parameters
detections (set of
Detection) – Detections used to generate set of trackstimestamp (datetime.datetime) – Current timestamp
- Returns
Tracks generated from detections
- Return type
set of
Track
-
class
stonesoup.initiator.simple.MultiMeasurementInitiator(prior_state: GaussianState, measurement_model: MeasurementModel, deleter: Deleter, data_associator: DataAssociator, updater: Updater, min_points: int = 2, updates_only: bool = True, initiator: Initiator = None)[source]¶ Bases:
stonesoup.initiator.base.GaussianInitiatorMulti-measurement initiator.
Utilises features of the tracker to initiate and hold tracks temporarily within the initiator itself, releasing them to the tracker once there are multiple detections associated with them enough to determine that they are ‘sure’ tracks.
Utilises simple initiator to initiate tracks to hold -> prevents code duplication.
Solves issue of short-lived single detection tracks being initiated only to then be removed shortly after. Does cause slight delay in initiation to tracker.
- Parameters
prior_state (
GaussianState) – Prior state informationmeasurement_model (
MeasurementModel) – Measurement modeldeleter (
Deleter) – Deleter used to delete the track.data_associator (
DataAssociator) – Association algorithm to pair predictions to detections.updater (
Updater) – Updater used to update the track object to the new state.min_points (
int, optional) – Minimum number of track points required to confirm a track.updates_only (
bool, optional) – Whethermin_pointsonly countsUpdatestates.initiator (
Initiator, optional) – Initiator used to create tracks. If None, aSimpleMeasurementInitiatorwill be created usingprior_stateandmeasurement_model. Otherwise, these attributes are ignored.
-
prior_state: stonesoup.types.state.GaussianState¶ Prior state information
-
measurement_model: stonesoup.models.measurement.base.MeasurementModel¶ Measurement model
-
deleter: stonesoup.deleter.base.Deleter¶ Deleter used to delete the track.
-
data_associator: stonesoup.dataassociator.base.DataAssociator¶ Association algorithm to pair predictions to detections.
-
updater: stonesoup.updater.base.Updater¶ Updater used to update the track object to the new state.
-
updates_only: bool¶ Whether
min_pointsonly countsUpdatestates.
-
initiator: stonesoup.initiator.base.Initiator¶ Initiator used to create tracks. If None, a
SimpleMeasurementInitiatorwill be created usingprior_stateandmeasurement_model. Otherwise, these attributes are ignored.
-
initiate(detections, timestamp, **kwargs)[source]¶ Generate tracks from detections.
- Parameters
detections (set of
Detection) – Detections used to generate set of trackstimestamp (datetime.datetime) – Current timestamp
- Returns
Tracks generated from detections
- Return type
set of
Track
-
class
stonesoup.initiator.simple.GaussianParticleInitiator(initiator: GaussianInitiator, number_particles: int = 200, use_fixed_covar: bool = False)[source]¶ Bases:
stonesoup.initiator.base.ParticleInitiatorGaussian Particle Initiator class
Utilising Gaussian Initiator, sample from the resultant track’s state to generate a number of particles, overwriting with a
ParticleState.- Parameters
initiator (
GaussianInitiator) – Gaussian Initiator which will be used to generate tracks.number_particles (
int, optional) – Number of particles for initial track stateuse_fixed_covar (
bool, optional) – If True, the Gaussian state covariance is used for theParticleStateas a fixed covariance. Default False.
-
initiator: stonesoup.initiator.base.GaussianInitiator¶ Gaussian Initiator which will be used to generate tracks.
-
use_fixed_covar: bool¶ If True, the Gaussian state covariance is used for the
ParticleStateas a fixed covariance. Default False.
-
initiate(detections, timestamp, **kwargs)[source]¶ Initiates tracks given unassociated measurements
- Parameters
detections (set of
Detection) – A list of unassociated detectionstimestamp (datetime.datetime) – Current timestamp
- Returns
A list of new tracks with a initial
ParticleState- Return type
set of
Track
Wrappers¶
-
class
stonesoup.initiator.wrapper.StatesLengthLimiter(initiator: Initiator, max_length: int)[source]¶ Bases:
stonesoup.initiator.base.InitiatorWrapper that defines the length of track history stored in memory
By default Stone Soup stores the track history for all tracks in memory. If running Stone Soup on very large data your application may run out of memory and the process terminated - often by the operating system.
This wrapper converts the states space list to a collections.deque data type with the maximum length specified.
from stonesoup.initiator.wrapper import StatesLengthLimiter initiator = StatesLengthLimiter(<initiator model>, max_length)
- Parameters
initiator (
Initiator) – Stone Soup Initiatormax_length (
int) – Length of track history to be stored in memory
-
initiator: stonesoup.initiator.base.Initiator¶ Stone Soup Initiator
-
initiate(*args, **kwargs)[source]¶ Generate tracks from detections.
- Parameters
detections (set of
Detection) – Detections used to generate set of trackstimestamp (datetime.datetime) – Current timestamp
- Returns
Tracks generated from detections
- Return type
set of
Track