The Maxwell Society viewing the planetary line up

The undergraduates here at King’s College London have a society called the Maxwell Society.  Named after James Clerk Maxwell, it boasts some famous members in the past including Peter Higgs and Arthur C. Clarke.  Today they run a variety of events throughout the year depending upon who’s in charge that year.  This year’s lot wanted me to let them up to the telescope, which of course I was very open to but I realised that there are not so many cheap thrills with a telescope in the middle of London, you have to work hard for your pictures/spectra and your views through the eyepiece will be so-so.

Anyway, they asked about the planetary alignment which is currently taking place and when I told them they’d have to get in around 6am, they barely skipped a beat before arranging it. So this morning I went in at 5am.  gah.  Anyway around 20 intrepid astronomers showed up at the crack of dawn.20160203_063307

As usual, it turned out the conditions were less than ideal, it was very windy, which meant the “seeing” was very bad, which means that the turbulent atmosphere makes the image extremely wobbly.  That also means you can’t even think about using a very high magnification as the images just get worse and worse so I stuck with a 24 mm eyepiece which gives 156x magnification.  In principle I could combine my 11mm eyepiece with my 2.5x barlow and get some massive magnification but it would look very bad- all the imperfections of seeing are enhanced non-linearly as you increase magnification.   Since all the planets we were looking at were close-ish to the horizon this was not ideal.   Even on a good day you shouldn’t even bother trying to see anything less than about 25 degrees above the horizon in central London.  I tried looking at Mars before they got up there but it was… underwhelming.

However I showed them Jupiter with cloud bands and three moons visible and then we saw Saturn.. it was very shaky but every so often they got a clear focused view of the rings, albeit a bit small.  Then some views of the moon, even the moon looked shaky, indicating how bad the conditions were.  Despite all this, they really seemed to enjoy the whole thing a lot!  I very much hope that they come again to see some better views when the conditions are improved.


That moment when you realise you’ve been handling ALL your image files wrongly (or 65,534 shades of Grey vs. 254)

Another post so soon?  Well I’ve discovered something and its pretty significant.  It’s really rather embarrassing, but well like I keep saying I REALLY don’t know what I’m doing and I try to pride myself on always admitting when I am wrong, (and if necessary apologising although on this occasion I don’t know who I’d apologise to.)

I recently discovered something about the free image processing software GIMP (photoshop for cheapskates) – it is 8 bit.  That means within the image every pixel has a value between 0 and 2^8-1 which is 255.  If it is 0 then the pixel is completely dark and if it is 255 then the pixel is completely saturated and there are 254 shades of grey between those two extremes.

I also recently discovered something about our camera, it is 16 bit, so each pixel has a value between 0 and 2^16-1 which is 65535 with 65534 shades of grey in between.

Unfortunately I’ve been using GIMP to stack and analyse our images.  So if the camera was reading 100 on a particular pixel out of a possible maximum 65535 then once you read the file from the camera into GIMP it will divide everything by 256.  The closest integer to 100/256 is zero.  If we were to stack 20 such images, then 20 times zero is still zero.  If you use a proper 16 bit software, you would have 20 x 100 which is a respectable 2000.

So basically we’ve been missing out on a heck of a lot of detail.  Luckily I’ve still got the original image files, so I’ve been spending the last part of my holiday re-analysing and stacking some of those old images.

The difference is remarkable:-


These two images come from exactly the same data, cropped very slightly differently.  The one on the left uses all 16 bits while the one on the right is only 8 bit.  So all this time we’ve been getting much better images than we thought.  This makes me even more eager to get out and look at more things, but the weather is awful.  Luckily I’ve got a UG project coming up with the telescope, so that will give me a chance to get some new images…

So I do feel like a bit of a fool but a relatively happy one…

End of Cloudy 2015

The weather has been horrible for months, its been mild but terribly cloudy.  For example, the only two clear nights in London lately have been Christmas Eve and New Year’s Eve, both of which I had plans for. It has really been very difficult to get good views of the sky from London for that whole time..  We haven’t had chance to do as much as we would have liked in continuing to learn how to use the telescope.

Messier 81, about 5 times as far away as Andromeda.

Sunayana and I did get this image of M81 earlier this month, which is a large Galaxy not very far away but it should be a lot brighter.  I hope you can see there is a galaxy there though!  We’ve also been trying to learn how to use Colour as you can see with this image of the Ring Nebula M57


