<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Krioma.net Blog</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/" />
   <link rel="self" type="application/atom+xml" href="http://www.krioma.net/blog/atom.xml" />
   <id>tag:www.krioma.net,2012:/blog//1</id>
   <updated>2012-02-04T14:38:27Z</updated>
   <subtitle>A site based on the thoughts of Samuel George - the guy behind Krioma.net. The thoughts mostly stem from his life experiences which mostly include astrophysics, astronomy, beer, football, music and computers.</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.38</generator>

<entry>
   <title>FAS Newsletter #1</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/02/fas_newsletter_1.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1703</id>
   
   <published>2012-02-04T14:21:24Z</published>
   <updated>2012-02-04T14:38:27Z</updated>
   
   <summary>I feel like someone having in their hands issue number one of a comic... well maybe not like that but its still quite cool. I love looking back at how things started. The Federation of Astronomical Societies newsletter has been...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="207" label="FAS" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="304" label="uk astronomy" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[I feel like someone having in their hands issue number one of a comic... well maybe not like that but its still quite cool. I love looking back at how things started. <a href="http://fedastro.org.uk">The Federation of Astronomical Societies</a> newsletter has been running since June 1984 and over the last few months I've been sorting and scanning in a bunch of older records. This will eventually enhance the <a href="http://fedastro.org.uk/fas/index.php?option=com_content&task=view&id=88&Itemid=83">full online archive</a> (before we only had back to 1999 online) of our newsletters. 

<a href="http://www.flickr.com/photos/starrydude/6816973033/" title="fas_newsletter1 by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7022/6816973033_34a71f5234.jpg" width="384" height="500" alt="fas_newsletter1"></a>

The highlights of this issue are a write up of a night out at the Temple Observatory by a member of <a href="http://www.covastro.org.uk/">Coventry and Warwickshire Astronomical Society</a>. Oh and if you were wondering, as I was, <a href="http://www.rugbyschool.net/temple-observatory-grand-opening">the telescope is still used</a>. There is the first ever news round up, a stable of the FAS newsletter over the years and an article on how to make a star clock. I quite enjoyed seeing that the FAS subscription for the year was £7.50 - which would not be for a small society. Lets compare that to our medium society now of £44.50 (not including early payment) - its not that bad given we are looking back close to 3 decades. 

Anyway, if you wish to read FAS Newsletter #1 you can get a <a href="www.fedastro.org.uk/newsletter/FASnewsolder/FAS_news1.pdf">pdf of it from the FAS website</a>.]]>
      
   </content>
</entry>
<entry>
   <title>Integration in R</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/01/integration_in_r.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1665</id>
   
   <published>2012-01-26T08:45:01Z</published>
   <updated>2012-01-26T08:50:15Z</updated>
   
   <summary>A reminder to myself of something I did quite a while go, how to do integration with [R]. dj integrand integrate(Vectorize(integrand), lower = 0, upper = 10) Of course the [R documentation] is of great use too....</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="291" label="r" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="120" label="research" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[A reminder to myself of something I did quite a while go, how to do integration with <a href="http://http://www.r-project.org/">[R]</a>.

<blockquote>dj <- c(6.8543973e+00,6.0742026e+00,
   5.1180908e+00,
   6.8335044e+00,
   5.5119610e+00,
   5.5103389e+00,
   4.8272714e+00,
   6.3162468e+00,
   4.9450749e+00,
   6.0684488e+00,
   3.9246411e+00,
   5.1356979e+00,
   5.3176933e+00,
   5.0402740e+00)

integrand <- function(i) {sum(dj[i] - i - 5 )^2}
integrate(Vectorize(integrand), lower = 0, upper = 10)</blockquote>

Of course the <a href="http://stat.ethz.ch/R-manual/R-patched/library/stats/html/integrate.html">[R documentation]</a> is of great use too. 


]]>
      
   </content>
