Monday 7 March 2016

Astro Pi data from the International Space Station

I've had an Internet email address since 1989 so who knows how many emails I must have received in that time. Getting one that contains data from the International Space Station is probably going to be one that is hard to forget. Yes, as revealed exclusively at our talk at the Raspberry Pi 4th birthday party, we now have the data from for AstroPi experiment back on Earth.

Picture by @ClareMacraeUK

For those of you who weren't there, here's the full story.

Cranmere CodeClub's AstroPi competition winning project was run on the ISS in February:


You can read more about our experiment here, but TL;DR: it uses the AstroPi's Relative Humidity (RH) sensor to look for changes due to the presence of an astronaut, and then tries to attract their attention so it can capture them in a photo.

I was quite nervous to hear that we'd got our data back from the ISS so soon. The children's project  was a proper experiment - they had the idea that the humidity sensor would be able to detect passing astronauts and had designed this experiment to test that theory.   Like all good experiments that was a chance that the outcome would be negative and disprove the theory. There were also a number of assumptions that we made that might have caused less than optimum results:
  • If we were sampling RH too infrequently we might miss astronauts
  • If the RH on the ISS fluctuated too much, we not be able to spot the effect of an astronaut being nearby
  • We calculate a baseline humidity at the start but was this calibration long period enough to smooth out activity in what must be a busy environment?
  • Was our threshold for detection set to a good value? Too low and we might get too many false positives, too high and we might never trigger on relevant changes in RH.
There were certainly lots of things that could have ended up with a gazillion pictures of an empty module or none at all. So I approached the analysis with some trepidation. 

The data consists of 3 logfiles - our code records all the timestamped RH readings to a file - and 12 images. The combined logfiles amount to over 200,000 rows. I tried to load the smallest one into LibreOffice and plot some charts but it just choked. So I used some grep and awk magic to extract each individual day of operation's records into smaller files. Even then, LibreOffice was struggling. I was about to commence a matplotlib attack when I had a brainwave and I uploaded the data to plot.ly instead - after all, I wanted to share the data. 

You can see from the first chunk of data that things were looking promising. It looks like we start off with quite high RH as you'd expect if Tim had been handling Ed and starting the code running. then it falls off quite quickly and settles at a nice reasonably flat value around 46%


In fact, if you zoom in on that initial region, you can see that the RH is constant for a while and then jumps up. Was Tim testing our code?



The logfile shows that one of Ed's buttons was pressed, providing confirmation that someone was around, and the timestamped photo snapped at 10:41 shows: Success!


Note: I've kept the orientation of all the photos as they were received. It think it helps emphasise the free-fall nature of life on the ISS.

Our experiment ran for 7 days on the ISS and our code recorded 11 more 'astronaut' events.



The 5th Feb had three such events. The early morning photo was a little gloomy...


 ... but a touch of brightness and contrast adjustment fixes that.


The other two photos form 5th Feb show Tim hard at work.



In fact all but one of our code-triggered photos shows an astronaut. The one that doesn't is a shot of the bulkhead - Ed was turned away so perhaps the crew were conducting medical experiments and understandably wanted to avoid being snapped.

However my favourite image is this one:


On first glance it looks like just a glimpse of Tim's arm. But closer inspection of the far hatchway shows what looks to be Cosmonaut Mikhail Kornienko's head!


We've really enjoyed looking at our data, and there's loads more fun analysis we can do, including looking at the periodic fluctuations of  RH over the course of an ISS day.

If you'd like to look at the data, all the photos and raw log files are available herehttps://github.com/topshed/SweatyAstronautData.

The processed daily RH data and a graph for each day can also be viewed here at plot.ly.

If you have any problems accessing any of the data, or find anything interesting, please let me know.

Massive thanks again to everyone at Raspberry Pi and the ESA for making this opportunity a reality.