<?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-05-15T13:45:51Z</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>ALMA at the SSE imaging</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/05/alma_at_the_sse_imaging.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1721</id>
   
   <published>2012-05-15T13:35:59Z</published>
   <updated>2012-05-15T13:45:51Z</updated>
   
   <summary>We&apos;ve been working on a bunch of things for the upcoming ALMA Summer Science Exhibition stand including a hands on ALMA simulator. I&apos;ve just finished adding our &quot;Send to twitter&quot; function with a bit of windows based commandline wizardy -...</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="319" label="alma" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="320" label="sse" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[We've been working on a bunch of things for the upcoming <a href="http://almauk.tumblr.com/">ALMA Summer Science Exhibition stand</a> including a hands on ALMA simulator. 

I've just finished adding our "Send to twitter" function with a bit of windows based commandline wizardy - I'm actually very pleased with it. So here is a bit of an Easter egg, me through the eyes of the ALMA SSE Imager - a bit of Earth rotation really brings out my features - can you guess what is on my t-shirt?

<a href="http://www.flickr.com/photos/starrydude/7202962602/" title="me through ALMA imager by ringsofsaturnrock, on Flickr"><img src="http://farm6.staticflickr.com/5459/7202962602_e780b45302.jpg" width="450" height="450" alt="me through ALMA imager"></a>]]>
      
   </content>
</entry>
<entry>
   <title>How to make an image in radio astronomy</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/05/how_to_make_an_image_in_radio.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1720</id>
   
   <published>2012-05-01T13:05:48Z</published>
   <updated>2012-05-01T13:09:20Z</updated>
   
   <summary> In a rather simplistic viewpoint: you get uv data from your array (bottom right); you convolve it with a point spread function (top right) to get a nicely uniformly gridded data set (top left) and then you take 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="318" label="computing" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="317" label="fft" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="155" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="168" label="SKA" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[<a href="http://www.flickr.com/photos/starrydude/7131724819/" title="Radio Astronomy 101 by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7136/7131724819_f43c31e0ea.jpg" width="500" height="500" alt="Radio Astronomy 101"></a>

In a rather simplistic viewpoint: you get uv data from your array (bottom right); you convolve it with a point spread function (top right) to get a nicely uniformly gridded data set (top left) and then you take the <a href="http://en.wikipedia.org/wiki/Fast_Fourier_transform">FFT</a> of it to get a pretty image (bottom left).

Of course that's a gross under-estimate  of what you need todo but highlights a key point - you have to grid the data. This is computationaly expensive and something I'm working on at the moment. The above plots are really just an example of a small python script I've developed to try out a few ideas. In reality, you'd have some source structure in there and hopefully your final image would be something that would be much more representative on the sky than the criss-cross pattern you seen in the final image (bottom left).  ]]>
      
   </content>
</entry>
<entry>
   <title>Astronomy Events in May</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/05/astronomy_events_in_may.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1719</id>
   
   <published>2012-05-01T11:15:26Z</published>
   <updated>2012-05-01T11:37:34Z</updated>
   
   <summary>Want to know what local astronomy events are going on this month? The [Federation of Astronomical Societies] have a great list of events that are taking place all over the UK. There are some 50 or so activites that range...</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" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[Want to know what local astronomy events are going on this month? The <a href="http://www.fedastro.org.uk/fas/index.php?option=com_wrapper&Itemid=26">[Federation of Astronomical Societies]</a> have a great list of events that are taking place all over the UK. There are some 50 or so activites that range from talks on advanced imaging techniques to solar observing. Of course I know this list quite well being the gate keeper and all. Go out and enjoy some astronomy run by the thousands of volunteers across the country.  

If you are unsure where you local astronomy society is you can find this out on their <a href="http://fedastro.org.uk/fas/index.php?option=com_content&task=view&id=98&Itemid=89">google map</a>.]]>
      
   </content>