</entry>
<entry>
   <title>M42: The Orion Nebula</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/01/m42_the_orion_nebula_1.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1693</id>
   
   <published>2012-01-15T00:11:43Z</published>
   <updated>2012-01-15T00:13:36Z</updated>
   
   <summary>I love looking at the Orion nebula. Its always a lovely object to look at - its even better to take photos of it. I&apos;ve not managed a properly deep image yet and the one that I&apos;ll show you below...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Photos" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="253" label="messier" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[I love looking at the Orion nebula. Its always a lovely object to look at - its even better to take photos of it. I've not managed a properly deep image yet and the one that I'll show  you below was affected by a pretty bright Moon. The Orion Nebula (Messier 42) is a diffuse nebula situated south of Orion's Belt and is a really easy binocular target. 

<a href="http://www.flickr.com/photos/starrydude/6486219783/" title="M42 by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7167/6486219783_47ca394a60.jpg" width="443" height="500" alt="M42"></a>

<a href="http://www.flickr.com/photos/starrydude/6486220117/" title="M42 by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7164/6486220117_68e2c60764.jpg" width="443" height="500" alt="M42"></a>

The same photo with different contrast levels chosen to highlight different parts of the Nebula.

]]>
      
   </content>
</entry>
<entry>
   <title>Moon and plane over Birmingham</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/01/moon_and_plane_over_birmingham.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1692</id>
   
   <published>2012-01-08T20:45:20Z</published>
   <updated>2012-01-08T21:08:39Z</updated>
   
   <summary>Not that long ago I managed to capture a lovely full Moon with a plane in the same field:...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Photos" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="119" label="moon" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[Not that long ago I managed to capture a lovely full Moon with a plane in the same field:

<a href="http://www.flickr.com/photos/starrydude/6486307835/" title="Moon and plane over Birmingham by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7158/6486307835_d74a5d1bc3.jpg" width="500" height="375" alt="Moon and plane over Birmingham"></a>]]>
      
   </content>
</entry>
<entry>
   <title>Convert 3gp to a better format</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/01/convert_3gp_to_a_better_format.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1702</id>
   
   <published>2012-01-02T11:21:24Z</published>
   <updated>2012-01-02T11:32:51Z</updated>
   
   <summary>By default my phone camera takes video in 3gp format - which isn&apos;t the best for sharing around... so here is how to convert it using ffmpeg on linux: Firstly you might need to install ffmpeg and some libraries: sudo...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="247" label="ffmpeg" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="179" label="video" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      By default my phone camera takes video in 3gp format - which isn&apos;t the best for sharing around... so here is how to convert it using ffmpeg on linux:

Firstly you might need to install ffmpeg and some libraries:

sudo apt-get install ffmpeg libavcodec-extra-52

You can just do:

ffmpeg -r 1 -i VIDEO0032.3gp -f avi -r 24 -vcodec libxvid -acodec libmp3lame  movie.avi  

but this gives some crapy quality -  a better way is:

ffmpeg -r 1 -i VIDEO0034.3gp -f mp4 -acodec libmp3lame -ar 44100 -ab 128 -vcodec mpeg4 -maxrate 2000 -b 1500 -qmin 3 -qmax 5 -bufsize 4096 -g 300 -r 30000/1001 outfile2.mp4 
      
   </content>
</entry>
<entry>
   <title>AMI Small Array Movie</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/ami_small_array_movie.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1701</id>
   
   <published>2011-12-27T17:19:39Z</published>
   <updated>2011-12-27T17:23:40Z</updated>
   
   <summary>A time lapse movie of the Arcminute Microkelvin Image (AMI) small array, I made by grabbing the webcam feed: Watch on youtube....</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[A time lapse movie of the <a href="http://www.mrao.cam.ac.uk/telescopes/ami/">Arcminute Microkelvin Image</a> (AMI) small array, I made by grabbing the webcam feed:

<iframe width="420" height="315" src="http://www.youtube.com/embed/SZcYV6h4kqw" frameborder="0" allowfullscreen></iframe>

<a href="http://youtu.be/SZcYV6h4kqw">Watch on youtube</a>. 

]]>
      
   </content>
