Skip to content

Commit

Permalink
FIX: Improve the accuracy of utils.delta_time (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamjwhite authored Feb 12, 2024
1 parent b7fe807 commit 7094219
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Binary file modified fastf1/tests/mpl-baseline/test_doc_example_delta_time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion fastf1/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def mini_pro(stream):
)

ltime = mini_pro(comp['Time'].dt.total_seconds().to_numpy())
ldistance = mini_pro(comp['Distance'].to_numpy())
multiplier = ref.Distance.iat[-1]/comp.Distance.iat[-1]
ldistance = mini_pro(comp['Distance'].to_numpy())*multiplier
lap_time = np.interp(ref['Distance'], ldistance, ltime)

delta = lap_time - ref['Time'].dt.total_seconds()
Expand Down

0 comments on commit 7094219

Please sign in to comment.