</entry>
<entry>
   <title>M52: a cluster of stars</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/04/m52_a_cluster_of_stars.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1695</id>
   
   <published>2012-04-20T08:54:06Z</published>
   <updated>2012-04-20T09:45:17Z</updated>
   
   <summary>M52 is an open cluster in the Cassiopeia constellation. This is a good binocular target and you will see some 200 or so stars belonging to the cluster:...</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[M52 is an open cluster in the Cassiopeia constellation. This is a good binocular target and you will see some 200 or so stars belonging to the cluster:

<a href="http://www.flickr.com/photos/starrydude/6405742343/" title="M52  by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7032/6405742343_937ff41cda.jpg" width="500" height="500" alt="M52 "></a>]]>
      
   </content>
</entry>
<entry>
   <title>Data interpolation in python</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/04/data_interpolation_in_python.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1718</id>
   
   <published>2012-04-13T14:12:09Z</published>
   <updated>2012-04-13T14:27:51Z</updated>
   
   <summary>Quite often in my day to day work I end up having to flag out bad data. In many cases this just creates a gap and normally this is fine just to throw away. There are occasions however, such as...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <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[Quite often in my day to day work I end up having to flag out bad data. In many cases this just creates a gap and normally this is fine just to throw away. There are occasions however, such as when creating the bandpass of reciever that its still quite useful to have some idea as to what is going on in the normally flagged out channels - especially when its large chunks of data. To solve this we use interpolation. This post isn't about explaining data interpolation - for that I suggest you take a look at <a href="http://en.wikipedia.org/wiki/Interpolation">wiki</a>. 

When interpolating I like to use splines. In linear interpolation we use a linear function for each intervale,s with splines we use low-degree polynomials in each of the intervals chosing a polynomial that nicely fits the sections together. Generally works quite well. 

Python has many different ways todo interpolation, be it spline or not. There is a huge variety of interpolation functions and I'd urge you to explore the scipy help for an exhaustive list. In this example I'm going to use the spline functions from scipy.signal

Firstly, import the functions required (asciidata is to read in the data and is not needed):

from scipy import *
from numpy import r_, sin
from scipy.signal import cspline1d, cspline1d_eval

I've defined a function to do the actual work:

def spline_lowchan(beamdata):
&nbsp;&nbsp;&nbsp;lastzero = max(where(beamdata == 0)[0]) #first 146 channels are 0 
&nbsp;&nbsp;&nbspstartchan = lastzero+1
&nbsp;&nbsp;&nbspx = r_[startchan:len(beamdata)]
&nbsp;&nbsp;&nbspdx = x[1]-x[0]
&nbsp;&nbsp;&nbspnewx = r_[0:startchan:1]  # notice outside the original domain 
&nbsp;&nbsp;&nbspy = beamdata[startchan:]
&nbsp;&nbsp;&nbspcj = cspline1d(y,lamb=0) 
&nbsp;&nbsp;&nbspnewy = cspline1d_eval(cj, newx, dx=dx,x0=x[0])
&nbsp;&nbsp;&nbspaa = list(newy) 
&nbsp;&nbsp;&nbspbb = list(y)
&nbsp;&nbsp;&nbspmod = aa + bb
&nbsp;&nbsp;&nbspreturn mod

The function is called like:

output = spline_lowchan(originaldata)

Where originaldata is the initial bandpass (just a sequence of numbers in an array or list) 

In the above example of interpolating the function is assuming that the first set of data is all set to 0, hence the where is 0. We then interpolate the data over the range where there is no signal. We then add this to the original signal, hence allowing the region without any useful data to have an interpolated data set. Not perfect but gives a better idea of what might be happening. Of course this is not really how you should treat the edges but the cspline1d method very well when you say lose a few data points out of a bandpass. ]]>
      
   </content>