</entry>
<entry>
   <title>Recover data with ddrescue</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/recover_data_with_ddrescue.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1688</id>
   
   <published>2011-12-24T12:13:44Z</published>
   <updated>2011-12-24T12:11:32Z</updated>
   
   <summary>Been handed a dead hard drive and want to try and recover some of the data? That&apos;s the problem I had the other day. So I turned to some good old linux tools to try and recover the data. One...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="47" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[Been handed a dead hard drive and want to try and recover some of the data? That's the problem I had the other day. So I turned to some good old linux tools to try and recover the data.  One of my favourite recovery tools is <a href="http://www.gnu.org/s/ddrescue/ddrescue.html">ddrescue</a>. It works really well and given enough time can do a pretty solid job of data recovery - of course a better solution is <strong>proper backups</strong> but that's not always the way people go.  Anyway, this is as much a note for myself but here is how to do some basic recovery using it:

<blockquote>sudo ddrescue -r 3 /dev/sde2 imaging loging</blockquote>

This images /dev/sed2 and produces the image file "imaging" with the log "logging". 

To try and extract files you could use something like <a href="http://foremost.sourceforge.net/">foremost</a>

<blockquote>sudo foremost -w -i imaging -o /recovery/foremost</blockquote>

To make an audit of the files that can be recovered, recovering them with:

<blockquote>sudo foremost -i imaging -o /recovery/foremost2</blockquote>]]>
      
   </content>
</entry>
<entry>
   <title>Music of 2011</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/music_of_2011.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1691</id>
   
   <published>2011-12-22T11:44:48Z</published>
   <updated>2011-12-23T08:52:48Z</updated>
   
   <summary>At the end of each year, yes I know I&apos;m a few days early but bah I have to move house at the start of the new year, I like to summarise the music I&apos;ve been listening to. The last...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="General Me" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Music" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[At the end of each year, yes I know I'm a few days early but bah I have to move house at the start of the new year, I like to summarise the music I've been listening to. The last few years have been much easier as <a href="http://www.last.fm/user/starrydude">last.fm</a> keeps hold of that info. I suspect that its missing about 20% of the music I listen to, which isn't scrobbled for one reason and another. It might be a little higher than that but I don't like to include the car journeys when we are using the CD player. 

I was a little shocked to see the number 1 artist of the year, and indeed a few different names in the top 10. I'm putting this down to a Calgary scene influence... (number, artist, plays)

1 	Daft Punk 1,163
2 	Linkin Park 664
3 	Avril Lavigne 552
4 	My Chemical Romance 526
5 	Tiësto 522
6 	Rise Against 285
7 	Angels & Airwaves 271
8 	Dead by April 259
9 	Lostprophets 239
10 	Disturbed 238


I have to say I did love the <a href="http://en.wikipedia.org/wiki/Tron:_Legacy">Daft Punk Tron</a> album so I'm guessing this is what dominates that. I also find <a href="http://www.tiesto.com">Tiesto</a> quite good for background music whilst I'm reading (in particular I really think Kaleidoscope fits in really well with the Garth Nix books I've been reading).

Not that much new for 2011 in this list though. Wonder if that will change in 2012. ]]>
      
   </content>
</entry>
<entry>
   <title>A review of my 2011</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/a_review_of_my_2011.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1690</id>
   
   <published>2011-12-21T18:14:03Z</published>
   <updated>2011-12-22T09:34:58Z</updated>
   
   <summary>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...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="General Me" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Photos" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[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<a href="http://www.krioma.net/blog/2011/01/my_first_time_snowboarding.php"> I went snowboarding for the first time</a>: 

<a href="http://www.flickr.com/photos/starrydude/5382700019/" title="me Snowboarding at COP by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5207/5382700019_a382d38a52.jpg" width="375" height="500" alt="me Snowboarding at COP"></a>

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 <a href="http://www.krioma.net/blog/2011/03/a_winter_trip_into_the_mountai.php">of his trip over where seeing ice sculptures</a> (and standing on the lake) at Lake Louise:

<a href="http://www.flickr.com/photos/starrydude/5485272241/" title="Lake Louise Ice Sculpture by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5256/5485272241_d48cfbddf1.jpg" width="500" height="375" alt="Lake Louise Ice Sculpture"></a>

It wouldn't have been a proper trip over for him without taking in some hockey, so we went and 
watched the outdoor<a href="http://www.krioma.net/blog/2011/03/a_couple_of_hockey_games.php"> WHL heritage game (that was damn cold!) and a couple of Flames games</a> at the Saddledome:

<a href="http://www.flickr.com/photos/starrydude/5480617684/" title="Flames vs San Jose Sharks by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5251/5480617684_62e8e01783.jpg" width="500" height="375" alt="Flames vs San Jose Sharks"></a>

We also went out and saw <a href="http://www.krioma.net/blog/2011/04/snowboarding_fis_world_cup.php">some world class snowboarding</a>:

<a href="http://www.flickr.com/photos/starrydude/5480619946/" title="Snowboarding World Cup @ COP by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5093/5480619946_262bbe22b5.jpg" width="500" height="375" alt="Snowboarding World Cup @ COP"></a>

At the end of April I found it hard to get home, as stuff was<a href="http://www.krioma.net/blog/2011/04/seriously_stuff_is_falling_off.php"> falling off the building across the road from me!</a>

<a href="http://www.flickr.com/photos/starrydude/5660026950/" title="Building falling apart on 10th st... by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5069/5660026950_3140f7df68.jpg" width="375" height="500" alt="Building falling apart on 10th st..."></a>


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. <a href="http://www.krioma.net/blog/2011/05/a_review_of_my_time_in_canada.php">I wrote a detailed review of my time in Calgary</a>. Though before I left Calgary I got to go to the wonderfully<a href="http://www.krioma.net/blog/2011/05/vulcan_and_headsmashedinbuffal.php"> named small town of Vulcan</a>:

<a href="http://www.flickr.com/photos/starrydude/5732004991/" title="DSCF6677 by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5184/5732004991_03a0796c19.jpg" width="500" height="375" alt="DSCF6677"></a>

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<a href="http://www.krioma.net/blog/2011/06/week_one_in_cambridge.php"> I started at the Cavendish</a>. I have to say I'm finding Cambridge a little different to the big 
cities I'm used to. Oh and I got probably <a href="http://www.krioma.net/blog/2011/06/new_paper_detection_thresholds.php">my best scientific result of the year accepted in June</a>.

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 <a href="http://www.krioma.net/blog/2011/07/british_f1_gp.php">British Grand Prix</a> for the first time. Yes, it rained - it was a great time though. 

<a href="http://www.flickr.com/photos/starrydude/5926712503/" title="Wet Racing by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6026/5926712503_5164fd9bb3.jpg" width="500" height="375" alt="Wet Racing"></a>

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:

<a href="http://www.flickr.com/photos/starrydude/6000693015/" title="Top at Laser Quest by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6003/6000693015_d3a4866af7.jpg" width="500" height="299" alt="Top at Laser Quest"></a>

<a href="http://www.flickr.com/photos/starrydude/6040408047/" title="DSCF6157 by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6203/6040408047_b2bb5d6f57.jpg" width="500" height="333" alt="DSCF6157"></a>


August... well this was a hectic month but all got more relaxed after the 19th. On the 19th we got married:

<a href="http://www.flickr.com/photos/starrydude/6065205650/" title="Me and my wife by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6184/6065205650_9dc6dab485.jpg" width="500" height="299" alt="Me and my wife"></a>

most of the better pictures aren't mine and well I feel bad about linking them so won't 
(I wrote lots <a href="http://www.krioma.net/blog/2011/08/wedding_preparations.php">about the preparations before</a>)