which is not bad for the time being at least.  There are very many tricks that we are learning about stacking images, but we haven’t started to do things like subtracting flat fields and dead pixels.  Hopefully we will get better weather in 2016.  Certainly we are looking forward to the return to the skies of Jupiter which already feels like an old friend.  February will be good for that.  However we want more galaxies and more student access to the telescope, which we are working on and will report more about soon…

best wishes for the new year to you all.

Sunayana’s image processing Software

This post is by Sunayana who has been helping me with the telescope over the past year.  Unfortunately she is now leaving us to pursue an MSc in Astrophysics at UCL but I sincerely hope she will find time to come back and visit us up on the roof as often as possible.

One of the key purposes for the KCL telescope is its use within third year project work. Trialled in early 2015, the first set of project students used spectroscopy to analyse the composition of elements in the atmosphere of Jupiter, the Orion Nebula and Sirius. This involved grappling with raw images, plugging them into software and outputting a spectrum of intensities plotted against a range of wavelengths. In pursuit of a more efficient solution, a challenge was posed – to write concise image processing software which would take any greyscale image of emission/absorption lines and immediately convert it to its corresponding spectrum. This would circumvent the tediousness of cropping images manually and having to abide by the constraints of external software, allowing for flexibility and swifter analysis.

So immediately I got to work, contemplating the most suitable programming language for manipulating image files in a streamlined and precise way. Reluctantly turning away from my familiarity with FORTRAN 90, I embraced C for an easier ride into image manipulation.
The programme opens a grayscale bitmap chosen by the user and scans each pixel, processing its intensity value. Since these are 8-bit grayscale images, each pixel contains only intensity information and therefore has a value between 0-255 (2^8). Then, the intensity of pixels in each row for a given column is summed and plotted. So, going across the image, any detected non-zero intensity value for a given column will yield a peak in the spectrum. Proportionally, the larger the number of non-zero intensity pixels, the bigger the peak will be. An all-white vertical line across the image, for example, would have the maximum intensity possible. Of course, the non-zero intensity pixels represent the areas on the image where characteristic emissions are occurring (or vice versa for zero-intensity pixels where absorptions are occurring).

It is important to note that the intensity of each pixel is typically non-linear and discrete data analysis of an image which supposedly contained equal increases in intensity across its width was terribly unhelpful in the early stages of writing the programme. Finally, the number of pixels across the width of the image is calibrated according to the wavelength range of the spectroscope (between 300nm and 1100nm). Therefore, a spike identified at the 50th pixel of a 200 x 200 image, will translate approximately to a peak at the 500nm mark. Automatically, all the pixel data of the image is written to a readable, graphable text file which is easily plotted on any data analysis software including GNUPLOT, Xmgrace and Microsoft Excel. Hopefully, this swift and user-friendly method for image manipulation will serve the next cohort of third year undergraduates well. Watch this space…

More recently, we have been trying to ratify, more broadly, student access to the telescope in both an academic and extracurricular capacity. We’ll be instrumentalising the (optimistic) novelty of a telescope on a rooftop in central London through termly events, titled ‘A Night on the Roof,’ where undergraduates will be able to attempt to find and focus on solar system and/or deep sky objects according to visibility. This will hopefully be the first of many streamlined operations to allow wider access to the work being undertaken at the telescope. Later we may have a series of public lectures on astrophysics and related themes, which might feature a live-feed from the telescope as an additional bonus.

We have been attempting to make the dome rotation smoother and now there an additional monitor has been mounted to the wall inside in the dome so we can have the computer in the hut but still work in the dome (see below).DSCF1656

A few more pictures and the Sky at Night

Hello, we’ve been working to update the telescope a bit, Sunayana has been writing some image processing software to make the analysis of spectra faster for undergraduates and we have been cleaning up the dome, more on that in a future post.

We’ve had an intermittent problem with the mount –  sometimes it just doesn’t work properly and there is a weird wobble.  Apart from that the weather has been so-so its quite rare in London to get a night without cloud and then in summer the clearer nights are not so perfect.  Anyway here are some pictures for you:-

