Follow the reluctant adventures in the life of a Welsh astrophysicist sent around the world for some reason, wherein I photograph potatoes and destroy galaxies in the name of science. And don't forget about my website,

Saturday 21 December 2013

Winter is Coming, look busy

Christmas is upon us, so how better to end the blogging for a year than with pictures of Prague in the snow ? If I post anything else over the next two weeks, it probably means I'm not having a good enough time and you should shower me with pity.

Anyway, a couple of weeks ago Prague was treated to a light dusting of snow. Immediately I went for a walk. The webcams indicated the city center wasn't amazingly snowy, so I stuck with the less-picturesque local area where the snow was pretty heavy.

Nothing particularly special, although to be in a country where snow just magically freakin' falls out of the sky every single year ! as opposed to somewhere where such an event would be nothing less than apocalyptic is rather gratifying. Much more interesting, though, was the effect caused by two spotlights illuminating a billboard. This is in fact a giant glowing snowcone.

The next day I willingly dragged myself out of bed by 6:30 and was in the center of town by 7:30. It was still dark as I left the Institute, but unfortunately it was more or less full daylight by the time I got to the center. This time I at least had the good sense to check the webcam beforehand, just in case everyone else had the same idea and already trampled the snow into mush.

They hadn't, though the snow was not quite as thick as in the exotic mountain land of Roztyly. But it was enough. Wenceslas Square and Old Town Square are both lined with stalls for the Christmas market. While this is quite famous, it's surprisingly small. Actually it probably consists of no more than half a dozen small stalls, but someone accidentally hit CTRL+V a bunch of times, so it looks a lot larger than it is. 

More annoyingly, they don't sell anything you couldn't buy in the shops anyway (apart from maybe the one selling swords and medieval armour). It's quite pretty, but actually as a functioning market where you'd buy things, it's rubbish. Don't go. Even if you like tourist tat, and I do, the selection is poor and the prices high. You're much, much better off staying at home.

Somewhat surprisingly, Prague isn't big on Christmas decorations. I suppose they're probably unnecessary. Wenceslas and Old Town Squares are very nice at night though, with the trees covered in thousands of white lights. The Christmas tree in Old Town Square is particularly impressive. The surrounding market may be useless, but it does look nice.

Then I wandered to Charles Bridge, and was not disappointed. Though next time I shall force myself to get up even earlier and see it with the street lights on.

Convinced that the snow might suddenly disappear at any moment for no reason (it was -3 C and there were still occasional small flurries) I happily walked up to Prague Castle. The snow wasn't really heavy enough to make this look any more extraordinary than usual, but the view down the hill was worth it.

By the time I returned to the town center the hours of tourism were fast approaching so I headed up to Vysherad, fast becoming one of my favourite spots. I mean really, could it be any more gothic ? It was busier than normal, but it's quite a large space so this didn't really matter.

There is one thing, though, that I must admit. The pool at the Astronomical Institute just isn't as good as the one at Arecibo (except maybe as an ice rink, if it got even colder).

Identifying which is which is left as an exercise for the reader.
Back in Cardiff, all shopping was complete within 6 hours. No-one in their right mind takes their holidays in Cardiff (except for serious Whovians) so there are no pointless tourist souvenirs to get in the way. The fact that everything is in English may also have helped, slightly.

Well, that's all for 2013. Tune in again next year when anything could happen... but it probably won't.

Monday 16 December 2013

I Set Fire To The Sky

At last, I've managed to combine recent efforts to depict the hydrogen of the Milky Way into a coherent YouTube video. For this one I'm trying something new : narration. But not by me. Alas, my suave and sophisticated British accent is... err... the wrong kind of suave and sophisticated for mere narration. Yeah. That's totally the reason.

There's no point writing another blog post about this, because I covered pretty much everything recently anyway. I updated the previous post to include the major new sequence : the hydrogen sky itself. This is what the sky would look like if we could see neutral hydrogen instead of all those stupid stars, and it's one of my favourites. Honestly, sometimes I think people who don't study neutral hydrogen must have some sort of serious mental problem. What a bunch of losers.