</entry>
<entry>
   <title>M36: an open cluster in Auriga</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/04/m36_an_open_cluster_in_auriga.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1696</id>
   
   <published>2012-04-08T15:56:09Z</published>
   <updated>2012-04-08T16:14:09Z</updated>
   
   <summary>M36 is an open cluster in Auriga - its a good binocular target and is some 4,000 light years away from the Earth. If this star cluster were as close as the Pleiades are then it would look very similar...</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" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[M36 is an open cluster in Auriga - its a good binocular target and is some 4,000 light years away from the Earth. If this star cluster were as close as the Pleiades are then it would look very similar from the Earth.

<a href="http://www.flickr.com/photos/starrydude/6405741433/" title="M36  by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7009/6405741433_594b4197bf.jpg" width="500" height="500" alt="M36 "></a>]]>
      
   </content>
</entry>
<entry>
   <title>Rugby at Wembley</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/04/rugby_at_wembley.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1717</id>
   
   <published>2012-04-02T11:44:51Z</published>
   <updated>2012-04-02T11:54:20Z</updated>
   
   <summary>I have to say I really enjoyed going down to London to watch the Saracens lose to the Harlequins on Saturday. At first watching rugby being played at Wembley sounded very strange to me, but once you are there you...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="General Me" scheme="http://www.sixapart.com/ns/types#category" />
         <category term="Sport" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="316" label="rugby" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[I have to say I really enjoyed going down to London to watch the Saracens lose to the Harlequins on Saturday. At first watching rugby being played at Wembley sounded very strange to me, but once you are there you realise what a magnificant stadium it is. Its the first time I've been there since the new stadium opened at is just look spectacular. I reckon no matter were you sit you get a great view. We had some great seats though:

<a href="http://www.flickr.com/photos/starrydude/7031831177/" title="Woop Wembley by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7076/7031831177_9e7dfbf6db.jpg" width="500" height="299" alt="Woop Wembley"></a>

Its nice to feel I was part of a new world record too. The highest attendance at a club rugby game; 83,671 people were at the game. I have to say though, that I was a bit disapointed with the need for a warm-up band - McFly, and the presence of cheerleaders. Felt a bit American and distracted from what we were there for - for watch 30 guys play rugby. ]]>
      
   </content>
</entry>
<entry>
   <title>Concatinating measurement sets in CASA</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/concatinating_measurement_sets.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1716</id>
   
   <published>2012-03-30T10:47:17Z</published>
   <updated>2012-03-30T11:00:09Z</updated>
   
   <summary>Combining data from different spectral windows or different days is quite useful. Quite often I will image these seperately and then combine in the image domain. It is useful, however, to be able to combine these into one measurement set,...</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" />
   <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/">
      Combining data from different spectral windows or different days is quite useful. Quite often I will image these seperately and then combine in the image domain. It is useful, however, to be able to combine these into one measurement set, its just easier to keep track of the files - and time based flagging in the case of many spectral windows is probably the same (e.g. one antenna is down, well it will be for both spectral windows). Anyway, in AIPS this was quite straightforward and it was something I did often. I&apos;ve only just needed a reason todo this in CASA and again its fairly easy. You just need to use the task &quot;concat&quot;. I&apos;ve put together a little script thats in two files from the commandline and runs this, see the code below: 

from os import sys #python library to read input from command line
inputfile1 = str(sys.argv[3:][0])
inputfile2 = str(sys.argv[3:][1])
visoutfile = &apos;combined.ms&apos;
print inputfile1,inputfile2,visoutfile
concat(vis=[inputfile1,inputfile2], concatvis=visoutfile) 

Save this (as concatms.py) and run as:
casapy -c &quot;concatms.py file1.ms file2.ms&quot;

Assuming the two files are different frequency ranges you will end up with a file that has two spectral windows in. 
      
   </content>