First Saturn.  It’s very low in the sky from up here in the UK and in London that’s bad, that’s very bad.  We have the Chelsea Lamborghini exhaust haze to the South East where Saturn pops up.  And there is huge thermal turbulence from the heat of the city which makes the density of air vary along the path of the photons, changing its refractive index and turning the air into a constantly distorting irregular lens which makes images wobble.

Anyway of course its Saturn, so we have to try, here is what we got:-

Saturn from London, see text for excuses as to why this is a difficult planet for us.

Saturn from London, see text for excuses as to why this is a difficult planet for us.

Next we looked at M27 Dumbell nebula which is a planetary nebula – what you are looking at is the expanding shell of gas from the Star which used to live at the middle, its the outer parts of that star that you can see, the inner parts would have formed a white dwarf star which is sitting somewhere in the middle.  That star will be so dense that a spoonful will literally weigh a ton but its very small so while it will be very hot, it won’t be very bright and it won’t do much, it will just sit there and cool down.  Slowly.

M27 Dumbell Nebula. Not very bright, I need to be more patient and take more exposures

M27 Dumbell Nebula. Not very bright, I need to be more patient and take more exposures

It’s not very bright, I need to take more exposures and then stack.  I did it through a hydrogen alpha filter as well because nebulae emit loads of hydrogen alpha photons.  I’ve coloured that bit in red.  We will definitely revisit this object and try to do a better job.

Finally I’m going to show you a globular cluster.  Now these objects look a bit boring but they are super important for Cosmology.  Globular clusters are spherical balls of stars, usually about a quarter of a million stars, There are two kinds of globular clusters, old ones and new ones.  New ones form recently in galaxies, old ones formed a long time before any galaxies existed, in fact people thing they are at least one component of the building blocks for galaxies.  They are the oldest remaining objects in the Universe today and by looking at the stars in them we can tell how old they are.

Now I’m not going to go into this in massive detail today because I don’t have time, but if you look at how quickly the Universe is expanding today and make some reasonable assumptions about what it contains you might calculate that it was only around 9 billion years old.  However, some of the old globular clusters are more than 12 billion years old, so this shows you that your assumptions are probably wrong and indeed is one of the reasons why we think dark energy exists, to make the Universe older.

Anyway here is a picture from the roof of one of the very old ones.  M56.

lives to be 12 billion years old and contains hundreds of thousands of stars and we can't think of a better name than M57

lives to be 12 billion years old and contains hundreds of thousands of stars and we can’t think of a better name than M56

In other news, I have been interviewed for the Sky at Night television program, which is very nice for me.  I used to watch this program when I was young and trying to see things with my very bad argos 60mm refractor telescope.  I thought when I turned my back on becoming a pure astrophysicist in 1997 that my chances of getting on the program were gone but here we are, life is strange!  I’ll be talking about dark matter at 2210 on Sunday 9th August on BBC four.  I was interviewed by Chris Lintott and not Maggie Aderin-Pocock although I did say hi to her.  The whole team were very nice and Chris was very friendly, he’s very good with people – I suppose that’s his job but he does it very well.

I hope I don’t end up looking stoopid, lets just wait and see…

UK election analysis – low Labour turnout got Cameron in

There has recently been a general election here in the UK, this is the election that determines who is a member of parliament (MP) in the house of commons.  There are 650 such MPs but four of them are Sinn Fein – people in northern Ireland who refuse to acknowledge the rule of London.  Those Sinn Fein MPs win their elections but then refuse to show up in London and make decisions (and I respect their right to do so) which means it is effectively a battle over 646 seats, so whichever party or coalition of parties can control more than 323 seats forms the government.

The seats are decided on individually –  the UK is split up into 650 constituencies with approximately the same number of people living in each, apart from where geography makes that impractical.  In each constituency the party with most votes gets the MP, a system called first past the post.  A lot of people don’t like this – imagine that everywhere 49% of people voted for purple and 51% of people voted for green, there would be 650 green MPs and zero purple MPs, which seems very silly, but there we are, that is the system and that is a separate conversation.

The result was quite surprising to many, in that we were all expecting there to be no overall control by one party, it was thought there would be an approximately equal percentage split between the two leading parties – Labour and the Conservatives, just look at this poll taken on the evening before the election.

Poll of polls night before election

Poll of polls night before election