My wedding speech even <a href="http://www.youtube.com/watch?v=8FUfBXHF8VI">made it onto youtube</a>:

<iframe width="560" height="315" src="http://www.youtube.com/embed/8FUfBXHF8VI" frameborder="0" allowfullscreen></iframe>

We took a short break to<a href="http://www.flickr.com/photos/starrydude/sets/72157627384663501/"> Bath as a honeymoon part 1</a>. 

In September I got to see <a href="http://www.krioma.net/blog/2011/09/supernova_in_ursa_major.php">my first supernova</a>! (that's a star blowing up by the way)

<a href="http://www.flickr.com/photos/starrydude/6130242514/" title="SN 2011fe by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6207/6130242514_58a788c11a.jpg" width="494" height="226" alt="SN 2011fe"></a>

and I took <a href="http://www.krioma.net/blog/2011/09/my_first_comet_comet_garrard.php">my first photo of a come</a>t, Garrard:

<a href="http://www.flickr.com/photos/starrydude/6146037183/" title="Comet Garrard C/2009 P1 by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6199/6146037183_3de590f1bc.jpg" width="468" height="500" alt="Comet Garrard C/2009 P1"></a>


October saw me start to settle into my new surroundings and <a href="http://www.krioma.net/blog/2011/10/a_trip_out_to_lords_bridge.php">I took my first trip out to the MRAO</a>. I also had a paper on <a href="http://www.krioma.net/blog/2011/10/new_paper_optical_observations.php">Ultra Steep Spectrum sources published</a>. 

At the of October we took our proper honeymoon out <a href="http://www.krioma.net/blog/2011/10/croatia_around_rovinj.php">to Croatia, in particular Rovinj</a>. It was absolutely beautiful. 

<a href="http://www.flickr.com/photos/starrydude/6216839179/" title="Sunset over Rovinj by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6042/6216839179_1ec67e68fc.jpg" width="500" height="375" alt="Sunset over Rovinj"></a>

The whole Istrian peninsula was full of interesting things,<a href="http://www.krioma.net/blog/2011/10/croatia_pula_groznjan.php"> including lots of Roman sites</a>. We also went inland to the <a href="http://www.krioma.net/blog/2011/10/croatia_plitvice_lakes_nationa.php">Plitvice Lakes National Park</a> - somewhere I'd love to spend a bit more time walking around.


In November I got to go to the <a href="http://www.krioma.net/blog/2011/11/vale_fireworks_2011.php">University of Birmingham Vale Fireworks</a> 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:

<a href="http://www.flickr.com/photos/starrydude/6311174639/" title="DSCF9224 by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6119/6311174639_df8eb89f31.jpg" width="500" height="375" alt="DSCF9224"></a>

I got to take a trip over to Paris for <a href="http://www.krioma.net/blog/2011/11/adass_overview.php">ADASS XXI</a> and I presented a poster on magnetic fields in <a href="http://www.krioma.net/blog/2011/11/probing_magnetic_fields_with_g.php">GALFACTS</a>.  Elizabeth joined me after 
the conference and <a href="http://www.krioma.net/blog/2011/11/a_week_in_paris.php">we had a great weekend exploring Paris</a>. Lots of fun.

<a href="http://www.flickr.com/photos/starrydude/6336128877/" title="Eiffel Tower at night by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6056/6336128877_318b70f16e.jpg" width="500" height="375" alt="Eiffel Tower at night"></a>

At the end of the month we went out to<a href="http://www.krioma.net/blog/2011/11/observing_last_night_2.php"> Wast Hills and did some more of Messier catalogue</a> but I went outside and tried out my camera at some night time constellation shots (Orion here above the dome):

<a href="http://www.flickr.com/photos/starrydude/6404230375/" title="Wast Hills and Orion by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7174/6404230375_f0efcb6e9d.jpg" width="500" height="375" alt="Wast Hills and Orion"></a>

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<a href="http://www.krioma.net/blog/2011/12/christmas_tree_cluster.php"> Christmas tree cluser</a>.  Merry Christmas!

<a href="http://www.flickr.com/photos/starrydude/6486238543/" title="Christmas Tree Cluster by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7151/6486238543_b08db7a299.jpg" width="500" height="500" alt="Christmas Tree Cluster"></a>

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
]]>
      
   </content>
