# -*- Mode: Sh -*- # dweebstar - the personal star rise/set predictor for _your_ horizon # whose source code all fits on _my_ tiny screen # Copyright : http://www.fsf.org/copyleft/gpl.html # Author : Dan Jacobson -- http://jidanni.org/ # Created On : Feb 25 2001 # Last Modified By: Dan Jacobson # Last Modified On: Fri Mar 22 19:04:03 2002 # Update Count : 2 # Status : wimpy # output sample: # Mizar pops up left of electric tower on old north mountain # Sun, 25 Feb 2001 19:37:49 +0800 # Mon, 26 Feb 2001 19:33:58 +0800... # This is a GNU/Linux shell program to find what time your selected # stars will appear on your horizon. You just replace the exact time # I once saw those stars come up over my horizon into this file, using # your times and favorite stars instead, and whenever you want to know # when they will come up for the next several days, just invoke this # program. Uses GNU's date program. Copyright of this program: # GNU/GPL. One could make a printout, handy to tell visitors at your # ranch: "look at the flank of that mountain, in exactly 34 seconds, # Vega will pop out!" Naturally this program is only useful for your # fixed spot. All we are really doing is subtracting 3 min 56 sec # each day. Yes, just record one exact observation time once into # this file, and it should be good for a lifetime, unless I got the # theory wrong. P.S. stars only, no planets please. Hmm, nothing # stopping you from also putting in star set entries too. However I # think predicting rises will impress your friends more. Hide the # printout, though. Dweebstar "project" begun: 25 Feb 2001 #usage: $ this_program [days] #where days is the number of days to predict for. Default 10 #export LC_TIME=C #uncomment this if something goes wrong echo My personal dweebstar star rise/set profile, echo ' ' printed `date` '(c)'2001 GNU/GPL echo gawk ' #yes, need gawk date stuff. Constant below could hardwire BEGIN{now=systime(); siderial_day=24*60*60*365.2422/366.2422; FS="|"} /^#/{next} #comments have # at first column only /^[ \t]*$/{next} blank line too { command_string="date --date \"" $1 "\" +%s" command_string | getline initial_sighting close (command_string) #wasteful... i guess next_siting1=int((now-initial_sighting)/siderial_day+1)*\ siderial_day+initial_sighting print $2; daylight=0 for (i=0;i<='${1-10}';i++){ time_str=strftime("%H %a, %d %b %Y %T %z", next_siting1+i*siderial_day) #check each time, wasteful, but they might be printing #out a whole year... if(time_str ~ /^(0[789]|1[0123456])/){daylight=1} else { print substr(time_str,4)}} if (daylight){print "[daylight values 07:00-17:00 not shown]"} print ""}' <