The prediction was that this wouldn’t translate into an equal number of MPs on both sides, because of the first past the post system there would be significantly more Conservative MPs than Labour MPs, but most people thought no-one would have enough MPs to form a government.  What actually happened was quite different, the conservatives won 331 MPs, not a large majority, but a majority nevertheless.

I was surprised by this and I wanted to look at the numbers in slightly more detail.  I got all the numbers from a wonderful website called In particular I was interested in the effect of two smaller parties who took more votes in this election than in previous elections – an environmental leftist party called the Green party and an anti-EU right wing party called UKIP.  Many Labour voters were disillusioned with the Labour party and voted Green.  The standard lore was that many Conservative voters voted UKIP, but actually a lot of lower income people who would normally have voted Labour also voted UKIP because they are worried about the effect of immigration on jobs and welfare, and they blame membership of Europe for this, since one of the aspects of being a member is opening your country to the free movement of citizens.

There are many very complicated things which could be done to the numbers to try to understand what the effect of these two parties are but I don’t have time to try them.  However I wanted to see what would happen if all the Green voters had instead voted Labour.  This is a misrepresentation of what would happen if the Green party didn’t exist since the environmental vote is wider, but I think perhaps most Green voters were Labour voters who wanted what they perceived as a more genuinely left wing alternative.  The following table shows what happens:-

Effect of redistributing votes from Green and UKIP to Labour and Consevratives

Effect of redistributing votes from Green and UKIP to Labour and Conservatives

If in every constituency you imagine that the Green party didn’t exist and transfer all of those votes to Labour, you do stop the conservatives from getting an immediate majority, but they would easily have found someone to go into coalition with such as the Democratic Unionists from Northen Ireland (who don’t appear in my tables, apologies)  and possibly the Liberal Democrats.  Also, of course, not all Green voters would be labour, I expect they picked up many Liberal Democrats.

In the same table I have plotted what would happen if all the UKIP voters voted conservative – a MASSIVE conservative majority.  If all the UKIP voters had voted Labour which is extremely unlikely then Labour would still have had no majority but would have safely formed a government with the SNP.  If the UKIP votes were split 50/50 between Labour and Conservative then not a lot would have happened.

I am well aware that this is a poor simulation of the real effect but it will have to do for now – to look in more detail at these figures, I really need some more demographic information about constituencies such as average income and average age, also more time than I have!  However, I did notice one thing, and that was that voter turnout was significantly higher in constituencies where the Conservatives won.  Look at this figure:-

Number of Con votes divided by number of Lab votes then logged vs. voter turnout

Logarithm of the number of Con. votes divided by number of Lab. votes vs. voter turnout

I took the conservative vote and divided it by the Labour vote.  So anywhere mainly conservative would give a number between one and infinity and anywhere mainly Labour will give a number between one and zero, which is not fair, so I took the logarithm, so that anywhere more conservative would be positive and anywhere more lab our would be negative.  I plot this against voter turnout.  To my eye there is clearly an upward trend, but of course we shouldn’t just use our eyes in science, we should measure something, so I evaluated the correlation coefficient which we usually call ‘r’.  If there was no correlation, then r=0.  If its a straight line going up then r=1, if its a straight line going down, then r=-1. Here we have an upwards cloud, with a correlation coefficient of r=0.55 so there is definitely an effect.  However, how can we try and work out the magnitude of this effect upon the election result?

I decided to take the N most Conservative constituencies and compare the average voter turnout in those N to the voter turnout in the N most Labour constituencies.  But then I couldn’t decide what was fair and unbiased to choose for the number N, so I did it for all N.  Of course if N is small you will get the biggest effect and if N includes all 632 mainland Constituencies you will get zero.  Here is the plot:-

Average percentage increase in voter turnout in N most Conservative seats relative to N most Labour seats.  I show all N

Average percentage increase in voter turnout in N most Conservative seats relative to N most Labour seats. I show all N

So as we go down to the low N we are really comparing VERY Conservative seats with VERY Labour seats so we should get a cleaner signal.  Again this is biased by the fact voter turnout would be lower in safe seats, so the effect could be even bigger than what I am about to estimate.  I don’t have a lot of time, so I’ve decided it starts to stabilise around 15% as you reduce N and then below about 50 seats it just gets noisy.  Pretty Arbitrary but that’s what I reckon.  So I’m going to multiply the Labour vote nationally by 1.15 to estimate what would happen if the Labour Party could get their supporters to turn out and vote like Conservatives.  This is what happens:-

