Grid Running – Part Ia

As a post-script to last week’s post, here’s a snippet of Python code that uses the wonderful matplotlib to display a given frame of Timepix data. It takes the Comma Separated Value (CSV) file generated by the frame reader and plots a “pixel” at each (x, y) with a colour corresponding to the number of counts measured by that pixel.

iPython_screenshot

I’ve added the Python code to the github repository as display.py, but it’s also included below so you can use it however you like. I’ve been having a lot of fun with IPython and the IPython notebook (which you can find out how to install on your own system here) to do all this on a web browser (screenshot above). But here’s the source code anyway:

###############################################################################
#              CERN@school: A very simple Python frame display                #
###############################################################################
# Author: T. Whyntie - t.whyntie [at] qmul.ac.uk                              #
# Date:   April 2013                                                          #
###############################################################################
#!/bin/env python

# Import what we need from numpy and matplotlib.
from numpy import loadtxt
from matplotlib import pyplot
from matplotlib.patches import Rectangle

# Open the data file - specify the actual filename between the quotes.
datafile = open("dataout0.csv", "r")

# Get the X, Y and C values from the data file.
X, Y, C = loadtxt(datafile, delimiter=",", unpack=True)

# Set up the plot area for the frame data.
pyplot.figure().add_subplot(111, aspect='equal') # ensure equal aspect ratio.
pyplot.xlim(0,256)                               # x limits.
pyplot.ylim(0,256)                               # y limits.
pyplot.gca().patch.set_facecolor((0,0,0))        # Black background.

# Select the "hot" colour map for the pixel counts.
cmap = pyplot.cm.hot

# Loop over the pixels extracted from the data file and draw a "pixel"
# in the plot area.
for x, y, c in zip(X, Y, C):
    pyplot.gca().add_patch( \
        Rectangle( # We now define the pixel's "Rectangle"; \
            (x,y), # The location of the pixel (lower-left corner);
            facecolor=cmap(c/C.max()), # The pixel colour (from the map);
            edgecolor='none',          # Edgeless pixels;
            width=1.0, height=1.0,     # Specify the size of the pixel.
            )\
        )

# Display the frame.
pyplot.show()

If you didn’t manage to get the frame reader working/compiling, I’ve put the CSV files of the test dataset on figshare too. Enjoy!

Grid Running – Part I

I’ve just given a talk about CERN@school at #GridPP30, the 30th GridPP Collaboration Meeting, at the University of Glasgow. It’s been a fantastic meeting – kindly sponsored by Dell – and it’s been great to meet everyone and let them know about how CERN@school is having an Impact. If you’re interested, you can find the slides here (along with the rest of the GridPP30 programme), but in a nutshell it covers what I’ve been up to for the last six months with a GridPP flavoured twist. Since my last post, we’ve now got to the point of running jobs with some custom CERN@school software as a member of the CERN@school Virtual Organisation (VO). The next step is to develop and run the GEANT4 simulations of the Timepix detectors and the LUCID experiment.

For the moment, though, I thought it might be interesting to put into practice something that I’ve been thinking a lot about recently. For simplicity, the jobs I ran used a custom piece of stand-alone software that takes a Timepix data file, reads it and extracts information about which of its 65,536 pixels had recorded the tell-tale signs of ionising radiation. The Pixelman software that runs the Timepix detector outputs the data in the format XYC, where X is the x position on the detectors sensor element (4 bytes), Y is the y position (4 bytes), and C is the number of time that pixel has spent over threshold (2 bytes). So, in binary format, five “hit” pixels would look like this (click on it for the full image):

Binary Cluster

The software takes this data, reads in each byte and converts each pixel’s 10-byte sequence of 1′s and 0′s into the three numbers we need to make sense of the data. It also checks a separate file that contains the information about where new frames begin (data files contain can contain more than one frame). So the above fifty bytes translate into the following pixel information in a handy Comma Separated Value (CSV) file:

57, 1, 83
58, 1, 115
59, 1, 28
58, 2, 71
59, 2, 46

You can see by the x and y values that these particular pixels are adjacent to each other. This is, of course, intentional – these pixels form a single cluster that I’d picked out from the sample data earlier. Here are the pixels visualised in the Pixelman frame viewer:

cluster-for-blog

Sure, it’s not exactly the Higgs boson – it’s almost certainly an electron that has hit the sensor element of the detector and bounced about a bit within the silicon, creating a signal in multiple pixels – but it’s a nice bit of particle physics data processing. We’ve taken the “raw” output from a detector and processed it using some software in order to interpret what it might mean. Future versions might depend on other external software packages (such as CERN’s ROOT analysis framework) – which would need to be installed for the CERN@school VO – and be used to process data stored on GridPP Storage Elements (SEs).