</entry>
<entry>
   <title>Observing last night - Jupiter + Dumbbell</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/observing_last_night_jupiter_d.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1689</id>
   
   <published>2011-12-19T14:29:02Z</published>
   <updated>2011-12-19T14:36:28Z</updated>
   
   <summary>It wasn&apos;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......</summary>
   <author>
      <name></name>
      
   </author>
   
   <category term="143" label="wast hills" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[It wasn't particularly clear during our observing session, which was mostly aimed at taking a look at the ISS and <a href="http://en.wikipedia.org/wiki/Jupiter">Jupiter</a> with our own eyes, but we focused the Meade out at <a href="http://www.sr.bham.ac.uk/observatory/">Wast Hills</a> and took a couple of images...

<a href="http://www.flickr.com/photos/starrydude/6537367731/" title="Jupiter_clouds by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7170/6537367731_f034f48030.jpg" width="500" height="331" alt="Jupiter_clouds"></a>

If you change the contrast a little you can clearly see the Moons:

<a href="http://www.flickr.com/photos/starrydude/6537367803/" title="Jupiter_moons by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7172/6537367803_b4112238cb.jpg" width="500" height="248" alt="Jupiter_moons"></a>

It was rather cloudy but we still managed a short exposure of the <a href="http://en.wikipedia.org/wiki/Dumbbell_Nebula">Dumbbell Nebula</a>:

<a href="http://www.flickr.com/photos/starrydude/6537368001/" title="dumbell_neb_rgb by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7152/6537368001_2f81101d1d.jpg" width="500" height="430" alt="dumbell_neb_rgb"></a>]]>
      
   </content>
