dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
384 stars 126 forks source link

Function to linearly interpolate state mutable sequences #865

Closed gawebb-dstl closed 9 months ago

gawebb-dstl commented 9 months ago

The function will take a StateMutableSequence and a times: List[datetime.datetime]. The function will create a new StateMutableSequence with states only at the times specified by times

gawebb-dstl commented 9 months ago

I've looked at 4 options (see code). All 4 options run function correctly. Option 4 is the quickest* so will be taken forward

Output when running the file:

Option 1 took 3.9378470000000005
Option 2 took 79.7136048
Option 3 took 1.762432000000004
Option 4 took 1.326851700000006
Option 1 worked
Option 2 worked
Option 3 worked
Option 4 worked

*Option 3 is quicker if all of the states need to be produced by interpolation

gawebb-dstl commented 9 months ago

See #872 for a new version of this pull request