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, www.rhysy.net



Tuesday, 3 March 2015

How To Model A Squid In Blender : A Tutorial

So, you've started learning Blender and obviously the first thing you want to do is model a squid. But there are sooo many buttons ! Which one to press first ? Unbelievably, there is no "add squid" button, but have no fear. With this helpful guide, in as little as nine years you too will be able to create your own virtual kraken to terrorise the briny deeps - in just 17 difficult steps !

I mean HOLY CRAP that is a lot of buttons.

1) Do a PhD in astronomy. Befriend someone who's really keen on galaxy simulations. It may seem like a odd beginning, but don't worry, it'll all make sense in step 10, probably.

2) Become vaguely confused about why there are lots of galaxies without much gas in the Virgo cluster, but no sign of where the gas has gone.

Well, not many. This one is a clear example of a galaxy losing gas in a long stream.
But while there are hundreds of galaxies in the cluster with less gas than expected, there
are only four with features like this. 

3) Fly to a tropical island and use the world's largest telescope to do the most sensitive hydrogen observations ever undertaken of the Virgo cluster and look for gas streams. I mean, that ought to do it, right ? Wrong. Fail miserably to find any.


4) Write a program to increase sensitivity by averaging the data in four hundred million different areas. Because you're young and stupid, you have no idea the CFITSIO library exists and you don't know Python or IDL. This means you're going to have to use a lot of "call system commands" to mbspect. Like, a lot.

Still fail to detect any streams.

5) Boldly declare, "Well gosh darn it, I don't think there are any hydrogen streams in this area !". Argue with supervisor.

6) After three years, frantically complete PhD, then live in the jungle for two and a half years publishing papers. Tell everyone it's really important you find those streams. Keep your squid-making plans secret, for now. Oh, and spend six months learning to drive first, but fail the test four times. If possible, write a 3000-line Python script for Blender to load astronomical data files. Keep raving on about it to anyone who'll listen.

Remember, this is all in aid of modelling a squid ! Try to stay focused, will you ?

Along the way, get stuck in a hurricane, adopt cats, write terrible poetry, create strange glass cubes, learn IDL, fail to learn any Spanish, perpetually complain about the humidity and lack of public transport, bake everyone brownies and keep drinking plenty of tea and pina coladas.
7) Decide that the jungle lifestyle isn't for you and move to a major European city where the focus is on simulations. Keep working on that script for another year. Publish more papers.


8) Become cajoled into doing simulations yourself. Remember about that whole "missing gas" thing.

9) Realise that the gravitational fields of the hundreds of galaxies buzzing through the cluster are probably going to make life quite difficult for any gas that does get removed from the galaxies.

Simulation showing the trajectories of 250 galaxies moving through a cluster.
10) Ask your friend (you didn't forget about him did you ?) if maybe his old galaxy harassment model would be suitable for making a squ... NO ! You must keep your squid project a secret. No-one's going to let you play with high-end simulations because you want a virtual squid.
Tell him it's about studying what happens to long streams of gas in a cluster environment. That ought to work.

11) Express delight when your friend returns the galaxy positions extracted from a big simulation that had full baryonic physics* included. This is pretty cutting-edge stuff and he's worked hard on this, so be polite. Humour him with clever banter about being interested in dramatic things like, "the fate of the stripped gas". He doesn't need to know about the squid... yet.

* It's not actually that simulation, but they have the best website.

12) Convert your friend's Fortran (urgh) script for generating streams into a nice Python version*,  that can automatically place the streams in a variety of different places in the cluster. Then you can sit back and watch what happens when a stream gravitationally interacts with all the galaxies in the cluster. That should give you a decent chance of creating a squid.

* You did remember to learn Python, right ? If not, return to step 6.

13) Drink tea for a week while the simulations are running. Try and keep busy by watching award-winning BBC documentaries about squid.


14) Have a look at the results. Say "ooooh". Realise you have to grid the data into position-velocity cubes to make any meaningful comparisons to observations.

15) Momentarily despair because the simulations look more snakes than squids ! And who cares about crappy old snakes ? No-one, that's who.


16) Realise you can grid the data is a better way ! Throw away that lousy velocity axis and replace the cube with a series of integrated flux maps, centered on the mean particle position, with time as the third axis. Those nine years of Python scripting ought to make that a doddle. And behold !


17) Say, "hmm, yes, indeed that does look quite a lot like a squid". Ask colleagues if they think "Cthulhu" or "Squiddy McSquiddington" would be a better name. When they look at you like you are  a crazy person, realise that they are correct. You've wasted nine years of your life. Take up golf instead.

No comments:

Post a Comment