</entry>
<entry>
   <title>Globular cluster, M3</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/globular_cluster_m3.php" />
   <id>tag:www.krioma.net,2011:/blog//1.1659</id>
   
   <published>2012-03-21T14:20:26Z</published>
   <updated>2012-03-21T15:21:56Z</updated>
   
   <summary>I occasionally use the Bradford Robotic Telescope for remote imaging... here is an image of the Ring Nebula, M3 a globular cluster in the constellation Canes Venatici:...</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[I occasionally use the Bradford Robotic Telescope for remote imaging... here is an image of the Ring Nebula, M3 a globular cluster in the constellation Canes Venatici:

<a href="http://www.flickr.com/photos/starrydude/3773180655/" title="M3 with BRT by ringsofsaturnrock, on Flickr"><img src="http://farm3.static.flickr.com/2573/3773180655_539dd84554.jpg" width="500" height="490" alt="M3 with BRT"></a>]]>
      
   </content>
</entry>
<entry>
   <title>SSH Keys and multi machine processing</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/ssh_keys_and_multi_machine_pro.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1714</id>
   
   <published>2012-03-17T09:42:06Z</published>
   <updated>2012-03-17T10:46:58Z</updated>
   
   <summary>A lot of my processing can be parallelised effectively by just splitting up the data and running on many machines. To accomplish this I use SSH keys so I can start jobs over the network from one bash script. Works...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="161" label="bash" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="313" label="ssh" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      A lot of my processing can be parallelised effectively by just splitting up the data and running on many machines. To accomplish this I use SSH keys so I can start jobs over the network from one bash script. Works nicely and is quite effective - the only downside is normally having to send data over NFS. 

Anyway, crucial to this is the ability to install SSH keys, this can be done quite easily.

Firstly make sure that you have ssh&apos;d from the machines you want to set this up on before. Simply just ssh into another machine, this will create a .ssh in your home directory with the proper permissions.

Now on your main machine run:

ssh-keygen -t dsa 

This will generate a key. It will ask you for a passphrase. If you are hoping to spawn loads of jobs over many machines then don&apos;t put anything here (otherwise you&apos;ll be asked for the passphrase instead of your password!). Of course this is a security risk - so make sure you trust your network etc. 

Now copy this key over to the other machines, in this case I&apos;m using a virtual machine at 192.168.56.101, so:

scp ~/.ssh/id_dsa.pub 192.168.56.101:.ssh/authorized_keys2

Now on the machine you just copied it over (in my case ssh 192.168.56.101) run:

ssh-agent sh -c &apos;ssh-add &lt; /dev/null &amp;&amp; bash&apos;

This will add the key and allow you to effectlviely have passwordless login - and allow for some nice multi-machine processing - we do this for lots of the Arecibo data we have to deal with, allows us to effectively run on 100 cores without any fancy software just a small bash script that loops over an array of machines. 
      
   </content>
</entry>
<entry>
   <title>M57: the ring nebula</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/m57_the_ring_nebula_1.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1694</id>
   
   <published>2012-03-14T15:44:16Z</published>
   <updated>2012-03-14T16:47:11Z</updated>
   
   <summary>A short image of the Ring Nebula out at Wast Hills. It is a rather prominent planetary nebula well worth a look through a telescope:...</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" />
   <category term="254" label="nebula" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[A short image of the Ring Nebula out at Wast Hills. It is a rather prominent planetary nebula well worth a look through a telescope:

<a href="http://www.flickr.com/photos/starrydude/6405743325/" title="M57  by ringsofsaturnrock, on Flickr"><img src="http://farm7.staticflickr.com/6113/6405743325_3be03b79dd.jpg" width="497" height="500" alt="M57 "></a>]]>
      
   </content>
