Trying and trying and trying

Since early last April I’ve been working with a fascinating textual artist called Gethan Dick (who’s previously worked on creating text murals for Brockwell Lido, amongst other things). Gethan’s Wellcome-trust funded mission over the last year has been to visit six life  scientists (microbiologists, geneticists, neuroscientists and medical physicists like me) and learn about their work. These six expeditions then turned into six pieces of prose; each piece of prose was set to a piece of music composed by a different set of musicians (beatboxers, singer-songwriters, noisy rock bands…) – the result is called Trying and Trying and Trying.

So where do I fit in? Well, in my previous life I was a medical physicist at the National Medical Laser Centre, specifically interested in using light for disease diagnosis. Gethan visited me and had the opportunity to see some of the work we do – and we talked a lot about the technical aspects of light scattering. One of the ideas she became excited about was the analogy between the atmospheric scattering which makes the sky blue and the scattering in tissue that we use to detect anomalies – so the title of her piece became “to light, you are the same as the sky”. I love the way that this makes the human body as beautiful on a fundamental level as the sky. By making us a force of nature, it also flips the narrative of disease. Disease is usually presented as being intentional, being deliberately destructive, having agency – a set of concepts which don’t really hold up when you think about them, but can instil dread and fear in sufferers. But, if we’re just the same as the sky, disease is just a cloud passing over – no more malign or intentional than a spring shower.

In a twist of fate, I also played guitar with The Overdrive Orchestra on the music recorded for this piece, and will do so live at the launch night at Brixton Jamm on Feb 23rd. This is going to be a very diverse night of music, and is worth £3 of anyone’s money – so please come along and see the culmination of a very cool, very innovative project.

London Bike Hire Scheme – animating your journey to work

(edit: I’ve updated the video to include the river and the larger parks – thanks again to Ollie O’Brien for this)

I’ve been working with Ollie O’Brien here in CASA on this animation showing hire bike journeys on October 4th 2010, the day of a major tube strike, and hence a very popular day for the London Bicycle Hire Scheme.

We gleaned this data from the public available first one million journeys (actually nearly 1.4 million journeys) – detailing the start and end stands,  start time and duration for each individual trip (this data runs from late July to November, but we’ve just looked at October 4th so far). Ollie has the positions of each stand, and was able to calculate the shortest reasonable route for each combination – as there are upwards of 350 stands, that’s over 100,000 potential routes! By dividing the route length by the duration of the journey, we were able to calculate an average speed for each trip.

In the visualization, the fixed circles represent stands – when a stand flashes red, it means that one or more bikes have left it -  and a yellow flash means a bike has arrived. The bikes themselves are represented by the Boris Barclays Blue Tadpoles whizzing around – leaving at the right time, travelling at their correct average speed, and taking a (generally) realistic route.

Bikes which start and end and the same place are represented by the tadpole circling around the stand a few times and then disappearing – faster circling means the bike was not used for very long; a slower orbit means the bike was out for longer.

There are a few provisos -  the route finding is not always 100% accurate (though it’s very good 99% of the time, but the Embankment proves confusing). I’ve yet to test the “number of bikes active” statistic properly – but I’ve reason to think it should be accurate most of the time. There is the occasional “blip” – bikes taking ten minutes to cross London – which could be due to bad data, or possibly the funny vans that redistribute them. We will no doubt tweak these on subsequent versions, and for the technically minded we can talk about the approach we used in more detail in future posts.

I think on that particular day I walked for 40 minutes before I could find a spare bike, and somewhere around Wenlock Rock I found a single usable bicycle in a rack of six dysfunctional ones and took furiously to the road. Hindsight is always 20/20.

Rank Clocks: showing time as time

Showing data as a time series enables us to see “data paths” – to simultaneously observe past, present and future, and to begin to spot trends. However, sometimes overloading an already complex graphic with a persistent time series will make the graphic dense and unusable.

So what about representing time as time? Represent the passage of time via the updating of the graphic – essentially some form of animation (obviously, this isn’t possible for a static graphic, e.g. in a printed article). To my eyes, this can have the effect of accentuating dynamics and, by mapping time onto time, sometimes giving a more realistic sense of the process occurring, especially when related to spatial flows.

The example below is drawn from Mike Batty and Ollie O’Brien’s excellent recent work on Rank Clocks. The concept behind a rank clock is that of a polar time-series of “rank”. So, the time axis proceeds in a circle from 0 to 360 degrees, and the distance from the centre charts the value being measured. In a Rank Clock, the value being measured is the rank of something in a set of similar objects – so in the example below, the top 20 Japanese cities (by population) are plotted by rank. The lower the rank, the larger the rank value, and the further it appears from the centre – so Tokyo is 1st and appears close to the centre, the city which is 20th appears 20 times further from the centre.

Given that Rank Clocks have the word “clock” in the description, I wanted to animate it to map time onto time. As I said before, this has the effect of accentuating some of the fast dynamics – and it becomes immediately obvious how stable the biggest cities are well out of the long tail. The software offers tools for the user to select the rank range of interest (they can view all 300+ cities if desired, but messiness ensues), at what timepoint the colour scheme is decided, the speed of the sweep, and the background alpha value (see below).

The way the tool works is to draw a small circle for each data point in each frame, representing the rank value at each timepoint. In order to calculate the rank values between the actual datapoints, a simple linear interpolation is employed. So no actual data lines are drawn – what appear to be lines are just overlapping ellipses.

Setting the “alpha” value sets the transparency of a black box drawn over the whole data pane at each refresh – set this to a high value and the frame is refreshed completely each time, showing dots which represent the data at the current time; set this to zero, and each previously drawn frame will exist indefinitely, eventually plotting out the entire time behaviour. Intermediate values give the data points a comet-like tail, showing their recent past clearly, and their distant past dimly. These animations look like a frogspawn race, or possibly a cohort of sperm circling impotently around a central, elusive egg, and I rather like the aesthetic effect they produce.

This was written in Processing (with OPENGL and the ControlP5 toolbox to create control sliders), and this “alpha wipe” technique is one that’s very easy to use to to create these smooth transitions. Don’t use a “background(colour)” method – instead, at the top of your “void draw”, just add

fill(0, 0, 0, alpha);
noStroke();
rect(0, 0, width, height);

Setting alpha to the value you want. As I said, I allow user control of this variable. I use this technique A LOT for smoothing frame-to-frame transitions.