Monday, May 16, 2011

F1 2011 Turkey Race - Elapsed Time Difference Chart With any Car Origin

One of the issues that has come up looking at the Battle Maps (proximity charts?) is that it's difficult to tell which cars a driver is battling with, or indeed identify any of the other cars to see whether they are passed e.g. in a close battle situation with cars in front and behind.

One chart that will show that is a modification of the race history/elapsed time difference chart where the origin is the car of interest, and the times for other cars are plotted as elapsed time of focus car - elapsed time of other car. Below is the elapsed time delta map for HAM:



Note that when HAM pits, we get a sudden increase (move up the chart/positive y-direction) in the delta for most of the other cars. When another car pits, there is a large move down the chart (negative y direction) for that car's trace. We can explicitly add grid lines to the graph to highlight when HAM pits:



We can also modify the axes to zoom in on a the close fought action:



Note however that these charts don't show the on-track position of backmarkers which were displayed on the battle map.

The data for generating these charts can be found here. An example gnuplot command for generating the chart is as follows:

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...
focusCar=4 //this is actually the column number in the Elapsed Time file, *not* the driver number
srcfile='tur_2011elapsedtimes.csv'
set grid noxtics x2tics noytics
set xrange [1:70]
set x2range [1:70]
set yrange [-50:50]
set x2tics ("" 9,"" 20,""34,"" 46)
plot srcfile using ($1):(column(focusCar) -$2) with lines title "VET",srcfile using ($1):(column(focusCar) -$3) with lines title "WEB",srcfile using ($1):(column(focusCar) -$4) with lines title "HAM",srcfile using ($1):(column(focusCar) -$5) with lines title "BUT",srcfile using ($1):(column(focusCar) -$6) with lines title "ALO",srcfile using ($1):(column(focusCar) -$7) with lines title "MAS",srcfile using ($1):(column(focusCar) -$8) with lines title "SCH",srcfile using ($1):(column(focusCar) -$9) with lines title "ROS",srcfile using ($1):(column(focusCar) -$10) with lines title "HEI",srcfile using ($1):(column(focusCar) -$11) with lines title "PET",srcfile using ($1):(column(focusCar) -$12) with lines title "BAR",srcfile using ($1):(column(focusCar) -$13) with lines title "MAL",srcfile using ($1):(column(focusCar) -$14) with lines title "SUT",srcfile using ($1):(column(focusCar) -$15) with lines title "RES",srcfile using ($1):(column(focusCar)-$16) with lines title "KOB",srcfile using ($1):(column(focusCar)-$17) with lines title "PER",srcfile using ($1):(column(focusCar)-$18) with lines title "BUE",srcfile using ($1):(column(focusCar)-$19) with lines title "ALG",srcfile using ($1):(column(focusCar)-$20) with lines title "TRU",srcfile using ($1):(column(focusCar)-$21) with lines title "KOV",srcfile using ($1):(column(focusCar)-$22) with lines title "KAR",srcfile using ($1):(column(focusCar)-$23) with lines title "LIU",srcfile using ($1):(column(focusCar)-$24) with lines title "GLO",srcfile using ($1):(column(focusCar)-$25) with lines title "AMB"


(Hmm... can I force gnuplot to use column headers as titles, somehow, rather than explicitly setting them?)

Note the use of the gnuplot column() command to allow us to set as a parameter which car we want to set as the focus car/car at the origin.

1 comment:

  1. These maps are very useful for viewing the story of a single driver - and what's interesting is that the lines of "distant" cars (ie not the 3 or 4 cars ahead and behind at any one point) is that the mass of other traces provide contextual info (as you note) about when somebody pitted or slowed "against the pack".

    So this larger context lets you see if someone is just slowing compared to the cars immediately ahead and behind speeding up, and when they're slowing compared to the entire pack (eg tyres wearing out, had an off, caught in traffic etc).

    But of course a mass of lines makes for a lot of noise, especially when the angles get steep (and the eye gets tricked into seeing the "gap" between 2 lines as a perpendicular to the line rather than a perpendicular to the axis).

    So it would require post-processing the graph (your gnuplot scripting skills make me jealous already) but for example, if the lines were SVG, I'd look at having the car immediately ahead and behind at each point at 100% opacity, the cars 2 ahead and 2 behind at 75% opacity, then 50%, and then maybe all the others at 25% opacity.

    In effect, plot the points for the end of each lap at the correct opacity for relative position that lap, and then draw the connecting line to the next datapoint at the opacity of the start/end/mean of the two.

    (Or do it with line thickness)

    This might get back to you clarity of the battle maps, but still provide the larger context of the rest of the pack (and you can see the battles against individuals as a particular line fades in and fades out).

    Of course it's hard to show the effect of backmarkers on such a graph compared to the battle maps, unless you were to extend the Y axis and plot a seperate line plotted at 0 - "target car lap time", and then when you'd be able to see when this line caught and passed a back marker...

    Might see if I can generate this as purely SVG (won't have all the gnuplot niceties) and see what it looks like...

    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