Archive | August 2010

My most useful scripts… so far

Over time I’ve wrote quite a few scripts todo lots of different things, from making [videos work on my PSP] to [astronomical coordinate system transformations]. A lot of these have been documented on my blog, lots more sit on my computer ready to go online (I will eventually put more online) either way things are a mess and I decided it would be a good idea if I put them in one place, so over on my research pages I did – so go take a look at my [most useful tools page]. Definitely one for geeks.

Advertisements

Talking GALFACTS Calibration

I gave a talk at the GALFACTS/POSSUM meeting last week on the calibration of the GALFACTS dataset. In essence I talked about how we are going about the calibration and applying it to the main data. I also discussed recent releases of the initial data products: GALFACTS Calibration & Data Quality – Samuel J George + GALFACTS Technical Team (talk at [GALFACTS/POSSUM 2010])
In this talk we discuss the calibration observations undertaken with the [ALFA instrument on the Arecibo Observatory] as part of the [GALFACTS survey]. A description of the observations and the calibration pipeline is given with specifics on the determination of the beam gains and the polarization leakage. The recent release of data to the [GALFA Continuum Consortium] is discussed and an assessment of the data quality is given. In short we have made substantial progress with the calibration and imaging pipelines however their is room for improvement. [PDF Version of talk] – given on 24/08/2010

Awk sexigesimal to decimal

Ages ago I put on here some awk scripts to convert between decimal numbers and sexigesimal (i.e. very useful with astronomical catalogues) and I think I’ve also gone the other way… anyway here is an updated and a more useful bash script todo this, still using awk at the heart of it (this goes from sexigesimal to decimal):

#!/bin/bash
filein=$1
fileout=$2
cat $filein | awk ‘{if ($4>= 0) {h=($1*15)+($2/60)*15+($3/3600)*15; h2=$4+($5/60)+($6/3600); print h,h2,$7,$8,$9}; if ($4 $fileout

put this in whateveryoulike.sh and there you go.

Make grids of images

Ever need to create subplots (or a nice mosaic of images) and can’t be bothered to figure out how todo it in what ever programming language, or have to open up photoshop or gimp and have to manually reposition everything? Well Imagemagik (like always) can solve this(!) and a friend of mine wanted to do this automatically the other day so I created a little bash script to do the job: combine_intogrid.sh
Here is an example of the output (I used (the top left image) an image I took of M51 and applied some filters to it (see bottom of post for filters):
final
For just one set of images (say you want a 4×1 mosaic you have to run this:

convert ( image1.png image2.png image3.png image4.png +append ) -background none -append final.png

and say for a 2×2 then its just:

convert ( image1.png image2.png +append ) ( image3.png image4.png +append ) -background none -append final.png

The script is essentially designed todo more than one directory at a time and was for astronomical images (hence the use of source in the directories) just replace this and off you go – it will loop through all your directories making nice mosaics of your images.
Filters / process to convert the one image into the 4 used for the mosaic:

convert image1.jpg image1.png
convert image1.png -negate image2.png
convert image2.png -blur 5×2 image3.png
convert image1.png -level 25%,100% image4.png
convert ( image1.png image2.png +append ) ( image3.png image4.png +append ) -background none -append final.png
mogrify -resize 400 final.png