Archive | July 2012

Its nice to be thanked

A couple of weeks back I had a lovely email asking about what is like to be an astronomer from a couple of school children in Melbourne, Australia. I wrote back to them with some of the details of my day-to-day life and what its like to work in the field. I thought it would be nice to send them a postcard of one of the telescopes from the MRAO. Yesterday I got a lovely response:

melbournepostcard1

melbournepostcard2

I’m rather touched.

Advertisements

2million times your eye…

.. yep that’s what the resolution (the smallest thing you can make out) that the  Atacama Pathfinder Experiment (APEX) telescope gets you! Now that’s just awesome. It’s also good enough to look at the super massive black hole in the centre of our Galaxy. Oh and lets not stop there (in the voice of some TV advert trying to sell you fitness products)… in the case of 3C 279, a distant quasar some 5 billion light years away, it gets a resolution of 1 light year! That’s good enough to properly resolve around the black hole!

To get this resolution a bunch of telescopes were all linked up using a method called  Very Long Baseline Interferometry (VLBI). Interferometry allows many telescopes to act like a single telescope but with the distance between them as the size of the telescope. This allows for such amazing resolutions to be achieved. 

You can read more over on the ESO webpages.

Time for a change…

Well then its been quite sometime since I last changed the look of these pages. I think its about time that I did this. So here we are… new look. Its very similar to my research pages… there are bound to be a few teething issues but here we go….

Making mosaics

For the [ALMA Summer Science Exhibition blog] I wanted to make a [big mosaic] of all the images taken – you’ll probably see this on the [post below] (unless its fallen off the bottom of the page!). To do this was really quite straight forward using python (well matplotlib mostly).
The below script takes in a list of png files and then setups a canvas – something I’d already figured out the dimensions for via the figure size of 12 by 12 inches and a 400dpi – that gives me 400 pixels for each inch and nicely each image is a 400×400 pixel square. I’d also already figured out the loop limits that were required to get all of my images in (if I get chance I might make these command line options and package this up as a little tool but I’m sure many better ones already exist – this is more a quick and dirty way of doing this).

import matplotlib.pyplot as plt
import Image
import numpy as np
import os
from scipy import ndimage

xtemp = os.popen("ls *png") #all files

xtemp2 = (xtemp.read().split('n'))

files = len(xtemp2)-1 #number of files.

stepsize = 400 #this is the image size in x,y

fig = plt.figure(num=None, figsize=(12, 12), facecolor='k', edgecolor='none')

k = 0

j = 0

i = 0

while k< 5000:

j = 0

while j < 5000:

im = Image.open(xtemp2[i])

im = np.array(im).astype(np.float) / 255

#im = ndimage.rotate(im, 90) #if we need to rotate

fig.figimage(im, k, j) #, zorder=i)

print k, j, i

i +=1

j +=stepsize

k +=stepsize

plt.subplots_adjust(left=0.00, right=1.0, top=0.9, bottom=0.0)

fig.savefig('outputprint.png',figsize=(12, 12),dpi=400, facecolor='k', edgecolor='k')

ALMA SSE imaging mosaic

A mosaic of all the “interferometered” people and objects at the ALMA Royal Society Summer Science Exhibition stand…
ALMA Summer Science Exhibition Mosaic
.. nice bunch of people – I can spot myself in there a few times. If came along you might be able to spot yourself!

Overplotting with matplotlib

For the [ALMA SSE] I had to code up some overlays using matplotlib. This was so visitors to our stand at the exhibit could take away a printed copy of themselves as “seen through ALMA’s eyes” – and this involved some simple overlaying with maplotlib. Now, given I tend to forget useful things like this I thought I’d post it here and here is an example of the output:
ALMA SSE output image
It turns out that a combination of the python packages numpy, imager and matplotlib is a really quick way to do the overlaying:

import matplotlib.pyplot as plt
import Image
import numpy as np
im = Image.open('logo.png')
height = im.size[1]
# Need array of floats between 0-1, not a uint8 array between 0-255
im = np.array(im).astype(np.float) / 255
fig = plt.figure()
plt.plot(np.arange(10), 4 * np.arange(10))
rect = fig.patch
rect.set_facecolor('black')
plt.text(-1, 30, 'Some lovely text n websiteaddress.org ', style='italic',
bbox={'facecolor':'blue', 'alpha':0.5, 'pad':10}, rotation=90)
# can use zorder here rather than hide behind it (e.g. zorder=1)
fig.figimage(im, 0, fig.bbox.ymax - height)
im = Image.open('logo2.png')
height = im.size[1]
im = np.array(im).astype(np.float) / 255
fig.figimage(im, fig.bbox.ymin, 0)
# Saving with the same dpi as the screen default
fig.savefig('temp.png', dpi=80, facecolor=fig.get_facecolor(), edgecolor='none')
plt.show()

Olympic Torch passed by this morning…

The Olympic torch ran right outside of our house this morning (down the Huntingdon Road in Cambridge). Was all a quick blur and to be honest really not worth getting up for at 7am. It all felt very corporate and really just an excuse to promote Coke and Samsung. There were so many support vehicles. I hate to think how much that is costing and how much pollution that is being unnecessarily produced… but here is the torch..
Olympic Torch ran past our home
so at least I got a shot! 🙂