« How things change in a week... | Main | Converting Video for the Ipod on a linuxbox »

Going from sexigesimal to decimal...

I decided (and since I had todo this today) that for consistency (see [my post from there other day]) I should post how to convert between astronomical sexigesimal and decimal coordinates in awk:

awk '{h=($2*15)+($3/60)*15+($4/3600)*15; h2=$5+($6/60)+($7/3600); print $1,h,h2}' input > output

see its nice and simple really... the input file given here simply as "input" should contain a list of Source Name (which is $1, not necessary but you normally have it...), RA (in H M S, all separated by spaces) and DEC (D M S, again space separated).... enjoy.

TrackBack

TrackBack URL for this entry:
http://www.krioma.net/cgi-bin/mt_new/mt-tb.cgi/414

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on December 10, 2009 12:51 AM.

The previous post in this blog was How things change in a week....

The next post in this blog is Converting Video for the Ipod on a linuxbox.

Many more can be found on the main index page or by looking through the archives.

Get Firefox! Valid XHTML 1.0! Valid CSS! RSS Feed BlogUniverse - listed Powered by Apache Creative Commons License ringsofsaturnrock's Most Interesting Photos on Flickriver

Powered by
Movable Type 3.33