|Last update March 22, 2008||Solunar project||Page is under construction|
|Resource links||Purpose: To create a web based calculator that will generate a 1 month calendar correlating the apparent rise and set of the sun and moon with major and minor game feeding times.|
|I am not a Software engineer, or any type of professional programmer, so you will have to excuse the condition of the code. Most of it has been found on the web, and modified under the GNU terms. I am always looking for help, and will greatly appreciate any contributions from those who are more adept at this stuff than myself. Please send an email to firstname.lastname@example.org to contribute any code, general comments, or other knowledge of this topic. As I get parts working I will post them here on this site, so you can do with them as you choose.|
|I have found a few Java based routines that perform much of this already, but For this project. I wish to use a server cgi based implementation. I think that many sporting related web sights would like to use this to help drive traffic to their sights. There are a few commercially produced programs out there, but they are targeted at individual users.|
|I have started out with some basic programs that were originally published in Sky and Telescope magazine. It seems that these two programs are the launching point for most of the sun and moon related programs that you find on the web, so why should I be any different. Other neat astronomy programs written in basic can also be found on their archive page. Sky and Telescope Basic library|
Here are the operational translations
|Well, it seems that with my version of Windows XP, and 2000 that basic is not an option. This is fine, but I wanted to run these programs so I could understand exactly how they worked. Well I will convert them to Perl, I needed to anyway to make them cgi based. By the way I don't know if I mentioned this, but I don't know much about Perl either. So I found this neat program on CPAN that converts a basic program to a Perl script Its a perl module called Language-Basic-1.44 I will start with this to get the code translated. It does a job, but leaves a lot of cleanup, for what it does not understand|
|Hey Wow! I was able to get modify the Perl code to take input from a web based form using the POST method, and a simplistic output from the Cgi server now works!! The working program can be found HERE|
|One done, the other was easy Here is the moonrise program converted to a web cgi with the POST method also. The working program can be found HERE The next task will be to refine the hacked up Perl into something more structured so the two independent programs can be merged into a single cgi. This may take some time I have been fairly busy at work, no free time at home. It summer time now, and need to spend the days on jet ski's or shooting Carp. We will see how it goes for July.|
Here are the individual files if you would like to download
Ok finally got this thing to work as a system I have converted the stand alone programs to perl modules that stay in the directory with the calendar program. I found the calendar program on the web was deigned to run command line mode, and would make a years worth of calendars in your run time directory. I have modified it to return directly to the browser. The parameters are passed directly to each perl module and returned to the calendar ay by day. I have noticed that there is a flaw with the sunrise program that develops on Sept 25th. After this day it reverses the sun rise and set Azimuths 180 degrees to be incorrect. This will have to be trouble shot, and will require that I figure out exactly how the algorithm is computing these numbers. I believe that this flaw exists in the original basic program, I don't have any way to check it though, I still don't have a computer with basic on it. Possibly the way perl manipulates trig functions is causing the error. The working web page can be found here The calendar program also requires that you put a number in for the day the year starts on, so in the current form this only will work for 2003. This will have to be addressed next if I stick with the current calendar generator. There are a few others out on the web, but most are written by software experts, and are cryptic looking gook to the amateur programmer.
If you wish to play with the files you will have to change your path to perl if different, and change the "use lib /path/to my modules" in the main kalendar program.
A lot remains to be done, cleanup!!, determining the directly overhead times for the sun and moon, correlating those with the phase of the moon, and assigning a value of likely hood of game, or human activity to this.
Yet this has come a long way considering the amount of time that has been spent, and the amount of learning about perl. I have not yet broke down and bought a book on perl, and just may once this activity reaches my comfort level of completeness.
The Version 1 files can be downloaded
Some improvements have now been made. I have taken a calendar generation routine from Collin Forbes and modified it to accept the perl modules. I have also generated a perl module to calculate the date of daylight saving time for any year. The completed calendar now works for any year, and adds the offset for DST in the appropriate months. The working program can be found HERE .
I have now also a computer with BASIC on it and have ran the original basic program. It does not make the Azimuth inversion error on Sept 25th, leading me to further suspect a potential error in the Perl trig functions.
As I am now getting closer to actually determining what the peak, and major/minor times are, I am finding some differences of opinion that peak times are driven by High tide/Low tide, or a true lunar solar position. I will now focus on this issue, and make my own decision as to what is correct. Initially the Tidal theory sounds like it could be correct, but a lot of other circumstances affect tidal height besides lunar position. Possibly it is a combination of both if you are near a ocean area, and less of a factor if your are more inland.
A contribution of code from a reader, This one is a C port of the original Basic, and I am told that it does not have as many dependencies as other C based calculators. I have not had the time to try and get it running myself, so I can not attest to it's functionality
Thanks to Art
Another reader and his solunar program in C, his latest work can be found at Source forge and his website running a PHP version
Thanks to Douglas
|Back to Schoepski.com|