Without further ado, for that weird particular subset of people who only follow the blog but not my Google+ or YouTube channel... come on people, get with the program ! But anyway here's the video. The soundtrack is a bit gloomy, but it has the redeeming feature of making the narration sound tremendously melodramatic. And don't forget to watch The Hydrogen Universe too.

Monday 2 December 2013

St George And The Small Plump Crocodile

Prague is a nice enough place, I suppose, in bright sunshine. But how much more awesome would that terrifying Gothic architecture be in, say, fog ? Or snow ? Or at night ? Or on a snowy foggy night... well, maybe not that last one. I imagine most places look extremely similar on a snowy foggy night, to wit, the inside of a ping-pong ball.

Look, it's Prague ! Or maybe it's Afghanistan... 
Still, night time is not a quantity in short supply, especially in winter. And yes, the ornate towers and façades which comprise Prague are indeed most intimidating come the hours of darkness. Snow has yet to materialise this winter, but no doubt it will be worth the wait. Occasional frost has given a glimpse of the future.

Fog is a little more haphazard. At the Astronomical Institute, it's not infrequent (as seen above). Once suitably adjusted to something resembling a daily routine, I waited for the first foggy weekend and, with more enthusiasm than sense, headed into central Prague hoping to see everything I'd seen before but with more fog in the way. This objective was not really achieved. The fog turned out to be more like very low cloud, with the city center largely unobscured. Of course, if my laptop had been working I'd have been able to check a webcam first...

Still, the trip was not without merit. At 9am on a Sunday, the normally visible-from-space tourist route is totally empty. And finally I got to see the Astronomical Clock do its hourly thing. Then I wandered up to Prague Castle, where the cloud was low enough to make a difference.

Prague, it must be said, does not do everything right. One of the biggest mistakes I've spotted is the depiction of St George's battle with the dragon. This is a reoccurring motif around the Castle, and while it's invariably very well carved, there's something a bit... off about the proportions.

On his royal face there is no note how dreadfully small a dragon his horse
has almost stepped on, 
Shakespeare would probably say.
Just what exactly was this slightly plump, immature crocodile doing to the villagers that they felt the need to call in a hero ? Stealing their shoes ? Biting their ankles ? Digging holes in the garden, perhaps ? Quite why they felt the need to sacrifice virgins to it, I don't know. More importantly, how ? How do you sacrifice a grown woman to small, slightly plump crocodile that's so inoffensive you could be forgiven for accidentally tripping over it ?

That's a swamp dragon if ever I saw one. Even if it could breathe
 fire it would be about as dangerous as a malfunctioning toaster.
Clearly the Czech version of this legend is rather different to that elsewhere in Europe. Though somehow the tale of "St George and the Big Lizard That Kept Stealing People's Socks" lacks a certain heroic romanticism. Can't imagine why.

Another explanation is that St George was actually one hundred and fifty feet tall, which would then make the dragon a reasonably threatening size to ordinary villagers. One suspects that this little nugget would probably have been mentioned more prominently in the story. All in all, I was more impressed with the "George and Dragon" British pub, because it has cider.

Later I wandered back to Vysherad, where, as at Prague Castle, the cloud was low enough to make a difference. Gone were the sweeping views of the river, replaced by a cathedral and graveyard that were clearly designed by a prophet with a singularly unique vision. One that told him that, a thousand years hence, a show called Dr Who would feature relentlessly frightening stone statues called the weeping angels. Vysherad, in one very specific sense, is beyond perfection - it is the Platonic ideal of a weeping angels episode location.

Not all of the graveyard features exquisite Gothic statues and tombstones, however. When I saw this mosaic of a very nonchalant Jesus, one caption instantly sprang to mind :

Finally there were these statues. I can only assume the artist wanted to show what the weeping angels get up to in their off-hours. Apparently they thought this involved taking Jesus to a dance club, for some reason.

Saturday 30 November 2013

Blog update !

Regular readers may notice some changes to the blog. Irregular readers should eat more fibre, or see a doctor. A medical doctor. But anyway, in an effort to keep things organised, I've re-arranged the blog slightly. Since most of my posts revolve around pretty pictures, and often have revolving pretty pictures, I changed the layout so that large images will no longer intersect the side banner.