</entry>
<entry>
   <title>Talk bingo generator</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/talk_bingo_generator.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1715</id>
   
   <published>2012-03-12T13:36:08Z</published>
   <updated>2012-03-12T13:52:27Z</updated>
   
   <summary>During my [talk on Saturday at the University of Birmingham] I played talk bingo. The idea is that as I give the talk the younger members of the audience can be entertained by playing a game that requires them to...</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="General Me" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="45" label="astrosoc" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="315" label="code" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="314" label="html" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="197" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="70" label="talks" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[During my <a href="http://www.sr.bham.ac.uk/outreach/talktelescope/exoplanets/">[talk on Saturday at the University of Birmingham]</a> I played talk bingo. The idea is that as I give the talk the younger members of the audience can be entertained by playing a game that requires them to pay attention. Whenever I give a talk I tend to use a subset of words (and indeed this can be played with a rather small number of words in any extragalactic seminar) from the field of astronomy. So all I did was generate a bunch of random bingo games and I say the words the audience cross them out. Eventually they will call bingo and I offer a small prize. On Saturday, due to a bit of a mix up with computers this didn't quite go as to plan but I think all were quite entertained. I suggested to a few that I'd put this together in a useful format. 

So do you want to play talk bingo? You can use my <a href="http://www.mrao.cam.ac.uk/~sgeorge/genbingoauto.php">[online talk bingo generator]</a> on my research pages.  It should be quite straight forward to use. Just provide the words (with space seperation) and a size of the grid and off you go. It produces html tables which can nicely be copied to openoffice for easy printing.

For those of you who might be interested in implementing this yourselves, here is the basic code (this is what I used for Saturday and I've changed it a bit to work nicely on my website, testing for max sizes and taking in input):

$random_text = array("Telescope","Dish","Data","Array","Universe","MeerKat","LOFAR","Space","Wave","Moon","Shock","Life","Transit","SKA","Radio","Exoplanet","Aurora","HD209458b","Arecibo","GMRT","ASKAP","POSSUM","GALFACTS","Galaxy","Jupiter","Sun","Earth","Magnetic","Gas","Electron","Kepler","Space","Venus","Mars","EVLA","Aliens","WOW","SETI","Radar");	
$number_of_games = 50;
$number_elements= 25; 	
$elementsinrow = 5;
$intro = "";
for ($j = 0; $j &lt; $number_of_games; $j++) {
&nbsp;&nbsp;&nbsp;$rand_keys = array_rand($random_text, $number_elements);
&nbsp;&nbsp;&nbsp;$sizeof_arr = sizeof($random_text); //echo $sizeof_arr;
&nbsp;&nbsp;&nbsp;$intro .= "&lt;table border=\"1\"&gt;&lt;tr&gt;";
&nbsp;&nbsp;&nbsp;$b = 0;
&nbsp;&nbsp;&nbsp;for ($i = 0; $i &lt; $number_elements; $i++) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$intro .=  "&lt;td&gt;&lt;font size=\"6\"&gt;" . &nbsp;&nbsp;&nbsp;$random_text[$rand_keys[$i]] . "&lt;/font&gt;&lt;/td&gt;";
&nbsp;&nbsp;&nbsp;$b +=1;
&nbsp;&nbsp;&nbsp;if ($b &gt; 4){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$intro .= "&lt;/tr&gt;";
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$b = 0;
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;$intro .= "&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;";
}
echo $intro;

As you will see its nothing particularly fancy, but darn useful]]>
      
   </content>
</entry>
<entry>
   <title>M34: an open cluster in Perseus.</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/m34_an_open_cluster_in_perseus.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1698</id>
   
   <published>2012-03-08T13:12:19Z</published>
   <updated>2012-03-08T13:15:04Z</updated>
   
   <summary>M34 is an open cluster in Perseus which can be seen by the naked eye.. but you will need properly dark skies, so that means well away from urban areas. Its a nice binocular object though, even from light polluted...</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[M34 is an open cluster in Perseus which can be seen by the naked eye.. but you will need properly dark skies, so that means well away from urban areas. Its a nice binocular object though, even from light polluted city streets. 

<a href="http://www.flickr.com/photos/starrydude/6405740407/" title="M34  by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7156/6405740407_3ca06f5e5c.jpg" width="500" height="500" alt="M34 "></a>]]>
      
   </content>
