Archive | December 2011

AMI Small Array Movie

A time lapse movie of the Arcminute Microkelvin Image (AMI) small array, I made by grabbing the webcam feed:

Watch on youtube.

Advertisements

Casacore installation: Addendum

So I was installing Casacore (as described here) on another machine and found I needed to do:

sudo cp -r lib/libcasa_*.so /usr/lib
sudo cp -r /usr/local/lib/libwcs*.so* /usr/lib/

To allow me to use some of the libraries. Bit odd but all seems to work, thought I should take a note of this!

A review of my 2011

2011 will always be one of the most memorable years in my life – it better be as I did get married 🙂
The year started off with me being back in the UK for my birthday which was great but my time at home was all to short and I jetted back off to Calgary (Canada). It is always a sad time to end up back in an empty flat far away from family. Though saying that I do have some
epic friends out in Calgary too. Once back in Calgary it wasn’t long before I was trying out something new… yep I went snowboarding for the first time:
me Snowboarding at COP
Was painful and so far has turned out to be the last time. I just can’t believe how poor my balance is.
In March my best-man Steve came over to visit me in Calgary and that was a lot of fun. Amongst the highlights of his trip over where seeing ice sculptures (and standing on the lake) at Lake Louise:
Lake Louise Ice Sculpture
It wouldn’t have been a proper trip over for him without taking in some hockey, so we went and
watched the outdoor WHL heritage game (that was damn cold!) and a couple of Flames games at the Saddledome:
Flames vs San Jose Sharks
We also went out and saw some world class snowboarding:
Snowboarding World Cup @ COP
At the end of April I found it hard to get home, as stuff was falling off the building across the road from me!
Building falling apart on 10th st...
In May, I said goodbye to Calgary as I had been offered a position at the University of Cambridge, back in the UK. I have to say I’m very glad to have come home and can spend a lot more time with my beautiful wife but I’ll always have very fond memories of Calgary and miss lots about it – in particular the people. I wrote a detailed review of my time in Calgary. Though before I left Calgary I got to go to the wonderfully named small town of Vulcan:
DSCF6677
Before I left Calgary I had a bit of a shock with a health issue, all was fine but lets just say I’ve since changed my work all hours, cut out go out drinking lots and living off caffeine.
In June I started at the Cavendish. I have to say I’m finding Cambridge a little different to the big
cities I’m used to. Oh and I got probably my best scientific result of the year accepted in June.
July was a very busy time. We were heavily involved in Wedding preparation though I did manage to stop for a few bits of fun. This included going to the British Grand Prix for the first time. Yes, it rained – it was a great time though.
Wet Racing
July also involved my stag do, but we don’t talk about that. It was great fun… we went go karting, had burgers and drank. Epic times.I even won a laser quest:
Top at Laser Quest
DSCF6157
August… well this was a hectic month but all got more relaxed after the 19th. On the 19th we got married:
Me and my wife
most of the better pictures aren’t mine and well I feel bad about linking them so won’t
(I wrote lots about the preparations before)
My wedding speech even made it onto youtube:

We took a short break to Bath as a honeymoon part 1.
In September I got to see my first supernova! (that’s a star blowing up by the way)
SN 2011fe
and I took my first photo of a comet, Garrard:
Comet Garrard C/2009 P1
October saw me start to settle into my new surroundings and I took my first trip out to the MRAO. I also had a paper on Ultra Steep Spectrum sources published.
At the of October we took our proper honeymoon out to Croatia, in particular Rovinj. It was absolutely beautiful.
Sunset over Rovinj
The whole Istrian peninsula was full of interesting things, including lots of Roman sites. We also went inland to the Plitvice Lakes National Park – somewhere I’d love to spend a bit more time walking around.
In November I got to go to the University of Birmingham Vale Fireworks for the first time in 2 years so I was quite pleased – always
feels good to celebrate the saving of parliament by blowing up part of the country:
DSCF9224
I got to take a trip over to Paris for ADASS XXI and I presented a poster on magnetic fields in GALFACTS. Elizabeth joined me after
the conference and we had a great weekend exploring Paris. Lots of fun.
Eiffel Tower at night
At the end of the month we went out to Wast Hills and did some more of Messier catalogue but I went outside and tried out my camera at some night time constellation shots (Orion here above the dome):
Wast Hills and Orion
and now its December. December has been a hectic month, and we are moving down to Cambridge in the new year so busy busy but we did manage to go out observing the other week and capture the Christmas tree cluser. Merry Christmas!
Christmas Tree Cluster
I’m looking forward to 2012… should be lots of fun. So far I have lots of observing planned, trip to India in Feb and tickets for the Olympics (alas just football). As a friend of mine said to me recently einen guten Rutsch ins neue Jahr

