Sunday, May 15, 2011

F1 2011 Turkey Race - Battle Maps

One of the challenges for race viewers arising from this year's seemingly non-stop round of pit stops is knowing who's in what race position at any given time given that the position of cars on track may be all over the place.

One of the chart styles I've been experimenting with tries to capture information about the distance to the cars in front of, and behind, a given car in both race position terms and positions on the track.

Here's one view, showing Hamilton's race:



And here's another, with the actual race position of the focus car overlaid on the diagram:



Here's a view over Button's race:




Without me providing any commentary, for now, about these charts, what information can you get from them? Can you spot where the driver is closing in on the car in the race position ahead? Can you spot where a car is in danger of being passed by a car catching up from behind?

Please let me know in the comments, then I'll post my own commentary...

PS here's the data for this chart, and here's a sample Gnuplot command to create a map like the above:

gnuplot> set term x11
//My mac doesn't display anything with the aqua setting?
gnuplot> set datafile separator ","
//my data file is CSV, so define the separator, just in case...
set driver =3
plot "tur_2011proximity.csv" using ($2==driver ? $1:1/0 ):3 with line title "Position","tur_2011proximity.csv" using ($2==driver ? $1:1/0 ):6 lc rgb "purple" title "Car ahead on track","tur_2011proximity.csv" using ($2==driver ? $1:1/0 ):7 lc rgb "magenta" title "Car behind on track","tur_2011proximity.csv" using ($2==driver ? $1:1/0 ):4 lc rgb "blue" title "Car in position ahead","tur_2011proximity.csv" using ($2==driver ? $1:1/0 ):5 lc rgb "red" title "Car in position behind","tur_2011proximity.csv" using ($2==driver ? $1:1/0 ):8 w line title "Pitstops"

4 comments:

  1. Interesting maps, but I'd say it's hard to spot identity in the charts - where there's a steep descending line of "+" turning into "x" this looks like catching and passing a backmarker, but where the gap to the car in position ahead changes after a pitstop, I've no idea what is that new car ahead - is it the car who was previously behind or someone else, and when do they pit ?

    Perhaps if the different lines were a consistent representation of which car is which (Vettel is the red line, Button is the green line etc) but you still limited the display to car ahead/behind on track and true position, then it might be easier to see who someone was dicing with.

    Nice idea tho.... will come back to it and study some more....

    ReplyDelete
  2. @tim You're right - identity is not consistent within this chart (that's what race history charts are for? And a variant (which I've still to pull together) of a race history chart where the origin is the elapsed time of an arbitrary driver rather than the the leader which would show who a driver was battling with for position throughout the race (though not drivers on other personal laps).

    What I wanted this chart to do was just act as a crib to show, for a particular driver, who might have been directly in sight across each lap and whether they were an opportunity or a threat in terms of possible overtakes. Obviously, in the real race, this might also include taking into account drivers a couple of track and place positions ahead but with a pitstop to come, but I've not started to think about that situation yet!)

    Discontinuities in the line implied by the blue star generally represent the car in front PITtig. Where there is an inplied gradient in the blue star (car in race position ahead) or red box (car in race position behind) this shows a change in distance between the cars lap on lap (the gradient showing the rate at which the cars are closing/getting further away).

    I put the markers in for the cars in track position and behind to show whether the driver had clear air to the car in race position ahead or behind.

    ReplyDelete
  3. At that level then, I guess they work quite well.

    The "+" and "x" markers are nicely less prominent and so provide a useful indicator of back markers being caught and passed (with the angle showing, as you say, the rate at which they're caught) without distracting from the the other more prominent data points and so I guess it does show when someone had clear air in front, or someone on their tail, etc.

    The identity can, as you say, be seen from other types of displays, but to flag up one point for example, the first chart, about lap 21 or 22, right after his pitstop HAM is catching the car close ahead, but also has someone right on his tail for 2 laps - now does it's hard to see if he then overtook the car (so it drops below the line and then drops back as he pulls away) or if the car ahead baulked HAM on its in lap to a pitstop, so the car behind HAM closes up, but then with clear air he pulls away again.

    If there were a faint trace line between any 2 consecutive points where they represent the same car (even if the car were to change "marker type") then it would dis-ambiguate the above interpretations, but of course such lines might in turn clog the chart as to obscure other details.

    And a "grid line" (ie horizontal line) thru the pitstop points might also help those of us who have to hold rulers up to our monitors :) - see also how the marker denoting HAM's first pitstop is mostly obscured by the blue data point and can be easily missed on first reading.

    Might need something a bit more specialist than gnuplot to do some of these so be harder to prototype of course - sorry, not meaning to nitpick.

    Cheers

    ReplyDelete
  4. @tim Thanks for feeding more comments in (the more nit picky the better:-) I tried to pick colours that would push the backmarkers into the background and foreground the race position cars, so I'm glad that worked!

    The order in which points are plotted also makes a difference, I think, so again, this can choose which marker gets emphasised. (I just added links to the data file and sample gnuplot command in the main post if you want to play...)

    To add grid lines to highlight the pitstops, we can do something like the following in gnuplot:

    set grid noytics noxtics x2tics
    set x2range [1:60] //i.e. same as xrange
    set x2tics ("" 9,"" 23, ""34,"" 46) //explicitly mark the pitstops e.g. for BUT
    replot

    As to the dificulty in spotting whether or not there was an overtaking manouver, that was why I added in the position line - as a cross reference to whether there were position changes. I think it would look neater if I did this line using a y2axis maybe below the main graph?

    set y2range [1:24]
    plot "tur_2011proximity.csv" using ($2==driver ?$1:1/0):$4 with line title "Pitstop" axes x1y2

    would be one way, but a mutliplot (e.g. http://t16web.lanl.gov/Kawano/gnuplot/plot6-e.html#5.16 ) may be neater? (So eg have the position trace in a second blot beneath the chart type shown above?)

    I did consider trying to make another mark, eg a tick above the line to show how many places a car moved forward, or below the line to show how many it moved back on each lap (though this also raises the question - should this take into account changes in track position or race position)?

    PS Give me half an hour and I'll put a new post giving an example race chart with any car origin...

    ReplyDelete

There seem to be a few issues with posting comments. I think you need to preview your comment before you can submit it... Any problems, send me a message on twitter: @psychemedia