So what? Well, the fact that this particular piece of software is stand-alone means that it shouldn’t be too difficult to make the source code available to anyone. I’ve been following the #openaccess and #opendata discussions with interest, as the two concepts are pretty fundamental to what CERN@school is trying to achieve, and I think something that naturally follows on from this making sure that your analysis is reproducible by anyone – i.e. they can access and use your code to process the data that you also make available. So that’s what I’ve done:

This has also (finally!) given me the chance to use Digital Science‘s figshare – something I’ve been meaning to do for ages. So, if you’ve got access to something that’ll compile and run some C++, you should be able to do a little CERN@school data analysis yourself. But there are some questions to think about:

  • Can you actually use this? If not, why not?
  • If you have, what have you/can you do with the data? What else do you need to know/want to know about the data set?
  • Would you want to actually use this? After all, it’s going to take some time to get set-up and running going. Is it worth the effort?

If you do do anything with the code or the data, I’d love to hear about it – please use the comments section below for this, or any other questions, or suggestions for improvement. Happy coding!

Update – 17:56 28th March 2013: There’s now a summary of the GridPP30 meeting here – thanks Neasan!

Update – 05:53 22nd May 2013: GitHub have very kindly given us an educational account, which you can find here – so I have moved the repository above there and updated the link. You can sign up for an educational account here.

Getting Back on the Grid

It’s been a while since I’ve blogged about what I’m actually doing job-wise at the moment. My “about me” page/Twitter bio states that I’m the “STFC Researcher in Residence for the CERN@school project”, but I think it’s fair to say that the focus of the first six months of this post has been about working out exactly what that actually means. Now it’s February 2013, and I think I’m in a position to explain it. In a nutshell, I’ve been establishing the boundaries of what’s possible with a school-based, student-led research group, and working out how to roll out the model to other schools. But that can wait for another post (and, indeed, my six month report to STFC); for now I’m going to write about what I did yesterday.

Back on the Grid - The Queen Mary High Throughput Cluster, part of the London Tier-2 GridPP site.

This is where my “Hello World!” job ran. What this picture can’t convey is the heat (even with the air conditioning) and the noise (hence the ear defenders).

Yesterday was (for me, at least) a “QMUL Day” – a day where I venture into London from Canterbury to work at Queen Mary, University of London. As part of the arrangement with STFC, I’m a visiting academic at the School of Physics and Astronomy’s Particle Physics Research Centre (PPRC). The PPRC support the project by giving CERN@school access to the GridPP – an immense network of computing power that forms the UK’s contribution (via STFC) to the Worldwide LHC Computing Grid (WLCG) that processes the petabytes of data produced by particle physics experiments around the world. The LHC experiments use it to analyse data and run simulations to compare with that data. Indeed, when I was working on the Compact Muon Solenoid (CMS) experiment for my PhD, I used it to look for evidence of supersymmetry in the 7TeV proton-proton collisions. We didn’t find it then (and haven’t found it yet), but that almost certainly wasn’t the fault of the GridPP or the WLCG.

Yesterday was bit of a special day for me in my CERN@school role: I ran my first Grid “job” as a member of the CERN@school “Virtual Organisation”. A “job” is a computer program that you can get the GridPP’s network of computers to run for you. A “Virtual Organisation” is the GridPP club that you join to keep track of who’s running which jobs; CMS have one (that I was once a member of), ATLAS have one, and CERN@school has one too. The job wasn’t particularly exciting: it ran a tiny bit of code that printed “Hello World!” to file that could then be retrieved from the GridPP (in this case, the QMUL cluster, but this particular job could have run at Glasgow or Birmingham) to my laptop.

Back on the Grid - the Back of the Racks.

The back of the cluster’s racks. It all gets a bit Skyfall here… thankfully, there were no blond-haired supervillains in sight.

While this was unlikely to trouble the 1.8 Petabyte storage capacity of QMUL’s High Throughput Cluster – which I also got to see for the first time yesterday – it was very much the first step towards getting students plugged into the GridPP and harnessing its potential for their own research. For example, with the right software in place – and a well-designed user interface – complex, computationally-intensive simulations of how the Timepix detectors that make up the Langton Ultimate Cosmic ray Intensity Detector (LUCID) will respond to various types of space weather could be run, monitored and analysed by students without the need to impose on school IT support teams.

Implementing this is just one of the things I’ve got to do. For now, I’m rather happy in the knowledge that my shiny new Grid Certificate worked and my first job relayed the timeless “Hello World!” message to me. I’m back on the Grid – and now the real work begins!

