PySport/kloppy

[Opta] Fix end coordinates of deflected passes

probberechts opened this issue · 0 comments

Opta inserts a "unintentional ball touch" event (type_id=61 + outcome=0) after passes that are deflected and sets the end location of the pass to the location where it got deflected. As a consequence, there are gaps in the data. I am not sure what all other providers do, but StatsBomb uses the real end location and tags the pass as "deflected". I propose to set the end location of the deflected pass to the start location of the next action and the outcome to "success" if the deflected pass reached a teammate.


Example

Take this example from Fulham vs Arsenal on 12th March 2023. Trossard provided a cross to Martinelli, who scored a header. However, the cross was touched by Kenny Tete so Opta registered it as a failed cross that ends where Tete touched it.

image

You can watch the video of this phase here: https://youtu.be/fn74_qPjQU4?t=48

And this is a plot of the phase:
image