Observing last night – Jupiter + Dumbbell

It wasn’t particularly clear during our observing session, which was mostly aimed at taking a look at the ISS and Jupiter with our own eyes, but we focused the Meade out at Wast Hills and took a couple of images…
Jupiter_clouds
If you change the contrast a little you can clearly see the Moons:
Jupiter_moons
It was rather cloudy but we still managed a short exposure of the Dumbbell Nebula:
dumbell_neb_rgb

Creating FITS files in c++

A simple example, very similar to that given in the CFITSIO guidebook, on how to create a FITS file using CFITSIO. In this case I’m also building against some casacore libraries, but these aren’t going to be used in this little code snippet but the idea is to use casacore todo further analysis. I’m hoping to post more here over time. Anyway the code (this can also be found as a filebuild_fits.cpp:

/* Create a FITS file, using cfitsio and some casacore libraries
by Samuel George
21-11-2011
Compile: g++ build_fits.cpp -o build_fits -lcasa_casa -lcfitsio
*/
#include // STL iostream
#include
#include
extern “C”{
#include
}
using std::cerr;
using std::cout;
using std::endl;
using std::string;
int main()
{
cout << "Create a FITS file" << endl;
int lenTime(10), status (0), lenFreq(20);
long naxis(2), naxes[2] = {lenTime,lenFreq};
long nelements (lenTime*lenFreq);
long fpixel (1), exposure (1500);
char comment[] ="Total Exposure Time";
cout << comment << endl;
float pixels[lenFreq][lenTime];
// create an array of pixels
try {
for (int ii(0); ii < lenTime; ii++){
for (int jj(0); jj <lenFreq; jj++){
pixels[jj][ii] = 10.0*(ii+jj);
}
}
} catch (string message) {
cerr << "Error creating pixel array" << message << endl;
}
try { // write the image to a fits file…
fitsfile *fptr;
fits_create_file (&fptr, "!output.fits", &status);
fits_create_img (fptr, FLOAT_IMG,naxis,naxes,&status);
/* Write a keyword – its the address you pass */
fits_update_key(fptr,TLONG,"EXPOSURE",&exposure,comment,&status);
//write an array to the image
fits_write_img(fptr, TFLOAT, fpixel, nelements, pixels[0],&status);
fits_close_file(fptr,&status);
status = 0 ;
} catch (std::string message) {
cerr << message << endl;
}
}

Save the code and compile like so:
g++ build_fits.cpp -o build_fits -lcasa_casa -lcfitsio
and then run with ./build_fits

Spectral Extraction in Python

I’ve wrote about how to read in FITS files in Python before, but I thought I’d readdress as I’ve been writing lots about fitting and wanted to build up to fitting properly calibrated data. So in this example I will add how to extract a spectra too. For this example I’m going to use a calibration lamp taken at the University of Birmingham Observatory. Both the script described here and the data will be given below. The output looks like:
Spectral Plotting
So let’s start with reading in a FITS file. Firstly ensure you have the most useful per-requisites ([Pyfits], [numpy], [scipy]) and import them:

import pyfits, numpy, scipy

Now read in the file:

input_file = “A.fits”
hdulist = pyfits.open(input_file)

Get the data:

img_data = hdulist[0].data

Get the header:

img_header = hdulist[0].header

(more on FITS)
Now lets use some calibration data (which can be downloaded):

import pyfits, numpy, scipy, pylab
from scipy import *
from pylab import *
input_file = “Neon.fits”
hdulist = pyfits.open(input_file)
img_data = hdulist[0].data

We know that the spectra, by looking at the FITS file with DS9 has data in a small aperture. For now we will ignore any averaging. Lets take line 144 as we know there is data.

data_use = img_data[144]

Plot the spectra:

fig = figure(figsize=(9, 9)) #make a plot
ax1 = fig.add_subplot(111)
ax1.plot(img_data[144]) #spectrum
setp(gca(), ylabel=”Un-normalised power”, xlabel=”Pixel Position”)
pylab.savefig(“plot_spectra.png”)

We have now extracted the data for a spectral column. I will follow this post up in the not to distant future with how to now identify the lines and run spectral calibration. Once you have this you can apply to a target spectra. Of course I’ve so far also ignored dark/bias counts but these can be easily dealt with.
The above can be downloaded as extract_spectra.py and the data Neon.fits (this is zipped, use gunzip).

Christmas Tree Cluster

Probably not the best picture I’ll ever take of this source, I blame the bright moon, but here is a picture of the Christmas Tree Cluster that we took last night….
Christmas Tree Cluster
… so “ho ho ho, merry Christmas”.