results corrected for poor Labour turnout

results corrected for poor Labour turnout

So they would have stopped the Conservatives from winning an outright majority, l think it would have been difficult for both sides to form a government in this situation.  David Cameron would have argued that he had more of a mandate to do so, and he probably would have been right, but it would have been a much much weaker, fragile government than the relatively stable one we see today, which can survive quite a few by-elections.

Why do the Tories (Conservatives) turnout to vote more?  Well a lot of them are old age pensioners which is certainly very important.  Then one can start talking about free-time, car ownership, education, weather, disenfranchisement with the entire system and things like this, but I’m not a sociologist so I’ll stop here for now.

So what have we learnt?

  • Green voters could have changed the result slightly in favour of the Conservatives but even if they all voted Labour, David Cameron would be in Westminster as a very powerful partner in a coalition.
  • The huge number of votes bled to UKIP by both parties could have changed things a great deal, but one needs to know not only the % swing overall to UKIP but analyse things with a demographic model, which I don’t have time for.
  • Lower Voter Turnout of Labour Party supporters was a bigger effect than the votes lost to the Green Party and if addressed could have caused real problems for Cameron.

feel free to criticise my naive analysis

First Spectra – Methane on Jupiter

Those of you who have been paying attention to this whole telescope malarkey will know that one of the original goals of the project was to do spectroscopy.  This is splitting light up into colours so that we can find out what something is made of.  To quote Wikipedia, Newton applied the word “spectrum” to describe the rainbow of colors that combine to form white light and that are revealed when the white light is passed through a prism.


Rather than using a prism, we used a spectroscope, or spectrograph which we then projected onto our camera.  Here is a picture of the spectrograph we bought

Here is the spectroscope we bought

Here is the spectroscope we bought

So what can we do with this?  We know that electrons orbit around atoms, right?  Now because of quantum mechanics, electrons cannot just go in any orbits around atoms, but only specific energy orbitals.  We also know that if they jump from one orbital to another, they either emit or absorb a particular quantum of energy in the form of a particle of light – a photon.

atoms aborbing and emitting photons of particular colours

atoms absorbing and emitting photons of particular colours

Because that photon has a particular energy, it has a particular frequency which also corresponds to a particular wavelength which also corresponds to a different colour.  In fact for a photon of light, the words energy, wavelength, frequency and colour are all different ways of saying the same thing.  The more energetic a photon, the higher the frequency, the lower the wavelength and the bluer the colour.

The colours we see with our eyes make up the visible part of the spectrum and go from wavelengths of about 390 nm (short wavelength, high frequency, high energy) which corresponds to the colour violet to about 700 nm (long wavelength, lower frequency, lower energy) which corresponds to the colour red.  A billion nm or “nano-metres” makes a metre.  We have evolved to see these wavelengths/frequencies/colours because they are the only ones which can get through water and our eyes are mainly made of water.

Also, there is a lot of water vapour in the atmosphere, so what we can see with our eyes corresponds roughly to the colours which can get through from space.  This is the reason we can see stars, given the effect those observations have had upon science, religion and philosophy the history of humanity would probably have been very different if we had not been able to see through the atmosphere.  Anyway, I’m getting off topic.

Lets look at the following cartoon of electrons in the Hydrogen atom and the colour of the photons they emit or absorb when they jump between orbitals

The jumps between electron orbitals in Hydrogen corresponding to the Lyman, Balmer and Paschen Series

The jumps between electron orbitals in Hydrogen corresponding to the Lyman, Balmer and Paschen Series

The Lyman series are the jumps deep down into the lowest, most tightly bound orbit.  They are the biggest, highest energy jumps so they correspond to very short wavelength photons, in fact these photons all have wavelengths less than 100 nm, so they are not visible light, they are beyond violet, so we call them (apologies if you are ahead of the game here) Ultra Violet.

