Tom Bakx: Python in Astronomy

I’m very pleased to welcome Tom Bakx who is a doctoral student here in the school of astronomy and physics. He is from the Netherlands studying here for the next few years and he is going to be talking to you about his work in Python and astronomy.

TOM BAKX: So, in 1995 a group of research astronomers used the Hubble Space Telescope to observe a small piece of sky over Christmas, they didn’t know any galaxies to be in this piece of sky and not even stars and it’s a very small region they looked at, so optimistic people were assuming there to be say 100 galaxies in a single viewing and normal people were thinking about a handful of galaxies but researchers were astonished when they found out that 6,000 galaxies were in this small piece of sky.

So, 6,000 galaxies is a lot to process and a lot of data to gather from a single image and back then there was a lot of galaxies but now there are samples of 3 million galaxies and recently has been launched a satellite going to observe one billion stars and observing that many different sources is a thing you really want to reserve to code as going through it by hand takes a lot of PhD students.

About this image it’s called the Hubble B fuel image and some images are so far away that the universe was a lot smaller when the light was emitted back and ever since the light has been emitted the universe has expanded and while the universe expands the light travelling towards us has expanded as well, expanded from bluer colours towards more red colours and if we’re able to find out how much it shifts towards the red we’re able to find out what the distribution through cosmic time is of the different properties of the galaxies.

Now to do this researchers use Python and other programming languages, especially the open source ones as astronomy has a very big community and mostly the easy to use ones as we’re pretty lazy. So, what did the researchers find when they plotted the activity of the galaxies through cosmic time?

They found that we live in a rather dull time. We’re at 13.8 billion years since the big bang but 8 to 10 million years ago when the universe was 3 times smaller than it is now star formation and other very active processes peaked and these can be seen in these galaxies here but optical light does not give the full breadth of spectrum of star formation. Star formation is very important to understand why we see as many galaxies with as many stars around as to day and it is crucial for our understanding of the entire problems. However when a star forms a large clump of gas falls together to form a smaller clump of gas, gas heats up, a star forms in the centre but cannot radiate its heat away because there is dust and gas in the way and the gas and dust absorbs the light, becomes warm and starts radiating heat radiation and this heat radiation we can see in sub millimetre wavelengths but as you can see from the optical image and sub millimetre image there is no way of saying these are the same images. The optical shows a lot of detail and the sub millimetre shows 5 things you can call to be galaxies and they don’t correlate to each other, the bright box in the centre of the optical doesn’t correlate to the bright box in the sub millimetre and this is the thing {inaudible} statistical properties Python enables us to use allows us to correlate the optical and sub millimetre in a way that we can be sure we’re looking at the same optical. The very brightly coloured spot in sub millimetre is so far away it is a 8 per cent of the age of the universe it is now, it is forming stars at the rate of a thousand solar masses per year where around us nowadays we only see galaxies forming one solar mass per year, so this a very, very active region in the universe.

Not only is it very far away, it is extremely bright, but it is being helped by something, and it is helped by a galaxy that is in the way, but instead of the galaxy in the way absorbing the light in the line of sight, the mass of the galaxy that is in the way bends the light around it and makes it appear less like this high resolution image can show us. This is recently been observed with a large observation array and Chile and it shows an Einstein ring as it is called of the lens image of the galaxy behind, image has been magnified 80 times and that allows us to peer even deeper into the universe. My PhD thesis is based around finding as many of these as possible because we can do some amazing science with this.

These galaxies are very, very heavy intense phase in their lives especially the far away ones and they’re bumping into each other a lot. Like these galaxies these are 2 galaxies - in the midst of a merger. You can see the 2 spiral arms of the different galaxies swirling round each other and the structure they had before, 2 spirals has been destroyed you can only see the small rings next to them and it brings with it a burst of star formation. Now we understand star formation a bit and can trace it from elementary physics but if we want to understand how it really works we have to use Python in a different way to data analysis. We use it to simulate and this is a simulation of the Illustris model where we can see on the left hand side the optical light, the light we were able to see with our telescopes and on the right hand side we see the gas intensity where there is a lot of gas where a lot of gas is able to form. And as these central 3 sources, or central 3 galaxies move closer together they come entangled and the value you want to look at is rather small but says SSR as the third digit and that means star formation rate, covers around 100 the entire time but as the merger starts to occur you’ll see it will peak to around 200 causing a phase of star formation throughout the galaxy, the galaxy we just saw in the sub millimetre is probably in the midst of a merger.

This is a small phase dwindling right now as we move closer to the present time, the number dwindles and falls below what it started as becoming not spiral galaxies but elliptical galaxies {inaudible}red, and dead galaxies because they don’t form any {inaudible} and these correspond very well to galaxies we see today.

This is only a snapshot of the big simulation which I’d love to show you now because this simulation is of a cosmic scale, it shows a very significant piece of the universe and what you can see here is dark matter distribution within it you can see sort of {inaudible} light structure of the dark matter and the dark matter is {inaudible} like the web indeed and consists of 5 times more mass than the normal matter we can see. However it’s invisible to optical light, doesn’t interact with it, so the only way we’re able to detect it is either by simulations or by the way it curves light.

Now {inaudible} the gas inside the galaxies and you can see there will occur explosions which happen at the centre. Supernovas exposures very big galaxies form very big stars; very big stars live a short time but go out with a bang creating heavier elements. Heavier elements we need to understand the formation of plants to understand the formation of water and perhaps the formation of life. In a nutshell, Python helps us understand the data we’re looking at to make sure we get the most out of it and helps us figure out if the theory we’re thinking about actually corresponds to the data we get from our measurements.

So, I think Python is a tool to put us in a bigger, in a cosmic perspective. Thank you. {Applause}.

VINCE: Any questions for Tom?

NEW SPEAKER: Wonder if you could dig into a bit more detail how you’re using Python, it is numerical computation or how the graphics are rendering or -

TOM BAKX: Python is able to do all the things I showed you here but I assume I didn’t use Python for the simulation I showed you - just for some cool images, probably used C {inaudible} because it’s faster but you could use Python.

NEW SPEAKER: Specifically you say you use Python to crunch the data. Do you use any packages like I don’t know {inaudible} or do you write everything from scratch?

TOM BAKX: There is a module called astro pi(?) and I use that mostly to {inaudible} data. Let me grab an image ... what happens here is if you were to just state the peak value of this image, you will get a less good estimation of the intensity the source has so you have to assume the profile you expect it to have then fit it and I use Python as a function to {inaudible} but I use it as a means of getting the shift from the red out of these galaxies just with functioning filling and do that and I use LM fit which is a different model but I’m not really into the module heavy stuff in Python. Thank you.

NEW SPEAKER: When you do simulations do you do everything on your local machine or use a computer and which set up you use like purely Python or you have some more supporting programmes?

TOM BAKX: The stuff I do myself I am able to do on my mac myself because it is not computationally heavy, it will take at most a couple of minutes, enough time to get a cup of coffee, but for example if you want to do large scale simulations you really have to go to super computers. It would take for the simulation I showed in the end to run it would take 2000 years on a normal computer but you are used to these {inaudible} because super computers? Yes, does that answer your question?

VINCE: Time for perhaps one last short question. Let’s just thank Tom again. {Applause}.

A couple of announcements after we’ve finished that first session. There will be coffee in the foyer and otherwise one of the workshops is more or less started the Django 4 for PHP programmers. If you go to foyer where coffee is people will take you there. Finally thank all speakers from the session one last time. {Applause}.