Well he seems happy enough, whoever he is. The side banner now has a subscribe button (at last !) and a link to follow me on Google+ (a.k.a. everyone's favourite anti-social network, where no-one gives a damn about what anyone did in the pub last night and instead posts epic science). There's also a list of labels, so if you don't care about my thoughts on creating the perfect piece of toast, it's easier to filter those out.
Mmm, toast.
Just to make things extra-specially organised, there are now separate pages with links to the more popular / interesting posts. Track my adventures in time and space in the travel section. View selected art highlights in the art section, only don't because instead you should buy some from StockTrek images. Or, if you'd rather actually learn something, try the popular science section. But don't do that either, because it's lame. Instead visit the unpopular science section, where science is explained with the help of an imaginary monkey, a princess, a magical moose and a potato.

Tuesday 26 November 2013

The Princess, Some Goblins, And A Magical Moose

Astronomy may be many things, but dull and predictable it is not. One day you're sorting through endless lines of code trying to find a wrongly-placed minus sign, the next you're detecting hydrogen with the help of an imaginary monkey. Even so, I never expected that I would end up writing a story about a princess and a magical moose in order to explain data visualisation, but that's what happened.

FRELLED, my custom 3D data viewer, cannot be said to be intuitive to learn. It can't be really, because Blender is designed to make art, not love science. So there are plenty of idiosyncrasies and unexpected pitfalls for anyone trying to just load in data who's never used Blender before. And though I try and work around as many of these as possible, avoiding some of them would involve learning C++ and recoding Blender. Which is not what I signed up for.

Neither can I expect everyone else to spend ten years learning Blender, so I put some effort into writing a fairly detailed manual. Alas, the latest AGES thrall complained that the manual was unreadable. She said it needed, "a joke on every page" and "a story about a princess". And that the princess' name should be - by a remarkable coincidence - Olivia. Well, I managed a joke every other page (but you'll have to actually read the manual for that) and decided that a story would be a good format for a quick-start guide. So here it is, complete with princess, goblins, and a magical moose (moose being the name of said student's computer).

The Story Of Princess Olivia And The Magical Moose Whose Name No-One Could Quite Remember 

Once upon a time, the fair Princess Olivia was bored and decided to look in her magic mirror. “Mirror, mirror, on the wall,” said the Princess, “who has the best HI data of them all ?”
“You, O Princess”, said the mirror, “but it would be even better if you looked at it with FRELLED.”
The Princess decided that this was a good idea and would go to the library to learn all about it. It was a long way to walk, but luckily a magical moose appeared from nowhere. That’s what magical mooses do.

“Climb aboard !” said the moose, “I’ll take you to the library in no time at all.” The moose ran to the library at an amazing speed. “Thanks, moose !” said the Princess, “I don’t suppose you know where I could find out about FRELLED ?”
“Why yes,” said the moose, “for I am a magical moose.” The moose and the Princess sat down in front of one of the library’s many computers. “First,” said the moose, “you should look at your data in ds9 or kvis”.*
 * The moose had the magical ability to pronounce italics.

“Why ?” asked Princess Olivia.
“You need to know how bright your sources are,” explained the moose, “then you will be able to tell FRELLED which parts of the data should be dark, and which should be bright.”
The Princess looked at the data and discovered that the lowest value was about 0 Jy and the highest was about 1 Jy. “How very convenient” she declared in a regal manner. “What’s next, moose ?”
“Now you open the ExportFITS script,” said the moose, “and enter those values in the data range boxes.”
“Anything else ?” asked the Princess.
“Yes,” said the moose, “You must choose which projections to export. Let’s try just the XY projection for now, it will be faster. And press the 3D button and the map 1 button. Then press go.”
The Princess did as she was bid and in no time at all, the FITS cube had been rendered into lots of .png images.

“Amazing !” said the Princess.
“Well done,” said the magical moose, “now you can import the images into FRELLED. Load and run the ImportFITS script.”
“Alright,” said the Princess, “but will this take long ? I have to go and fight off an invading horde of goblins this afternoon.”**
 “Oh no, it’s very fast,” the moose reassured her, “Just press the ‘Axes’ button... that’s the one. Now press ‘XY’ and then ‘Import images’ ”.
** Princess Olivia was a warrior princess.

The Princess marvelled to see a wonderful three-dimensional image appear on the screen. “Wow !” she exclaimed, “This is better than Avatar ! But.... oh, if I rotate it too much, it all disappears !”
“Ah, yes,” said the moose, who magically blushed and shuffled his feet in an embarrassed manner, “I’m afraid you must press the ‘Enable script links’ button when looking the data.”
Princess Olivia was not amused. “Why ?” she asked, scornfully, “That’s not intuitive at all !”
“Sorry !” said the luckless moose, “It’s a software limitation.”
“Oh well,” said the Princess, “I suppose this will have to do. But what about all these other buttons ?”
 “There isn’t any time to explain. This is only a quick start guide,” said the moose, magically breaking the fourth wall. But he tipped his head and something white and fluttery fell from his antlers. “Try reading this manual. That should answer all your questions.”

Princess Olivia thought about this and adjusted her tiara in a haughty fashion. She wasn’t sure that Princesses were allowed to read manuals. Perhaps she could find a servant to read it for her. “Oh, alright,” she said. “Goodbye moose !”
The moose magically disappeared. Later on, Princess Olivia decided that fighting the goblins was too much effort. Instead she decided to teach them all about FRELLED. And they all analysed HI data ever after.


Monday 25 November 2013

Damn That's A Nice Piece Of Gas

I mean, seriously, why would you choose a career in astronomy if you didn't want to look at pretty pictures all day ? Fortune and glory ? The only way to get rich in astronomy is to sell your students into slavery. The only glory you'll ever get is - if you're very lucky - a five minute slot on the local news where the reporters insist you're a fully qualified, eminent astrologer. The rest of the time you'll struggle to be heard against the background noise of everyone else's ludicrously high publication rate... except by your competitors, who will claim everything you do is wrong and also hate you.

Tycho Brahe learned this lesson the hard way,
losing in nose in a duel about an equation.
Far safer, then, to shun the bright lights of celebrity status and get on with the important business of looking at pretty pictures. Lately I've been obsessing with one particular set of particularly pretty pictures : the neutral hydrogen gas* in our own galaxy. In fact, I've always had something of an fascination with visualising fluffy (a.k.a. volumetric) clouds and explosions. Intricate structures without a well-defined edge are just about some of the most beautiful things in existence, in my opinion.
* Colours in all of the following images are false, because to see neutral hydrogen we'd need enormous eyes made of metal. The structures the colours represent are absolutely real.

Two-dimensional images taken at roughly the same wavelengths of light that we can see are one thing, but visualising 3D data is another challenge altogether. I've previously managed this reasonably well, I think, for certain cases. The basic method is incredibly simple : chop up the data into lots of slices, and make an image of each slice. Then you just line up all the image slices and you get a very convincing illusion that you're looking at a whole volume of data (each slice has to be slightly transparent, of course).

This actually works pretty well for most hydrogen observations of distant galaxies. For these, the observations generally only span a small part of the sky, so the data forms something which is roughly cube-shaped. The only major complication is that while we can map the hydrogen on the sky, the third axis is not distance, but velocity. On very large scales, this turns out to be a good approximation to distance. But not on the scale of a single galaxy. Here the velocity information tells you about the rotation of a galaxy and nothing about how distant individual parts of it are.

That doesn't really matter too much, though, because it's still useful to view the data in 3D. And prettier too, otherwise there'd be no point in bothering.

Ironically, things get more difficult with our own, much closer galaxy. We can see things in much greater detail and with quadrillions of times more sensitivity, over the entire sky. The sensitivity brings me to the first problem - the "dynamic range" of the data. All this means is that there's a massive difference between the faintest and brightest emission we can detect. The contrast between the faint and bright parts of the image also varies with velocity. So, for instance, in some parts of the data volume you might have a single small bright structure, whereas in others you'll have huge complicated things but all at about the same brightness.

The above shows the view moving through part of the the hydrogen detected in the Milky Way by the GALFA-HI survey. Someone - I believe it was Josh Peek - came up with the genius idea of generating colour by using different slices. So one slice will be coloured red, the next green and the next blue.

If you use parts of the cube that are too far apart, you get a meaningless mess, because the structures in different parts of the volume are very different. But if you use adjacent (or nearly so) slices, the structures are similar but not identical - and the effect is to create a really quite wonderful lightshow. That's fine for 2D images and animations. In 3D, however, all of those glorious colours wash each other out and you get a sort of big browny-coloured fuzzy blob.

Leiden / Argentine / Bonn all-sky data.

With other galaxies, a large part of the data is actually just noise. This is easy to remove, leaving only the relatively small important data. Not so with our own galaxy. Here, all of the data is important. And some parts, as I've said, are very bright, which can overwhelm the faint structures. So how do you see the full 3D complexity of the data ? And how do you preserve the glorious technicolour of the 2D images ?

One nice trick is to allow the colour of each slice of the data to vary according to the range of data values in each slice. What this means is that the contrast between bright and faint structures will always be the same, even if the faintest emission in one slice of the data is brighter than the strongest emission in other slices.

The second important trick is to have colour and transparency vary differently. You need to be able to see which parts of the data are really bright, but you don't want them to block the view of the fainter features. If you want to get really fancy, you can have the colours vary logarithmically. That means that something has to actually be, say, 10 times brighter before it will appear to be twice as bright. The upshot is that both faint and bright features become visible.

Enough talk. Here's what the above GALFA data set looks like in 3D, with the correct settings :

But that's only part of the problem. Most extragalactic data only covers a small part of the sky. GALFA data covers 13,000 square degrees, but over a relatively narrow portion of the sky. Pretending the data is actually a cuboid doesn't really make much difference - like peeling a narrow strip of the skin from an orange, you won't cause much distortion by flattening it.

But other HI surveys cover the entire sky. If you try and pretend the whole, spherical sky is actually cube-shaped, you get something that looks kinda cool, but also pretty weird and difficult to interpret :

The entire sky from the Leiden / Argentine / Bonn survey.

One thing you could do instead is to sum up all the values along each pixel in the cube, and map those values onto a sphere. Which you can then flatten into a 2D map. You've seen such things before for the Earth, I'm sure.

Unfortunately, this is really boring. A much better approach is to keep the sphere and render a rotating GIF of it, because the internet freakin' loves GIFs :

But then of course, you can't see how the structures vary in velocity. The simplest method is to animate the texture on the sphere so that you see different slices of the data - just like before, with the flat images, but this time wrapped to a sphere. This works, and it looks lovely. I think this may be my favourite gif :

This doesn't help at all with the problem of viewing the data in 3D, of course. The solution to that is to make hundreds of nested spheres, each one with a map of the hydrogen at a different velocity channel. And then you get something which looks... well, a bit weird, really.

The center of this bizarre-looking thing looks even more spectacular :

And here's the resulting obligatory movie :

OK, what are we looking at here ? The problem is that velocity bares little obvious relation to distance, and interpreting it is... well, it's not fun. Yet it is possible, with enough mathematical jiggery-pokery, to convert the velocity and position on the sky into something approaching true 3D position. And that looks like this :

So why did the galaxy turn into an iridescent butterfly ? The moire patterning is due to the limited resolution of the survey - there are, in a sense, only so many angles the telescope can point at. Transforming this into distance creates long blank streaks where (effectively) the telescope didn't look.

More serious problems occur because looking directly towards or away from the galactic center, we can't measure the velocity of the gas at all. That's because we can only measure how fast the gas is moving toward or away from us, and at these particular angles, it isn't. It's only moving across the sky, which we can't measure. Another weird effect is that for any point closer to the center of the galaxy than the Sun, the equations produce two (yes, TWO !) possible distances for the gas, and there's no easy way to find out which is the right one. That's what causes the weird bubble-like structure in the center.

Ironically then, it really is easier to see the structure of external galaxies than the one we live in. But all is not lost. Further away from the center than the Sun, and avoiding looking directly toward or away from the center, the measurments are pretty good. When the parts where measurements become meaningless are removed (well mostly), things look quite a bit better. It's even just about possible to see that the galaxy has spiral arms.

Hardcore enthusiasts - who have somehow read this entire thing - should go and get a cup of tea, and then take a look at  Kevin Jardine's extraordinarily awesome Galaxy Map - especially the mapping hydrogen and velocity pages. All I really wanted to do was make pretty pictures, but the (arguably) more important business of mapping the galaxy has to use other techniques to fill in the gaps. But don't worry - this post is almost over, so I'll skip ahead to the end result.

Credit :
What's that ? You'd like this post in video form, with narration by an angry Scotsman ? No problem !

And that's it. Excuse me while I attend to the needs of my iridescent butterfly.

Monday 11 November 2013

Prague Castle 2 : The Sequel

As I've previously reported, people flock in droves to the Charles Bridge to the point where it becomes invisible. This is undoubtedly the peak of the population density in Prague, but on the surrounding streets the flow of tourists is still torrential. Yet, walk for merely a minute - or less - orthogonal to this living human filament and the streets are practically empty.

It isn't that the towers and spires of the city are mere fronts, disguising some kind of foul city-wide cesspit. In fact the rest of central Prague is no less beautiful than the army-ant tourist route, though it is, perhaps, less iconic. Even this isn't true of Vysehrad, Prague's second castle. It's accessible by a short, very easy (i.e. flat) walk from a metro station, is about a thousand years old and has sweeping panoramic views of the city. And yet on a sunny Saturday afternoon there were no more than a handful of visitors in the whole, extensive site.

What's wrong with people ? The site is only two metro stops from the city center - so it's basically still in the city center. A city with a population of 1.3 million, yet it almost feels like somewhere rural. This is wonderful. In fact, I'm wary of promoting it, in case it too is swallowed whole by the voracious human wyrm.

It's also cheaper than Prague Castle (which itself it not very expensive). Entering the cathedral is about £1 (St Vitus is free to simply enter but costs about £5 to walk around - still, admittedly, a bargain) while the spacious grounds are entirely free. As is the cemetery, where the great and good of Czech society are buried. As I understand it, the nearest British equivalent would be Westminster Abbey.

It's a fascinating place to explore, though the only name I recognized was Dvorak. Even so, I would have spent longer had I not already been around the site for about 3 or 4 hours. I kept getting distracted by just how lovely the place is.

If you want landscapes, go to Switzerland. For skyscrapers go to America, and for castles go to Wales. But for churches, go to Prague. So far I'm convinced that the city could no more allow an ugly church than a Greenpeace activist would eat a  whale burger with a side order of dolphin fins. Vysehrad is not as magnificent as St Vitus or as ornate as Our Lady Before Tyn. But it is cheaper than St Vitus and far less crowded. It's not free, unlike Tyn, but they do let you take photos (unlike Tyn). The interior is certainly remarkable, and well worth seeing, being entirely covered in paintings.

One could be forgiven for walking through Prague Castle and not realising it's a castle. Not so at Vysehrad, whose massive ramparts are... err, well, they're very large. I think I've run out of metaphors for the day. Still, they provide a very nice walk through the extensive park grounds. I had lunch in what was an unremarkable café until I realised that the walls were four feet thick. Well, I suppose it was important to protect the tourists back in medieval times*.
* Another, much less likely possibility is that it wasn't originally built as a café.

Also, the bar was literally ship-shape and had a demon head hanging at the front.
Vysehrad, though almost deserted, does not lack for places to eat. I can only assume the place is busier in the summer. It also has one or two exhibitions, though I did not pay them a visit. Having spent several hours wandering around, and with the need for laundry becoming ever more pressing, it was time to return. For, as the poet Homer would say :

"But despite my grief, let me do laundry, since there is nothing more shameful than the wretched washing machine that demands a man’s attention however deep his distress, or heavy his heart, and my heart is heavy now, yet my laundry goes on insisting I wash it at 40 degrees with a 1200rpm spin cycle, making me forget what I suffered, demanding the washing machine its fill. "