You can find further information about the GridPP from QMUL’s GridCafe website.

What counts as “new” physics?

I can’t lie to you – I really rather enjoyed the phrase “Bog Standard Model“. Punning aside, though, to label the latest Higgs boson results from Kyoto as “boring” is a little harsh. Perhaps the LHC has been a victim of its own media success, but if you’ve heard Frank Close or John Ellis talk about the Higgs field as a kind of “relativistic aether”, you’d know that it’s anything but “boring” when you stop and really try to think about it. Now that we know this thing exists, we really can try to think about what it might mean for our universe.

However, the article (and some of the speakers in Kyoto) also came under fire from Jon Butterworth for bemoaning the lack of “new physics” from the LHC. Every test the 8TeV proton-proton collisions have thrown at the Standard Model – our best understanding of how matter and forces work at the fundamental level – has been passed with flying colours, including this recent result from LHCb. But as Jon rightly points out, it would be criminal to say that no “new physics” was being done – the Standard Model is being tested in new regimes and we are discovering more and more about how well it seems to do the job. So are people being unfair when they that there’s no “new physics” from the LHC yet?

I like the way @LinkaNeo put it in a tweet yesterday: “The idea isn’t new [...], but the discovery and the proof are,” and to be fair to those reporting on the LHC pre-2009 (i.e. before we had any data), there were plenty of ideas relating to physics beyond the Standard Model that were happily labelled as “new” – extra dimensions, supersymmetry, Kaluza-Klein resonances – that we haven’t seen evidence for yet, and probably wouldn’t until the LHC energy upgrade in 2015. So how to report on the distinction? Well, at the risk of getting a little bit Blairy, let’s refer to physics beyond the Standard Model as “New Physics“, and the amazing work coming out of the LHC that’s confirming the success of the Standard Model as “new physics“. And let’s remember that it’s all important.

I know, I know – the Higgs boson shouldn’t have any spin. But for now, it looks like Things Can Only Get Better (Measured).

UPDATE – Saturday 17th November 2012, 9:19am: There’s a nice example of the “New Physics Fallacy” in this Nature News article, via the @LHCproton. “For if physicists don’t find anything that conflicts with existing theories, how will we deepen our understanding?“. Did you really mean that, Michael Moyer? Really?

A Century of Cosmic Rays

IT IS PROBABLY FAIR TO SAY that the 4th of July 2012 will go down in history as the day we discovered the Higgs boson (or, at least, something like it). The last jigsaw piece of the Standard Model of particle physics has been found. While we may not be sure if it’s an edge, a corner, or one of those really important middle bits, at least we know now that it was indeed down the back of the Sofa of Time, and not lodged somewhere in the bowels of some naughty Cosmological Canine*.

But did you know that 2012 also marks one hundred years of cosmic rays? In 1912, Victor Hess got into the basket of a rickety hydrogen balloon, ascended to an altitude of about five kilometres and found, through a series of careful measurements, that the level of ionising radiation increased the further up he went. The results of his experiments suggested that some previously unknown extraterrestrial source was responsible – that the Earth was, in fact, being bombarded by particles from outer space. Hess shared the 1936 Nobel Prize for this discovery.

Now, while this was interesting in its own right, for particle physicists cosmic rays were also (quite literally) gifts from the heavens. Until then, they were mainly playing about with cathode rays or naturally radioactive materials to probe the nature of matter (electrons were discovered with the former, the nucleus/protons/neutrons with the latter). Cosmic rays blasted open a new frontier for physicists; the energies at which they were pummelling the Earth were far beyond what was achievable in the lab at that time. This made possible the discovery of the muon, the pi mesons and the positron — particles that pushed us out of our atomic comfort zone and marked the first steps towards our current understanding of matter and forces at the fundamental level – the Standard Model.

Of course, the picture of quarks, leptons, Ws, Zs, photons and gluons that we know today has largely been pieced together by accelerator-based experiments; machines that offer the impatient physicist with cosmic rays on demand (the first giga-electron volt accelerator was named “The Cosmotron“). On Wednesday, the series of ever-larger particle smashers has reached a triumphant climax with CERN’s Large Hadron Collider and the discovery of the hitherto missing mass-bringer. But here’s the twist: the LHC hasn’t found anything else yet**. Plans to increase the energy have been pushed back to allow further study of the new resonance at 125 GeV. So how might we probe energies beyond those of the LHC that might give us an insight into physics beyond the Standard Model?