</entry>
<entry>
   <title>Setting up a Virtual Webserver</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/03/setting_up_a_virtual_webserver.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1713</id>
   
   <published>2012-03-05T12:17:47Z</published>
   <updated>2012-03-06T14:01:31Z</updated>
   
   <summary>This is a quick guide on how to setup a webserver in a virtual machine. This is based on using Virtualbox and Ubuntu, so it might not work with all version of linux and though the install instructions inside the...</summary>
   <author>
      <name></name>
      
   </author>
         <category term="Computing" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="312" label="webserver" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[This is a quick guide on how to setup a webserver in a virtual machine. This is based on using Virtualbox and Ubuntu, so it might not work with all version of linux and though the install instructions inside the virtual machine will work with any <a href="http://en.wikipedia.org/wiki/Virtualization">virtualisation</a> tool the rest of the info, of course, will not. This is as much a reminder to myself as I seem to always forget to do one thing when doing this. Its really useful being able to just create a VM and fire off testing without having to compromise your normal desktop. I do this for many different coding projects, allowing me to have the exact environment I need / users have.

Firstly, lets install <a href="https://www.virtualbox.org/">virtualbox</a> (of course you could install one of many other virtualisation products): 

<blockquote>sudo apt-get install virtualbox</blockquote>

Follow the on screen instructions on how to create a guest os in virtual box, quite straight forward. I tend to use a dynamically allocated disk. Start up the OS and find the image file you wish to boot (I've been using Ubuntu 10.04). 

Like you would do for any operating system install this to the local disk. 

To make life easier lets first setup SSH to the system.

<blockquote>sudo apt-get install openssh-client openssh-server</blockquote>

Now turn off the guest OS and in virtual box go: settings > network > adapter 2 > Enable 

and change to attached to: Host-only adapter using vboxnet0

Reboot the guest OS.

Now we need to edit: /etc/network/interfaces to (you need to run something like sudo pico /etc/network/interfaces/), adding: 

<blockquote>auto eth1<br />
iface eth1 inet static <br />
    address 192.168.56.101<br />
    netmask 255.255.255.0</blockquote>

Now to finish the network setup, run:

<blockquote>sudo ifup eth1</blockquote>

Lets now restart the network:

<blockquote>sudo /etc/init.d/networking restart</blockquote>

We should now be able to ssh in to the system using: ssh your-username@192.168.56.101

If you don't want to have to remember the IP address you can add this to your /etc/hosts files, with:

<blockquote>192.168.56.101 yourvirtualos</blockquote>

Lets now install the important webserver tools:

<blockquote>sudo apt-get install apache2 php5 libapache2-mod-php5 </blockquote>

Create a directory called "public_html" in your home directory,

<blockquote>mkdir public_html</blockquote>

and lets configure apache and get it running:
<blockquote>
cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/userdir.conf userdir.conf
sudo ln -s ../mods-available/userdir.load userdir.load
sudo /etc/init.d/apache2 restart </blockquote>

<blockquote>sudo pico /etc/apache2/mods-available/php5.conf</blockquote>

change to: 
<blockquote>

&lt;IfModule mod_php5.c&gt;
    &lt;FilesMatch "\.ph(p3?|tml)$"&gt;
        SetHandler application/x-httpd-php
    &lt;/FilesMatch&gt;
    &lt;FilesMatch "\.phps$"&gt;
        SetHandler application/x-httpd-php-source
    &lt;/FilesMatch&gt;
    # To re-enable php in user directories comment the following lines
    # (from &lt;IfModule ...&gt; to &lt;/IfModule&gt;.) Do NOT set it to On as it
    # prevents .htaccess files from disabling it.
#    &lt;IfModule mod_userdir.c&gt;
#        &lt;Directory /home/*/public_html&gt;
 #           php_admin_value engine Off
 #       &lt;/Directory&gt;
 #   &lt;/IfModule&gt;
&lt;/IfModule&gt;
</blockquote>


i.e. comment out &lt;IfModule... &lt;/IfModule&gt;

And there you have it a webserver running in a virtual machine. Nice and straight forward really and takes about 10 minutes. Really useful for doing some web testing before uploading.

To test this just go to: http://192.168.56.101/ on either your main desktop or in your guest OS.]]>
      
   </content>
</entry>
<entry>
   <title>Highlights of Mumbai</title>
   <link rel="alternate" type="text/html" href="http://www.krioma.net/blog/2012/02/highlights_of_mumbai.php" />
   <id>tag:www.krioma.net,2012:/blog//1.1712</id>
   
   <published>2012-02-29T18:58:40Z</published>
   <updated>2012-02-29T19:22:03Z</updated>
   
   <summary>I&apos;ve still got lots to write about our time in India, it went way too fast but was lots of fun. We spent a couple of days in Mumbai after my time at the National Centre for Radio Astrophysics was...</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" />
   
   <category term="93" label="india" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="311" label="mumbai" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://www.krioma.net/blog/">
      <![CDATA[I've still got lots to write about our time in India, it went way too fast but was lots of fun. We spent a couple of days in Mumbai after my time at the National Centre for Radio Astrophysics was over. It was a good few days. Overall I found Mumbai quite a dirty place, much dirty than Pune and there seemed to be much more rubble around the place. The part of Mumbai we stayed in, Colaba at times could look like European country with grand Victorian buildings lining the streets. I guess that's cause this was the heart of Victorian British India. One of the most striking sites is the Gateway of India:

<a href="http://www.flickr.com/photos/starrydude/6921221493/" title="Gateway of India, Mumbai by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7043/6921221493_63bfdebd4a.jpg" width="500" height="375" alt="Gateway of India, Mumbai"></a>

which was rammed the first time we went there. It appeared that there was some kind of rally going on. The second time we went it was much more relaxed still there was obvious security with our bags being checked on both occasions. Again though its the same security you see across all of India - you go through a metal detector, it goes off and you are waved on.  Its a shame you can't walk through the Gateway but apart from that it was one of my favourite sites in Mumbai. I was definitely non-plussed about the Taj Mahal hotel next to it. I'm sure its fantastic inside, but a price I wasn't willing to pay. 

The University of Mumbai appears to be quite expansive, not to the same extent as Pune (in this location anyway), and their is some lovely buildings:

<a href="http://www.flickr.com/photos/starrydude/6921108809/" title="DSCF1603 by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7180/6921108809_04a45efffc.jpg" width="375" height="500" alt="DSCF1603"></a>

Of course we continued my tradition of finding the cathedral and taking a few pictures. St. Thomas Cathedral in Mumbai from the outside doesn't look that grand and indeed on the inside its quite basic but does have some nice stained glass windows. It also has some "interesting" dedications from the East India trading company - really makes you step back in time a little.

<a href="http://www.flickr.com/photos/starrydude/6921069349/" title="DSCF1528 by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7044/6921069349_800306621f.jpg" width="500" height="375" alt="DSCF1528"></a>

Probably the best place we visited was the Chhatrapati Shivaji Maharaj Vastu Sangrahalaya  (formerly the Prince of Wales Museum of Western India). We spent something like 5 hours wondering around this expansive museum. 

<a href="http://www.flickr.com/photos/starrydude/6775099314/" title="Prince of Wales Museum by ringsofsaturnrock, on Flickr"><img src="http://farm8.staticflickr.com/7192/6775099314_7bd068afd8.jpg" width="500" height="375" alt="Prince of Wales Museum"></a>

Oh and I even fell down there stairs there - just as we were leaving and since we were getting a flight at 2am meant I was feeling a bit achy all the way home. 

All in all, we quite enjoyed Mumbai but I don't think we would have found much to do past the few days we stayed. ]]>
      
   </content>
</entry>

</feed>