The Paschen Series correspond to jumps to the third deepest orbit, which is much less tightly bound.  These jumps all have energies/frequencies corresponding to wavelengths beyond 1000 nm, so they are redder than red, we can’t see them and we call them Infra Red.  The jumps to the second n=2 orbit are called the Balmer Series and (like a scene from Goldilocks and the Three Bears – this porridge is too hot, this porridge is too cold etc…) they are just right.  It’s for this reason the Balmer Series are so important for Earthbound Astronomy.  We call the 3->2 transition Hydrogen alpha, 4->2 Hydrogen beta, 5->2 Hydrogen gamma etc.

So what can WE see when we point our telescope into space with the spectrograph attached?  Lets look at the star Sirius:-

The spectrum of Sirius with the Balmer lines clearly visible

The spectrum of Sirius with the Balmer lines clearly visible

Like all the spectra on this page we got this from the roof of KCL in the middle of London with help from undergraduates as part of a third year project we ran between January and March.  Well we can see lots of photons from 350 nm (violet), peaking around 500 nm (green) and going well beyond 700 nm (red) into the infra red region, which our camera can pick up.  Now Sirius is actually a very blue star with lots of low wavelength violet and ultraviolet light coming from it, and our camera could pick up some of that too, but that doesn’t get past the water in the atmosphere, so from down here on Earth, Sirius looks more green than it really is.

What we are really interested in today however is the lines you can see in the spectrum – some of the radiation from inside the star gets absorbed by the Hydrogen in the outer parts of the star by exciting the electrons, but only at the particular wavelengths corresponding to the jumps between election orbitals.  We can clearly see some other stuff, but for Sirius, the most obvious lines are the Balmer series which is probably what you would expect since stars are mainly made of hydrogen.  These are absorption lines.  We actually use the position of the lines to calibrate the horizontal axis, this calibration is not perfect but it will do for now.

So we have just established Hydrogen in the atmosphere of a star which is 82 thousand million million kilometres away.  Taking pretty picture of stuff in space is just Astronomy, what we are doing now is proper Astrophysics. Thank Goodness for Newton and Quantum Mechanics!

When we look at diffuse gas like the Orion Nebula, we don’t see absorption lines but rather emission lines, this is because the gas surrounds very hot young stars which are still forming which heat up the gas and knock the electrons off the atoms.  Every so often, when those electrons are recaptured, the gas emits a photon corresponding to that energy jump.  Here is the spectrum we got:-

Emissions lines of Orion Nebula

Emissions lines of Orion Nebula

And here it is with a log scale to bring out the details of some of the dimmer lines you can see, so we have at least two lines from the Balmer Series, but also oxygen lines, a Helium line and a Nitrogen line.

Emission Lines from Orion Nebula with a log scale to see less pronounced lines

Emission Lines of Orion Nebula with a log scale

So lets now look at a planet.  Planets don’t produce their own light, they just reflect light from the star closest to them.  Of course for practical purposes for the planets we can see that means the Sun.  Jupiter is a big bright planet that isn’t too far away So lets look at that.

Spectrum of Jupiter

Spectrum of Jupiter

Jupiter reflects the light that falls on it from the Sun, but it also absorbs some of that light.  Jupiter contains molecules, which the Sun is far too hot to contain, they would break up in the intense heat.  In particular, Jupiter has some methane (CH4) in its atmosphere and light with the correct radiation can get absorbed by those molecules, so then is not reflected back to us.  It is in this way we can figure out what Jupiter is made up of.  So lets zoom in on part of Jupiter’s spectrum

Detail of Spectrum of Jupiter, see text for colour coding

Detail of Spectrum of Jupiter, see text for colour coding

Here I have colour coded various lines.  In red you can see the Hydrogen Alpha line, the significance of the red is that this spectral feature was in the original light from the sun.  What I mean is that line of missing photons corresponds to those photons that were absorbed in the outer part of the Sun before that light went to Jupiter and then got reflected.  You can also see in blue two oxygen bands which also appear in Sirius’s spectrum up at the top of this post.  Well they will appear in anything we look at from down here because its light being absorbed by the oxygen in the Earth’s atmosphere, so the blue means a spectral feature due to absorption of photons in the Earth’s atmosphere.  The two features colour coded orange are two bands of methane absorption, not narrow lines since the molecules can vibrate in lots of different ways.  There isn’t any methane in the Sun as its too hot. There is very little methane on Earth, but there is some.  However if this was an absorption feature from the methane on Earth, we would also see it in the spectrum from Sirius, which we don’t – there isn’t enough.  So this methane is on Jupiter!