</entry>
<entry>
   <title>Creating FITS files in c++</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/creating_fits_files_in_c.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1681</id>
   
   <published>2011-12-18T10:41:22Z</published>
   <updated>2011-12-18T16:47:11Z</updated>
   
   <summary>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&apos;m also building against some casacore libraries, but these aren&apos;t going to be used in this...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="298" label="c++" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="293" label="casa" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[A simple example, very similar to that given in the <a href="http://heasarc.gsfc.nasa.gov/fitsio/">CFITSIO</a> guidebook, on how to create a FITS file using <a href="http://heasarc.gsfc.nasa.gov/fitsio/">CFITSIO</a>. In this case I'm also building against some <a href="http://code.google.com/p/casacore/">casacore</a> libraries, but these aren't going to be used in this little code snippet but the idea is to use <a href="http://code.google.com/p/casacore/">casacore</a> todo further analysis. I'm hoping to post more here over time. Anyway the code (this can also be found as a file<a href="http://www.mrao.cam.ac.uk/~sgeorge/scripts/build_fits.cpp">build_fits.cpp</a>:

<blockquote>/* 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 <iostream> // STL iostream
#include <string>
#include <cmath>

extern "C"{
#include <fitsio.h>
}

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;
	}
}</blockquote>

Save the code and compile like so:

g++ build_fits.cpp -o build_fits -lcasa_casa -lcfitsio

and then run with ./build_fits]]>
      
   </content>
</entry>
<entry>
   <title>CASA leap seconds issue</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/casa_leap_seconds_issue.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1682</id>
   
   <published>2011-12-14T11:39:33Z</published>
   <updated>2011-12-14T15:33:36Z</updated>
   
   <summary>I had an odd CASA issue yesterday. It was complaining about missing leap second information for TAI_UTC! Seemed really quite odd to me as I hadn&apos;t done anything to my installation... anyway simple fix is to update the latest leap...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="293" label="casa" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[I had an odd CASA issue yesterday. It was complaining about missing leap second information for TAI_UTC! Seemed really quite odd to me as I hadn't done anything to my installation... anyway simple fix is to update the latest leap second information into CASA by running a simple command in the root casa install directory:

<blockquote>cd $CASA_ROOT/data
rsync -avz rsync.aoc.nrao.edu::casadata .</blockquote>]]>
      
   </content>
</entry>
<entry>
   <title>Spectral Extraction in Python</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/spectral_extraction_in_python.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1687</id>
   
   <published>2011-12-10T16:24:26Z</published>
   <updated>2011-12-10T16:34:06Z</updated>
   
   <summary>I&apos;ve wrote about how to read in FITS files in Python before, but I thought I&apos;d readdress as I&apos;ve been writing lots about fitting and wanted to build up to fitting properly calibrated data. So in this example I will...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="302" label="fits" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="155" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="134" label="spectra" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="143" label="wast hills" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[I've wrote about <a href="http://www.krioma.net/blog/2011/04/fits_files_in_python.php">how to read in FITS files in Python before</a>, but I thought I'd readdress<a href="http://www.krioma.net/blog/2011/12/multiple_gaussian_fitting_in_p.php"> as I've been writing lots about fitting</a> 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 <a href="http://www.sr.bham.ac.uk/observatory/">University of Birmingham Observatory</a>. Both the script described here and the data will be given below. The output looks like:

<a href="http://www.flickr.com/photos/starrydude/6487335787/" title="Spectral Plotting by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7005/6487335787_f12f8ee2a5.jpg" width="500" height="500" alt="Spectral Plotting"></a>

So let's start with reading in a FITS file. Firstly ensure you have the most useful per-requisites (<a href="http://www.stsci.edu/resources/software_hardware/pyfits">[Pyfits]</a>, <a href="http://numpy.scipy.org/">[numpy]</a>, <a href="http://www.scipy.org/">[scipy]</a>) and import them:

<blockquote>import pyfits, numpy, scipy</blockquote>

Now read in the file:

<blockquote>input_file = "A.fits" <br />
hdulist = pyfits.open(input_file)</blockquote>

Get the data:

<blockquote>img_data = hdulist[0].data</blockquote>

Get the header:

<blockquote>img_header = hdulist[0].header</blockquote>

(<a href="http://www.krioma.net/blog/2011/04/fits_files_in_python.php">more on FITS</a>)

Now lets use some calibration data (<a href="www.mrao.cam.ac.uk/~sgeorge/scripts/Neon.fits.gz">which can be downloaded</a>):

<blockquote>import pyfits, numpy, scipy, pylab <br />
from scipy import * <br />
from pylab import * <br />
input_file = "Neon.fits" <br />
hdulist = pyfits.open(input_file) <br />
img_data = hdulist[0].data <br />
</blockquote>

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. 

<blockquote>data_use = img_data[144]</blockquote>

Plot the spectra:

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


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 <a href="http://www.mrao.cam.ac.uk/~sgeorge/scripts/extract_spectra.py">extract_spectra.py</a> and the data <a href="www.mrao.cam.ac.uk/~sgeorge/scripts/Neon.fits.gz">Neon.fits</a> (this is zipped, use gunzip).]]>
      
   </content>
</entry>
<entry>
   <title>Christmas Tree Cluster</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/christmas_tree_cluster.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1686</id>
   
   <published>2011-12-10T12:49:10Z</published>
   <updated>2011-12-10T12:52:37Z</updated>
   
   <summary>Probably not the best picture I&apos;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.... ... so &quot;ho ho ho, merry Christmas&quot;....</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="143" label="wast hills" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[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....

<a href="http://www.flickr.com/photos/starrydude/6486238543/" title="Christmas Tree Cluster by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7151/6486238543_b08db7a299.jpg" width="500" height="500" alt="Christmas Tree Cluster"></a>

... so "ho ho ho, merry Christmas". ]]>
      
   </content>
</entry>
<entry>
   <title>Multiple Gaussian Fitting in Python</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2011/12/multiple_gaussian_fitting_in_p.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1685</id>
   
   <published>2011-12-09T15:04:53Z</published>
   <updated>2011-12-09T15:14:23Z</updated>
   
   <summary>Yesterday I showed you [how to fit a single Gaussian in some data]. Today lets deal with the case of two Gaussians. This came about due to some students trying to fit two Gaussian&apos;s to a shell star as the...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Astronomy" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="246" label="fitting" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="155" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[Yesterday I showed you <a href="http://www.krioma.net/blog/2011/12/gaussian_fitting_in_python.php">[how to fit a single Gaussian in some data]</a>. Today lets deal with the case of two Gaussians. This came about due to some students trying to fit two Gaussian's to a shell star as the spectral line was altered from a simple Gaussian, actually there is a nice P-Cygni dip in there data so you should be able to recover the absorption line by this kind of fitting.  Anyway, fitting 2 Gaussian's is basically the same thing as fitting one in python but with the added function. I'm thinking I'll work up how to deal with a whole spectrum including source finding. In this case what you have to deal with is that there are two sources and so a rough estimation of the peak position of both is crucial to the fit (well in the way it is implemented). 

You basically want to end up with something like this:

<a href="http://www.flickr.com/photos/starrydude/6482008247/" title="Fit 2 Gaussians in Python by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7004/6482008247_95b00ee846.jpg" width="500" height="500" alt="Fit 2 Gaussians in Python"></a>

Where the green points are the data, the blue dashed line the fit and the red line where the maximum is in the array. The fitting is done via a least-squares fitting routine. 

In this example we will first start by generating some data, skipping the input from a file (but you can use the code from the 1 Gaussian example).

<blockquote>
import scipy, numpy, pylab, asciidata
from numpy import *
from pylab import *
from scipy import *
from scipy.optimize import leastsq

#generate some data
gaussian = lambda x: 3*exp(-(10-x)**2/10.) + 1*exp(-(30-x)**2/10.)#change the parameters as you see fit 
y_power = gaussian(arange(100)) 
x_pos = arange(100)

gauss_fit = lambda p, x: p[0]*(1/sqrt(2*pi*(p[2]**2)))*exp(-(x-p[1])**2/(2*p[2]**2))+p[3]*(1/sqrt(2*pi*(p[5]**2)))*exp(-(x-p[4])**2/(2*p[5]**2)) #1d Gaussian func
e_gauss_fit = lambda p, x, y: (gauss_fit(p,x) -y) #1d Gaussian fit


v0= [1,10,1,1,30,1] #inital guesses for Gaussian Fit.  - just do it around the peaks
out = leastsq(e_gauss_fit, v0[:], args=(x_pos, y_power), maxfev=100000, full_output=1) #Gauss Fit
v = out[0] #fit parameters out
covar = out[1] #covariance matrix output


xxx = arange(min(x_pos),max(x_pos),x_pos[1]-x_pos[0])
ccc = gauss_fit(v,xxx) # this will only work if the units are pixel and not wavelength

fig = figure(figsize=(9, 9)) #make a plot
ax1 = fig.add_subplot(111)
ax1.plot(x_pos,y_power,'gs') #spectrum
ax1.plot(xxx,ccc,'b--') #fitted spectrum
ax1.axvline(x=xxx[where(ccc == max(ccc))[0]][0],color='r') #max position in data
setp(gca(), ylabel="power", xlabel="pixel position")
pylab.savefig("plotfitting.png")

print "p[0], a1: ", v[0]
print "p[1], mu1: ", v[1]
print "p[2], sigma1: ", v[2]
print "p[3], a2: ", v[0]
print "p[4], mu2: ", v[1]
print "p[5], sigma2: ", v[2]</blockquote>


The full detailed listing is given in <a href="http://www.mrao.cam.ac.uk/~sgeorge/scripts/multiplegaussfit.py">[multiplegaussfit.py]</a>]]>
      
   </content>
</entry>

</feed>