One possibility (as you may have guessed) is to return to where it all began – Hess’s cosmic rays. Of course, in true 21st century “Big Science” style, we won’t be using balloons and photographic emulsion. We’ll be using the Pierre Auger Observatory, an array of networked detectors in Argentina covering an area the size of the M25, to study the highest energy Extensive Air Showers. We’ll be using the HESS array in Namibia to probe cosmic gamma rays up to energies of 100 TeV. But most excitingly (for me, at least!) are projects such as LUCID, CERN@school and CORUS that will put cosmic ray detectors in schools to allow students to be part of cutting-edge research that will help us answer some of the biggest unanswered questions in fundamental physics.

The LUCID display at the Cosmic 100 Summer Science Exhibition.

If you want to find out more — like what some of these questions are — come along to the “Cosmic 100: A 100 year-old cosmic mystery” stand at the Royal Society’s Summer Science Exhibition this weekend — the photo is of our LUCID display; if you can’t make it, do feel free to ask a question here or below in the comments.

* Amazingly, this is probably one of the least strained analogies you’ll have heard this week.

** I can’t really emphasise the yet enough, of course. Follow ICHEP 2012 for the latest results.

The Langton Star Centre: First Day

Yesterday, The Times Cheltenham Science Festival 2012 drew to a close after a magnificent week of sharing the joy of science with the wonderful Cheltenham Festival audiences – thanks, it must be said, to the phenomenal efforts of the festival staff and the brilliant army of volunteers. A quick search for the #CheltSciFest hashtag will give you a flavour of the post-festival comedown most of those who went are experiencing. But it’s not been so bad for me – I started a new job today and, if you spoke to me during the festival about it, you’ll know that I’ve been rather excited about it.

The CERN@school detector.

I’m going to be getting rather familiar with this.

In a nutshell, I’m being funded by STFC to be a researcher in residence at the Simon Langton Grammar School for Boys in Canterbury, Kent. Working with Queen Mary University London, GridPP and SEPnet – the South East Physics Network – we’re aiming to get as many schools as possible in the south-east of England doing research through the CERN@school project. Ever since taking part in the FameLab competition in 2009, the question “research or communication?” has been rattling around – from the post-talk judging panel grillings, to conversations with many of the great friends I’ve made through the competition. After a PhD and post-doc of trying to juggle the two, I’m incredibly grateful to STFC and The Langton Star Centre for giving me the chance to be involved in a project that will let me fundamentally combine the two aspects of science I love the most. And what’s more, my new boss is Dr Becky Parker. If you’ve met the Director of The Langton Star Centre, you’ll you know why that’s seventy shades of awesome.

Anyway, it looks like I’m starting as I mean to go on – I’m meeting Ian Russell tomorrow at the Royal Institution of Great Britain about a cosmic ray exhibition, and the first (day!) trip to CERN is booked for Monday. I’ve got a feeling it’s going to be a very different kind of high energy physics.

The Banana Equivalent Dose Song

(…a.k.a. “And So To BED”.)

I’m bashing this post out from my hotel at the The Times Cheltenham Science Festival, where last night you might have been lucky enough to hear some science-based songs from Andrew Pontzen at Robin Ince‘s Bad Science Book Club or Helen Arney preview her upcoming Edinburgh show, “Voice of an Angle“.

Have a banana.

All of the evidence* suggests that the ingestion of science in aural, musical form is effective for the treatment of a wide range of symptoms including disinterest, acute fidgetry, and light-to-mild diarrhea**. Now, while Helen and Andrew’s contributions to the field are most welcome, it’s always important to identify and nurture new sources. Fortunately, Martin Z Austwick (@sociablephysics) and Hayley Birch (@gingerbreadlady) of @GeekPop fame are running a fantastic competition — “Science Song Writer OF THE FUTURE” — to do just that.

Helen and I are just two of the judges involved in the competition (which is supported by @imascientist, the Institute of Physics, the Green Man Festival and the House of Strange) so in a blog-post-tastic join the dots exercise, the soundcloud widget above features a song I first performed at one of the Domestic Science scratch nights (Arney and Wells – also at Edinburgh this year) a few months ago. It’s a song about the Banana Equivalent Dose system, with words inspired by a chat I had with Simon Mayo on Radio 2, produced by my wizard of a brother. Technically the song wouldn’t qualify for the competition — you have to write your own music — but it should give you a flavour of the heavy, heavy punning I’m looking for in the lyric department.

So, if (you==student) {enter the competition}; else {tell everyone you know about the competition} – the entry deadline is the 13th of July!

 

* I asked a few people in the Green Room last night, and published the findings on a napkin I found on the table next to me.

** 1) This isn’t true, and; 2) such hyphenated classifications are very, very important.