NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
Re: Computer generated Almanac
From: Dan Allen
Date: 2003 Sep 5, 15:09 -0700
From: Dan Allen
Date: 2003 Sep 5, 15:09 -0700
On Friday, September 5, 2003, at 01:25 PM, Philip Bailey wrote: > Dan - I recently ordered Jean Meeus' book, and will be interested to > look at your code in more detail. I got an error message ("sh: line > 1: calc: command not found") followed by other (correct-looking) > output. It seems an external program ("calc") is being used by the > script; is this publicly available? Interesting website, by the way. Oops: this Awk script calls another a tool ("calc", which is unfortunately not publicly available) to output today's date in a certain format for my Awk program to read. You can just change that part of the code and it will work just fine. Delete this code: if (ARGC == 1) { "calc mdyhms" | getline t = J2000($1,$2) } else if (ARGC == 2 && (index(ARGV[1],"/") || index(ARGV[1],"."))) And in its place put this line if (ARGC == 2 && (index(ARGV[1],"/") || index(ARGV[1],"."))) and it should work fine. You may want to add some code to parse the Unix date command or if you are on Windows you may need to write a small date tool, or you can just key in the date yourself each time you run the program. Really the hardest part of this program is dealing with date formats and how to specify the inputs. The actual computation is very straightforward. Dan